Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'ets-use-old-nbands-while-purging-unused-classes'

Davide Caratti says:

====================
ets: use old 'nbands' while purging unused classes

- patch 1/2 fixes a NULL dereference in the control path of sch_ets qdisc
- patch 2/2 extends kselftests to verify effectiveness of the above fix
====================

Link: https://patch.msgid.link/cover.1755016081.git.dcaratti@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+15 -5
+6 -5
net/sched/sch_ets.c
··· 651 651 652 652 sch_tree_lock(sch); 653 653 654 + for (i = nbands; i < oldbands; i++) { 655 + if (i >= q->nstrict && q->classes[i].qdisc->q.qlen) 656 + list_del_init(&q->classes[i].alist); 657 + qdisc_purge_queue(q->classes[i].qdisc); 658 + } 659 + 654 660 WRITE_ONCE(q->nbands, nbands); 655 661 for (i = nstrict; i < q->nstrict; i++) { 656 662 if (q->classes[i].qdisc->q.qlen) { 657 663 list_add_tail(&q->classes[i].alist, &q->active); 658 664 q->classes[i].deficit = quanta[i]; 659 665 } 660 - } 661 - for (i = q->nbands; i < oldbands; i++) { 662 - if (i >= q->nstrict && q->classes[i].qdisc->q.qlen) 663 - list_del_init(&q->classes[i].alist); 664 - qdisc_purge_queue(q->classes[i].qdisc); 665 666 } 666 667 WRITE_ONCE(q->nstrict, nstrict); 667 668 memcpy(q->prio2band, priomap, sizeof(priomap));
+1
tools/testing/selftests/net/forwarding/sch_ets.sh
··· 11 11 ets_test_strict 12 12 ets_test_mixed 13 13 ets_test_dwrr 14 + ets_test_plug 14 15 classifier_mode 15 16 ets_test_strict 16 17 ets_test_mixed
+8
tools/testing/selftests/net/forwarding/sch_ets_tests.sh
··· 224 224 ets_set_dwrr_two_bands 225 225 xfail_on_slow ets_dwrr_test_01 226 226 } 227 + 228 + ets_test_plug() 229 + { 230 + ets_change_qdisc $put 2 "3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3" "1514 1514" 231 + tc qdisc add dev $put handle 20: parent 10:4 plug 232 + start_traffic_pktsize 100 $h1.10 192.0.2.1 192.0.2.2 00:c1:a0:c1:a0:00 "-c 1" 233 + ets_qdisc_setup $put 2 234 + }