aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/net/forwarding/tc_actions.sh (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-05-11selftests: forwarding: tc_actions: allow mirred egress test to run on non-offloaded h2Vladimir Oltean1-1/+1
The host interfaces $h1 and $h2 don't have to be switchdev interfaces, but due to the fact that we pass $tcflags which may have the value of "skip_sw", we force $h2 to offload a drop rule for dst_ip, something which it may not be able to do. The selftest only wants to verify the hit count of this rule as a means of figuring out whether the packet was received, so remove the $tcflags for it and let it be done in software. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Tested-by: Ido Schimmel <idosch@nvidia.com> Link: https://lore.kernel.org/r/20220510220904.284552-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-11-16selftests: add a test case for mirred egress to ingressDavide Caratti1-1/+46
add a selftest that verifies the correct behavior of TC act_mirred egress to ingress: in particular, it checks if the dst_entry is removed from skb before redirect egress -> ingress. The correct behavior is: an ICMP 'echo request' generated by ping will be received and generate a reply the same way as the one generated by mausezahn. Suggested-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Davide Caratti <dcaratti@redhat.com> Acked-by: Cong Wang <cong.wang@bytedance.com> Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-04-27selftests: forwarding: tc_actions.sh: add matchall mirror testJiri Pirko1-8/+18
Add test for matchall classifier with mirred egress mirror action. 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>
2018-05-03selftests: forwarding: Allow running specific testsIdo Schimmel1-7/+18
Similar to commit a511858c7536 ("selftests: fib_tests: Allow user to run a specific test"), allow user to run only a subset of the tests using the TESTS environment variable. This is useful when not all the tests can pass on a given system. Example: # export TESTS="ping_ipv4 ping_ipv6" # ./bridge_vlan_aware.sh TEST: ping [PASS] TEST: ping6 [PASS] Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-03-07selftests: forwarding: fix flags passed to first drop rule in gact_drop_and_ok_testJiri Pirko1-1/+1
Fix copy&paste error and pass proper flags. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-03-07selftests: forwarding: fix "ok" action testJiri Pirko1-1/+4
Fix the "ok" action test so it checks that packet that is okayed does not continue to be processed by other rules. Fix error message as well. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-03-05selftests: Extend the tc action test for action mirrorArkadi Sharshevsky1-6/+10
Currently the tc action test is used only to test mirred redirect action. This patch extends it for mirred mirror. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-03-01selftests: forwarding: Only check tc version for tc testsDavid Ahern1-1/+1
Capabilities of tc command are irrelevant for router tests: $ ./router.sh SKIP: iproute2 too old, missing shared block support Add a CHECK_TC flag and only check tc capabilities if set. Add flag to tc_common.sh and have it sourced before lib.sh Also, if the command lacks some feature the test should exit non-0. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-02-28selftests: forwarding: Introduce tc actions testsJiri Pirko1-0/+195
Add first part of actions tests. This patch only contains tests of gact ok/drop/trap and mirred redirect egress. 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>