mirror of
https://github.com/torvalds/linux.git
synced 2026-04-21 08:13:56 -04:00
Extend RED testsuite to cover the new nodrop mode of RED-ECN. This test is really similar to ECN test, diverging only in the last step, where UDP traffic should go to backlog instead of being dropped. Thus extract a common helper, ecn_test_common(), make do_ecn_test() into a relatively simple wrapper, and add another one, do_ecn_nodrop_test(). Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
69 lines
949 B
Bash
Executable File
69 lines
949 B
Bash
Executable File
#!/bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
ALL_TESTS="
|
|
ping_ipv4
|
|
ecn_test
|
|
ecn_nodrop_test
|
|
red_test
|
|
mc_backlog_test
|
|
"
|
|
source sch_red_core.sh
|
|
|
|
BACKLOG=300000
|
|
|
|
install_qdisc()
|
|
{
|
|
local -a args=("$@")
|
|
|
|
tc qdisc add dev $swp3 root handle 108: red \
|
|
limit 1000000 min $BACKLOG max $((BACKLOG + 1)) \
|
|
probability 1.0 avpkt 8000 burst 38 "${args[@]}"
|
|
sleep 1
|
|
}
|
|
|
|
uninstall_qdisc()
|
|
{
|
|
tc qdisc del dev $swp3 root
|
|
}
|
|
|
|
ecn_test()
|
|
{
|
|
install_qdisc ecn
|
|
do_ecn_test 10 $BACKLOG
|
|
uninstall_qdisc
|
|
}
|
|
|
|
ecn_nodrop_test()
|
|
{
|
|
install_qdisc ecn nodrop
|
|
do_ecn_nodrop_test 10 $BACKLOG
|
|
uninstall_qdisc
|
|
}
|
|
|
|
red_test()
|
|
{
|
|
install_qdisc
|
|
do_red_test 10 $BACKLOG
|
|
uninstall_qdisc
|
|
}
|
|
|
|
mc_backlog_test()
|
|
{
|
|
install_qdisc
|
|
# Note that the backlog value here does not correspond to RED
|
|
# configuration, but is arbitrary.
|
|
do_mc_backlog_test 10 $BACKLOG
|
|
uninstall_qdisc
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
setup_prepare
|
|
setup_wait
|
|
|
|
bail_on_lldpad
|
|
tests_run
|
|
|
|
exit $EXIT_STATUS
|