Skip to content

Commit f520489

Browse files
idoschkuba-moo
authored andcommitted
selftests: mlxsw: Fix test failure on Spectrum-4
Remove assumptions about shared buffer cell size and instead query the cell size from devlink. Adjust the test to send small packets that fit inside a single cell. Tested on Spectrum-{1,2,3,4}. Fixes: 4735402 ("mlxsw: spectrum: Extend to support Spectrum-4 ASIC") Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Petr Machata <petrm@nvidia.com> Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/f7dfbf3c4d1cb23838d9eb99bab09afaa320c4ca.1692268427.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 348c976 commit f520489

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

tools/testing/selftests/drivers/net/mlxsw/sharedbuffer.sh

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ sb_occ_etc_check()
9898

9999
port_pool_test()
100100
{
101-
local exp_max_occ=288
101+
local exp_max_occ=$(devlink_cell_size_get)
102102
local max_occ
103103

104104
devlink sb occupancy clearmax $DEVLINK_DEV
105105

106-
$MZ $h1 -c 1 -p 160 -a $h1mac -b $h2mac -A 192.0.1.1 -B 192.0.1.2 \
106+
$MZ $h1 -c 1 -p 10 -a $h1mac -b $h2mac -A 192.0.1.1 -B 192.0.1.2 \
107107
-t ip -q
108108

109109
devlink sb occupancy snapshot $DEVLINK_DEV
@@ -126,12 +126,12 @@ port_pool_test()
126126

127127
port_tc_ip_test()
128128
{
129-
local exp_max_occ=288
129+
local exp_max_occ=$(devlink_cell_size_get)
130130
local max_occ
131131

132132
devlink sb occupancy clearmax $DEVLINK_DEV
133133

134-
$MZ $h1 -c 1 -p 160 -a $h1mac -b $h2mac -A 192.0.1.1 -B 192.0.1.2 \
134+
$MZ $h1 -c 1 -p 10 -a $h1mac -b $h2mac -A 192.0.1.1 -B 192.0.1.2 \
135135
-t ip -q
136136

137137
devlink sb occupancy snapshot $DEVLINK_DEV
@@ -154,16 +154,12 @@ port_tc_ip_test()
154154

155155
port_tc_arp_test()
156156
{
157-
local exp_max_occ=96
157+
local exp_max_occ=$(devlink_cell_size_get)
158158
local max_occ
159159

160-
if [[ $MLXSW_CHIP != "mlxsw_spectrum" ]]; then
161-
exp_max_occ=144
162-
fi
163-
164160
devlink sb occupancy clearmax $DEVLINK_DEV
165161

166-
$MZ $h1 -c 1 -p 160 -a $h1mac -A 192.0.1.1 -t arp -q
162+
$MZ $h1 -c 1 -p 10 -a $h1mac -A 192.0.1.1 -t arp -q
167163

168164
devlink sb occupancy snapshot $DEVLINK_DEV
169165

0 commit comments

Comments
 (0)