/usr/src/linux-headers-5.15.0-181/tools/testing/selftests/net/forwarding
NameSizeModeActions
bridge_igmp.sh151520755editdlrm
bridge_mld.sh165630755editdlrm
bridge_port_isolation.sh23780755editdlrm
bridge_sticky_fdb.sh11590755editdlrm
bridge_vlan_aware.sh25240755editdlrm
bridge_vlan_unaware.sh12480755editdlrm
custom_multipath_hash.sh99930755editdlrm
devlink_lib.sh131180644editdlrm
dual_vxlan_bridge.sh114390755editdlrm
ethtool.sh67450755editdlrm
ethtool_extended_state.sh19230755editdlrm
ethtool_lib.sh28150644editdlrm
fib_offload_lib.sh251570644editdlrm
gre_custom_multipath_hash.sh127680755editdlrm
gre_inner_v4_multipath.sh77300755editdlrm
gre_inner_v6_multipath.sh78430755editdlrm
gre_multipath.sh64390755editdlrm
gre_multipath_nh.sh93010755editdlrm
gre_multipath_nh_res.sh94910755editdlrm
ip6gre_custom_multipath_hash.sh130380755editdlrm
ip6gre_inner_v4_multipath.sh79560755editdlrm
ip6gre_inner_v6_multipath.sh80690755editdlrm
ip6_forward_instats_vrf.sh30920755editdlrm
ipip_flat_gre.sh8380755editdlrm
ipip_flat_gre_key.sh8600755editdlrm
ipip_flat_gre_keys.sh8860755editdlrm
ipip_hier_gre.sh8870755editdlrm
ipip_hier_gre_key.sh9100755editdlrm
ipip_hier_gre_keys.sh9380755editdlrm
ipip_lib.sh85570644editdlrm
lib.sh286680644editdlrm
loopback.sh15890755editdlrm
Makefile17180644editdlrm
mirror_gre.sh33660755editdlrm
mirror_gre_bound.sh59290755editdlrm
mirror_gre_bridge_1d.sh45040755editdlrm
mirror_gre_bridge_1d_vlan.sh27170755editdlrm
mirror_gre_bridge_1q.sh43800755editdlrm
mirror_gre_bridge_1q_lag.sh74850755editdlrm
mirror_gre_changes.sh58240755editdlrm
mirror_gre_flower.sh28910755editdlrm
mirror_gre_lag_lacp.sh74580755editdlrm
mirror_gre_lib.sh25650644editdlrm
mirror_gre_neigh.sh23380755editdlrm
mirror_gre_nh.sh29740755editdlrm
mirror_gre_topo_lib.sh35240644editdlrm
mirror_gre_vlan.sh17150755editdlrm
mirror_gre_vlan_bridge_1q.sh91170755editdlrm
mirror_lib.sh29640644editdlrm
mirror_topo_lib.sh27580644editdlrm
mirror_vlan.sh23030755editdlrm
pedit_dsfield.sh67890755editdlrm
pedit_l4port.sh45640755editdlrm
q_in_vni.sh109260755editdlrm
router.sh63220755editdlrm
router_bridge.sh17940755editdlrm
router_bridge_vlan.sh21080755editdlrm
router_broadcast.sh51420755editdlrm
router_mpath_nh.sh98280755editdlrm
router_mpath_nh_res.sh102230755editdlrm
router_multicast.sh115970755editdlrm
router_multipath.sh84490755editdlrm
router_nh.sh26270755editdlrm
router_vid_1.sh21530755editdlrm
sch_ets.sh7810755editdlrm
sch_ets_core.sh74560644editdlrm
sch_ets_tests.sh40440644editdlrm
sch_red.sh113580755editdlrm
sch_tbf_core.sh51400644editdlrm
sch_tbf_ets.sh1180755editdlrm
sch_tbf_etsprio.sh7110644editdlrm
sch_tbf_prio.sh1180755editdlrm
sch_tbf_root.sh4220755editdlrm
skbedit_priority.sh39010755editdlrm
tc_actions.sh66060755editdlrm
tc_chains.sh49450755editdlrm
tc_common.sh5240644editdlrm
tc_flower.sh217520755editdlrm
tc_flower_router.sh30960755editdlrm
tc_mpls_l2vpn.sh51460755editdlrm
tc_police.sh121110755editdlrm
tc_shblocks.sh27480755editdlrm
tc_vlan_modify.sh32460755editdlrm
vxlan_asymmetric.sh179780755editdlrm
vxlan_bridge_1d.sh208630755editdlrm
vxlan_bridge_1d_port_8472.sh1720755editdlrm
vxlan_bridge_1q.sh240530755editdlrm
vxlan_bridge_1q_port_8472.sh1720755editdlrm
vxlan_symmetric.sh184880755editdlrm
Edit: /usr/src/linux-headers-5.15.0-181/tools/testing/selftests/net/forwarding/skbedit_priority.sh (3901B)
#!/bin/bash # SPDX-License-Identifier: GPL-2.0 # This test sends traffic from H1 to H2. Either on ingress of $swp1, or on # egress of $swp2, the traffic is acted upon by an action skbedit priority. The # new priority should be taken into account when classifying traffic on the PRIO # qdisc at $swp2. The test verifies that for different priority values, the # traffic ends up in expected PRIO band. # # +----------------------+ +----------------------+ # | H1 | | H2 | # | + $h1 | | $h2 + | # | | 192.0.2.1/28 | | 192.0.2.2/28 | | # +----|-----------------+ +----------------|-----+ # | | # +----|----------------------------------------------------------------|-----+ # | SW | | | # | +-|----------------------------------------------------------------|-+ | # | | + $swp1 BR $swp2 + | | # | | PRIO | | # | +--------------------------------------------------------------------+ | # +---------------------------------------------------------------------------+ ALL_TESTS=" ping_ipv4 test_ingress test_egress " NUM_NETIFS=4 source lib.sh : ${HIT_TIMEOUT:=2000} # ms h1_create() { simple_if_init $h1 192.0.2.1/28 } h1_destroy() { simple_if_fini $h1 192.0.2.1/28 } h2_create() { simple_if_init $h2 192.0.2.2/28 } h2_destroy() { simple_if_fini $h2 192.0.2.2/28 } switch_create() { ip link add name br1 up type bridge vlan_filtering 1 ip link set dev $swp1 master br1 ip link set dev $swp1 up ip link set dev $swp2 master br1 ip link set dev $swp2 up tc qdisc add dev $swp1 clsact tc qdisc add dev $swp2 clsact tc qdisc add dev $swp2 root handle 10: \ prio bands 8 priomap 7 6 5 4 3 2 1 0 } switch_destroy() { tc qdisc del dev $swp2 root tc qdisc del dev $swp2 clsact tc qdisc del dev $swp1 clsact ip link set dev $swp2 down ip link set dev $swp2 nomaster ip link set dev $swp1 down ip link set dev $swp1 nomaster ip link del dev br1 } setup_prepare() { h1=${NETIFS[p1]} swp1=${NETIFS[p2]} swp2=${NETIFS[p3]} h2=${NETIFS[p4]} h2mac=$(mac_get $h2) vrf_prepare h1_create h2_create switch_create } cleanup() { pre_cleanup switch_destroy h2_destroy h1_destroy vrf_cleanup } ping_ipv4() { ping_test $h1 192.0.2.2 } test_skbedit_priority_one() { local locus=$1; shift local prio=$1; shift local classid=$1; shift RET=0 tc filter add $locus handle 101 pref 1 \ flower action skbedit priority $prio local pkt0=$(qdisc_parent_stats_get $swp2 $classid .packets) local pkt2=$(tc_rule_handle_stats_get "$locus" 101) $MZ $h1 -t udp "sp=54321,dp=12345" -c 10 -d 20msec -p 100 \ -a own -b $h2mac -A 192.0.2.1 -B 192.0.2.2 -q local pkt1 pkt1=$(busywait "$HIT_TIMEOUT" until_counter_is ">= $((pkt0 + 10))" \ qdisc_parent_stats_get $swp2 $classid .packets) check_err $? "Expected to get 10 packets on class $classid, but got $((pkt1 - pkt0))." local pkt3=$(tc_rule_handle_stats_get "$locus" 101) ((pkt3 >= pkt2 + 10)) check_err $? "Expected to get 10 packets on skbedit rule but got $((pkt3 - pkt2))." log_test "$locus skbedit priority $prio -> classid $classid" tc filter del $locus pref 1 } test_ingress() { local prio for prio in {0..7}; do test_skbedit_priority_one "dev $swp1 ingress" \ $prio 10:$((8 - prio)) done } test_egress() { local prio for prio in {0..7}; do test_skbedit_priority_one "dev $swp2 egress" \ $prio 10:$((8 - prio)) done } trap cleanup EXIT setup_prepare setup_wait tests_run exit $EXIT_STATUS