diff options
| author | Guillaume Nault <gnault@redhat.com> | 2021-02-12 20:05:37 +0100 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2021-02-12 17:13:52 -0800 |
| commit | 203ee5cd723502e88bac830a2478258f23bc4756 (patch) | |
| tree | 48aab9d1a5551b4a482a2536c76a4ba89f4ea01b /tools/testing/selftests/net/forwarding/lib.sh | |
| parent | 4098ced4680a485c5953f60ac63dff19f3fb3d42 (diff) | |
selftests: tc: Add basic mpls_* matching support for tc-flower
Add tests in tc_flower.sh for mpls_label, mpls_tc, mpls_bos and
mpls_ttl. For each keyword, test the minimal and maximal values.
Selectively skip these new mpls tests for tc versions that don't
support them.
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/net/forwarding/lib.sh')
| -rw-r--r-- | tools/testing/selftests/net/forwarding/lib.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 40b3a86a62cf..043a417651f2 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -42,6 +42,21 @@ check_tc_version() fi } +# Old versions of tc don't understand "mpls_uc" +check_tc_mpls_support() +{ + local dev=$1; shift + + tc filter add dev $dev ingress protocol mpls_uc pref 1 handle 1 \ + matchall action pipe &> /dev/null + if [[ $? -ne 0 ]]; then + echo "SKIP: iproute2 too old; tc is missing MPLS support" + return 1 + fi + tc filter del dev $dev ingress protocol mpls_uc pref 1 handle 1 \ + matchall +} + check_tc_shblock_support() { tc filter help 2>&1 | grep block &> /dev/null |
