Thread (3 messages) 3 messages, 3 authors, 2026-08-27

Re: [PATCH net-next] net/sched: act_sample: reset truncation settings on action replace

flat view

From: Victor Nogueira <hidden>
Date: 2026-08-25 17:03:30
Also in: lkml

On 25/08/2026 13:01, Khawar Ahemad wrote:
When replacing an existing sample action, if TCA_SAMPLE_TRUNC_SIZE is not
passed in the netlink request, s->truncate and s->trunc_size retain their
previous values from the prior configuration.

As a result, a user cannot disable packet truncation when replacing a
sample action unless the action is fully deleted and recreated. In
addition, the hardware offload state and netlink dump continue to report
truncation as active.

Fix this by explicitly resetting s->truncate to false and s->trunc_size
to 0 when TCA_SAMPLE_TRUNC_SIZE is omitted during tcf_sample_init().
This would be a behavioural regression. Users are not expecting that
a replace omitting truncation parameters will silently overwrite their
previous truncation settings. Can you instead create a new netlink
attribute? Something like "TCA_SAMPLE_FLAGS" which might have a
flag telling the action to unset this parameter?
Other option is to interpret 0 as "unset", but that might break
some setups.
Your fixes commit doesn't seem to exist and, since this is a fix,
you should target net and not net-next.
Also remember to wait 24 hours before posting a v2.

cheers,
Victor
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help