WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / drivers / net / mlxsw / sch_red_ets.sh
blob3f007c5f8361cea814b88b79094316d16bf70e2b
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0
4 ALL_TESTS="
5 ping_ipv4
6 ecn_test
7 ecn_nodrop_test
8 red_test
9 mc_backlog_test
10 red_mirror_test
11 red_trap_test
13 : ${QDISC:=ets}
14 source sch_red_core.sh
16 # do_ecn_test first build 2/3 of the requested backlog and expects no marking,
17 # and then builds 3/2 of it and does expect marking. The values of $BACKLOG1 and
18 # $BACKLOG2 are far enough not to overlap, so that we can assume that if we do
19 # see (do not see) marking, it is actually due to the configuration of that one
20 # TC, and not due to configuration of the other TC leaking over.
21 BACKLOG1=200000
22 BACKLOG2=500000
24 install_qdisc()
26 local -a args=("$@")
28 tc qdisc add dev $swp3 root handle 10: $QDISC \
29 bands 8 priomap 7 6 5 4 3 2 1 0
30 tc qdisc add dev $swp3 parent 10:8 handle 108: red \
31 limit 1000000 min $BACKLOG1 max $((BACKLOG1 + 1)) \
32 probability 1.0 avpkt 8000 burst 38 "${args[@]}"
33 tc qdisc add dev $swp3 parent 10:7 handle 107: red \
34 limit 1000000 min $BACKLOG2 max $((BACKLOG2 + 1)) \
35 probability 1.0 avpkt 8000 burst 63 "${args[@]}"
36 sleep 1
39 uninstall_qdisc()
41 tc qdisc del dev $swp3 parent 10:7
42 tc qdisc del dev $swp3 parent 10:8
43 tc qdisc del dev $swp3 root
46 ecn_test()
48 install_qdisc ecn
50 do_ecn_test 10 $BACKLOG1
51 do_ecn_test 11 $BACKLOG2
53 uninstall_qdisc
56 ecn_nodrop_test()
58 install_qdisc ecn nodrop
60 do_ecn_nodrop_test 10 $BACKLOG1
61 do_ecn_nodrop_test 11 $BACKLOG2
63 uninstall_qdisc
66 red_test()
68 install_qdisc
70 do_red_test 10 $BACKLOG1
71 do_red_test 11 $BACKLOG2
73 uninstall_qdisc
76 mc_backlog_test()
78 install_qdisc
80 # Note that the backlog numbers here do not correspond to RED
81 # configuration, but are arbitrary.
82 do_mc_backlog_test 10 $BACKLOG1
83 do_mc_backlog_test 11 $BACKLOG2
85 uninstall_qdisc
88 red_mirror_test()
90 install_qdisc qevent early_drop block 10
92 do_drop_mirror_test 10 $BACKLOG1 early_drop
93 do_drop_mirror_test 11 $BACKLOG2 early_drop
95 uninstall_qdisc
98 red_trap_test()
100 install_qdisc qevent early_drop block 10
102 do_drop_trap_test 10 $BACKLOG1 early_drop
103 do_drop_trap_test 11 $BACKLOG2 early_drop
105 uninstall_qdisc
108 trap cleanup EXIT
110 setup_prepare
111 setup_wait
113 bail_on_lldpad
114 tests_run
116 exit $EXIT_STATUS