summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDharmender Garg <dharmender.garg@broadcom.com>2026-10-26 14:57:57 +0530
committerJakub Kicinski <kuba@kernel.org>2026-10-28 17:37:40 -0700
commit8b97091eae744a577573797e5d5abc3e0da10769 (patch)
tree10d2ad4947860fbcf5e7ad8dd5663b6f953e8503 /drivers
parente8f6ca11167d4753386340ce88444b5445dff831 (diff)
bnge: fix RSS table sizing for large RX ring counts
bnge_adjust_pow_two() adds one block before rounding up to a power of two only when the quotient is 0 or 1. A larger quotient that is already a power of two is returned unchanged, so 129-192 RX rings get a 128-entry RSS indirection table and 257-320 rings a 256-entry one. The rings above the table size never receive default RSS traffic. bnxt_calc_nr_ring_pages() always adds one, which is correct. Make bnge_adjust_pow_two() always add one block before rounding up. bnge_adjust_pow_two() also sizes the RX, RX aggregation, TX and completion ring pages. For the default 511-entry rings their page counts do not change. The completion ring is sized from more than the default depth, so its page count changes where the old code dropped a partial page. With 8K ring pages, TPA off and the default rings, its budget is 1533 entries and the page count goes from 2 to 4. With 4K ring pages and TPA on, when the firmware reports a max_aggs_supported of 260 to 387, it goes from 16 to 32. In these cases the old completion ring held fewer entries than its budget. Fixes: 627c67f038d2 ("bng_en: Add resource management support") Signed-off-by: Dharmender Garg <dharmender.garg@broadcom.com> Reviewed-by: Vikas Gupta <vikas.gupta@broadcom.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20261026092757.9168-3-vikas.gupta@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/broadcom/bnge/bnge_resc.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_resc.h b/drivers/net/ethernet/broadcom/bnge/bnge_resc.h
index b62a634669f6..c0b6992d7f82 100644
--- a/drivers/net/ethernet/broadcom/bnge/bnge_resc.h
+++ b/drivers/net/ethernet/broadcom/bnge/bnge_resc.h
@@ -81,13 +81,10 @@ bnge_adjust_pow_two(u32 total_ent, u16 ent_per_blk)
{
u32 blks = total_ent / ent_per_blk;
- if (blks == 0 || blks == 1)
- return ++blks;
+ if (!blks)
+ return 1;
- if (!is_power_of_2(blks))
- blks = roundup_pow_of_two(blks);
-
- return blks;
+ return roundup_pow_of_two(blks + 1);
}
#define BNGE_MAX_ROCE_MSIX 64