bnxt_en: Check additional resources in bnxt_check_rings()
authorMichael Chan <michael.chan@broadcom.com>
Tue, 20 Feb 2024 23:03:11 +0000 (15:03 -0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 22 Feb 2024 14:31:23 +0000 (15:31 +0100)
bnxt_check_rings() is called to check if we have enough resource
assets to satisfy the new number of ethtool channels.  If the asset
test fails, the ethtool operation will fail gracefully.  Otherwise
we will proceed and commit to use the new number of channels.  If it
fails to allocate any resources, the chip will fail to come up.

For completeness, check all possible resources before committing to
the new settings.  Add the missing ring group and RSS context asset
tests in bnxt_check_rings().

Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index e6fad2a8b817e43dc2da7fa7b075488624a59523..71ac165dfb5247aa43398aca9b3d8c733b247b33 100644 (file)
@@ -13339,6 +13339,8 @@ int bnxt_check_rings(struct bnxt *bp, int tx, int rx, bool sh, int tcs,
        if (BNXT_NEW_RM(bp)) {
                hwr.cp += bnxt_get_ulp_msix_num(bp);
                hwr.stat += bnxt_get_ulp_stat_ctxs(bp);
+               hwr.grp = rx;
+               hwr.rss_ctx = bnxt_get_total_rss_ctxs(bp, &hwr);
        }
        if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS)
                hwr.cp_p5 = hwr.tx + rx;