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

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/resource_scale.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 lib_dir=$(dirname $0)/../../../../net/forwarding
  5 
  6 NUM_NETIFS=6
  7 source $lib_dir/lib.sh
  8 source $lib_dir/tc_common.sh
  9 source $lib_dir/devlink_lib.sh
 10 source ../mlxsw_lib.sh
 11 
 12 mlxsw_only_on_spectrum 2+ || exit 1
 13 
 14 current_test=""
 15 
 16 cleanup()
 17 {
 18         pre_cleanup
 19         if [ ! -z $current_test ]; then
 20                 ${current_test}_cleanup
 21         fi
 22         # Need to reload in order to avoid router abort.
 23         devlink_reload
 24 }
 25 
 26 trap cleanup EXIT
 27 
 28 ALL_TESTS="
 29         router
 30         tc_flower
 31         mirror_gre
 32         tc_police
 33         port
 34         rif_mac_profile
 35         rif_counter
 36         port_range
 37 "
 38 
 39 for current_test in ${TESTS:-$ALL_TESTS}; do
 40         RET_FIN=0
 41         source ${current_test}_scale.sh
 42 
 43         num_netifs_var=${current_test^^}_NUM_NETIFS
 44         num_netifs=${!num_netifs_var:-$NUM_NETIFS}
 45 
 46         for should_fail in 0 1; do
 47                 RET=0
 48                 target=$(${current_test}_get_target "$should_fail")
 49                 if ((target == 0)); then
 50                         continue
 51                 fi
 52 
 53                 ${current_test}_setup_prepare
 54                 setup_wait $num_netifs
 55                 # Update target in case occupancy of a certain resource changed
 56                 # following the test setup.
 57                 target=$(${current_test}_get_target "$should_fail")
 58                 ${current_test}_test "$target" "$should_fail"
 59                 if [[ "$should_fail" -eq 0 ]]; then
 60                         log_test "'$current_test' $target"
 61 
 62                         if ((!RET)); then
 63                                 tt=${current_test}_traffic_test
 64                                 if [[ $(type -t $tt) == "function" ]]; then
 65                                         $tt "$target"
 66                                         log_test "'$current_test' $target traffic test"
 67                                 fi
 68                         fi
 69                 else
 70                         log_test "'$current_test' overflow $target"
 71                 fi
 72                 ${current_test}_cleanup $target
 73                 devlink_reload
 74                 RET_FIN=$(( RET_FIN || RET ))
 75         done
 76 done
 77 current_test=""
 78 
 79 exit "$RET_FIN"

~ [ 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