From: netdev-bot+sashiko@kernel.org
To: vikas.gupta@broadcom.com
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bhargava.marreddy@broadcom.com, rahul-rg.gupta@broadcom.com,
vsrama-krishna.nemani@broadcom.com,
rajashekar.hudumula@broadcom.com, dharmender.garg@broadcom.com,
ajit.khaparde@broadcom.com
Subject: Re: [PATCH net 2/2] bnge: cap RSS contexts and RX rings to the RSS table size
Date: Tue, 13 Oct 2026 05:44:57 +0000 [thread overview]
Message-ID: <179187029731.434549.16806543347969284166@kernel.org> (raw)
In-Reply-To: <20261012054325.1782819-3-vikas.gupta@broadcom.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message says the overflow happens with "577 or more RX
rings".
- [Low] The commit message says the pad computation "in
bnge_set_dflt_rss_indir_tbl() and bnge_modify_rss() underflows into a…
--
bnge: cap RSS contexts and RX rings to the RSS table size
This patch caps the value returned by bnge_cal_nr_rss_ctxs() at
BNGE_RSS_TABLE_MAX_TBL. It also limits max_rx in _bnge_get_max_rings() to
BNGE_MAX_RSS_TABLE_ENTRIES, so the RSS context count and the indirection
table size fit the arrays, which hold 8 contexts and 512 entries.
> bnge_cal_nr_rss_ctxs() has no upper bound. The VNIC holds at most
> BNGE_RSS_TABLE_MAX_TBL (8) RSS contexts, in fw_rss_cos_lb_ctx[] and in
> a 512-entry indirection table and DMA buffer. With 577 or more RX rings
> the function returns more than 8, so bnge_setup_vnic() writes past
[Severity: Low]
Is 577 the right threshold here? Here is bnge_adjust_pow_two() in
bnge_resc.h:
u32 blks = total_ent / ent_per_blk;
if (!blks)
return 1;
return roundup_pow_of_two(blks + 1);
With rx_rings = 512, bnge_cal_nr_rss_ctxs() passes 511, so blks = 7 and
the result is 8 contexts.
With rx_rings = 513 it passes 512, so blks = 8 and roundup_pow_of_two(9)
returns 16 contexts.
So the overflows described here seem to start at 513 RX rings. 577 is
one of the values in the 513..1024 range that also give 16. The code
change caps max_rx at 512, so it covers that whole range. Only the number
in the message looks wrong.
Could the message say 513 instead of 577?
> vnic->fw_rss_cos_lb_ctx[], bnge_set_dflt_rss_indir_tbl() and
> bnge_fill_hw_rss_tbl() write past the indirection table and its DMA
> buffer, and the pad computation in bnge_set_dflt_rss_indir_tbl() and
> bnge_modify_rss() underflows into a huge memset().
[Severity: Low]
Where is bnge_modify_rss() defined? I couldn't find a function by that
name under drivers/net/ethernet/broadcom/. bnge also doesn't seem to have
a set_rxfh or set_channels path where one would live.
The only pad underflow site in bnge seems to be in
bnge_set_dflt_rss_indir_tbl():
pad = bd->rss_indir_tbl_entries - max_entries;
if (pad)
memset(&rss_indir_tbl[i], 0, pad * sizeof(*rss_indir_tbl));
Was this reference carried over from bnxt? Should the message list only
the sites that exist in bnge, i.e. bnge_setup_vnic(),
bnge_fill_hw_rss_tbl() and bnge_set_dflt_rss_indir_tbl()?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261012054325.1782819-1-vikas.gupta%40broadcom.com
next prev parent reply other threads:[~2026-10-13 5:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 5:43 [PATCH net 0/2] bnge fixes Vikas Gupta
2026-10-12 5:43 ` [PATCH net 1/2] bnge: fix RSS table sizing for large RX ring counts Vikas Gupta
2026-10-13 5:44 ` netdev-bot+sashiko
2026-10-13 6:42 ` Vikas Gupta
2026-10-12 5:43 ` [PATCH net 2/2] bnge: cap RSS contexts and RX rings to the RSS table size Vikas Gupta
2026-10-13 5:44 ` netdev-bot+sashiko [this message]
2026-10-12 5:50 ` [PATCH net 0/2] bnge fixes netdev-bot+sinfo
2026-10-12 5:56 ` Vikas Gupta
2026-10-12 11:51 ` Björn Töpel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179187029731.434549.16806543347969284166@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=ajit.khaparde@broadcom.com \
--cc=andrew+netdev@lunn.ch \
--cc=bhargava.marreddy@broadcom.com \
--cc=davem@davemloft.net \
--cc=dharmender.garg@broadcom.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rahul-rg.gupta@broadcom.com \
--cc=rajashekar.hudumula@broadcom.com \
--cc=vikas.gupta@broadcom.com \
--cc=vsrama-krishna.nemani@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox