Skip to contentSkip to conversation

selftests/net: ipv6 flowlabel

PATCH Applied Willem de Bruijn 2 participants 2 messages May 27, 2019 – May 29, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/net: ipv6 flowlabel

From: Willem de Bruijn <[email protected]>

Test the IPv6 flowlabel control and datapath interfaces:

Acquire and release the right to use flowlabels with socket option IPV6_FLOWLABEL_MGR.

Then configure flowlabels on send and read them on recv with cmsg IPV6_FLOWINFO. Also verify auto-flowlabel if not explicitly set.

This helped identify the issue fixed in commit 95c169251bf73 ("ipv6:
invert flowlabel sharing check in process and user mode")

---
 tools/testing/selftests/net/.gitignore        |   2 +
 tools/testing/selftests/net/Makefile          |   4 +-
 tools/testing/selftests/net/ipv6_flowlabel.c  | 230 ++++++++++++++++++
 tools/testing/selftests/net/ipv6_flowlabel.sh |  22 ++
 .../selftests/net/ipv6_flowlabel_mgr.c        | 200 +++++++++++++++
 5 files changed, 456 insertions(+), 2 deletions(-)
 create mode 100644 tools/testing/selftests/net/ipv6_flowlabel.c
 create mode 100755 tools/testing/selftests/net/ipv6_flowlabel.sh
 create mode 100644 tools/testing/selftests/net/ipv6_flowlabel_mgr.c
tools/testing/selftests/net/.gitignore +2 -0
index 27ef4d07ac915..99a4e41d52499 100644
@@ -18,3 +18,5 @@ tls
 txring_overwrite
 ip_defrag
 so_txtime
+flowlabel
+flowlabel_mgr
tools/testing/selftests/net/Makefile +2 -2
index 8af7869e0f1c8..8343fb9d8a463 100644
@@ -9,13 +9,13 @@ TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh \
 TEST_PROGS += fib_tests.sh fib-onlink-tests.sh pmtu.sh udpgso.sh ip_defrag.sh
 TEST_PROGS += udpgso_bench.sh fib_rule_tests.sh msg_zerocopy.sh psock_snd.sh
 TEST_PROGS += udpgro_bench.sh udpgro.sh test_vxlan_under_vrf.sh reuseport_addr_any.sh
-TEST_PROGS += test_vxlan_fdb_changelink.sh so_txtime.sh
+TEST_PROGS += test_vxlan_fdb_changelink.sh so_txtime.sh ipv6_flowlabel.sh
 TEST_PROGS_EXTENDED := in_netns.sh
 TEST_GEN_FILES =  socket
 TEST_GEN_FILES += psock_fanout psock_tpacket msg_zerocopy reuseport_addr_any
 TEST_GEN_FILES += tcp_mmap tcp_inq psock_snd txring_overwrite
 TEST_GEN_FILES += udpgso udpgso_bench_tx udpgso_bench_rx ip_defrag
-TEST_GEN_FILES += so_txtime
+TEST_GEN_FILES += so_txtime ipv6_flowlabel ipv6_flowlabel_mgr
 TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa
 TEST_GEN_PROGS += reuseport_dualstack reuseaddr_conflict tls
 
tools/testing/selftests/net/ipv6_flowlabel.c new file +230 -0

230 lines not on this page · raw message

tools/testing/selftests/net/ipv6_flowlabel.sh new file +22 -0
new file mode 100755
index 0000000000000..5d89fd8dbfc7d
@@ -0,0 +1,22 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+#
+# Regression tests for IPv6 flowlabels
+#
+# run in separate namespaces to avoid mgmt db conflicts betweent tests
+
+set -e
+
+echo "TEST management"
+./in_netns.sh ./ipv6_flowlabel_mgr
+
+echo "TEST datapath"
+./in_netns.sh \
+  sh -c 'sysctl -q -w net.ipv6.auto_flowlabels=0 && ./ipv6_flowlabel -l 1'
+
+echo "TEST datapath (with auto-flowlabels)"
+./in_netns.sh \
+  sh -c 'sysctl -q -w net.ipv6.auto_flowlabels=1 && ./ipv6_flowlabel -l 1'
+
+echo OK. All tests passed
+
tools/testing/selftests/net/ipv6_flowlabel_mgr.c new file +200 -0

200 lines not on this page · raw message

Signature · 1 line
2.22.0.rc1.257.g3120a18244-goog
maintainer Applied
#1 lore raw

From: Willem de Bruijn <[email protected]>
Date: Mon, 27 May 2019 16:47:51 -0400

Quoted 7 lines

From: Willem de Bruijn <[email protected]>

Test the IPv6 flowlabel control and datapath interfaces:

Acquire and release the right to use flowlabels with socket option IPV6_FLOWLABEL_MGR.

Quoted 7 lines

Then configure flowlabels on send and read them on recv with cmsg IPV6_FLOWINFO. Also verify auto-flowlabel if not explicitly set.

This helped identify the issue fixed in commit 95c169251bf73 ("ipv6:
invert flowlabel sharing check in process and user mode")

Applied.