Skip to content

Commit 57bf3dd

Browse files
wdebruijdavem330
authored andcommitted
selftests/net: calibrate fq_band_pktlimit
This test validates per-band packet limits in FQ. Packets are dropped rather than enqueued if the limit for their band is reached. This test is timing sensitive. It queues packets in FQ with a future delivery time to fill the qdisc. The test failed in a virtual environment (vng). Increase the delays to make it more tolerant to environments with timing variance. Signed-off-by: Willem de Bruijn <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1485082 commit 57bf3dd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tools/testing/selftests/net/fq_band_pktlimit.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# 3. send 20 pkts on band A: verify that 0 are queued, 20 dropped
99
# 4. send 20 pkts on band B: verify that 10 are queued, 10 dropped
1010
#
11-
# Send packets with a 100ms delay to ensure that previously sent
11+
# Send packets with a delay to ensure that previously sent
1212
# packets are still queued when later ones are sent.
1313
# Use SO_TXTIME for this.
1414

@@ -29,19 +29,21 @@ ip -6 addr add fdaa::1/128 dev dummy0
2929
ip -6 route add fdaa::/64 dev dummy0
3030
tc qdisc replace dev dummy0 root handle 1: fq quantum 1514 initial_quantum 1514 limit 10
3131

32-
./cmsg_sender -6 -p u -d 100000 -n 20 fdaa::2 8000
32+
DELAY=400000
33+
34+
./cmsg_sender -6 -p u -d "${DELAY}" -n 20 fdaa::2 8000
3335
OUT1="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')"
3436

35-
./cmsg_sender -6 -p u -d 100000 -n 20 fdaa::2 8000
37+
./cmsg_sender -6 -p u -d "${DELAY}" -n 20 fdaa::2 8000
3638
OUT2="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')"
3739

38-
./cmsg_sender -6 -p u -d 100000 -n 20 -P 7 fdaa::2 8000
40+
./cmsg_sender -6 -p u -d "${DELAY}" -n 20 -P 7 fdaa::2 8000
3941
OUT3="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')"
4042

4143
# Initial stats will report zero sent, as all packets are still
42-
# queued in FQ. Sleep for the delay period (100ms) and see that
44+
# queued in FQ. Sleep for at least the delay period and see that
4345
# twenty are now sent.
44-
sleep 0.1
46+
sleep 0.6
4547
OUT4="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')"
4648

4749
# Log the output after the test

0 commit comments

Comments
 (0)