bnxt_en: Fix stats context reservation logic
authorMichael Chan <michael.chan@broadcom.com>
Mon, 25 Aug 2025 17:59:27 +0000 (10:59 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 27 Aug 2025 00:48:35 +0000 (17:48 -0700)
commitb4fc8faacfea2538184a1dbd616ae9447a361f3d
tree18aab7b1b5009769966a93e1f755801437b4affe
parent1ee581c24dfdcbc6de25aac95a48c1f08e9a542c
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: 2e4592dc9bee ("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>
drivers/net/ethernet/broadcom/bnxt/bnxt.c