Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/bash
0002 # SPDX-License-Identifier: GPL-2.0
0003 
0004 # A driver for the ETS selftest that implements testing in slowpath.
0005 lib_dir=.
0006 source sch_ets_core.sh
0007 
0008 ALL_TESTS="
0009         ping_ipv4
0010         priomap_mode
0011         ets_test_strict
0012         ets_test_mixed
0013         ets_test_dwrr
0014         classifier_mode
0015         ets_test_strict
0016         ets_test_mixed
0017         ets_test_dwrr
0018 "
0019 
0020 switch_create()
0021 {
0022         ets_switch_create
0023 
0024         # Create a bottleneck so that the DWRR process can kick in.
0025         tc qdisc add dev $swp2 root handle 1: tbf \
0026            rate 1Gbit burst 1Mbit latency 100ms
0027         PARENT="parent 1:"
0028 }
0029 
0030 switch_destroy()
0031 {
0032         ets_switch_destroy
0033         tc qdisc del dev $swp2 root
0034 }
0035 
0036 # Callback from sch_ets_tests.sh
0037 collect_stats()
0038 {
0039         local -a streams=("$@")
0040         local stream
0041 
0042         for stream in ${streams[@]}; do
0043                 qdisc_parent_stats_get $swp2 10:$((stream + 1)) .bytes
0044         done
0045 }
0046 
0047 ets_run