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

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