Skip to content

Commit 4cb1837

Browse files
congwangPaolo Abeni
authored andcommitted
selftests/tc-testing: Add a test case for FQ_CODEL with QFQ parent
Add a test case for FQ_CODEL with QFQ parent to verify packet drop behavior when the queue becomes empty. This helps ensure proper notification mechanisms between qdiscs. Note this is best-effort, it is hard to play with those parameters perfectly to always trigger ->qlen_notify(). Cc: Pedro Tammela <pctammela@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Reviewed-by: Victor Nogueira <victor@mojatatu.com> Link: https://patch.msgid.link/20250403211636.166257-3-xiyou.wangcong@gmail.com Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent cbe9588 commit 4cb1837

File tree

1 file changed

+31
-0
lines changed
  • tools/testing/selftests/tc-testing/tc-tests/infra

1 file changed

+31
-0
lines changed

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,5 +189,36 @@
189189
"$TC qdisc del dev $DUMMY handle 1: root",
190190
"$IP addr del 10.10.10.10/24 dev $DUMMY || true"
191191
]
192+
},
193+
{
194+
"id": "a4be",
195+
"name": "Test FQ_CODEL with QFQ parent - force packet drop with empty queue",
196+
"category": [
197+
"qdisc",
198+
"fq_codel",
199+
"qfq"
200+
],
201+
"plugins": {
202+
"requires": "nsPlugin"
203+
},
204+
"setup": [
205+
"$IP link set dev $DUMMY up || true",
206+
"$IP addr add 10.10.10.10/24 dev $DUMMY || true",
207+
"$TC qdisc add dev $DUMMY handle 1: root qfq",
208+
"$TC class add dev $DUMMY parent 1: classid 1:10 qfq weight 1 maxpkt 1000",
209+
"$TC qdisc add dev $DUMMY parent 1:10 handle 10: fq_codel memory_limit 1 flows 1 target 0.1ms interval 1ms",
210+
"$TC filter add dev $DUMMY parent 1: protocol ip prio 1 u32 match ip protocol 1 0xff flowid 1:10",
211+
"ping -c 10 -s 1000 -f -I $DUMMY 10.10.10.1 > /dev/null || true",
212+
"sleep 0.1"
213+
],
214+
"cmdUnderTest": "$TC -s qdisc show dev $DUMMY",
215+
"expExitCode": "0",
216+
"verifyCmd": "$TC -s qdisc show dev $DUMMY | grep -A 5 'qdisc fq_codel'",
217+
"matchPattern": "dropped [1-9][0-9]*",
218+
"matchCount": "1",
219+
"teardown": [
220+
"$TC qdisc del dev $DUMMY handle 1: root",
221+
"$IP addr del 10.10.10.10/24 dev $DUMMY || true"
222+
]
192223
}
193224
]

0 commit comments

Comments
 (0)