From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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 ; Fri, 4 Dec 2026 14:02:42 +0000 (UTC) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 190D01F00897; Fri, 4 Dec 2026 14:02:42 +0000 (UTC) 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== Subject: Re: [PATCH net v4 3/5] net/sched: cls_u32: don't remove old HW rule on failed knode replace 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 Date: Fri, 04 Dec 2026 14:02:41 +0000 Message-ID: <179639296163.3146.1203206789038840466@kernel.org> In-Reply-To: <20261203124056.547555-4-jedrzej.jagielski@intel.com> References: <20261203124056.547555-4-jedrzej.jagielski@intel.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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