2 # SPDX-License-Identifier: GPL-2.0
4 # Test for port-default priority. Non-IP packets ingress $swp1 and are
5 # prioritized according to the default priority specified at the port.
6 # rx_octets_prio_* counters are used to verify the prioritization.
8 # +-----------------------+
12 # +----|------------------+
14 # +----|------------------+
19 # +-----------------------+
26 lib_dir
=$
(dirname $0)/..
/..
/..
/net
/forwarding
29 : ${HIT_TIMEOUT:=1000} # ms
30 source $lib_dir/lib.sh
38 local app
="app=$prio,1,0"
40 lldptool
-T -i $dev -V APP
$app >/dev
/null
41 lldpad_app_wait_set
$dev
49 local app
=${APP[$prio]}
51 lldptool
-T -i $dev -V APP
-d $app >/dev
/null
61 if ((${#APP[@]})); then
62 lldptool
-T -i $dev -V APP
-d ${APP[@]} >/dev
/null
70 simple_if_init
$h1 192.0.2.1/28
75 simple_if_fini
$h1 192.0.2.1/28
80 ip link
set dev
$swp1 up
81 ip addr add dev
$swp1 192.0.2.2/28
87 ip addr del dev
$swp1 192.0.2.2/28
88 ip link
set dev
$swp1 down
114 ping_test
$h1 192.0.2.2
119 local prio_install
=$1; shift
120 local prio_observe
=$1; shift
127 defprio_install
$swp1 $prio_install
129 local t0
=$
(ethtool_stats_get
$swp1 rx_frames_prio_
$prio_observe)
130 mausezahn
-q $h1 -d 100m
-c 10 -t arp reply
131 t1
=$
(busywait
"$HIT_TIMEOUT" until_counter_is
">= $((t0 + 10))" \
132 ethtool_stats_get
$swp1 rx_frames_prio_
$prio_observe)
134 check_err $?
"Default priority $prio_install/$prio_observe: Expected to capture 10 packets, got $((t1 - t0))."
135 log_test
"Default priority $prio_install/$prio_observe"
137 defprio_uninstall
$swp1 $prio_install
144 for prio
in {0.
.7}; do
145 __test_defprio
$prio $prio
148 defprio_install
$swp1 3
156 defprio_uninstall
$swp1 3