aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
authorEric Dumazet <edumazet@google.com>2026-05-22 11:03:56 +0000
committerJakub Kicinski <kuba@kernel.org>2026-05-25 11:09:27 -0700
commit0f700d144b5a35fdf3e67439327f92c9ca7f8e34 (patch)
tree2358e52a7c6c4be0f8d5382a9c33863c1119e943 /net
parent061c0aa740d5d3847cd600a74c66a165bee1fbe0 (diff)
downloadlinux-next-history-0f700d144b5a35fdf3e67439327f92c9ca7f8e34.tar.gz
net/sched: sch_ets: make cl->quantum lockless
cl->quantum does not need to be protected by RTNL or qdisc spinlock. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Victor Nogueira <victor@mojatatu.com> Link: https://patch.msgid.link/20260522110356.1403343-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/sched/sch_ets.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/sched/sch_ets.c b/net/sched/sch_ets.c
index 1cc559634ed27..cb8cf437ce870 100644
--- a/net/sched/sch_ets.c
+++ b/net/sched/sch_ets.c
@@ -247,9 +247,7 @@ static int ets_class_change(struct Qdisc *sch, u32 classid, u32 parentid,
if (err)
return err;
- sch_tree_lock(sch);
- cl->quantum = quantum;
- sch_tree_unlock(sch);
+ WRITE_ONCE(cl->quantum, quantum);
ets_offload_change(sch);
return 0;
@@ -320,7 +318,7 @@ static int ets_class_dump(struct Qdisc *sch, unsigned long arg,
if (!nest)
goto nla_put_failure;
if (!ets_class_is_strict(q, cl)) {
- if (nla_put_u32(skb, TCA_ETS_QUANTA_BAND, cl->quantum))
+ if (nla_put_u32(skb, TCA_ETS_QUANTA_BAND, READ_ONCE(cl->quantum)))
goto nla_put_failure;
}
return nla_nest_end(skb, nest);
@@ -445,7 +443,7 @@ static int ets_qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch,
if (!cl_is_active(cl) && !ets_class_is_strict(q, cl)) {
list_add_tail(&cl->alist, &q->active);
- cl->deficit = cl->quantum;
+ cl->deficit = READ_ONCE(cl->quantum);
}
qstats_backlog_add(sch, len);
@@ -499,7 +497,7 @@ static struct sk_buff *ets_qdisc_dequeue(struct Qdisc *sch)
return ets_qdisc_dequeue_skb(sch, skb);
}
- cl->deficit += cl->quantum;
+ cl->deficit += READ_ONCE(cl->quantum);
list_move_tail(&cl->alist, &q->active);
}
out: