Skip to content

Commit daf6340

Browse files
committed
Merge branch 'net_sched-skbprio-remove-overly-strict-queue-assertions'
Cong Wang says: ==================== net_sched: skbprio: Remove overly strict queue assertions ==================== Link: https://patch.msgid.link/20250329222536.696204-1-xiyou.wangcong@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 078aabd + 076c700 commit daf6340

2 files changed

Lines changed: 33 additions & 4 deletions

File tree

net/sched/sch_skbprio.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ static int skbprio_enqueue(struct sk_buff *skb, struct Qdisc *sch,
123123
/* Check to update highest and lowest priorities. */
124124
if (skb_queue_empty(lp_qdisc)) {
125125
if (q->lowest_prio == q->highest_prio) {
126-
/* The incoming packet is the only packet in queue. */
127-
BUG_ON(sch->q.qlen != 1);
128126
q->lowest_prio = prio;
129127
q->highest_prio = prio;
130128
} else {
@@ -156,7 +154,6 @@ static struct sk_buff *skbprio_dequeue(struct Qdisc *sch)
156154
/* Update highest priority field. */
157155
if (skb_queue_empty(hpq)) {
158156
if (q->lowest_prio == q->highest_prio) {
159-
BUG_ON(sch->q.qlen);
160157
q->highest_prio = 0;
161158
q->lowest_prio = SKBPRIO_MAX_PRIORITY - 1;
162159
} else {

tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,37 @@
126126
"$TC qdisc del dev $DUMMY root handle 1: drr",
127127
"$IP addr del 10.10.10.10/24 dev $DUMMY"
128128
]
129-
}
129+
},
130+
{
131+
"id": "c024",
132+
"name": "Test TBF with SKBPRIO - catch qlen corner cases",
133+
"category": [
134+
"qdisc",
135+
"tbf",
136+
"skbprio"
137+
],
138+
"plugins": {
139+
"requires": "nsPlugin"
140+
},
141+
"setup": [
142+
"$IP link set dev $DUMMY up || true",
143+
"$IP addr add 10.10.10.10/24 dev $DUMMY || true",
144+
"$TC qdisc add dev $DUMMY handle 1: root tbf rate 100bit burst 2000 limit 1000",
145+
"$TC qdisc add dev $DUMMY parent 1: handle 10: skbprio limit 1",
146+
"ping -c 1 -W 0.1 -Q 0x00 -s 1400 -I $DUMMY 10.10.10.1 > /dev/null || true",
147+
"ping -c 1 -W 0.1 -Q 0x1c -s 1400 -I $DUMMY 10.10.10.1 > /dev/null || true",
148+
"ping -c 1 -W 0.1 -Q 0x00 -s 1400 -I $DUMMY 10.10.10.1 > /dev/null || true",
149+
"ping -c 1 -W 0.1 -Q 0x1c -s 1400 -I $DUMMY 10.10.10.1 > /dev/null || true",
150+
"sleep 0.5"
151+
],
152+
"cmdUnderTest": "$TC -s qdisc show dev $DUMMY",
153+
"expExitCode": "0",
154+
"verifyCmd": "$TC -s qdisc show dev $DUMMY | grep -A 5 'qdisc skbprio'",
155+
"matchPattern": "dropped [1-9][0-9]*",
156+
"matchCount": "1",
157+
"teardown": [
158+
"$TC qdisc del dev $DUMMY handle 1: root",
159+
"$IP addr del 10.10.10.10/24 dev $DUMMY || true"
160+
]
161+
}
130162
]

0 commit comments

Comments
 (0)