From: netdev-bot+sashiko@kernel.org
To: alexander.sverdlin@siemens.com
Cc: netdev@vger.kernel.org, s-vadapalli@ti.com, rogerq@kernel.org,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, kmehltretter@gmail.com,
haokexin@gmail.com, lgs201920130244@gmail.com,
aleksandr.loktionov@intel.com, ilias.apalodimas@linaro.org,
m-karicheri2@ti.com, grygorii.strashko@ti.com,
mugunthanvnm@ti.com, linux-omap@vger.kernel.org,
lukas.stockmann@siemens.com
Subject: Re: [PATCH net-next 2/3] net: ethernet: ti: cpsw: forward unknown VLANs in promiscuous switch mode
Date: Fri, 04 Dec 2026 08:53:36 +0000 [thread overview]
Message-ID: <179637441631.3146.10682708359159776909@kernel.org> (raw)
In-Reply-To: <20261203080514.577407-3-alexander.sverdlin@siemens.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 2 · Low: 0
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 patch may not fix what it says it fixes.
- [Medium] Suppose the Unknown VLAN register does control forwarding of
unknown VIDs, as the commit message assumes.
--
net: ethernet: ti: cpsw: forward unknown VLANs in promiscuous switch mode
In legacy cpsw switch mode, this commit sets the ALE unknown VLAN member
list and the unknown and registered multicast flood masks to all ports
while the interface is promiscuous. It clears them again when promiscuity
is turned off. The goal is to let frames from VLAN-tagging DSA switches
such as LAN9303 reach the host.
> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index 14350ec5b7d0c..1390bf5ecba8c 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -150,11 +150,27 @@ static void cpsw_set_promiscious(struct net_device *ndev, bool enable)
>
> /* Flood All Unicast Packets to Host port */
> cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 1);
> +
> + /* Forward packets of VLANs unknown to the ALE */
> + cpsw_ale_control_set(ale, 0, ALE_PORT_UNKNOWN_VLAN_MEMBER,
> + ALE_ALL_PORTS);
> + cpsw_ale_control_set(ale, 0, ALE_PORT_UNKNOWN_MCAST_FLOOD,
> + ALE_ALL_PORTS);
> + cpsw_ale_control_set(ale, 0,
> + ALE_PORT_UNKNOWN_REG_MCAST_FLOOD,
> + ALE_ALL_PORTS);
[Severity: Medium]
Are these writes enough on their own while the ALE is still VLAN-aware?
In switch mode, cpsw_init_host_port() does this:
drivers/net/ethernet/ti/cpsw.c:cpsw_init_host_port() {
...
cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_VLAN_AWARE,
CPSW_ALE_VLAN_AWARE);
...
}
CPSW_ALE_VLAN_AWARE is 1, and this patch does not change ALE_CONTROL
bit 2.
As I recall, the CPSW TRM describes ALE_VLAN_AWARE as "0 = flood if VLAN
not found, 1 = drop packet if VLAN not found". I have not been able to
re-check that against the TRM. If the hardware works that way, the
unknown VLAN masks only apply in the VLAN-unaware case.
The LAN9303 source port VIDs would then still be dropped while the
conduit is promiscuous. cpsw.c never sets default_vlan, so the ALE only
knows VID 0 and the VIDs the host adds.
Two other things point the same way:
- gbe_init_host_port() in netcp_ethss.c is the only other in-tree user of
these masks. It sets ALE_PORT_UNKNOWN_VLAN_MEMBER and never sets
ALE_VLAN_AWARE.
- The sibling commit "net: ethernet: ti: cpsw_new: bypass ALE in
promiscuous mode" fixes the same symptom with ALE_BYPASS, which works
whatever VLAN_AWARE is set to. That commit has a Tested-by. This one
does not, and the rest of the series seems to have been tested in
dual_emac mode, which never reaches this branch.
Has legacy cpsw switch mode with only this patch been shown on hardware
to receive LAN9303-tagged frames? If not, the fix may need to clear
ALE_VLAN_AWARE or enable ALE_BYPASS while promiscuous.
If so, this part of the commit message would also need updating:
"In switch mode the ALE is VLAN-aware and the Unknown VLAN register is
left at its reset value, so frames tagged with a VID the ALE doesn't
know are dropped even if the interface is promiscuous."
[Severity: Medium]
If these masks do take effect, does writing ALE_ALL_PORTS here also
forward unknown-VID frames between the two external slave ports, and not
just to the host?
ALE_ALL_PORTS is 0x7, which covers the host, port 1 and port 2. The
ALE_UNKNOWNVLAN fields are global (port_offset and port_shift are 0 in
ale_controls[]), so they apply to every ingress port.
This branch also sets ALE_PORT_NOLEARN and ALE_PORT_NO_SA_UPDATE on all
ports, so unknown-VID unicast is always flooded to every port in the
member list.
With LAN9303 on slave port 1, this seems to have three effects:
- Every frame LAN9303 sends to the CPU with a source-port VID is also
flooded out slave port 2. DSA keeps the conduit promiscuous, so in
practice this happens all the time.
- Host TX in switch mode is non-directed and goes through the ALE
lookup, so DSA-tagged frames from the host also go out port 2.
- A device on slave port 2 can send frames with LAN9303 management VIDs.
Those now reach the LAN9303 CPU port; before this patch they were
dropped.
Some context makes this less of a change. Switch mode already gives known
VLANs ALE_ALL_PORTS membership through cpsw_add_vlan_ale_entry() and
cpsw_add_default_vlan(). Promiscuous mode already floods known-VLAN
unicast to both ports. So this extends an existing design choice.
Is it intended that VLAN filtering between the external ports stops
whenever the host is promiscuous, for example under tcpdump or DSA? If
so, could the commit message mention this side effect?
> dev_dbg(&ndev->dev, "promiscuity enabled\n");
> } else {
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203080514.577407-1-alexander.sverdlin%40siemens.com
next prev parent reply other threads:[~2026-12-04 8:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 8:05 [PATCH net-next 0/3] net: ethernet: ti: cpsw: Support cascaded switches A. Sverdlin
2026-12-03 8:05 ` [PATCH net-next 1/3] net: ethernet: ti: cpsw_new: bypass ALE in promiscuous mode A. Sverdlin
2026-12-03 9:13 ` Siddharth Vadapalli
2026-12-03 13:06 ` Andrew Lunn
2026-12-03 13:11 ` Sverdlin, Alexander
2026-12-03 13:13 ` Andrew Lunn
2026-12-04 8:53 ` netdev-bot+sashiko
2026-12-03 8:05 ` [PATCH net-next 2/3] net: ethernet: ti: cpsw: forward unknown VLANs in promiscuous switch mode A. Sverdlin
2026-12-04 8:53 ` netdev-bot+sashiko [this message]
2026-12-03 8:05 ` [PATCH net-next 3/3] net: ethernet: ti: cpsw: don't untag frames on DSA conduit A. Sverdlin
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=179637441631.3146.10682708359159776909@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=aleksandr.loktionov@intel.com \
--cc=alexander.sverdlin@siemens.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=grygorii.strashko@ti.com \
--cc=haokexin@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=kmehltretter@gmail.com \
--cc=kuba@kernel.org \
--cc=lgs201920130244@gmail.com \
--cc=linux-omap@vger.kernel.org \
--cc=lukas.stockmann@siemens.com \
--cc=m-karicheri2@ti.com \
--cc=mugunthanvnm@ti.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rogerq@kernel.org \
--cc=s-vadapalli@ti.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