Article View: linux.kernel.netdev
Article #26962Re: [PATCH net v4 3/5] net/sched: cls_u32: don't remove old HW rule on failed knode replace
From: netdev-bot+sashiko
Date: Fri, 04 Dec 2026 14:02
Date: Fri, 04 Dec 2026 14:02
103 lines
11667 bytes
11667 bytes
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
Technical Details
Message-ID:
<179639296163.3146.1203206789038840466@kernel.org>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377399-linux-kernel-netdev=dewy.ruReferences:
<20261203124056.547555-4-jedrzej.jagielski@intel.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377399-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev 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 Organization: Usenet Network Message-ID: <179639296163.3146.1203206789038840466@kernel.org> References: <20261203124056.547555-4-jedrzej.jagielski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2778452"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ryBeLJET/11cMb/EmrQPaejMUSs= sha256:v3hUpNAGaWE9go9+4F6SaZg044HppMeCc9bv8kH6iuk= sha1:MchXfwIKJOhmwMowY+GawIbHPQg= sha256:JZQBS37lt7Kmprhq2cxpfpCE3zWNeGw/xZBl5FpPSCE= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 1A61E117C1A; Fri, 4 Dec 2026 17:03:07 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.641 X-Spam-Status: No, score=-3.641 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.142, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pkdAi-ImPntx; Fri, 4 Dec 2026 17:03:04 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-377399-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 9EA81117C17; Fri, 4 Dec 2026 17:02:45 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 101302F07C; Fri, 4 Dec 2026 14:02:44 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796392963; b=y4hgJzTrfhG6BLRWH7qSbvUJ15RQa3hLkc3+nzOpY7QYgsEIotkUAj6cUew4lasMGEn/ BrlYST2Dyn8c8bTDbshaFNAJcmNkL7sK6eeypZD3bk0JiK836IvS8gtpT27xwsxHWB80r xUv2EfGZ7D2mNjK9yioLHs0Ax3ENH7+rivpjLk3qltyrwAygEHXmcqH9aWZrAAqr9SXjF ue2TksuY1gsC6Cx32Y1ontrai0c73xCXbfm6gTkbIwv6eWPkGCMkikiUF06/+2cjIb1vB Wbc9Rw/1Zt1Y0CH9/aO6zoIU5SAS0polidkK5i8bobiOdpmgj0S6RebuWSiPrx5ciOg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796392963; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=D4p3X6UVd5R8HMpBdzI9Zrp1532uZNhye8KhvaCl7CI=; b=mbj/988FIRGVneVb/wdcnkDfaXopz7c4PEFWYPH1cUXeEsooj1fq8lZW7KzA3ChqTHlf Hz706PBf3NY5qcMdGrTErbEPBTPq9Tt0uFEQ4Pu3r6Ijx2feRajoJwK9cRjRAjsdEKQSI amUqaGRdeJDQgY6VL+njLo3RyZPwT9t3TK0n4hTuECvEcJ21SLMKoo4uOCxkb7jxn1mKk D6YoIF716DrcR3leAXmePdohrUlxxeftZNyRbK2w3EFYydHmdSmgxFrWO0aCvBb/en3vZ O+YRFcBwtidLdnzEt8KrhAT1mzyfoCq/l2yIPl+fVXkmabTLpwX7LzGXktN67mvFM7w== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SkltB769; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C699E606A32F; Fri, 4 Dec 2026 14:02:43 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SkltB769 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796392963; b=ODoLZJQNdh2JY2+n+bVP9Mm7VgQV5tLEwiHHS5Kn0xRdEQ3lWulSE2Jf3FFKywGMsQ9+ Umwmnl1cRQo7ZzXsgKbCjahI/QrfZHq3scKxrIYeqScgzwsuIVAeJeCWdoNae3Cwgg7GV 4rk90nsMt3xD0cx20csRCeKZCMR6NUMk1SpYwwuNLqZQjkC4pyYlYOcv1eyQqBWIqxaBI CPIlBX/J4ek+TFugk228CO41o2ynXcyeA7zpctqZrUjSzeLbYVeKOtVPbM2ZtFrE9POUi VmOp+iAHGEWjSa37ehwXcBMoFEp9hvbIcm8USPmXOVPkoIPwBFewpnLv8GLCJ/z8TeA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796392963; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=D4p3X6UVd5R8HMpBdzI9Zrp1532uZNhye8KhvaCl7CI=; b=BZq5P7hB4W5tlVzhspxXQi7e/arIhCi+lt5Vgh2cLbcnOj1TgbCo9HHvYcY5Dex5hSgd a4VxhucI5wa5q3pnFBRf3jnuku/5iGKbsbOoa8nhHmLyPKIP66BZ96MXJYmFyw4Nkqq5j W8oKWMgRIhX6lZtR0WvCNE/iTeUU7M9m37BgUfYrzRnAVz908F0BOHogzRXve8bFzVkAC tVwZ/MyZb0hGvRgdDUKldFAxWBw8HrOax5XBGJqPXLel4ByfEle0FO5eDtBDEefwkqnwU 8BneJFFqzbA8X7HbDntNML2+nLQxXqsmQQ9i+lwtRgtP0VCG1Pn1Lf+4g2Px4eG4TOw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SkltB769; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5810606A330 for <netdev@vger.kernel.org>; Fri, 4 Dec 2026 14:02:42 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 190D01F00897; Fri, 4 Dec 2026 14:02:42 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796392962; bh=D4p3X6UVd5R8HMpBdzI9Zrp1532uZNhye8KhvaCl7CI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=SkltB769GOqkfG7SlBC+dNbhKx82w2UzzxPISvU2mNV5ZGVNL7YEZrJmt89M7UgRm 0N6zux0+s70CSNB0fUgNd9Oc5ckVSTIJi2HsQkLg+jtRO+YVn/GumJws1xBKzTMcSt gPMa5X1xSDPFDJDFmrJVGkqTiUVIV2OY8BpTkcTw+O1kVzy8GV2GFtoRs35Yi32SB2 a+0khzoVmbaOYU60aPY/HgO3qiXOYFzokLOxlEReJFJfnGy23oAh1BauX/RfR1I5op uOH+jPO5YEUb0y8+zIh6pscF6LNbcn45vs6BQ0FmDsxJwVwKyaXqnb0vVjp1bzsHuS GtkFphx/9xjzQ== X-Cc: netdev@vger.kernel.org, anthony.l.nguyen@intel.com, kuba@kernel.org, jhs@mojatatu.com, jiri@resnulli.us, edumazet@google.com X-In-Reply-To: <20261203124056.547555-4-jedrzej.jagielski@intel.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list