Skip to content

Commit df50c3d

Browse files
author
CKI KWF Bot
committed
Merge: net/sched: phase-2 backports for RHEL-10.1
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1205 JIRA: https://issues.redhat.com/browse/RHEL-96604 Upstream Status: all mainline in net-next.git Tested: boot-tested only Conflicts: None Signed-off-by: Davide Caratti <dcaratti@redhat.com> Approved-by: Florian Westphal <fwestpha@redhat.com> Approved-by: Xin Long <lxin@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents aac34b9 + 106a16c commit df50c3d

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

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_sfq.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@ static unsigned int sfq_drop(struct Qdisc *sch, struct sk_buff **to_free)
310310
/* It is difficult to believe, but ALL THE SLOTS HAVE LENGTH 1. */
311311
x = q->tail->next;
312312
slot = &q->slots[x];
313-
q->tail->next = slot->next;
313+
if (slot->next == x)
314+
q->tail = NULL; /* no more active slots */
315+
else
316+
q->tail->next = slot->next;
314317
q->ht[slot->hash] = SFQ_EMPTY_SLOT;
315318
goto drop;
316319
}
@@ -653,6 +656,14 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt,
653656
NL_SET_ERR_MSG_MOD(extack, "invalid quantum");
654657
return -EINVAL;
655658
}
659+
660+
if (ctl->perturb_period < 0 ||
661+
ctl->perturb_period > INT_MAX / HZ) {
662+
NL_SET_ERR_MSG_MOD(extack, "invalid perturb period");
663+
return -EINVAL;
664+
}
665+
perturb_period = ctl->perturb_period * HZ;
666+
656667
if (ctl_v1 && !red_check_params(ctl_v1->qth_min, ctl_v1->qth_max,
657668
ctl_v1->Wlog, ctl_v1->Scell_log, NULL))
658669
return -EINVAL;
@@ -669,14 +680,12 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt,
669680
headdrop = q->headdrop;
670681
maxdepth = q->maxdepth;
671682
maxflows = q->maxflows;
672-
perturb_period = q->perturb_period;
673683
quantum = q->quantum;
674684
flags = q->flags;
675685

676686
/* update and validate configuration */
677687
if (ctl->quantum)
678688
quantum = ctl->quantum;
679-
perturb_period = ctl->perturb_period * HZ;
680689
if (ctl->flows)
681690
maxflows = min_t(u32, ctl->flows, SFQ_MAX_FLOWS);
682691
if (ctl->divisor) {

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)