sch_ets.sh 781 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. # SPDX-License-Identifier: GPL-2.0
  3. # A driver for the ETS selftest that implements testing in slowpath.
  4. lib_dir=.
  5. source sch_ets_core.sh
  6. ALL_TESTS="
  7. ping_ipv4
  8. priomap_mode
  9. ets_test_strict
  10. ets_test_mixed
  11. ets_test_dwrr
  12. classifier_mode
  13. ets_test_strict
  14. ets_test_mixed
  15. ets_test_dwrr
  16. "
  17. switch_create()
  18. {
  19. ets_switch_create
  20. # Create a bottleneck so that the DWRR process can kick in.
  21. tc qdisc add dev $swp2 root handle 1: tbf \
  22. rate 1Gbit burst 1Mbit latency 100ms
  23. PARENT="parent 1:"
  24. }
  25. switch_destroy()
  26. {
  27. ets_switch_destroy
  28. tc qdisc del dev $swp2 root
  29. }
  30. # Callback from sch_ets_tests.sh
  31. collect_stats()
  32. {
  33. local -a streams=("$@")
  34. local stream
  35. for stream in ${streams[@]}; do
  36. qdisc_parent_stats_get $swp2 10:$((stream + 1)) .bytes
  37. done
  38. }
  39. ets_run