Re: [PATCH net v8 1/1] net/sched: act_gate: snapshot parameters with RCU on replace
From: Vladimir Oltean
Date: Thu Feb 26 2026 - 20:33:06 EST
On Wed, Feb 25, 2026 at 08:55:30AM -0500, Jamal Hadi Salim wrote:
> On Mon, Feb 23, 2026 at 10:05 AM Paul Moses <p@xxxxxxx> wrote:
> >
> > The gate action can be replaced while the hrtimer callback or dump path is
> > walking the schedule list.
> >
> > Convert the parameters to an RCU-protected snapshot and swap updates under
> > tcf_lock, freeing the previous snapshot via call_rcu(). When REPLACE omits
> > the entry list, preserve the existing schedule so the effective state is
> > unchanged.
> >
> > Fixes: a51c328df310 ("net: qos: introduce a gate control flow action")
> > Cc: stable@xxxxxxxxxxxxxxx
> > Signed-off-by: Paul Moses <p@xxxxxxx>
>
> Looks good - but can we have Vlad (added to Cc) review this as well in
> case it breaks anything in the offload case? More specifically,
> regarding an update policy..
>
> cheers,
> jamal
I've regression-tested this with tools/testing/selftests/drivers/net/ocelot/psfp.sh
and haven't noticed issues.
However, that doesn't test very much of the action possibilities - no dynamic gate
parameters change (as part of standalone action or bound to filter).
The ocelot/felix driver doesn't offload standalone actions (TC_SETUP_ACT) so it
doesn't notice changes made to the action using the "tc action" command.
If I make changes to the "tc gate" action parameters using "tc filter replace ...",
then I trigger the "The stream is added on this port" extack error in the offload
driver, which seems to not have been written to handle parameter changes very well.
I don't get any lockdep warnings on tcfa_lock, if that's of interest.
To the extent that the testing above is relevant:
Tested-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>