Skip to content

Commit

Permalink
Merge branch 'net_sched-skbprio-remove-overly-strict-queue-assertions'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Kicinski committed Apr 2, 2025
2 parents 078aabd + 076c700 commit daf6340
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
3 changes: 0 additions & 3 deletions net/sched/sch_skbprio.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ static int skbprio_enqueue(struct sk_buff *skb, struct Qdisc *sch,
/* Check to update highest and lowest priorities. */
if (skb_queue_empty(lp_qdisc)) {
if (q->lowest_prio == q->highest_prio) {
/* The incoming packet is the only packet in queue. */
BUG_ON(sch->q.qlen != 1);
q->lowest_prio = prio;
q->highest_prio = prio;
} else {
Expand Down Expand Up @@ -156,7 +154,6 @@ static struct sk_buff *skbprio_dequeue(struct Qdisc *sch)
/* Update highest priority field. */
if (skb_queue_empty(hpq)) {
if (q->lowest_prio == q->highest_prio) {
BUG_ON(sch->q.qlen);
q->highest_prio = 0;
q->lowest_prio = SKBPRIO_MAX_PRIORITY - 1;
} else {
Expand Down
34 changes: 33 additions & 1 deletion tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,37 @@
"$TC qdisc del dev $DUMMY root handle 1: drr",
"$IP addr del 10.10.10.10/24 dev $DUMMY"
]
}
},
{
"id": "c024",
"name": "Test TBF with SKBPRIO - catch qlen corner cases",
"category": [
"qdisc",
"tbf",
"skbprio"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link set dev $DUMMY up || true",
"$IP addr add 10.10.10.10/24 dev $DUMMY || true",
"$TC qdisc add dev $DUMMY handle 1: root tbf rate 100bit burst 2000 limit 1000",
"$TC qdisc add dev $DUMMY parent 1: handle 10: skbprio limit 1",
"ping -c 1 -W 0.1 -Q 0x00 -s 1400 -I $DUMMY 10.10.10.1 > /dev/null || true",
"ping -c 1 -W 0.1 -Q 0x1c -s 1400 -I $DUMMY 10.10.10.1 > /dev/null || true",
"ping -c 1 -W 0.1 -Q 0x00 -s 1400 -I $DUMMY 10.10.10.1 > /dev/null || true",
"ping -c 1 -W 0.1 -Q 0x1c -s 1400 -I $DUMMY 10.10.10.1 > /dev/null || true",
"sleep 0.5"
],
"cmdUnderTest": "$TC -s qdisc show dev $DUMMY",
"expExitCode": "0",
"verifyCmd": "$TC -s qdisc show dev $DUMMY | grep -A 5 'qdisc skbprio'",
"matchPattern": "dropped [1-9][0-9]*",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP addr del 10.10.10.10/24 dev $DUMMY || true"
]
}
]

0 comments on commit daf6340

Please sign in to comment.