Skip to content

Commit a844b0c

Browse files
committed
Merge branch 'net_sched-no-longer-use-qdisc_tree_flush_backlog'
Eric Dumazet says: ==================== net_sched: no longer use qdisc_tree_flush_backlog() This series is based on a report from Gerrard Tai. Essentially, all users of qdisc_tree_flush_backlog() are racy. We must instead use qdisc_purge_queue(). ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 7ca5254 + adcaa89 commit a844b0c

File tree

5 files changed

+4
-12
lines changed

5 files changed

+4
-12
lines changed

include/net/sch_generic.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -973,14 +973,6 @@ static inline void qdisc_qstats_qlen_backlog(struct Qdisc *sch, __u32 *qlen,
973973
*backlog = qstats.backlog;
974974
}
975975

976-
static inline void qdisc_tree_flush_backlog(struct Qdisc *sch)
977-
{
978-
__u32 qlen, backlog;
979-
980-
qdisc_qstats_qlen_backlog(sch, &qlen, &backlog);
981-
qdisc_tree_reduce_backlog(sch, qlen, backlog);
982-
}
983-
984976
static inline void qdisc_purge_queue(struct Qdisc *sch)
985977
{
986978
__u32 qlen, backlog;

net/sched/sch_ets.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ static int ets_qdisc_change(struct Qdisc *sch, struct nlattr *opt,
661661
for (i = q->nbands; i < oldbands; i++) {
662662
if (i >= q->nstrict && q->classes[i].qdisc->q.qlen)
663663
list_del_init(&q->classes[i].alist);
664-
qdisc_tree_flush_backlog(q->classes[i].qdisc);
664+
qdisc_purge_queue(q->classes[i].qdisc);
665665
}
666666
WRITE_ONCE(q->nstrict, nstrict);
667667
memcpy(q->prio2band, priomap, sizeof(priomap));

net/sched/sch_prio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static int prio_tune(struct Qdisc *sch, struct nlattr *opt,
211211
memcpy(q->prio2band, qopt->priomap, TC_PRIO_MAX+1);
212212

213213
for (i = q->bands; i < oldbands; i++)
214-
qdisc_tree_flush_backlog(q->queues[i]);
214+
qdisc_purge_queue(q->queues[i]);
215215

216216
for (i = oldbands; i < q->bands; i++) {
217217
q->queues[i] = queues[i];

net/sched/sch_red.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ static int __red_change(struct Qdisc *sch, struct nlattr **tb,
285285
q->userbits = userbits;
286286
q->limit = ctl->limit;
287287
if (child) {
288-
qdisc_tree_flush_backlog(q->qdisc);
288+
qdisc_purge_queue(q->qdisc);
289289
old_child = q->qdisc;
290290
q->qdisc = child;
291291
}

net/sched/sch_tbf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ static int tbf_change(struct Qdisc *sch, struct nlattr *opt,
452452

453453
sch_tree_lock(sch);
454454
if (child) {
455-
qdisc_tree_flush_backlog(q->qdisc);
455+
qdisc_purge_queue(q->qdisc);
456456
old = q->qdisc;
457457
q->qdisc = child;
458458
}

0 commit comments

Comments
 (0)