From: netdev-bot+sashiko@kernel.org
To: florian.fainelli@broadcom.com
Cc: netdev@vger.kernel.org, rafal@milecki.pl,
bcm-kernel-feedback-list@broadcom.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, horms@kernel.org, corbet@lwn.net,
jonas.gorski@gmail.com, olteanv@gmail.com, pablo@netfilter.org,
fw@strlen.de, phil@nwl.cc, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org
Subject: Re: [PATCH net-next 9/9] docs: net: document Northstar FA setup and NAT qualification
Date: Tue, 17 Nov 2026 23:29:30 +0000 [thread overview]
Message-ID: <179495817095.3136.15574702882079067890@kernel.org> (raw)
In-Reply-To: <20261116222519.1416501-10-florian.fainelli@broadcom.com>
Thank you for your contribution! Sashiko AI review found 6 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 4 · Low: 2
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] The reference nftables ruleset in
Documentation/networking/device_drivers/ethernet/broadcom/bcm-ns-…
- [Medium] bcm-ns-fa.rst (lines 130-131) says "Every IPv4 FIB route, rule
and nexthop change flushes all FA-owned flows".
- [Medium] B53 and the FA backend decide independently whether FA
metadata mode is active, and they use different tests.
- [Medium] The FA block is at 0x18027c00 (reg <0x18027c00 0xc0>), which
is offset 0xc00 inside the GMAC3 BCMA core aperture (gmac3:…
- [Low] The 'Automated validation' section runs kunit.py with the suite
filter `'*fa*'` against drivers/net/ethernet/broadcom/.kunitconfig.
- [Low] The commit message for "docs: net: document Northstar FA setup
and NAT qualification" ends with "Keep campaign history and review…
--
docs: net: document Northstar FA setup and NAT qualification
This adds documentation for the Broadcom Northstar flow accelerator. It
covers the supported GMAC2/GMAC0 topology, the device tree and kernel
configuration, and how route and neighbour invalidation works. It also
describes a three-host NAT qualification procedure, fault injection tests
and KUnit validation, and adds the new file to the index and MAINTAINERS.
> validation from the driver's incomplete FIB eligibility probe. Keep
> campaign history and review status in the accompanying package.
[Severity: Low]
This isn't a bug, but what does "the accompanying package" refer to? The
patch only adds bcm-ns-fa.rst, an index entry and a MAINTAINERS line.
Nothing in the tree matches that description.
Could this sentence go in the cover letter or below the --- line instead
of the permanent changelog?
> diff --git a/Documentation/networking/device_drivers/ethernet/broadcom/bcm-ns-fa.rst b/Documentation/networking/device_drivers/ethernet/broadcom/bcm-ns-fa.rst
> new file mode 100644
> index 0000000000000..2bc6cc5d94cea
> --- /dev/null
> +++ b/Documentation/networking/device_drivers/ethernet/broadcom/bcm-ns-fa.rst
> @@ -0,0 +1,507 @@
[ ... ]
> +Netdevice shutdown, address/MTU changes, new active switch ports, and upper
> +interface changes flush entries. Every IPv4 FIB route, rule and nexthop change
> +flushes all FA-owned flows, including unrelated prefixes and local-table
> +entries. This is intentional: the rule does not carry enough routing-policy
> +context to prove that an event cannot affect an installed path. Work is
> +coalesced, but even unrelated routing churn can reduce offload residency.
[Severity: Medium]
Can the IPv4 FIB notifier actually provide this guarantee? fa_fib_event()
in drivers/net/ethernet/broadcom/bcm-ns-fa.c is the only route
invalidation path. The same promise appears in its comment. However,
fib_table_insert() only notifies when the new alias is the first one for
that prefix and table:
net/ipv4/fib_trie.c:fib_table_insert() {
...
if (fib_find_alias(&l->leaf, new_fa->fa_slen, 0, 0, tb->tb_id, true) ==
new_fa) {
enum fib_event_type fib_event;
...
}
The NLM_F_REPLACE branch and the delete path work the same way:
net/ipv4/fib_trie.c:fib_notify_alias_delete() {
...
/* Do not notify if we do not care about the route. */
if (fib_find_alias(fah, slen, 0, 0, tb_id, true) != fa_to_delete)
return;
...
}
Aliases are sorted by descending DSCP. If a prefix also has a
DSCP-specific alias (ip route ... tos X), the DSCP-0 alias that ordinary
traffic uses is not first. Adding, replacing or deleting that alias raises
no notifier event. As a result, neither fa_invalidate_locked() nor
fa_mtu_route_update() runs.
Flowtable GC doesn't catch this for hardware flows either, because
validation-only references are skipped:
include/net/netfilter/nf_flow_table.h:nf_flow_dst_check() {
/* A driver-only reference must not change direct-path/GC semantics. */
if (!tuple->dst_cache || tuple->dst_validation_only)
return true;
...
}
nf_flow_offload_validate() only runs at admission.
Suppose the DSCP-0 route is replaced with a blackhole, moved to another
next hop, or given an MTU below 1500 as a non-first alias. Would the
hardware rows keep forwarding on the old path while counter activity keeps
refreshing them? The same gap applies to the later claim that flows stay
in software while any route has an MTU below 1500. The blackhole and MTU
1200 qualification steps only use first-alias routes, so they would pass
anyway.
A minor point: fa_fib_event() also handles FIB_EVENT_ENTRY_ADD and
FIB_EVENT_ENTRY_APPEND, which IPv4 never emits.
[ ... ]
> +For a BCM53012 board, add the following node under the root address space
> +(adjust the compatible to ``brcm,bcm53011-fa`` for BCM53011)::
> +
> + / {
> + fa: flow-accelerator@18027c00 {
> + compatible = "brcm,bcm53012-fa";
> + reg = <0x18027c00 0xc0>;
> + };
> + };
[ ... ]
> +Remove any other conflicting CPU assignments for this test. B53 selects ``brcm-fa``
> +when it finds the enabled accelerator through this phandle. Do not set
> +``dsa-tag-protocol``: B53 does not implement the runtime protocol-change
> +operation. No existing board is enabled automatically by this series.
[Severity: Medium]
Is this the whole condition? B53 and the FA backend each decide on their
own whether FA metadata mode is active, and they use different tests:
drivers/net/dsa/b53/b53_common.c:b53_uses_fa_tag() {
...
enabled = IS_ENABLED(CONFIG_BCM_NS_FA) && of_device_is_available(fa) &&
(dev->chip_id == BCM53011_DEVICE_ID ||
dev->chip_id == BCM53012_DEVICE_ID ||
(is5301x(dev) && of_device_is_compatible(fa, "brcm,bcm4708-fa")));
...
}
drivers/net/ethernet/broadcom/bcm-ns-fa.c:bcm_ns_fa_init() {
...
if (!of_device_is_compatible(np, "brcm,bcm4708-fa") &&
!of_device_is_compatible(np, "brcm,bcm53011-fa") &&
!of_device_is_compatible(np, "brcm,bcm53012-fa")) {
of_node_put(np);
return ERR_PTR(-ENODEV);
}
...
}
bcm_ns_fa_init() ignores the chip. It then always enables FA_BRCM_HDR
processing and clears FA_CTL_BYPASS.
Take the brcm,bcm53012-fa node from the example above on a 5301x switch
whose runtime chip_id is BCM53010, BCM53018 or BCM53019. The backend would
switch GMAC2 RX to the FA descriptor format. B53 would keep the ordinary
brcm tagger on port 8 and skip the CFP exception guards. Would conduit RX
on port 8 then be misparsed or dropped?
An available FA node with any other compatible makes bcm_ns_fa_init()
return -ENODEV. That fails the whole GMAC2 probe:
drivers/net/ethernet/broadcom/bgmac.c:bgmac_enet_probe() {
...
bgmac->fa = bcm_ns_fa_init(net_dev);
if (IS_ERR(bgmac->fa)) {
err = PTR_ERR(bgmac->fa);
bgmac->fa = NULL;
...
}
Also, "brcm,bcm4708-fa" turns on FA mode for any 5301x chip. That includes
parts the binding, the Kconfig help and this document do not list as
supported.
Could B53 and the backend share one predicate, and could the document
state the actual conditions?
> +
> +The FA resource is outside the GMAC3 DMA register window. It is managed by
> +the GMAC2 consumer; it does not need a separate platform driver or character
> +device. Leave the accelerator disabled or omit the GMAC2 phandle to retain
> +the existing board configuration.
[Severity: Medium]
What state does the GMAC3 core need to be in? The FA block at 0x18027c00
is at offset 0xc00 inside the GMAC3 BCMA core aperture (gmac3:
ethernet@27000 in bcm-ns.dtsi). bcm_ns_fa_init() maps and programs it from
GMAC2 without checking or enabling the core that hosts it.
If the FA shares GMAC3's reset or clock domain, two cases look like
problems.
First, when GMAC3 is disabled in DT, nothing releases the core's reset:
drivers/bcma/main.c:bcma_register_devices() {
...
np = core->dev.of_node;
if (np && !of_device_is_available(np))
continue;
...
}
Could FA register accesses then abort, or hit the FA_INIT_DONE poll
timeout, depending on what the bootloader left behind?
Second, when GMAC3 is enabled, bgmac_probe() in bgmac-bcma.c only rejects
the phandle on a core other than unit 2. GMAC3 therefore still probes, and
bgmac_enet_probe() unconditionally calls:
bgmac_clk_enable(bgmac, 0);
This reaches bcma_core_enable(), which pulses the GMAC3 core reset. If
that happens after GMAC2 has initialized the FA, does it wipe FA_CTL and
the table state? The GMAC2 side would still believe its flows[] and
next-hop bookkeeping match the hardware. BGMAC_FEAT_NO_RESET suppresses
the reset in open/close, but not this probe-time enable.
The setup steps only cover GMAC0 and GMAC2. Should they say whether GMAC3
must be enabled, disabled or left alone?
[ ... ]
> + table inet fa_test {
> + flowtable ft {
> + hook ingress priority 0;
> + devices = { lan1, wan };
> + flags offload;
> + counter;
> + }
> + chain forward {
> + type filter hook forward priority 0; policy drop;
> + meta l4proto udp ct state established flow add @ft
> + ct state established,related counter accept
> + iifname "lan1" oifname "wan" udp dport 5001 counter accept
> + iifname "wan" oifname "lan1" udp dport 5001 ct status dnat counter accept
> + }
> + chain prerouting {
> + type nat hook prerouting priority dstnat; policy accept;
> + iifname "wan" udp dport 15001 dnat ip to 192.0.2.2:5001
> + }
> + chain postrouting {
> + type nat hook postrouting priority srcnat; policy accept;
> + iifname "lan1" oifname "wan" ip saddr 192.0.2.2 snat ip to 198.51.100.1:45000
> + }
> + }
[Severity: Medium]
Will this table load with nft -f? The snat rule in the postrouting chain
asks for a port mapping. However, iifname, oifname and ip saddr don't set
a transport protocol. nft rejects such a rule with "transport protocol
mapping is only valid after transport protocol match". nft -f loads the
file as one transaction, so the whole fa_test table would be rejected.
The dnat rule is fine because udp dport 15001 comes first. Would a meta
l4proto (or tcp/udp) match before the snat statement fix this? The
in-tree nft_flowtable.sh and nft_nat.sh selftests do that.
Separately, the forward chain only handles UDP:
meta l4proto udp ct state established flow add @ft
iifname "lan1" oifname "wan" udp dport 5001 counter accept
With policy drop, wouldn't a new TCP SYN match no accept rule and be
dropped? The text below says "run a UDP or TCP echo server". Later
sections ask for the SNAT, DNAT, pressure, fallback and aging tests to be
repeated with TCP, but no TCP ruleset is given.
[ ... ]
> + ./tools/testing/kunit/kunit.py run --arch=x86_64 \
> + --kunitconfig=drivers/net/ethernet/broadcom/.kunitconfig \
> + --build_dir=/tmp/bcm-ns-fa-kunit '*fa*'
[Severity: Low]
Does the '*fa*' filter skip suites that this kunitconfig builds?
drivers/net/ethernet/broadcom/.kunitconfig also sets
CONFIG_NF_FLOW_TABLE_KUNIT_TEST=y. That builds the nf-flow-lifetime suite
(net/netfilter/nf_flow_table_core_test.c) and the nf-flow-path suite
(net/netfilter/nf_flow_table_offload_test.c). Neither name contains "fa",
so the documented command builds them but never runs them.
nf-flow-path covers the cached route and neighbour validation in
nf_flow_offload_validate() that the commit message relies on.
Should the filter include these suites? Should the text below also
mention CONFIG_NF_FLOW_TABLE_KUNIT_TEST next to the three suites it lists?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116222519.1416501-1-florian.fainelli%40broadcom.com
next prev parent reply other threads:[~2026-11-17 23:29 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 22:25 [PATCH net-next 0/9] net: bgmac: add Northstar IPv4 TCP/UDP NAT flowtable offload Florian Fainelli
2026-11-16 22:25 ` [PATCH net-next 1/9] net: ethernet: bgmac: validate RX length against the DMA packet capacity Florian Fainelli
2026-11-17 23:29 ` netdev-bot+sashiko
2026-11-17 23:43 ` Florian Fainelli
2026-11-16 22:25 ` [PATCH net-next 2/9] netfilter: flowtable: reject non-host IPv4 packets before lookup Florian Fainelli
2026-11-17 23:29 ` netdev-bot+sashiko
2026-11-16 22:25 ` [PATCH net-next 3/9] netfilter: flowtable: retain offload ownership until deletion completes Florian Fainelli
2026-11-17 23:29 ` netdev-bot+sashiko
2026-11-16 22:25 ` [PATCH net-next 4/9] dt-bindings: net: describe the Northstar flow accelerator Florian Fainelli
2026-11-17 23:29 ` netdev-bot+sashiko
2026-11-16 22:25 ` [PATCH net-next 5/9] net: dsa: add Broadcom FA metadata and IPv4 exception paths Florian Fainelli
2026-11-17 23:29 ` netdev-bot+sashiko
2026-11-16 22:25 ` [PATCH net-next 6/9] net: flow_offload: allow drivers to validate and invalidate cached paths Florian Fainelli
2026-11-17 23:29 ` netdev-bot+sashiko
2026-11-16 22:25 ` [PATCH net-next 7/9] net: bgmac: add Northstar IPv4 TCP/UDP NAT flowtable offload Florian Fainelli
2026-11-17 23:29 ` netdev-bot+sashiko
2026-11-16 22:25 ` [PATCH net-next 8/9] net: add KUnit coverage for FA and flowtable path validation Florian Fainelli
2026-11-17 23:29 ` netdev-bot+sashiko
2026-11-16 22:25 ` [PATCH net-next 9/9] docs: net: document Northstar FA setup and NAT qualification Florian Fainelli
2026-11-17 23:29 ` netdev-bot+sashiko [this message]
2026-11-16 22:38 ` [PATCH net-next 0/9] net: bgmac: add Northstar IPv4 TCP/UDP NAT flowtable offload netdev-bot+sinfo
2026-11-16 22:45 ` Florian Fainelli
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=179495817095.3136.15574702882079067890@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=fw@strlen.de \
--cc=horms@kernel.org \
--cc=jonas.gorski@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=phil@nwl.cc \
--cc=rafal@milecki.pl \
--cc=robh@kernel.org \
/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