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, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 3/4] net: dsa: motorcomm: Stop at the first terminal flower action
Date: Tue, 03 Nov 2026 07:55:26 +0000 [thread overview]
Message-ID: <179369252617.488856.6718577731969033249@kernel.org> (raw)
In-Reply-To: <20261102071119.3435180-4-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 yt921x_acl_rule_ext_parse_flow_action()
(drivers/net/dsa/motorcomm/tc.c), the patch now treats every…
--
net: dsa: motorcomm: Stop at the first terminal flower action
This commit changes yt921x_acl_rule_ext_parse_flow_action() so that it
stops at the first terminal action in the flower action list (accept,
drop, redirect or trap). A later action can then no longer override the
hardware verdict of an earlier one.
> diff --git a/drivers/net/dsa/motorcomm/tc.c b/drivers/net/dsa/motorcomm/tc.c
> index 5a4459507582d..87c04f0dd7365 100644
> --- a/drivers/net/dsa/motorcomm/tc.c
> +++ b/drivers/net/dsa/motorcomm/tc.c
> @@ -1038,55 +1038,43 @@ yt921x_acl_rule_ext_parse_flow_action(struct yt921x_acl_rule_ext *ruleext,
[ ... ]
> + case FLOW_ACTION_REDIRECT: {
> + struct dsa_port *to_dp;
> +
> + to_dp = dsa_port_from_netdev(act->dev);
> + if (IS_ERR(to_dp) || to_dp->ds != &priv->ds) {
> + reason = "Redirect to non-local port";
> goto fallback;
> }
[ ... ]
> + action[2] |= YT921X_ACL_ACTc_FWD_EN |
> + YT921X_ACL_ACTc_FWD_REDIR |
> + YT921X_ACL_ACTc_FWD_REDIR_DPORTn(to_dp->index);
> + terminal = true;
> break;
> + }
[Severity: Medium]
Is it safe to treat every FLOW_ACTION_REDIRECT as terminal here?
The flow_action_entry does not carry the mirred control verdict. For any
egress redirect, tcf_mirred_offload_act_setup() emits FLOW_ACTION_REDIRECT
and does not look at m->tcf_action:
net/sched/act_mirred.c:tcf_mirred_offload_act_setup() {
...
if (is_tcf_mirred_egress_redirect(act)) {
entry->id = FLOW_ACTION_REDIRECT;
tcf_offload_mirred_get_dev(entry, act);
...
}
A redirect with the pipe control is not terminal in software.
tcf_mirred_init() accepts TC_ACT_PIPE through tcf_action_check_ctrlact().
In tcf_mirred_to_dev(), tcf_mirred_can_reinsert(TC_ACT_PIPE) returns
false, so the skb is cloned and the clone is sent. TC_ACT_PIPE is then
returned and the remaining actions run.
For example:
tc filter add dev swp0 ingress flower skip_sw \
action mirred egress redirect dev swp1 pipe \
action mirred egress redirect dev swp2
In software this delivers to both swp1 and swp2. Before this patch the
hardware ORed both DPORTn bits, which matched software. With this patch
the loop exits at the if (terminal) break after the first redirect. Only
swp1 gets programmed, and the rule is accepted with no error and no
extack warning.
The same applies to "redirect dev swp1 pipe action trap". In software
that sends a copy to swp1 and also traps to the CPU. In hardware it would
now only redirect to swp1.
The driver cannot tell stolen apart from pipe. Could a redirect followed
by more actions be rejected under skip_sw, and fall back to trap
otherwise, instead of programming only part of the list? That would
match the "Prefer explicit rejects over implicit behaviour changes"
policy in yt921x_acl_rule_ext_parse_flow(). In the default stolen case
the actions after the redirect never run in software anyway, so
rejecting them loses nothing.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261102071119.3435180-1-mmyangfl%40gmail.com
next prev parent reply other threads:[~2026-11-03 7:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 7:11 [PATCH net 0/4] net: dsa: motorcomm: ACL fixup David Yang
2026-11-02 7:11 ` [PATCH net 1/4] net: dsa: motorcomm: Fix extack message on unsupported TC actions David Yang
2026-11-02 7:11 ` [PATCH net 2/4] net: dsa: motorcomm: Fix IPv4/IPv6 address key dispatch in flower David Yang
2026-11-03 7:55 ` netdev-bot+sashiko
2026-11-02 7:11 ` [PATCH net 3/4] net: dsa: motorcomm: Stop at the first terminal flower action David Yang
2026-11-03 7:55 ` netdev-bot+sashiko [this message]
2026-11-02 7:11 ` [PATCH net 4/4] net: dsa: motorcomm: Delete the ACL rule of the port being unbound David Yang
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=179369252617.488856.6718577731969033249@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=linux-kernel@vger.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
all inboxes | Powered by JetHome®