bnxt_en: Adjust TX rings if reservation is less than requested
authorMichael Chan <michael.chan@broadcom.com>
Mon, 25 Aug 2025 17:59:26 +0000 (10:59 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 27 Aug 2025 00:48:35 +0000 (17:48 -0700)
commit1ee581c24dfdcbc6de25aac95a48c1f08e9a542c
tree82aba09ec7e6517d2cdb98cdad3ce2cf9bd10557
parent2747328ba2714f1a7454208dbbc1dc0631990b4a
bnxt_en: Adjust TX rings if reservation is less than requested

Before we accept an ethtool request to increase a resource (such as
rings), we call the FW to check that the requested resource is likely
available first before we commit.  But it is still possible that
the actual reservation or allocation can fail.  The existing code
is missing the logic to adjust the TX rings in case the reserved
TX rings are less than requested.  Add a warning message (a similar
message for RX rings already exists) and add the logic to adjust
the TX rings.  Without this fix, the number of TX rings reported
to the stack can exceed the actual TX rings and ethtool -l will
report more than the actual TX rings.

Fixes: 674f50a5b026 ("bnxt_en: Implement new method to reserve rings.")
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-3-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c