FILE
tc_flower_scale.sh
File preview with syntax highlighting.
linux-6.19.14/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower_scale.sh
1# SPDX-License-Identifier: GPL-2.0 2source ../tc_flower_scale.sh 3 4tc_flower_get_target() 5{ 6 local should_fail=$1; shift 7 local max_cnts 8 9 # The driver associates a counter with each tc filter, which means the 10 # number of supported filters is bounded by the number of available 11 # counters. 12 max_cnts=$(devlink_resource_size_get counters flow) 13 14 # Remove already allocated counters. 15 ((max_cnts -= $(devlink_resource_occ_get counters flow))) 16 17 # Each rule uses two counters, for packets and bytes. 18 ((max_cnts /= 2)) 19 20 if ((! should_fail)); then 21 echo $max_cnts 22 else 23 echo $((max_cnts + 1)) 24 fi 25}
~/
Read-only file preview.