]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Do not adjust max_cp_rings by the ones used by RDMA.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 3 Sep 2018 08:23:19 +0000 (04:23 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Sep 2018 04:59:43 +0000 (21:59 -0700)
commite189b3598bfcca08702583b90d156f777c0c24f5
tree11b6523dbad8eb05b49ab35b00ae081988a6398c
parent4d1b44c55a338d9dd2d90c603b704e3e9bcb6857
bnxt_en: Do not adjust max_cp_rings by the ones used by RDMA.

Currently, the driver adjusts the bp->hw_resc.max_cp_rings by the number
of MSIX vectors used by RDMA.  There is one code path in open that needs
to check the true max_cp_rings including any used by RDMA.  This code
is now checking for the reduced max_cp_rings which will fail when the
number of cp rings is very small.

To fix this in a clean way, we don't adjust max_cp_rings anymore.
Instead, we add a helper bnxt_get_max_func_cp_rings_for_en() to get the
reduced max_cp_rings when appropriate.

Fixes: 91b8fbaba98c ("bnxt_en: Add ULP calls to stop and restart IRQs.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h
drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c