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=1796129688; b=e2/Xiz/SeeYNJ9jo8/Wo93vHvhEkgwDPCtE0+i+xic5fkoQ4MV2m8bay/Cq+AMIHi/no eqqb+Yznuxv4Ei+y57ilir4Xtu8xRF3OOcQGqOO64rZ67fbtNH8CZLep5wNzlzyxuPPH5 CVvx1HZYZXioQAmEQxJkvhVSdUbB6Ghkvh3a62Jkn5gmmNomEnXDbRMmHP/qE/g37uszv +jkU5H5AN3WMJKJlNJbOKiLdttImGICfY0fUYEI+bmvOCAnmj8S7nFM4CCGPqZ7mOoOnU Y3ttnCcHylQnKBNSYkrKrJgEJmUKrC/+PfFyFZxRWrlsYQzc/DateX7D1GPiCOoGIaQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796129688; 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=sfw5YYiS/QmcZ4dfmIEl8J+iGgI86wpEkWkivmzNQxI=; b=bRbEB0lAuCQReKruY6aIramqd02eWzgcGtwcUkle8nm3tVmzuiNQBzDMJ4/qFKQCTE9i L1aI6mYrzyjPObZggbiW8y9j4N+RNc3cEqC6nwmpF8fkJpe5B8FUELYCrpynkpe/n9vRa l0ZevRDQG6AU/GIRPoTxgjP/QtCSHUOJQ/BrEWSiYlvoZ4Ophm/skODdrR7NsToRn7qRF /gLa75kvI3e1YL1FoA6k4HrNEjSLrYUzFBH6Q2WYS+LCiE+vipX/NHHNocXWp3diqA+EM 56EZXryeM/GssTH1A+8dCYH2yLFS2ZYa8307kiFokDfywu9uLoQi/2HQwsHO6qOFMiQ== 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=ZMQmNSrW; 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 D5AC1606A330; Tue, 1 Dec 2026 12:54:48 +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=ZMQmNSrW Received: by smtp.kernel.org (Postfix) with ESMTPSA id EACE01F000C1; Tue, 1 Dec 2026 12:54:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796129688; bh=sfw5YYiS/QmcZ4dfmIEl8J+iGgI86wpEkWkivmzNQxI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=ZMQmNSrWvsbJicgNE9+tqkaA54Rqy4a8lHEs6Seto+Rifq0QhtELQG5l1XF3t4PoP JLmmdvgXP5QivNVQCfvWLvXH18IbnATYx0uKCclthlCrxQoYAmEbLHkik1iQNVVvLm dsYhxTuKGyCJzOewTeQ5rUkHRgdxTTrIHuTRlio269bLzQK2jcpJChTGiJ4hoInkzE oL/lF/SQ/tKNdV8CoPipMgiyeyDe/NoFSd6tcxYJVVlyya3HmIFsey9lYVLVM+hVJB nnkbRblyMjT9fEvMg0mWOUmYnoywVP3xVsGwx6TME63UAjFfmnYSurThfVPFDXNk03 SsL1PyCQ6d34g== Subject: Re: [PATCH net v3 4/5] net/sched: cls_u32: feed u32_replace_hw_knode() with correct set of flags 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 Date: Tue, 01 Dec 2026 12:54:47 +0000 Message-ID: <179612968754.3146.9944840736432058737@kernel.org> In-Reply-To: <20261130123028.516696-5-jedrzej.jagielski@intel.com> References: <20261130123028.516696-5-jedrzej.jagielski@intel.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: stable@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] 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