From: netdev-bot+sashiko@kernel.org
To: mmyangfl@gmail.com
Cc: netdev@vger.kernel.org, andrew@lunn.ch, olteanv@gmail.com,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com
Subject: Re: [PATCH net-next v4 2/6] net: dsa: motorcomm: Do not block hairpins on standalone ports
Date: Sat, 05 Dec 2026 11:00:44 +0000 [thread overview]
Message-ID: <179646844468.3146.971259533328458467@kernel.org> (raw)
In-Reply-To: <20261204101300.3680838-3-mmyangfl@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · 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] In drivers/net/dsa/motorcomm/chip.c,
yt921x_userport_standalone() now writes YT921X_PORTn_ISOLATION(port) =…
--
net: dsa: motorcomm: Do not block hairpins on standalone ports
The patch clears the port's own bit in YT921X_PORTn_ISOLATION(port) for
standalone user ports. The goal is to allow ACL rules that redirect a
frame back to its ingress port. The commit message says port isolation
is applied after the REDIR decision, so these rules were blocked before.
> diff --git a/drivers/net/dsa/motorcomm/chip.c b/drivers/net/dsa/motorcomm/chip.c
> index c96512faeca25..6e57c9262c681 100644
> --- a/drivers/net/dsa/motorcomm/chip.c
> +++ b/drivers/net/dsa/motorcomm/chip.c
> @@ -1261,7 +1261,7 @@ static int yt921x_userport_standalone(struct yt921x_priv *priv, int port)
> u32 ctrl;
> int res;
>
> - ctrl = ~dsa_cpu_ports(ds);
> + ctrl = ~(dsa_cpu_ports(ds) | BIT(port));
> res = yt921x_reg_write(priv, YT921X_PORTn_ISOLATION(port), ctrl);
[Severity: Medium]
Does this change turn on hairpin for all hardware-forwarded traffic on
standalone ports, and not only for ACL redirect-to-self?
The driver already uses this same bit as its general hairpin control in
yt921x_bridge():
/* to itself when non-hairpin */
if (!pp->hairpin)
ctrl |= BIT(port);
else
ctrl &= ~BIT(port);
Broadcasts don't seem to be trapped on this switch. yt921x_chip_setup_dsa()
programs YT921X_ACT_UNK_ACTn_TRAP only for unknown unicast and unknown
multicast. YT921X_FILTER_BCAST is never written, and yt921x_bridge_flags()
notes:
/* BR_BCAST_FLOOD: we can filter bcast, but cannot trap them */
This means the comment further down in yt921x_userport_standalone()
doesn't hold for broadcasts:
/* Unrelated since learning is off and all packets are trapped;
* set it anyway
*/
So a broadcast arriving on a standalone port is flooded in hardware,
limited only by the isolation register. Before this patch it could only
reach the CPU port. With the self bit cleared, could the switch also
send ARP or DHCP broadcasts back out of the port they arrived on?
If that happens, an upstream switch would see the sender's MAC arrive
from the yt921x link and could move its FDB entry there, which would
blackhole that host. Two such ports in a loop could also cause a
broadcast storm.
This path runs at port setup and on every yt921x_bridge_leave(). Also,
yt921x_isolate() only sets this port's bit in other ports' registers,
never in the port's own register.
All of this depends on how the hardware floods. The reflection only
happens if the switch has no separate source-port suppression for
flooded frames. The BR_HAIRPIN_MODE offload in yt921x_bridge() seems to
assume there is none.
Later patches in the series keep the same behaviour. The new helper
yt921x_isolation_calc_ports() also computes the standalone mask as:
isolation_masks[port] = ~(BIT(port) | cpu_ports_mask);
Could the self bit stay set for normal forwarding, and redirect-to-self
be handled another way? One option is trapping it to the CPU, as the
later commit "net: dsa: motorcomm: Reject isolated redirect targets"
does for other isolated targets.
> if (res)
> return res;
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204101300.3680838-1-mmyangfl%40gmail.com
next prev parent reply other threads:[~2026-12-05 11:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 10:12 [PATCH net-next v4 0/6] net: dsa: motorcomm: Reject isolated redirect targets David Yang
2026-12-04 10:12 ` [PATCH net-next v4 1/6] net: dsa: motorcomm: Remove local cpu_ports_mask David Yang
2026-12-04 10:12 ` [PATCH net-next v4 2/6] net: dsa: motorcomm: Do not block hairpins on standalone ports David Yang
2026-12-05 11:00 ` netdev-bot+sashiko [this message]
2026-12-04 10:12 ` [PATCH net-next v4 3/6] net: dsa: motorcomm: Derive port isolation masks on the fly David Yang
2026-12-04 10:12 ` [PATCH net-next v4 4/6] net: dsa: motorcomm: Reject isolated redirect targets David Yang
2026-12-04 10:12 ` [PATCH net-next v4 5/6] net: dsa: motorcomm: Reject bridge flags that break redirect rules David Yang
2026-12-05 11:00 ` netdev-bot+sashiko
2026-12-04 10:12 ` [PATCH net-next v4 6/6] net: dsa: motorcomm: Recompute redirect rules on bridge changes David Yang
2026-12-05 11:00 ` 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=179646844468.3146.971259533328458467@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=mmyangfl@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.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