~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/drivers/net/mlxsw/sch_ets.sh

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #!/bin/bash
  2 # SPDX-License-Identifier: GPL-2.0
  3 
  4 # A driver for the ETS selftest that implements testing in offloaded datapath.
  5 lib_dir=$(dirname $0)/../../../net/forwarding
  6 source $lib_dir/sch_ets_core.sh
  7 source $lib_dir/devlink_lib.sh
  8 
  9 ALL_TESTS="
 10         ping_ipv4
 11         priomap_mode
 12         ets_test_strict
 13         ets_test_mixed
 14         ets_test_dwrr
 15 "
 16 
 17 PARENT="parent 3:3"
 18 
 19 switch_create()
 20 {
 21         # Create a bottleneck so that the DWRR process can kick in.
 22         tc qdisc replace dev $swp2 root handle 3: tbf rate 1gbit \
 23                 burst 128K limit 1G
 24 
 25         ets_switch_create
 26 
 27         # Set the ingress quota high and use the three egress TCs to limit the
 28         # amount of traffic that is admitted to the shared buffers. This makes
 29         # sure that there is always enough traffic of all types to select from
 30         # for the DWRR process.
 31         devlink_port_pool_th_save $swp1 0
 32         devlink_port_pool_th_set $swp1 0 12
 33         devlink_tc_bind_pool_th_save $swp1 0 ingress
 34         devlink_tc_bind_pool_th_set $swp1 0 ingress 0 12
 35         devlink_port_pool_th_save $swp2 4
 36         devlink_port_pool_th_set $swp2 4 12
 37         devlink_tc_bind_pool_th_save $swp2 7 egress
 38         devlink_tc_bind_pool_th_set $swp2 7 egress 4 5
 39         devlink_tc_bind_pool_th_save $swp2 6 egress
 40         devlink_tc_bind_pool_th_set $swp2 6 egress 4 5
 41         devlink_tc_bind_pool_th_save $swp2 5 egress
 42         devlink_tc_bind_pool_th_set $swp2 5 egress 4 5
 43 
 44         # Note: sch_ets_core.sh uses VLAN ingress-qos-map to assign packet
 45         # priorities at $swp1 based on their 802.1p headers. ingress-qos-map is
 46         # not offloaded by mlxsw as of this writing, but the mapping used is
 47         # 1:1, which is the mapping currently hard-coded by the driver.
 48 }
 49 
 50 switch_destroy()
 51 {
 52         devlink_tc_bind_pool_th_restore $swp2 5 egress
 53         devlink_tc_bind_pool_th_restore $swp2 6 egress
 54         devlink_tc_bind_pool_th_restore $swp2 7 egress
 55         devlink_port_pool_th_restore $swp2 4
 56         devlink_tc_bind_pool_th_restore $swp1 0 ingress
 57         devlink_port_pool_th_restore $swp1 0
 58 
 59         ets_switch_destroy
 60 
 61         tc qdisc del dev $swp2 root handle 3:
 62 }
 63 
 64 # Callback from sch_ets_tests.sh
 65 collect_stats()
 66 {
 67         local -a streams=("$@")
 68         local stream
 69 
 70         # Wait for qdisc counter update so that we don't get it mid-way through.
 71         busywait_for_counter 1000 +1 \
 72                 qdisc_parent_stats_get $swp2 10:$((${streams[0]} + 1)) .bytes \
 73                 > /dev/null
 74 
 75         for stream in ${streams[@]}; do
 76                 qdisc_parent_stats_get $swp2 10:$((stream + 1)) .bytes
 77         done
 78 }
 79 
 80 bail_on_lldpad "configure DCB" "configure Qdiscs"
 81 ets_run

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php