* [PATCH net-next 0/2] Add selftests for pedit ex munge ip6 dsfield
@ 2020-04-22 16:48 Petr Machata
2020-04-22 16:48 ` [PATCH net-next 1/2] selftests: forwarding: pedit_dsfield: Add pedit " Petr Machata
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Petr Machata @ 2020-04-22 16:48 UTC (permalink / raw)
To: netdev; +Cc: Petr Machata, davem, kuba, Roman Mashak
Patch #1 extends the existing generic forwarding selftests to cover pedit
ex munge ip6 traffic_class as well. Patch #2 adds TDC test coverage.
Petr Machata (2):
selftests: forwarding: pedit_dsfield: Add pedit munge ip6 dsfield
selftests: tc-testing: Add a TDC test for pedit munge ip6 dsfield
.../selftests/net/forwarding/pedit_dsfield.sh | 66 +++++++++++++++++++
.../tc-testing/tc-tests/actions/pedit.json | 25 +++++++
2 files changed, 91 insertions(+)
--
2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 1/2] selftests: forwarding: pedit_dsfield: Add pedit munge ip6 dsfield
2020-04-22 16:48 [PATCH net-next 0/2] Add selftests for pedit ex munge ip6 dsfield Petr Machata
@ 2020-04-22 16:48 ` Petr Machata
2020-04-22 16:48 ` [PATCH net-next 2/2] selftests: tc-testing: Add a TDC test for " Petr Machata
2020-04-23 2:54 ` [PATCH net-next 0/2] Add selftests for pedit ex " David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Petr Machata @ 2020-04-22 16:48 UTC (permalink / raw)
To: netdev; +Cc: Petr Machata, davem, kuba, Roman Mashak
Extend the pedit_dsfield forwarding selftest with coverage of "pedit ex
munge ip6 dsfield set".
Signed-off-by: Petr Machata <petrm@mellanox.com>
---
.../selftests/net/forwarding/pedit_dsfield.sh | 66 +++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/tools/testing/selftests/net/forwarding/pedit_dsfield.sh b/tools/testing/selftests/net/forwarding/pedit_dsfield.sh
index b50081855913..1181d647f6a7 100755
--- a/tools/testing/selftests/net/forwarding/pedit_dsfield.sh
+++ b/tools/testing/selftests/net/forwarding/pedit_dsfield.sh
@@ -20,10 +20,14 @@
ALL_TESTS="
ping_ipv4
+ ping_ipv6
test_ip_dsfield
test_ip_dscp
test_ip_ecn
test_ip_dscp_ecn
+ test_ip6_dsfield
+ test_ip6_dscp
+ test_ip6_ecn
"
NUM_NETIFS=4
@@ -107,6 +111,11 @@ ping_ipv4()
ping_test $h1 192.0.2.2
}
+ping_ipv6()
+{
+ ping6_test $h1 2001:db8:1::2
+}
+
do_test_pedit_dsfield_common()
{
local pedit_locus=$1; shift
@@ -228,6 +237,63 @@ test_ip_dscp_ecn()
do_test_ip_dscp_ecn "dev $swp2 egress"
}
+do_test_ip6_dsfield()
+{
+ local locus=$1; shift
+ local dsfield
+
+ for dsfield in 0 1 2 3 128 252 253 254 255; do
+ do_test_pedit_dsfield "$locus" \
+ "ip6 traffic_class set $dsfield" \
+ ipv6 "ip_tos $dsfield" \
+ "-6 -A 2001:db8:1::1 -B 2001:db8:1::2"
+ done
+}
+
+test_ip6_dsfield()
+{
+ do_test_ip6_dsfield "dev $swp1 ingress"
+ do_test_ip6_dsfield "dev $swp2 egress"
+}
+
+do_test_ip6_dscp()
+{
+ local locus=$1; shift
+ local dscp
+
+ for dscp in 0 1 2 3 32 61 62 63; do
+ do_test_pedit_dsfield "$locus" \
+ "ip6 traffic_class set $((dscp << 2)) retain 0xfc" \
+ ipv6 "ip_tos $(((dscp << 2) | 1))" \
+ "-6 -A 2001:db8:1::1 -B 2001:db8:1::2"
+ done
+}
+
+test_ip6_dscp()
+{
+ do_test_ip6_dscp "dev $swp1 ingress"
+ do_test_ip6_dscp "dev $swp2 egress"
+}
+
+do_test_ip6_ecn()
+{
+ local locus=$1; shift
+ local ecn
+
+ for ecn in 0 1 2 3; do
+ do_test_pedit_dsfield "$locus" \
+ "ip6 traffic_class set $ecn retain 0x3" \
+ ipv6 "ip_tos $((124 | $ecn))" \
+ "-6 -A 2001:db8:1::1 -B 2001:db8:1::2"
+ done
+}
+
+test_ip6_ecn()
+{
+ do_test_ip6_ecn "dev $swp1 ingress"
+ do_test_ip6_ecn "dev $swp2 egress"
+}
+
trap cleanup EXIT
setup_prepare
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] selftests: tc-testing: Add a TDC test for pedit munge ip6 dsfield
2020-04-22 16:48 [PATCH net-next 0/2] Add selftests for pedit ex munge ip6 dsfield Petr Machata
2020-04-22 16:48 ` [PATCH net-next 1/2] selftests: forwarding: pedit_dsfield: Add pedit " Petr Machata
@ 2020-04-22 16:48 ` Petr Machata
2020-04-23 2:54 ` [PATCH net-next 0/2] Add selftests for pedit ex " David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Petr Machata @ 2020-04-22 16:48 UTC (permalink / raw)
To: netdev; +Cc: Petr Machata, davem, kuba, Roman Mashak
Add a self-test for the IPv6 dsfield munge that iproute2 will support.
Signed-off-by: Petr Machata <petrm@mellanox.com>
---
.../tc-testing/tc-tests/actions/pedit.json | 25 +++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/pedit.json b/tools/testing/selftests/tc-testing/tc-tests/actions/pedit.json
index f8ea6f5fa8e9..72cdc3c800a5 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/actions/pedit.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/actions/pedit.json
@@ -1471,6 +1471,31 @@
"$TC actions flush action pedit"
]
},
+ {
+ "id": "94bb",
+ "name": "Add pedit action with LAYERED_OP ip6 traffic_class",
+ "category": [
+ "actions",
+ "pedit",
+ "layered_op"
+ ],
+ "setup": [
+ [
+ "$TC actions flush action pedit",
+ 0,
+ 1,
+ 255
+ ]
+ ],
+ "cmdUnderTest": "$TC actions add action pedit ex munge ip6 traffic_class set 0x40 continue",
+ "expExitCode": "0",
+ "verifyCmd": "$TC actions list action pedit",
+ "matchPattern": "ipv6\\+0: val 04000000 mask f00fffff",
+ "matchCount": "1",
+ "teardown": [
+ "$TC actions flush action pedit"
+ ]
+ },
{
"id": "6f5e",
"name": "Add pedit action with LAYERED_OP ip6 flow_lbl",
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 0/2] Add selftests for pedit ex munge ip6 dsfield
2020-04-22 16:48 [PATCH net-next 0/2] Add selftests for pedit ex munge ip6 dsfield Petr Machata
2020-04-22 16:48 ` [PATCH net-next 1/2] selftests: forwarding: pedit_dsfield: Add pedit " Petr Machata
2020-04-22 16:48 ` [PATCH net-next 2/2] selftests: tc-testing: Add a TDC test for " Petr Machata
@ 2020-04-23 2:54 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-04-23 2:54 UTC (permalink / raw)
To: petrm; +Cc: netdev, kuba, mrv
From: Petr Machata <petrm@mellanox.com>
Date: Wed, 22 Apr 2020 19:48:28 +0300
> Patch #1 extends the existing generic forwarding selftests to cover pedit
> ex munge ip6 traffic_class as well. Patch #2 adds TDC test coverage.
Series applied, thanky ou.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-04-23 2:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-22 16:48 [PATCH net-next 0/2] Add selftests for pedit ex munge ip6 dsfield Petr Machata
2020-04-22 16:48 ` [PATCH net-next 1/2] selftests: forwarding: pedit_dsfield: Add pedit " Petr Machata
2020-04-22 16:48 ` [PATCH net-next 2/2] selftests: tc-testing: Add a TDC test for " Petr Machata
2020-04-23 2:54 ` [PATCH net-next 0/2] Add selftests for pedit ex " David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).