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

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 <willemb@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Willem de Bruijn and committed by
David S. Miller
57bf3dd2 14850821

+8 -6
+8 -6
tools/testing/selftests/net/fq_band_pktlimit.sh
··· 8 8 # 3. send 20 pkts on band A: verify that 0 are queued, 20 dropped 9 9 # 4. send 20 pkts on band B: verify that 10 are queued, 10 dropped 10 10 # 11 - # Send packets with a 100ms delay to ensure that previously sent 11 + # Send packets with a delay to ensure that previously sent 12 12 # packets are still queued when later ones are sent. 13 13 # Use SO_TXTIME for this. 14 14 ··· 29 29 ip -6 route add fdaa::/64 dev dummy0 30 30 tc qdisc replace dev dummy0 root handle 1: fq quantum 1514 initial_quantum 1514 limit 10 31 31 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 33 35 OUT1="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')" 34 36 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 36 38 OUT2="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')" 37 39 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 39 41 OUT3="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')" 40 42 41 43 # 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 43 45 # twenty are now sent. 44 - sleep 0.1 46 + sleep 0.6 45 47 OUT4="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')" 46 48 47 49 # Log the output after the test