From: Simon Horman <horms@kernel.org>
To: Alexandre Cassen <acassen@corp.free.fr>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
Ido Schimmel <idosch@nvidia.com>, Shuah Khan <shuah@kernel.org>,
netdev@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net 1/2] net/sched: act_api: inherit filter offload flags only on new actions
Date: Mon, 26 Oct 2026 16:53:27 +0000 [thread overview]
Message-ID: <20261026165327.GD257209@horms.kernel.org> (raw)
In-Reply-To: <20261021193222.1318333-2-acassen@corp.free.fr>
On Wed, Oct 21, 2026 at 09:32:18PM +0200, Alexandre Cassen wrote:
> tcf_action_init() gives the skip_sw and skip_hw flags of a filter to the
> actions it binds. An action that another filter created gets them too,
> they then apply to every filter that uses this action. When a
> skip_sw filter reuses the action of a software filter, the software
> filter silently stops running it. This happens even when the filter add
> fails on a later action. A skip_hw filter likewise prevents a later
> filter without flags from reusing the action.
>
> Give the flags only to the actions that the filter creates. The mismatch
> check still rejects a filter that reuses an action with a flag that the
> filter does not have.
>
> Discovered by manual code inspection after the Sashiko AI review [1] of
> a tunnel_key patch questioned how actions get the filter flags.
> Reproduced on netdevsim without kernel changes. The egress filter below
> runs in software only, since netdevsim offloads only ingress filters.
> Once the skip_sw filter reuses its drop action, the last command shows
> skip_sw on this action and the egress filter stops dropping packets:
>
> ethtool -K eth0 hw-tc-offload on
> tc qdisc add dev eth0 clsact
> tc filter add dev eth0 egress protocol ip flower dst_ip 192.0.2.1 \
> action gact drop index 1
> tc filter add dev eth0 ingress protocol ip flower skip_sw \
> dst_ip 192.0.2.2 action gact drop index 1
> tc actions get action gact index 1
>
> Tested with the reproducer and the tc-testing action, matchall and
> flower tests.
>
> Fixes: 34d35b4edbbe ("net/sched: act_api: deny mismatched skip_sw/skip_hw flags for actions created by classifiers")
> Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261009051930.3619697-1-acassen%40corp.free.fr [1]
> Signed-off-by: Alexandre Cassen <acassen@corp.free.fr>
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2026-10-26 16:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 19:32 [PATCH net 0/2] net/sched: act_api: keep the offload flags of shared actions Alexandre Cassen
2026-10-21 19:32 ` [PATCH net 1/2] net/sched: act_api: inherit filter offload flags only on new actions Alexandre Cassen
2026-10-26 16:53 ` Simon Horman [this message]
2026-10-21 19:32 ` [PATCH net 2/2] selftests: tc-testing: test offload flags of reused matchall actions Alexandre Cassen
2026-10-26 16:53 ` Simon Horman
2026-10-26 23:30 ` [PATCH net 0/2] net/sched: act_api: keep the offload flags of shared actions patchwork-bot+netdevbpf
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=20261026165327.GD257209@horms.kernel.org \
--to=horms@kernel.org \
--cc=acassen@corp.free.fr \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=idosch@nvidia.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=vladimir.oltean@nxp.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