From: Florian Fainelli <florian.fainelli@broadcom.com>
To: netdev-bot+sashiko@kernel.org
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 4/9] dt-bindings: net: describe the Northstar flow accelerator
Date: Wed, 18 Nov 2026 09:22:05 -0800 [thread overview]
Message-ID: <e8714dba-f51a-40a2-9bda-be49fb3b16ff@broadcom.com> (raw)
In-Reply-To: <179495816151.3136.14110323389854628043@kernel.org>
On 11/17/26 15:29, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 3 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 · Medium: 1 · 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 flow-accelerator register resource in brcm,bcm4708-fa.yaml
> is modelled as a standalone MMIO block with only `compatible` and…
> - [Low] The new brcm,bcm5301x-gmac.yaml schema is selected only when the
> `brcm,flow-accelerator` property is present (`select: required:…
> - [Low] The FA binding description calls switch port 5 'IMP5' ('Switch
> port 5 (IMP5), connected to GMAC0, ...').
>
> --
>
> dt-bindings: net: describe the Northstar flow accelerator
>
> This commit adds a binding for the register block of the
> BCM4708/BCM53011/BCM53012 flow accelerator. It also adds a schema for the
> brcm,flow-accelerator phandle on the GMAC2 BCMA Ethernet node. The
> description covers the second CPU path, port 5 to GMAC0, for exceptions
> that bypass the accelerator.
>
>> diff --git a/Documentation/devicetree/bindings/net/brcm,bcm4708-fa.yaml b/Documentation/devicetree/bindings/net/brcm,bcm4708-fa.yaml
>> new file mode 100644
>> index 0000000000000..f744b23433c46
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/brcm,bcm4708-fa.yaml
>> @@ -0,0 +1,45 @@
>
> [ ... ]
>
>> +description: |
>> + The flow accelerator is inline between GMAC2 and switch port 8 (IMP0).
>> + GMAC0 and GMAC1 bypass it. The GMAC2 BCMA Ethernet node references this
>> + register block through a brcm,flow-accelerator phandle. Miss packets carry
>> + a prepended accelerator descriptor in place of the embedded switch tag.
>> +
>> + Switch port 5 (IMP5), connected to GMAC0, provides a second CPU path for
>
> [Severity: Low]
> Should this say IMP1 instead of IMP5? The b53 SRAB code calls the two IMP
> ports IMP0 (port 8) and IMP1 (port 5):
>
> drivers/net/dsa/b53/b53_srab.c:
> #define B53_SRAB_IMP1_SLEEP_TIMER BIT(10)
> #define B53_SRAB_P7_SLEEP_TIMER BIT(11)
> #define B53_SRAB_IMP0_SLEEP_TIMER BIT(12)
>
> This description already uses IMP0 for port 8.
>
>> + exceptions that must bypass the accelerator, including TCP control,
>> + low-TTL and oversized packets. Describe that CPU port with an ethernet
>> + phandle to GMAC0 and an internal, 1 Gbps full-duplex fixed link in the
>> + switch's ports node. Port 8 remains the data connection to GMAC2.
>
> [ ... ]
>
>> + reg:
>> + maxItems: 1
>> +
>> +required:
>> + - compatible
>> + - reg
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> + - |
>> + flow-accelerator@18027c00 {
>> + compatible = "brcm,bcm53011-fa";
>> + reg = <0x18027c00 0xc0>;
>> + };
>
> [Severity: Medium]
> Can the flow accelerator be treated as a standalone MMIO block? The example
> address 0x18027c00 falls inside the 4 KiB BCMA window of GMAC core unit 3.
> bcm-ns.dtsi already describes that core under the 0x18000000 axi bus:
>
> arch/arm/boot/dts/broadcom/bcm-ns.dtsi:
> gmac3: ethernet@27000 {
> reg = <0x27000 0x800>;
> };
>
> The binding allows only compatible and reg. It has no clocks or resets
> and no link to the GMAC3 core. It also does not say that the hosting core
> must be out of reset and clocked.
>
> Later in the series, bcm_ns_fa_init() in
> drivers/net/ethernet/broadcom/bcm-ns-fa.c maps this node and writes to it
> straight away:
>
> np = of_parse_phandle(parent->of_node, "brcm,flow-accelerator", 0);
> ...
> fa->regs = devm_ioremap_resource(parent, &res);
> ...
> writel(0, fa->regs + FA_STATUS_MASK);
>
> Nothing in bgmac or bcm-ns-fa calls bcma_core_enable() on core unit 3.
> bgmac_probe() also rejects core_unit 3 when that core has no MAC address,
> so it never gets enabled there.
>
> Suppose the bootloader leaves the GMAC3 wrapper in reset or clock-gated.
> Could bgmac_probe() for GMAC2 -> bcm_ns_fa_init() -> writel() then take
> an imprecise external abort or hang the bus? And if something later resets
> the GMAC3 wrapper, would that wipe the programmed FA state?
>
> This is inferred from how AI wrappers usually behave. I have not checked
> it against the Northstar register map, so I can't confirm that GMAC3
> hosts the FA. On BCM53012 boards where CFE leaves core 3 enabled, it may
> work as is.
>
> Should the binding describe how the FA relates to its hosting core, or
> the clocks and resets it depends on?
>
>> diff --git a/Documentation/devicetree/bindings/net/brcm,bcm5301x-gmac.yaml b/Documentation/devicetree/bindings/net/brcm,bcm5301x-gmac.yaml
>> new file mode 100644
>> index 0000000000000..76fbe2abf5152
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/net/brcm,bcm5301x-gmac.yaml
>> @@ -0,0 +1,27 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/net/brcm,bcm5301x-gmac.yaml#
>
> [ ... ]
>
>> +select:
>> + required:
>> + - brcm,flow-accelerator
>> +
>> +properties:
>> + brcm,flow-accelerator:
>> + $ref: /schemas/types.yaml#/definitions/phandle
>> + description: |
>> + Phandle to the BCM4708, BCM53011 or BCM53012 inline flow accelerator.
>> + Only GMAC2 (BCMA Ethernet core unit 2) has this connection.
>> +
>> +additionalProperties: true
>
> [Severity: Low]
> The "Only GMAC2" restriction exists only in the description text. The
> schema is selected purely by the presence of the property, and it sets
> additionalProperties: true. Wouldn't a DT that puts brcm,flow-accelerator
> on gmac0 (ethernet@24000), gmac1 or gmac3 still pass dt_binding_check and
> dtbs_check?
>
> Nothing checks that the phandle points to a brcm,*-fa node either.
>
> Later in the series, bgmac_probe() in bgmac-bcma.c enforces the rule at
> runtime:
>
> if (of_property_present(core->dev.of_node, "brcm,flow-accelerator") &&
> core->core_unit != 2)
> return -EINVAL;
>
> So a misplaced phandle makes that GMAC fail to probe, and dtbs_check gives
> no warning beforehand.
>
> Separately, the file name and $id suggest a brcm,bcm5301x-gmac compatible,
> but the BCMA GMAC nodes have no compatible. Is that naming intended?
>
[Medium] FA modeled as a standalone MMIO block
The register block does not overlap the GMAC3 node: 0x18027c00 is in the
GMAC3 BCMA window but outside the 0x800 bytes described by
ethernet@27000. Per the data sheets, the FA is part of the AXI MAC + FA
block together with the four GMAC cores (GMAC3 being the block's
loopback port), not a separate peripheral. It has no clock or reset
input of its own in the DT, and BCMA wrappers are not modeled as DT
clocks/resets.
I cannot tell from the documentation how the GMAC3 BCMA wrapper state
affects access to these registers, so I am checking this on hardware and
will add the core enable to bcm_ns_fa_init() if it turns out to be
needed. v2 documents where the registers live in the binding description.
[Low] IMP5 vs IMP1
Agreed, port 5 is IMP1. Fixed in v2.
[Low] GMAC2-only restriction / naming
v2 restricts the consumer schema to ethernet@26000 with a $nodename
pattern. BCMA GMAC nodes have no compatible, which is why the schema is
selected by the property; the description now says so. dt-schema cannot
check what the phandle points to, the driver validates the compatible.
pw-bot: cr
--
Florian
next prev parent reply other threads:[~2026-11-18 17:22 UTC|newest]
Thread overview: 30+ 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-17 23:51 ` Florian Fainelli
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-17 23:57 ` Florian Fainelli
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-18 17:22 ` Florian Fainelli [this message]
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-18 18:08 ` Florian Fainelli
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-18 18:10 ` Florian Fainelli
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-18 18:18 ` Florian Fainelli
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-18 18:22 ` Florian Fainelli
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
2026-11-18 18:25 ` Florian Fainelli
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=e8714dba-f51a-40a2-9bda-be49fb3b16ff@broadcom.com \
--to=florian.fainelli@broadcom.com \
--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=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-bot+sashiko@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
all inboxes | Powered by JetHome®