]> git.dujemihanovic.xyz Git - linux.git/commit
bnxt_en: Add MSIX check in bnxt_check_rings()
authorMichael Chan <michael.chan@broadcom.com>
Mon, 9 Sep 2024 20:27:36 +0000 (13:27 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 11 Sep 2024 01:42:45 +0000 (18:42 -0700)
commit2d51eb0bd81cfbafc762592ede9e9234063cc853
tree5d46fca4ffe436249affa9633797deee8be18935
parentf775cb1bbfd50cbbdafd4b18c1650eb5477ba769
bnxt_en: Add MSIX check in bnxt_check_rings()

bnxt_check_rings() is called to ensure that we have the hardware ring
resources before committing to reinitialize with the new number of
rings.  MSIX vectors are never checked at this point, because up
until recently we must first disable MSIX before we can allocate the
new set of MSIX vectors.

Now that we support dynamic MSIX allocation, check to make sure we
can dynamically allocate the new MSIX vectors as the last step in
bnxt_check_rings() if dynamic MSIX is supported.

For example, the IOMMU group may limit the number of MSIX vectors
for the device.  With this patch, the ring change will fail more
gracefully when there is not enough MSIX vectors.

It is also better to move bnxt_check_rings() to be called as the last
step when changing ethtool rings.

Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240909202737.93852-3-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c