From: netdev-bot+sashiko@kernel.org
To: jedrzej.jagielski@intel.com
Cc: netdev@vger.kernel.org, anthony.l.nguyen@intel.com,
kuba@kernel.org, jhs@mojatatu.com, jiri@resnulli.us,
edumazet@google.com, stable@vger.kernel.org,
sashiko-bot@kernel.org
Subject: Re: [PATCH net v3 4/5] net/sched: cls_u32: feed u32_replace_hw_knode() with correct set of flags
Date: Tue, 01 Dec 2026 12:54:47 +0000 [thread overview]
Message-ID: <179612968754.3146.9944840736432058737@kernel.org> (raw)
In-Reply-To: <20261130123028.516696-5-jedrzej.jagielski@intel.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] This patch passes `userflags` into u32_replace_hw_knode(), so
a `skip_sw` knode now reaches tc_setup_cb_add() with err_stop=true.
--
net/sched: cls_u32: feed u32_replace_hw_knode() with correct set of flags
This commit passes the parsed TCA_U32_FLAGS value (userflags) to
u32_replace_hw_knode() instead of the TCA_ACT_FLAGS_* flags argument of
u32_change(). With this change, tc_skip_sw() sees skip_sw and the offload
path honours it.
> diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
> index bf4dc4244b84a..48c581d6830c9 100644
> --- a/net/sched/cls_u32.c
> +++ b/net/sched/cls_u32.c
[ ... ]
> @@ -1194,7 +1194,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
> struct tc_u_knode __rcu **ins;
> struct tc_u_knode *pins;
>
> - err = u32_replace_hw_knode(tp, n, flags, true, extack);
> + err = u32_replace_hw_knode(tp, n, userflags, true, extack);
[Severity: Medium]
With skip_sw now reaching tc_setup_cb_add() as err_stop=true, the error
branch in u32_replace_hw_knode() can run for the first time since
695176bfe5de. Can that rollback remove an unrelated filter from hardware?
net/sched/cls_u32.c:u32_replace_hw_knode() {
...
err = tc_setup_cb_add(block, tp, TC_SETUP_CLSU32, &cls_u32, skip_sw,
&n->flags, &n->in_hw_count, true);
if (err) {
if (new_handle)
u32_remove_hw_knode(tp, n, NULL);
...
}
u32_remove_hw_knode() sends TC_CLSU32_DELETE_KNODE through
tc_setup_cb_destroy() to every block callback. That includes the driver
that has just rejected the add and never programmed the knode.
In ixgbe, the driver named in the commit message, root table knodes
(uhtid 0x800) are deleted by slot alone. The child_loc_map ownership check
is skipped:
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:ixgbe_delete_clsu32() {
...
u32 loc = cls->knode.handle & 0xfffff;
...
if (uhtid != 0x800) {
...
if (!test_bit(loc - 1, jump->child_loc_map))
return -EINVAL;
...
spin_lock(&adapter->fdir_perfect_lock);
err = ixgbe_update_ethtool_fdir_entry(adapter, NULL, loc);
spin_unlock(&adapter->fdir_perfect_lock);
...
}
ixgbe_update_ethtool_fdir_entry() then erases the FDIR perfect filter at
sw_idx == loc, whatever it is, and frees its fdir_filter_list entry.
Ethtool ntuple rules and u32 knodes in child hash tables use the same
sw_idx space.
As an example, an admin could first add an existing rule in slot 5 with
"ethtool -N ethX ... loc 5" or a u32 filter 1:0:5 in a linked table. Then
they could run something like:
tc filter add dev ethX ingress protocol ipv6 u32 handle 800::5 ... skip_sw
The call chain would be:
u32_change()
u32_replace_hw_knode(tp, n, userflags, true, ...)
tc_setup_cb_add(..., err_stop = true, ...)
ixgbe_configure_clsu32() returns -EINVAL (protocol != ETH_P_IP)
u32_remove_hw_knode(tp, n, NULL)
tc_setup_cb_destroy()
ixgbe_delete_clsu32()
ixgbe_update_ethtool_fdir_entry(adapter, NULL, 5)
A mask that differs from adapter->fdir_mask, or an action rejected by
parse_tc_actions(), would hit the same path. In each case
ixgbe_configure_clsu32() fails before it touches the hardware.
The tc command fails, as the commit message expects. However, the filter
that was already live in slot 5 also seems to be gone from the device.
If slot 5 belonged to another u32 knode, the software side would still
report it as offloaded (TCA_CLS_FLAGS_IN_HW, in_hw_count, child_loc_map
bit). If that knode is also skip_sw, its traffic would no longer match in
either software or hardware.
Before this patch, err_stop was always false. tc_setup_cb_add() returned
0 and this rollback never ran. Since the patch is Cc: stable, would stable
trees pick up this behaviour as well?
Should the rollback only notify callbacks that accepted the add? Or should
ixgbe_delete_clsu32() check ownership for uhtid 0x800 before it erases
the slot?
> if (err)
> goto errunbind;
>
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130123028.516696-1-jedrzej.jagielski%40intel.com
next prev parent reply other threads:[~2026-12-01 12:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 12:30 [PATCH net v3 0/5] net/sched: u32_change() fixes Jedrzej Jagielski
2026-11-30 12:30 ` [PATCH net v3 1/5] net/sched: cls_u32: fix linked hash table refcount leak Jedrzej Jagielski
2026-11-30 19:07 ` Jamal Hadi Salim
2026-12-01 12:54 ` netdev-bot+sashiko
2026-11-30 12:30 ` [PATCH net v3 2/5] net/sched: cls_u32: remove erroneous refcount_inc() Jedrzej Jagielski
2026-11-30 19:07 ` Jamal Hadi Salim
2026-11-30 12:30 ` [PATCH net v3 3/5] net/sched: cls_u32: don't remove old HW rule on failed knode replace Jedrzej Jagielski
2026-11-30 19:18 ` Jamal Hadi Salim
2026-11-30 19:19 ` Jamal Hadi Salim
2026-11-30 12:30 ` [PATCH net v3 4/5] net/sched: cls_u32: feed u32_replace_hw_knode() with correct set of flags Jedrzej Jagielski
2026-11-30 19:25 ` Jamal Hadi Salim
2026-12-01 12:54 ` netdev-bot+sashiko [this message]
2026-11-30 12:30 ` [PATCH net v3 5/5] selftests: tc-testing: add u32 skip_sw test Jedrzej Jagielski
2026-11-30 19:26 ` Jamal Hadi Salim
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=179612968754.3146.9944840736432058737@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=anthony.l.nguyen@intel.com \
--cc=edumazet@google.com \
--cc=jedrzej.jagielski@intel.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sashiko-bot@kernel.org \
--cc=stable@vger.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