OSDN Git Service

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)
commit00fe9c326d2027f2437dea38ef0e82f9d02d94c0
tree11b6523dbad8eb05b49ab35b00ae081988a6398c
parentad95c27bdb930105f3eea02621bda157caf2862d
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: ec86f14ea506 ("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