Skip to content

Commit ffff9c9

Browse files
idoschdavem330
authored andcommitted
selftests: mlxsw: Reduce runtime of tc-police scale test
Currently, the test takes about 626 seconds to complete because of an inefficient use of the device's TCAM. Reduce the runtime to 202 seconds by inserting all the flower filters with the same preference and mask, but with a different key. In particular, this reduces the deletion of the qdisc (which triggers the deletion of all the filters) from 66 seconds to 0.2 seconds. This prevents various netlink requests from user space applications (e.g., systemd-networkd) from timing-out because RTNL is not held for too long anymore. Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 24f54c5 commit ffff9c9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ tc_police_switch_destroy()
2424
simple_if_fini $swp1
2525
}
2626

27+
tc_police_addr()
28+
{
29+
local num=$1; shift
30+
31+
printf "2001:db8:1::%x" $num
32+
}
33+
2734
tc_police_rules_create()
2835
{
2936
local count=$1; shift
@@ -34,8 +41,9 @@ tc_police_rules_create()
3441
for ((i = 0; i < count; ++i)); do
3542
cat >> $TC_POLICE_BATCH_FILE <<-EOF
3643
filter add dev $swp1 ingress \
37-
prot ip \
38-
flower skip_sw \
44+
prot ipv6 \
45+
pref 1000 \
46+
flower skip_sw dst_ip $(tc_police_addr $i) \
3947
action police rate 10mbit burst 100k \
4048
conform-exceed drop/ok
4149
EOF

0 commit comments

Comments
 (0)