diff options
author | Jiri Pirko <jiri@mellanox.com> | 2020-02-27 10:50:09 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-02-27 22:10:14 +0300 |
commit | ab2b8ab253d17a81a3d905d4c3e215391c725771 (patch) | |
tree | b275d8ca8ff64de67926694c73aa50644048f7f5 /tools | |
parent | c84e903f6227a4e7cf9a925fc491a4206009cd75 (diff) | |
download | linux-ab2b8ab253d17a81a3d905d4c3e215391c725771.tar.xz |
selftests: add a mirror test to mlxsw tc flower restrictions
Include test of forbidding to have multiple mirror actions.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/testing/selftests/drivers/net/mlxsw/tc_flower_restrictions.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/testing/selftests/drivers/net/mlxsw/tc_flower_restrictions.sh b/tools/testing/selftests/drivers/net/mlxsw/tc_flower_restrictions.sh index 67e0c25adcee..68c80d0ec1ec 100755 --- a/tools/testing/selftests/drivers/net/mlxsw/tc_flower_restrictions.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/tc_flower_restrictions.sh @@ -6,6 +6,7 @@ lib_dir=$(dirname $0)/../../../net/forwarding ALL_TESTS=" shared_block_drop_test egress_redirect_test + multi_mirror_test " NUM_NETIFS=2 @@ -127,6 +128,33 @@ egress_redirect_test() log_test "shared block drop" } +multi_mirror_test() +{ + RET=0 + + # It is forbidden in mlxsw driver to have multiple mirror + # actions in a single rule. + + tc qdisc add dev $swp1 clsact + + tc filter add dev $swp1 ingress protocol ip pref 1 handle 101 flower \ + skip_sw dst_ip 192.0.2.2 \ + action mirred egress mirror dev $swp2 + check_err $? "Failed to add rule with single mirror action" + + tc filter del dev $swp1 ingress protocol ip pref 1 handle 101 flower + + tc filter add dev $swp1 ingress protocol ip pref 1 handle 101 flower \ + skip_sw dst_ip 192.0.2.2 \ + action mirred egress mirror dev $swp2 \ + action mirred egress mirror dev $swp1 + check_fail $? "Incorrect success to add rule with two mirror actions" + + tc qdisc del dev $swp1 clsact + + log_test "multi mirror" +} + setup_prepare() { swp1=${NETIFS[p1]} |