Skip to content

Commit b4fc8fa

Browse files
Michael Chankuba-moo
authored andcommitted
bnxt_en: Fix stats context reservation logic
The HW resource reservation logic allows the L2 driver to use the RoCE resources if the RoCE driver is not registered. When calculating the stats contexts available for L2, we should not blindly subtract the stats contexts reserved for RoCE unless the RoCE driver is registered. This bug may cause the L2 rings to be less than the number requested when we are close to running out of stats contexts. Fixes: 2e4592d ("bnxt_en: Change MSIX/NQs allocation policy") Reviewed-by: Kalesh AP <[email protected]> Reviewed-by: Somnath Kotur <[email protected]> Signed-off-by: Michael Chan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 1ee581c commit b4fc8fa

File tree

1 file changed

+2
-1
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+2
-1
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8016,7 +8016,8 @@ static int __bnxt_reserve_rings(struct bnxt *bp)
80168016
}
80178017
rx_rings = min_t(int, rx_rings, hwr.grp);
80188018
hwr.cp = min_t(int, hwr.cp, bp->cp_nr_rings);
8019-
if (hwr.stat > bnxt_get_ulp_stat_ctxs(bp))
8019+
if (bnxt_ulp_registered(bp->edev) &&
8020+
hwr.stat > bnxt_get_ulp_stat_ctxs(bp))
80208021
hwr.stat -= bnxt_get_ulp_stat_ctxs(bp);
80218022
hwr.cp = min_t(int, hwr.cp, hwr.stat);
80228023
rc = bnxt_trim_rings(bp, &rx_rings, &hwr.tx, hwr.cp, sh);

0 commit comments

Comments
 (0)