diff mbox series

[net-next,04/10] bnxt_en: Check additional resources in bnxt_check_rings()

Message ID 20240220230317.96341-5-michael.chan@broadcom.com (mailing list archive)
State Accepted
Commit 9294299867734ceff303012cd6ec98990fbd78e6
Delegated to: Netdev Maintainers
Headers show
Series bnxt_en: Ntuple filter improvements | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 940 this patch: 940
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/build_clang success Errors and warnings before: 957 this patch: 957
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 959 this patch: 959
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-02-22--00-00 (tests: 1455)

Commit Message

Michael Chan Feb. 20, 2024, 11:03 p.m. UTC
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>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index e6fad2a8b817..71ac165dfb52 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;