Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/bash
0002 # SPDX-License-Identifier: GPL-2.0
0003 
0004 ALL_TESTS="
0005         ping_ipv4
0006         ecn_test
0007         ecn_test_perband
0008         ecn_nodrop_test
0009         red_test
0010         mc_backlog_test
0011         red_mirror_test
0012 "
0013 source sch_red_core.sh
0014 
0015 BACKLOG=300000
0016 
0017 install_qdisc()
0018 {
0019         local -a args=("$@")
0020 
0021         tc qdisc add dev $swp3 root handle 108: red \
0022            limit 1000000 min $BACKLOG max $((BACKLOG + 1)) \
0023            probability 1.0 avpkt 8000 burst 38 "${args[@]}"
0024         sleep 1
0025 }
0026 
0027 uninstall_qdisc()
0028 {
0029         tc qdisc del dev $swp3 root
0030 }
0031 
0032 ecn_test()
0033 {
0034         install_qdisc ecn
0035         do_ecn_test 10 $BACKLOG
0036         uninstall_qdisc
0037 }
0038 
0039 ecn_test_perband()
0040 {
0041         install_qdisc ecn
0042         do_ecn_test_perband 10 $BACKLOG
0043         uninstall_qdisc
0044 }
0045 
0046 ecn_nodrop_test()
0047 {
0048         install_qdisc ecn nodrop
0049         do_ecn_nodrop_test 10 $BACKLOG
0050         uninstall_qdisc
0051 }
0052 
0053 red_test()
0054 {
0055         install_qdisc
0056         do_red_test 10 $BACKLOG
0057         uninstall_qdisc
0058 }
0059 
0060 mc_backlog_test()
0061 {
0062         install_qdisc
0063         # Note that the backlog value here does not correspond to RED
0064         # configuration, but is arbitrary.
0065         do_mc_backlog_test 10 $BACKLOG
0066         uninstall_qdisc
0067 }
0068 
0069 red_mirror_test()
0070 {
0071         install_qdisc qevent early_drop block 10
0072         do_drop_mirror_test 10 $BACKLOG
0073         uninstall_qdisc
0074 }
0075 
0076 bail_on_lldpad
0077 
0078 trap cleanup EXIT
0079 setup_prepare
0080 setup_wait
0081 tests_run
0082 
0083 exit $EXIT_STATUS