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
Subject: Re: [PATCH net v4 3/5] net/sched: cls_u32: don't remove old HW rule on failed knode replace
Date: Fri, 04 Dec 2026 14:02:41 +0000 [thread overview]
Message-ID: <179639296163.3146.1203206789038840466@kernel.org> (raw)
In-Reply-To: <20261203124056.547555-4-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] In the final state of the series, u32_replace_hw_knode() in
net/sched/cls_u32.c no longer rolls back hardware when a knode replace…
--
net/sched: cls_u32: don't remove old HW rule on failed knode replace
The commit adds a new_handle parameter to u32_replace_hw_knode(). When
offloading a replacement knode fails, it no longer sends
TC_CLSU32_DELETE_KNODE for the handle that the new knode shares with the
old one, which is still installed. In that case it sets a weak extack
message saying the hardware rollback was skipped, unless the block has a
netdev that cannot offload.
> diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
> index ae1b6476f921d..7ec05629e8604 100644
> --- a/net/sched/cls_u32.c
> +++ b/net/sched/cls_u32.c
[ ... ]
> @@ -576,7 +577,11 @@ static int u32_replace_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
> err = tc_setup_cb_add(block, tp, TC_SETUP_CLSU32, &cls_u32, skip_sw,
> &n->flags, &n->in_hw_count, true);
> if (err) {
> - u32_remove_hw_knode(tp, n, NULL);
> + if (new_handle)
> + u32_remove_hw_knode(tp, n, NULL);
> + else if (!block->nooffloaddevcnt)
> + NL_SET_ERR_MSG_WEAK_MOD(extack,
> + "Replace failed, hardware rollback was skipped");
[Severity: Medium]
Will this message reach userspace in the multi-callback case that the
commit message calls a trade-off? NL_SET_ERR_MSG_WEAK_MOD() writes only
when no message has been set yet:
include/linux/netlink.h:
#define NL_SET_ERR_MSG_WEAK_MOD(extack, msg) do { \
if ((extack) && !(extack)->_msg) \
NL_SET_ERR_MSG_MOD((extack), msg); \
} while (0)
tc_cls_common_offload_init() passes extack to drivers only when
tc_skip_sw(flags) is set. Because err_stop is skip_sw, that is also the
only case in which tc_setup_cb_add() can return an error here. So the
driver that rejects the rule always holds this same extack.
u32 offload drivers usually fill it in when they reject a rule, for
example:
iavf_add_cls_u32():
NL_SET_ERR_MSG_MOD(extack, "Linking not supported");
cxgb4_config_knode():
NL_SET_ERR_MSG_MOD(extack,
"No free LETCAM index available");
Take a shared block where an earlier callback accepts REPLACE_KNODE and a
later one rejects it. __tc_setup_cb_call() stops at the failing callback,
so the earlier devices keep the new rule. That rule may carry a
link_handle to an hnode that software stops referencing after
u32_change() calls __u32_destroy_key(new). Software keeps the old knode,
and userspace sees only the driver's reject reason.
The commit message says:
Unless a netdev sharing the block is not offload-capable
let userspace know via extack that the hardware rollback was skipped.
Is that statement reliably true, given that the macro is the weak
variant?
The opposite case happens too. ixgbe_configure_clsu32() never sets
extack. If ixgbe is the first or only callback and rejects the replace,
userspace gets "Replace failed, hardware rollback was skipped" even
though no hardware state changed.
At this commit the path is still dead, because u32_change() passes flags
instead of userflags. It becomes reachable with the follow-up patch
"net/sched: cls_u32: feed u32_replace_hw_knode() with correct set of
flags".
> return err;
> }
>
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203124056.547555-1-jedrzej.jagielski%40intel.com
next prev parent reply other threads:[~2026-12-04 14:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 12:40 [PATCH net v4 0/5] net/sched: u32_change() fixes Jedrzej Jagielski
2026-12-03 12:40 ` [PATCH net v4 1/5] net/sched: cls_u32: fix linked hash table refcount leak Jedrzej Jagielski
2026-12-03 12:40 ` [PATCH net v4 2/5] net/sched: cls_u32: remove erroneous refcount_inc() Jedrzej Jagielski
2026-12-04 14:02 ` netdev-bot+sashiko
2026-12-03 12:40 ` [PATCH net v4 3/5] net/sched: cls_u32: don't remove old HW rule on failed knode replace Jedrzej Jagielski
2026-12-04 14:02 ` netdev-bot+sashiko [this message]
2026-12-03 12:40 ` [PATCH net v4 4/5] net/sched: cls_u32: feed u32_replace_hw_knode() with correct set of flags Jedrzej Jagielski
2026-12-03 12:40 ` [PATCH net v4 5/5] selftests: tc-testing: add u32 skip_sw test Jedrzej Jagielski
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=179639296163.3146.1203206789038840466@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 \
/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