1#!/bin/bash 2# SPDX-License-Identifier: GPL-2.0 3 4NUM_NETIFS=6 5source ../../../../net/forwarding/tc_common.sh 6source devlink_lib_spectrum.sh 7 8current_test="" 9 10cleanup() 11{ 12 pre_cleanup 13 if [ ! -z $current_test ]; then 14 ${current_test}_cleanup 15 fi 16 devlink_sp_size_kvd_to_default 17} 18 19devlink_sp_read_kvd_defaults 20trap cleanup EXIT 21 22ALL_TESTS="router tc_flower mirror_gre" 23for current_test in ${TESTS:-$ALL_TESTS}; do 24 source ${current_test}_scale.sh 25 26 num_netifs_var=${current_test^^}_NUM_NETIFS 27 num_netifs=${!num_netifs_var:-$NUM_NETIFS} 28 29 for profile in $KVD_PROFILES; do 30 RET=0 31 devlink_sp_resource_kvd_profile_set $profile 32 if [[ $RET -gt 0 ]]; then 33 log_test "'$current_test' [$profile] setting" 34 continue 35 fi 36 37 for should_fail in 0 1; do 38 RET=0 39 target=$(${current_test}_get_target "$should_fail") 40 ${current_test}_setup_prepare 41 setup_wait $num_netifs 42 ${current_test}_test "$target" "$should_fail" 43 ${current_test}_cleanup 44 if [[ "$should_fail" -eq 0 ]]; then 45 log_test "'$current_test' [$profile] $target" 46 else 47 log_test "'$current_test' [$profile] overflow $target" 48 fi 49 done 50 done 51done 52current_test="" 53 54exit "$RET" 55