Article View: linux.kernel.netdev
Article #21696Re: [PATCH net-next v9 08/10] bnge: add NTUPLE filter support in ethtool
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 10:20
Date: Tue, 24 Nov 2026 10:20
144 lines
13453 bytes
13453 bytes
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
Technical Details
Message-ID:
<179551563543.3135.8782865682278121894@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370224-linux-kernel-netdev=dewy.ruReferences:
<20261123100746.1975030-9-vikas.gupta@broadcom.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370224-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v9 08/10] bnge: add NTUPLE filter support in ethtool Date: Tue, 24 Nov 2026 10:20:35 +0000 Organization: Usenet Network Message-ID: <179551563543.3135.8782865682278121894@kernel.org> References: <20261123100746.1975030-9-vikas.gupta@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="4110732"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:buzP9fFX6sF2v9SjZqZj1dJqUgg= sha256:kwW3W7o5YUAt1es7xlOFZru9IyXKEFTezk86/dI1O/k= sha1:9mrUpeFEpjlMr/aF6Z63HK4HPIw= sha256:FWEyN/0Z+ptdH9D6Ex7gpvTmoASXGjjl43qFqRCKh2g= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 21963125DEE; Tue, 24 Nov 2026 13:21:08 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4ULApL8HM9fW; Tue, 24 Nov 2026 13:21:04 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370224-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 175B3125DEF; Tue, 24 Nov 2026 13:20:56 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 38EE23DD7E; Tue, 24 Nov 2026 10:20:40 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795515637; b=ytciwEuB71Y0YM2tKwZMDNIVSJvu3rIYKRmNLoG7TjmCUNA3epMm0m36p7OQvVSpaOIx xa92bkWGi8LAjLTnSszJCXOFrBAudeT0bIpS3+m/TQDu+KkSuiNZJFDVvul0SMip13wKF dsS55rVn92emp1r8WWwIeUmKll2jv1JC+z2hActhArVmqiLjVa0466/yL7yHecUgoieZ7 na8nwhaEXmBQVU1pj/8fLkpyAEkLIAvx3vmztnsC2O4CpP5zcynSt7APmZ9dSLK718wCS /b2oPedSstbwYw/tNfx4Xt6+o8Ndp0o+LAhTIfLKlWFLREDm0x07wSAuMc8A/Bj2obg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795515637; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=ezwj1PmRYTif22M9HdFfo8GLeV0gGpBM+EfbcndNxVQ=; b=dNKxNIdyjU/vPjNOuLD+CfCdjs3l8VnwfDjV0MergMkbF9B7/AsvAIdsL/UAo0S9/Ga5 PyoKrDu19YRxpy2HGza4YrfqMm0OkAKQJl+0UCNX9T2GSEFRZNkM1BDGTPv/y0GZhAk31 xqXnisUed16qG//daR6hz/Re2zP2QKzIQm9/7oieOnwryqq/Vo5qTg0EdT46CDcgbrpJV wbTW5N4pBU+kMrb+SWl7L1gbNgztbYhgGgkQmc9mIlXFD2wV5Ims22Ozg4LpuLweY9BbS 5lQux5k1RfQhaCUcSgIeAirNW4gDvQkxd0vC0PSjKFp1ZLnB3f+A5S2eO1aZObo2hSQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jLQ2iJj3; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A50F7606A338; Tue, 24 Nov 2026 10:20:37 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jLQ2iJj3 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795515636; b=ylQNkMkzeh0yTlhvI1zPy48Si28ggZrZsj6d4YtfWeUKii8mhVDFhtkpq0asQYzofHPS dQiugjFTyP3MK/A8uHOCUD1CmEfcOH3mT8zLUT/azsNd1itKtERfFgK6fIBg8IiIH8POI qAEJOxGyhGUUuxpX8WOMYI8Fpm73+jOY77hxYPPje8moLLSX29XFEBZbyoCSIyEwCr34w 9YBYURA8NNd1Ge5yDmDfaSTb5s3k+7TnIgUutlBApH0goaTBhJvns7UCkTfbBaK7e/wDJ BjsMYROzEMAvtHzaakJVSutLbmK5A9MtJRCm1peK+z7AXtRK81BkIJDQ7nWBO3Cd4bg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795515636; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=ezwj1PmRYTif22M9HdFfo8GLeV0gGpBM+EfbcndNxVQ=; b=3usx3Ipayz6FI3GvOgG1eionPDBw8nXBTrT0/sq2qd7DND9WjhhrskmVl9pi4pHCSnAo utfrvzBiyvBL5nQg+YbV5s/O/eF9lUVkwRyQYuPOchX3KZ6N67PQiW7Qk16UZSmuU+3Ir LgIqiQyX4ZVbZV03D+aSnbk2PrHlvztv8SbFw5MZOVgPbCSJQT2Avu0AWlUvcBTeHBumW IHfx5c2T+zP7fu3y9+ufLcolgcRvJ0KNxkKgiNl+T39zM9bHdWsJ5zJmXW1T7GGE1k57W 7K9g59+SXZKGgScPnbZlx9gCknaNchXKhWHLRXC1LKr1vgXnY6RpDnjYnMMzSYP/whQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jLQ2iJj3; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C73D7606A31E; Tue, 24 Nov 2026 10:20:36 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D128A1F00A3C; Tue, 24 Nov 2026 10:20:35 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795515636; bh=ezwj1PmRYTif22M9HdFfo8GLeV0gGpBM+EfbcndNxVQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=jLQ2iJj3OsuPL0YQ2O5F6BzFhCiZsfJNS22dnzAA6MY2752TwJQ/TT7nKtKtTRfss rqeTvPe34QaGQOMilS3v1ywy/s+lvZCFQ0UE9vusPUn/ZXyUIJcrlcSrzKzXRm81NP Jc25v7ejcIpoorv/Lbdo5q0wDrtZWgduazqWbUyiWO7kI18OREmWC2AqV0Bl3NT0oZ MvgPORoIOx98rHJJPkmod4iTtkURfTa3HvXIAIH6cLHvTcQ6NiQ8OBsU3aPsacU1tI TitMjPXlfzV1qGl/t48Dme3s2jJEFWRWoOpJh8yOJCioZ8Q58d7VlhjpLXCVUFFMkQ 0ds68MR15WxFg== X-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 X-In-Reply-To: <20261123100746.1975030-9-vikas.gupta@broadcom.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list