]> www.infradead.org Git - users/hch/configfs.git/commitdiff
bnxt_en: Fix the resource check condition for RSS contexts
authorPavan Chebbi <pavan.chebbi@broadcom.com>
Wed, 3 Jul 2024 18:01:12 +0000 (11:01 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 4 Jul 2024 14:40:27 +0000 (07:40 -0700)
While creating a new RSS context, bnxt_rfs_capable() currently
makes a strict check to see if the required VNICs are already
available.  If the current VNICs are not what is required,
either too many or not enough, it will call the firmware to
reserve the exact number required.

There is a bug in the firmware when the driver tries to
relinquish some reserved VNICs and RSS contexts.  It will
cause the default VNIC to lose its RSS configuration and
cause receive packets to be placed incorrectly.

Workaround this problem by skipping the resource reduction.
The driver will not reduce the VNIC and RSS context reservations
when a context is deleted.  The resources will be available for
use when new contexts are created later.

Potentially, this workaround can cause us to run out of VNIC
and RSS contexts if there are a lot of VF functions creating
and deleting RSS contexts.  In the future, we will conditionally
disable this workaround when the firmware fix is available.

Fixes: 438ba39b25fe ("bnxt_en: Improve RSS context reservation infrastructure")
Reported-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/netdev/20240625010210.2002310-1-kuba@kernel.org/
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240703180112.78590-1-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index a6d69a45fa01455f751e1b6db85a6bfa9f3a6931..53085058100c24f544cc2b195060baa8640b9736 100644 (file)
@@ -12669,7 +12669,11 @@ bool bnxt_rfs_capable(struct bnxt *bp, bool new_rss_ctx)
        if (!BNXT_NEW_RM(bp))
                return true;
 
-       if (hwr.vnic == bp->hw_resc.resv_vnics &&
+       /* Do not reduce VNIC and RSS ctx reservations.  There is a FW
+        * issue that will mess up the default VNIC if we reduce the
+        * reservations.
+        */
+       if (hwr.vnic <= bp->hw_resc.resv_vnics &&
            hwr.rss_ctx <= bp->hw_resc.resv_rsscos_ctxs)
                return true;