diff options
author | Eric Dumazet <edumazet@google.com> | 2024-04-18 10:32:40 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-04-19 13:34:07 +0300 |
commit | a1ac3a7c3d1e1f80965510cec7f2c3d4eba57d37 (patch) | |
tree | 8818f684b44db89b11224df476d658914b2764b4 | |
parent | c45bd26c829ea229c067f4096a746ea2f717bc20 (diff) | |
download | linux-a1ac3a7c3d1e1f80965510cec7f2c3d4eba57d37.tar.xz |
net_sched: sch_tfs: implement lockless etf_dump()
Instead of relying on RTNL, codel_dump() can use READ_ONCE()
annotations.
There is no etf_change() yet, this patch imply aligns
this qdisc with others.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/sched/sch_etf.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/sched/sch_etf.c b/net/sched/sch_etf.c index 2e4bef713b6a..c74d778c32a1 100644 --- a/net/sched/sch_etf.c +++ b/net/sched/sch_etf.c @@ -467,15 +467,15 @@ static int etf_dump(struct Qdisc *sch, struct sk_buff *skb) if (!nest) goto nla_put_failure; - opt.delta = q->delta; - opt.clockid = q->clockid; - if (q->offload) + opt.delta = READ_ONCE(q->delta); + opt.clockid = READ_ONCE(q->clockid); + if (READ_ONCE(q->offload)) opt.flags |= TC_ETF_OFFLOAD_ON; - if (q->deadline_mode) + if (READ_ONCE(q->deadline_mode)) opt.flags |= TC_ETF_DEADLINE_MODE_ON; - if (q->skip_sock_check) + if (READ_ONCE(q->skip_sock_check)) opt.flags |= TC_ETF_SKIP_SOCK_CHECK; if (nla_put(skb, TCA_ETF_PARMS, sizeof(opt), &opt)) |