summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMichael Chan <michael.chan@broadcom.com>2019-05-05 13:17:05 +0200
committerDavid S. Miller <davem@davemloft.net>2019-05-06 06:42:17 +0200
commit01989c6b69d91a0df0af8d5c6b5f33d82a239ae0 (patch)
treebbacd939d63cafd505006091e57ae1057b00cdae /drivers
parentbnxt_en: Separate RDMA MR/AH context allocation. (diff)
downloadlinux-01989c6b69d91a0df0af8d5c6b5f33d82a239ae0.tar.xz
linux-01989c6b69d91a0df0af8d5c6b5f33d82a239ae0.zip
bnxt_en: Improve NQ reservations.
bnxt_need_reserve_rings() determines if any resources have changed and requires new reservation with firmware. The NQ checking is currently just an approximation. Improve the NQ checking logic to make it accurate. NQ reservation is only needed on 57500 PFs. This fix will eliminate unnecessary reservations and will reduce NQ reservations when some NQs have been released on 57500 PFs. Fixes: c0b8cda05e1d ("bnxt_en: Fix NQ/CP rings accounting on the new 57500 chips.") Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index d70320cfbc3f..cdbadc634947 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -5521,11 +5521,13 @@ static bool bnxt_need_reserve_rings(struct bnxt *bp)
stat = bnxt_get_func_stat_ctxs(bp);
if (BNXT_NEW_RM(bp) &&
(hw_resc->resv_rx_rings != rx || hw_resc->resv_cp_rings != cp ||
- hw_resc->resv_irqs < nq || hw_resc->resv_vnics != vnic ||
- hw_resc->resv_stat_ctxs != stat ||
+ hw_resc->resv_vnics != vnic || hw_resc->resv_stat_ctxs != stat ||
(hw_resc->resv_hw_ring_grps != grp &&
!(bp->flags & BNXT_FLAG_CHIP_P5))))
return true;
+ if ((bp->flags & BNXT_FLAG_CHIP_P5) && BNXT_PF(bp) &&
+ hw_resc->resv_irqs != nq)
+ return true;
return false;
}