Skip to content

Commit 5c5f9f4

Browse files
Michael Changregkh
authored andcommitted
bnxt_en: Fix stats context reservation logic
[ Upstream commit b4fc8fa ] 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 <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Link: https://patch.msgid.link/20250825175927.459987-4-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c23655b commit 5c5f9f4

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
@@ -8009,7 +8009,8 @@ static int __bnxt_reserve_rings(struct bnxt *bp)
80098009
}
80108010
rx_rings = min_t(int, rx_rings, hwr.grp);
80118011
hwr.cp = min_t(int, hwr.cp, bp->cp_nr_rings);
8012-
if (hwr.stat > bnxt_get_ulp_stat_ctxs(bp))
8012+
if (bnxt_ulp_registered(bp->edev) &&
8013+
hwr.stat > bnxt_get_ulp_stat_ctxs(bp))
80138014
hwr.stat -= bnxt_get_ulp_stat_ctxs(bp);
80148015
hwr.cp = min_t(int, hwr.cp, hwr.stat);
80158016
rc = bnxt_trim_rings(bp, &rx_rings, &hwr.tx, hwr.cp, sh);

0 commit comments

Comments
 (0)