From: Michael Chan Date: Tue, 20 Feb 2024 23:03:11 +0000 (-0800) Subject: bnxt_en: Check additional resources in bnxt_check_rings() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9294299867734ceff303012cd6ec98990fbd78e6;p=linux.git bnxt_en: Check additional resources in bnxt_check_rings() 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 Reviewed-by: Somnath Kotur Signed-off-by: Michael Chan Signed-off-by: Paolo Abeni --- diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index e6fad2a8b817e..71ac165dfb524 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -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;