-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'selftests-mlxsw-Add-scale-tests-for-Spectrum-2'
Ido Schimmel says: ==================== selftests: mlxsw: Add scale tests for Spectrum-2 This series from Danielle adds two scale tests for the Spectrum-2 ASIC. The first scale test (patches #1-#4) validates the number of mirroring sessions (using tc-mirred) that can be supported by the device. As a preparatory step, patch #1 exposes the maximum number and current usage of mirroring agents via devlink-resource. This allows us to avoid hard-coding the limits later in the test. The second scale test (patch #5) validates the number of tc-flower filters that can be supported by the device. ==================== Signed-off-by: David S. Miller <[email protected]>
- Loading branch information
Showing
7 changed files
with
160 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
tools/testing/selftests/drivers/net/mlxsw/spectrum-2/mirror_gre_scale.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
source ../mirror_gre_scale.sh | ||
|
||
mirror_gre_get_target() | ||
{ | ||
local should_fail=$1; shift | ||
local target | ||
|
||
target=$(devlink_resource_size_get span_agents) | ||
|
||
if ((! should_fail)); then | ||
echo $target | ||
else | ||
echo $((target + 1)) | ||
fi | ||
} |
46 changes: 46 additions & 0 deletions
46
tools/testing/selftests/drivers/net/mlxsw/spectrum-2/resource_scale.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
# SPDX-License-Identifier: GPL-2.0 | ||
|
||
lib_dir=$(dirname $0)/../../../../net/forwarding | ||
|
||
NUM_NETIFS=6 | ||
source $lib_dir/lib.sh | ||
source $lib_dir/tc_common.sh | ||
source $lib_dir/devlink_lib.sh | ||
|
||
current_test="" | ||
|
||
cleanup() | ||
{ | ||
pre_cleanup | ||
if [ ! -z $current_test ]; then | ||
${current_test}_cleanup | ||
fi | ||
} | ||
|
||
trap cleanup EXIT | ||
|
||
ALL_TESTS="tc_flower mirror_gre" | ||
for current_test in ${TESTS:-$ALL_TESTS}; do | ||
source ${current_test}_scale.sh | ||
|
||
num_netifs_var=${current_test^^}_NUM_NETIFS | ||
num_netifs=${!num_netifs_var:-$NUM_NETIFS} | ||
|
||
for should_fail in 0 1; do | ||
RET=0 | ||
target=$(${current_test}_get_target "$should_fail") | ||
${current_test}_setup_prepare | ||
setup_wait $num_netifs | ||
${current_test}_test "$target" "$should_fail" | ||
${current_test}_cleanup | ||
if [[ "$should_fail" -eq 0 ]]; then | ||
log_test "'$current_test' $target" | ||
else | ||
log_test "'$current_test' overflow $target" | ||
fi | ||
done | ||
done | ||
current_test="" | ||
|
||
exit "$RET" |
20 changes: 20 additions & 0 deletions
20
tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower_scale.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
source ../tc_flower_scale.sh | ||
|
||
tc_flower_get_target() | ||
{ | ||
local should_fail=$1; shift | ||
|
||
# The driver associates a counter with each tc filter, which means the | ||
# number of supported filters is bounded by the number of available | ||
# counters. | ||
# Currently, the driver supports 12K (12,288) flow counters and six of | ||
# these are used for multicast routing. | ||
local target=12282 | ||
|
||
if ((! should_fail)); then | ||
echo $target | ||
else | ||
echo $((target + 1)) | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters