Re: [Intel-wired-lan] [PATCH net v1] net/sched: cls_u32: feed u32_replace_hw_knode() with correct set of flags
"Loktionov, Aleksandr" <[email protected]> Fri, 7 Aug 2026 11:15:28 +0000
| Newsgroups | org.osuosl.intel-wired-lan,org.kernel.vger.netdev,org.kernel.vger.stable |
|---|---|
| Message-ID | <DS4PPF7551E655214DCC347F9701AA76387E5D12@DS4PPF7551E6552.namprd11.prod.outlook.com> |
> -----Original Message----- > From: Intel-wired-lan <[email protected]> On Behalf > Of Jedrzej Jagielski > Sent: Friday, August 7, 2026 12:04 PM > To: [email protected] > Cc: [email protected]; Nguyen, Anthony L > <[email protected]>; [email protected]; Hadi Salim, Jamal > <[email protected]>; [email protected]; [email protected]; > Jagielski, Jedrzej <[email protected]>; > [email protected]; Kitszel, Przemyslaw > <[email protected]>; Marcin Szycik > <[email protected]> > Subject: [Intel-wired-lan] [PATCH net v1] net/sched: cls_u32: feed > u32_replace_hw_knode() with correct set of flags >=20 > Fix u32_change() to pass proper variable to u32_replace_hw_knode(). >=20 > When trying to offload u32 cmd by adding skip_sw attributes it gets > ignored and it cannot be correctly processed by HW and > tc_cls_u32_offload struct which is then passed to driver lacks > skip_sw var enabled. >=20 > u32_replace_hw_knode is fed with the TCA_ACT_* flags (bits 16+) > instead of TCA_CLS_* flags (bits 0-4) which actually stores the > flags parsed by tc, so tc_skip_sw() always returns false. This leads > to ignoring some of the attibutes which are meant to be configured attibutes -> attributes=20 > on filter setup. >=20 > None of the TCA_ACT_FLAGS_* is actually used within > u32_replace_hw_knode(), so there is no point in passing them. >=20 > Looks like commit 695176bfe5de ("net_sched: refactor TC action init > API") shadowed the local flags variable which used to be set with > nla_get_u32(tb[TCA_U32_FLAGS]) with the flags as the new function > param while not replacing for none of the u32_replace_hw_knode() > calls. Better avoid double negation, for example: 'without updating either call to= u32_replace_hw_knode()'=20 Reviewed-by: Aleksandr Loktionov <[email protected]> >=20 > Fixes: 695176bfe5de ("net_sched: refactor TC action init API") > Cc: <[email protected]> > Reviewed-by: Przemek Kitszel <[email protected]> > Reviewed-by: Marcin Szycik <[email protected]> > Signed-off-by: Jedrzej Jagielski <[email protected]> > --- > net/sched/cls_u32.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index > 8f30cc82181d..dc6e455e64ec 100644 > --- a/net/sched/cls_u32.c > +++ b/net/sched/cls_u32.c > @@ -935,7 +935,7 @@ static int u32_change(struct net *net, struct > sk_buff *in_skb, >=20 > u32_bind_filter(tp, new, base, tb); >=20 > - err =3D u32_replace_hw_knode(tp, new, flags, extack); > + err =3D u32_replace_hw_knode(tp, new, userflags, extack); > if (err) { > u32_unbind_filter(tp, new, tb); >=20 > @@ -1161,7 +1161,7 @@ static int u32_change(struct net *net, struct > sk_buff *in_skb, > struct tc_u_knode __rcu **ins; > struct tc_u_knode *pins; >=20 > - err =3D u32_replace_hw_knode(tp, n, flags, extack); > + err =3D u32_replace_hw_knode(tp, n, userflags, extack); > if (err) > goto errunbind; >=20 > -- > 2.31.1