Skip to content

Commit 240fe73

Browse files
jpirkokuba-moo
authored andcommitted
selftests: mlxsw: tc_restrictions: add test to check sample action restrictions
Check that matchall rules with sample actions are not possible to be inserted to egress. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent b886dea commit 240fe73

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

‎tools/testing/selftests/drivers/net/mlxsw/tc_restrictions.sh‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ALL_TESTS="
77
shared_block_drop_test
88
egress_redirect_test
99
multi_mirror_test
10+
matchall_sample_egress_test
1011
"
1112
NUM_NETIFS=2
1213

@@ -155,6 +156,30 @@ multi_mirror_test()
155156
log_test "multi mirror"
156157
}
157158

159+
matchall_sample_egress_test()
160+
{
161+
RET=0
162+
163+
# It is forbidden in mlxsw driver to have matchall with sample action
164+
# bound on egress
165+
166+
tc qdisc add dev $swp1 clsact
167+
168+
tc filter add dev $swp1 ingress protocol all pref 1 handle 101 \
169+
matchall skip_sw action sample rate 100 group 1
170+
check_err $? "Failed to add rule with sample action on ingress"
171+
172+
tc filter del dev $swp1 ingress protocol all pref 1 handle 101 matchall
173+
174+
tc filter add dev $swp1 egress protocol all pref 1 handle 101 \
175+
matchall skip_sw action sample rate 100 group 1
176+
check_fail $? "Incorrect success to add rule with sample action on egress"
177+
178+
tc qdisc del dev $swp1 clsact
179+
180+
log_test "matchall sample egress"
181+
}
182+
158183
setup_prepare()
159184
{
160185
swp1=${NETIFS[p1]}

0 commit comments

Comments
 (0)