sch_red_root.sh 1.2 KB
Newer Older
1 2 3 4 5 6
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0

ALL_TESTS="
	ping_ipv4
	ecn_test
7
	ecn_test_perband
8
	ecn_nodrop_test
9 10
	red_test
	mc_backlog_test
11
	red_mirror_test
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
"
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
}

39 40 41 42 43 44 45
ecn_test_perband()
{
	install_qdisc ecn
	do_ecn_test_perband 10 $BACKLOG
	uninstall_qdisc
}

46 47 48 49 50 51 52
ecn_nodrop_test()
{
	install_qdisc ecn nodrop
	do_ecn_nodrop_test 10 $BACKLOG
	uninstall_qdisc
}

53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
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
}

69 70 71 72 73 74 75
red_mirror_test()
{
	install_qdisc qevent early_drop block 10
	do_drop_mirror_test 10 $BACKLOG
	uninstall_qdisc
}

76 77 78 79 80 81 82 83 84
trap cleanup EXIT

setup_prepare
setup_wait

bail_on_lldpad
tests_run

exit $EXIT_STATUS