/usr/src/linux-headers-5.15.0-181/tools/testing/selftests/drivers/net/mlxsw
NameSizeModeActions
spectrum/-0755rm
spectrum-2/-0755rm
blackhole_routes.sh50750755editdlrm
devlink_trap.sh19280755editdlrm
devlink_trap_acl_drops.sh24580755editdlrm
devlink_trap_control.sh183990755editdlrm
devlink_trap_l2_drops.sh99660755editdlrm
devlink_trap_l3_drops.sh168120755editdlrm
devlink_trap_l3_exceptions.sh140980755editdlrm
devlink_trap_policer.sh94410755editdlrm
devlink_trap_tunnel_ipip.sh60350755editdlrm
devlink_trap_tunnel_vxlan.sh89890755editdlrm
ethtool_lanes.sh40260755editdlrm
extack.sh34710755editdlrm
fib.sh55620755editdlrm
fib_offload.sh101640755editdlrm
mirror_gre.sh44470755editdlrm
mirror_gre_scale.sh57820644editdlrm
mlxsw_lib.sh3620644editdlrm
one_armed_router.sh69500755editdlrm
port_scale.sh13910644editdlrm
qos_defprio.sh27380755editdlrm
qos_dscp_bridge.sh43250755editdlrm
qos_dscp_router.sh67640755editdlrm
qos_ets_strict.sh88100755editdlrm
qos_headroom.sh83670755editdlrm
qos_lib.sh19180644editdlrm
qos_mc_aware.sh94120755editdlrm
qos_pfc.sh117000755editdlrm
q_in_q_veto.sh79480755editdlrm
router_scale.sh21380644editdlrm
rtnetlink.sh306040755editdlrm
sch_ets.sh23320755editdlrm
sch_red_core.sh180140644editdlrm
sch_red_ets.sh24760755editdlrm
sch_red_prio.sh810755editdlrm
sch_red_root.sh10810755editdlrm
sch_tbf_ets.sh1750755editdlrm
sch_tbf_prio.sh1760755editdlrm
sch_tbf_root.sh1760755editdlrm
sharedbuffer.sh39120755editdlrm
tc_action_hw_stats.sh22930755editdlrm
tc_flower_scale.sh24600644editdlrm
tc_police_occ.sh21200755editdlrm
tc_police_scale.sh16600644editdlrm
tc_restrictions.sh118470755editdlrm
tc_sample.sh178910755editdlrm
vxlan.sh299960755editdlrm
vxlan_fdb_veto.sh29550755editdlrm
vxlan_flooding.sh88490755editdlrm
Edit: /usr/src/linux-headers-5.15.0-181/tools/testing/selftests/drivers/net/mlxsw/qos_defprio.sh (2738B)
#!/bin/bash # SPDX-License-Identifier: GPL-2.0 # Test for port-default priority. Non-IP packets ingress $swp1 and are # prioritized according to the default priority specified at the port. # rx_octets_prio_* counters are used to verify the prioritization. # # +-----------------------+ # | H1 | # | + $h1 | # | | 192.0.2.1/28 | # +----|------------------+ # | # +----|------------------+ # | SW | | # | + $swp1 | # | 192.0.2.2/28 | # | APP=,1,0 | # +-----------------------+ ALL_TESTS=" ping_ipv4 test_defprio " lib_dir=$(dirname $0)/../../../net/forwarding NUM_NETIFS=2 : ${HIT_TIMEOUT:=1000} # ms source $lib_dir/lib.sh declare -a APP defprio_install() { local dev=$1; shift local prio=$1; shift local app="app=$prio,1,0" lldptool -T -i $dev -V APP $app >/dev/null lldpad_app_wait_set $dev APP[$prio]=$app } defprio_uninstall() { local dev=$1; shift local prio=$1; shift local app=${APP[$prio]} lldptool -T -i $dev -V APP -d $app >/dev/null lldpad_app_wait_del unset APP[$prio] } defprio_flush() { local dev=$1; shift local prio if ((${#APP[@]})); then lldptool -T -i $dev -V APP -d ${APP[@]} >/dev/null fi lldpad_app_wait_del APP=() } h1_create() { simple_if_init $h1 192.0.2.1/28 } h1_destroy() { simple_if_fini $h1 192.0.2.1/28 } switch_create() { ip link set dev $swp1 up ip addr add dev $swp1 192.0.2.2/28 } switch_destroy() { defprio_flush $swp1 ip addr del dev $swp1 192.0.2.2/28 ip link set dev $swp1 down } setup_prepare() { h1=${NETIFS[p1]} swp1=${NETIFS[p2]} vrf_prepare h1_create switch_create } cleanup() { pre_cleanup switch_destroy h1_destroy vrf_cleanup } ping_ipv4() { ping_test $h1 192.0.2.2 } __test_defprio() { local prio_install=$1; shift local prio_observe=$1; shift local key local t1 local i RET=0 defprio_install $swp1 $prio_install local t0=$(ethtool_stats_get $swp1 rx_frames_prio_$prio_observe) mausezahn -q $h1 -d 100m -c 10 -t arp reply t1=$(busywait "$HIT_TIMEOUT" until_counter_is ">= $((t0 + 10))" \ ethtool_stats_get $swp1 rx_frames_prio_$prio_observe) check_err $? "Default priority $prio_install/$prio_observe: Expected to capture 10 packets, got $((t1 - t0))." log_test "Default priority $prio_install/$prio_observe" defprio_uninstall $swp1 $prio_install } test_defprio() { local prio for prio in {0..7}; do __test_defprio $prio $prio done defprio_install $swp1 3 __test_defprio 0 3 __test_defprio 1 3 __test_defprio 2 3 __test_defprio 4 4 __test_defprio 5 5 __test_defprio 6 6 __test_defprio 7 7 defprio_uninstall $swp1 3 } trap cleanup EXIT setup_prepare setup_wait tests_run exit $EXIT_STATUS