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-next v9 08/10] bnge: add NTUPLE filter support in ethtool
Date: Tue, 24 Nov 2026 10:20:35 +0000 [thread overview]
Message-ID: <179551563543.3135.8782865682278121894@kernel.org> (raw)
In-Reply-To: <20261123100746.1975030-9-vikas.gupta@broadcom.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] bnge_cfg_rx_mode()
(drivers/net/ethernet/broadcom/bnge/bnge_netdev.c) raises the number…
- [Low] The commit message promises a two-case outcome when a user
ETHER_FLOW rule and a unicast address share a MAC: "If the unicast…
--
bnge: add NTUPLE filter support in ethtool
This adds ethtool rxnfc get/set operations to bnge for ntuple and
ETHER_FLOW rules. User filters are kept in software across down/up and
programmed again on open. It also replaces the BNGE_MAX_UC_ADDRS limit with
BNGE_MAX_L2_FLTRS, so up to 127 unicast addresses are programmed before the
driver falls back to promiscuous mode, and it enables NETIF_F_NTUPLE by
default.
> diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_netdev.c b/drivers/net/ethernet/broadcom/bnge/bnge_netdev.c
> index 58039e6d610ed..44637152b075c 100644
> --- a/drivers/net/ethernet/broadcom/bnge/bnge_netdev.c
> +++ b/drivers/net/ethernet/broadcom/bnge/bnge_netdev.c
[ ... ]
> @@ -2126,14 +2129,24 @@ static int bnge_cfg_rx_mode(struct bnge_net *bn, struct netdev_hw_addr_list *uc,
[ ... ]
> netdev_hw_addr_list_for_each(ha, uc)
> if (!ether_addr_equal(ha->addr, dev->dev_addr))
> uc_count++;
> - if (uc_count > BNGE_MAX_UC_ADDRS - 1) {
> + /* The unicast addresses and the user ETHER_FLOW rules share the L2
> + * filters. Receive the addresses that do not fit in promiscuous mode.
> + * The firmware supports many more L2 filters than BNGE_MAX_L2_FLTRS,
> + * so it is not expected to refuse a filter in the loop below.
> + */
> + l2_free = BNGE_MAX_L2_FLTRS -
> + bitmap_weight(bn->l2_fltr_bmap, BNGE_MAX_L2_FLTRS);
> + if (uc_count > BNGE_MAX_L2_FLTRS - 1 || uc_count > l2_free) {
> vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS;
> } else {
[Severity: Medium]
The threshold goes from 3 addresses to 127 here. Is l2_free the only limit
on how many unicast filters get programmed?
l2_free is computed from the driver's own bn->l2_fltr_bmap. The firmware
reports a per-function limit, which bnge_hwrm_func_qcaps() stores:
hw_resc->min_l2_ctxs = le16_to_cpu(resp->min_l2_ctxs);
hw_resc->max_l2_ctxs = le16_to_cpu(resp->max_l2_ctxs);
Nothing in the driver reads max_l2_ctxs, though. So no check in the code
backs the commit message's "the firmware supports many more L2 filters, so
a refusal in this path is not expected".
Suppose firmware refuses bnge_hwrm_l2_filter_alloc() in the fill loop below
with an error other than -EEXIST. The function then does this before
bnge_hwrm_cfa_l2_set_rx_mask() runs:
vnic->uc_filter_count = i;
return rc;
Would the remaining addresses then get neither an L2 filter nor promiscuous
mode?
On the open path, bnge_init_vnic() treats this as fatal:
rc = bnge_cfg_rx_mode(bn, &bn->netdev->uc, true, false);
if (rc == -EAGAIN) {
netif_rx_mode_schedule_retry(bn->netdev);
rc = 0;
} else if (rc) {
goto err_out;
}
Could a refusal there make the interface fail to open? With the old
3-address limit, the driver would have gone promiscuous well before this
point. Whether it can happen depends on what max_l2_ctxs the firmware
reports for a bnge PF.
Would it make sense to limit uc_count by min(BNGE_MAX_L2_FLTRS, max_l2_ctxs)
minus the filters already in use? Another option is to fall back to
promiscuous mode when the firmware refuses a filter.
[ ... ]
> @@ -2149,6 +2162,11 @@ static int bnge_cfg_rx_mode(struct bnge_net *bn, struct netdev_hw_addr_list *uc,
>
> for (i = 1, off = 0; i < vnic->uc_filter_count; i++, off += ETH_ALEN) {
> rc = bnge_hwrm_set_vnic_filter(bn, 0, i, vnic->uc_list + off);
> + if (rc == -EEXIST) {
> + /* Already delivered by a user L2 rule */
> + vnic->l2_filters[i] = NULL;
> + continue;
> + }
[Severity: Low]
The commit message says:
If the unicast address is added first, adding a rule for the same MAC
fails with -EEXIST.
Is that always true? By the time bnge_cfg_rx_mode() takes the promiscuous
branch above, the filters in l2_filters[1..] have already been freed, and
the branch creates no new ones. So the software L2 hash table has no entry
for those addresses.
A later ETHER_FLOW rule for one of those MACs then goes through:
bnge_srxclsrlins()
bnge_add_l2_cls_rule()
bnge_alloc_user_l2_filter()
bnge_lookup_l2_filter() <- finds nothing
The rule is accepted and programmed in firmware instead of failing with
-EEXIST.
On the next rx_mode update where the addresses fit,
bnge_hwrm_set_vnic_filter() returns -EEXIST here. The address (a macvlan,
for example) is then delivered only to the rule's ring. That is the "rule
added first" outcome, even though the address was added first.
The same seems to happen when the fill loop stopped early on a firmware
error and left later addresses without a filter.
Could the commit message cover these cases?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261123100746.1975030-1-vikas.gupta%40broadcom.com
next prev parent reply other threads:[~2026-11-24 10:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 10:07 [PATCH net-next v9 00/10] add features to bnge Vikas Gupta
2026-11-23 10:07 ` [PATCH net-next v9 01/10] bnge: restructure VNIC and filter code Vikas Gupta
2026-11-23 10:07 ` [PATCH net-next v9 02/10] bnge: add NTUPLE/ARFS VNIC Vikas Gupta
2026-11-24 10:20 ` netdev-bot+sashiko
2026-11-23 10:07 ` [PATCH net-next v9 03/10] bnge: add helper functions for multi RSS contexts Vikas Gupta
2026-11-23 10:07 ` [PATCH net-next v9 04/10] bnge: add RXFH ethtool support Vikas Gupta
2026-11-24 10:20 ` netdev-bot+sashiko
2026-11-23 10:07 ` [PATCH net-next v9 05/10] bnge: add ethtool support to manage RSS contexts Vikas Gupta
2026-11-24 10:20 ` netdev-bot+sashiko
2026-11-23 10:07 ` [PATCH net-next v9 06/10] bnge: remove refcount from L2 filter Vikas Gupta
2026-11-24 10:20 ` netdev-bot+sashiko
2026-11-23 10:07 ` [PATCH net-next v9 07/10] bnge: add NTUPLE filter infrastructure Vikas Gupta
2026-11-24 10:20 ` netdev-bot+sashiko
2026-11-23 10:07 ` [PATCH net-next v9 08/10] bnge: add NTUPLE filter support in ethtool Vikas Gupta
2026-11-24 10:20 ` netdev-bot+sashiko [this message]
2026-11-23 10:07 ` [PATCH net-next v9 09/10] bnge: add aRFS flow steering ndo support Vikas Gupta
2026-11-24 10:20 ` netdev-bot+sashiko
2026-11-23 10:07 ` [PATCH net-next v9 10/10] bnge: add cpu_rmap support for IRQ affinity Vikas Gupta
2026-11-24 10:20 ` netdev-bot+sashiko
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=179551563543.3135.8782865682278121894@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
all inboxes | Powered by JetHome®