Skip to contentSkip to conversation

selftests: net: ioam: add tunsrc support

PATCH Applied Justin Iurman 2 participants 4 messages Oct 2, 2024 – Oct 4, 2024

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

v2 cover selftests: net: ioam: add tunsrc support

v2:
- v1 missed the merge window, so while we're at it...
- split changes into two patches instead of one for readability (#1 removes the ioam selftests, #2 adds the updated ioam selftests)

TL;DR This patch comes from a discussion we had with Jakub and Paolo on aligning the ioam selftests with its new "tunsrc" feature.

This patch updates the IOAM selftests to support the new "tunsrc" feature of IOAM. As a consequence, some changes were required. For example, the IPv6 header must be accessed to check some fields (i.e., the source address for the "tunsrc" feature), which is not possible AFAIK with IPv6 raw sockets. The latter is currently used with IPV6_RECVHOPOPTS and was introduced by commit 187bbb6968af ("selftests:
ioam: refactoring to align with the fix") to fix an issue. But, we really need packet sockets actually... which is one of the changes in this patch (see the description of the topology at the top of ioam6.sh for explanations). Another change is that all IPv6 addresses used in the topology are now based on the documentation prefix (2001:db8::/32). Also, the tests have been improved and there are now many more of them. Overall, the script is more robust.

Justin Iurman (2):
selftests: net: remove ioam tests
selftests: net: add new ioam tests

 tools/testing/selftests/net/ioam6.sh       | 1832 +++++++++++++++-----
 tools/testing/selftests/net/ioam6_parser.c | 1087 ++++++++----
 2 files changed, 2129 insertions(+), 790 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/2 selftests: net: remove ioam tests

This patch entirely removes the ioam selftests to prepare for the next patch in this series, which re-adds the new ioam selftests for better readability.

---
 tools/testing/selftests/net/Makefile       |   2 -
 tools/testing/selftests/net/config         |   1 -
 tools/testing/selftests/net/ioam6.sh       | 771 ---------------------
 tools/testing/selftests/net/ioam6_parser.c | 674 ------------------
 4 files changed, 1448 deletions(-)
 delete mode 100755 tools/testing/selftests/net/ioam6.sh
 delete mode 100644 tools/testing/selftests/net/ioam6_parser.c
tools/testing/selftests/net/Makefile +0 -2
index 649f1fe0dc46..ef40d099aa1c 100644
@@ -28,7 +28,6 @@ TEST_PROGS += unicast_extensions.sh
 TEST_PROGS += udpgro_fwd.sh
 TEST_PROGS += udpgro_frglist.sh
 TEST_PROGS += veth.sh
-TEST_PROGS += ioam6.sh
 TEST_PROGS += gro.sh
 TEST_PROGS += gre_gso.sh
 TEST_PROGS += cmsg_so_mark.sh
@@ -67,7 +66,6 @@ TEST_GEN_FILES += fin_ack_lat
 TEST_GEN_FILES += reuseaddr_ports_exhausted
 TEST_GEN_FILES += hwtstamp_config rxtimestamp timestamping txtimestamp
 TEST_GEN_FILES += ipsec
-TEST_GEN_FILES += ioam6_parser
 TEST_GEN_FILES += gro
 TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa
 TEST_GEN_PROGS += reuseport_dualstack reuseaddr_conflict tls tun tap epoll_busy_poll
tools/testing/selftests/net/config +0 -1
index 5b9baf708950..3f0b02835e78 100644
@@ -95,7 +95,6 @@ CONFIG_NET_CLS_FLOWER=m
 CONFIG_NET_ACT_TUNNEL_KEY=m
 CONFIG_NET_ACT_MIRRED=m
 CONFIG_BAREUDP=m
-CONFIG_IPV6_IOAM6_LWTUNNEL=y
 CONFIG_CRYPTO_SM4_GENERIC=y
 CONFIG_AMT=m
 CONFIG_TUN=y
tools/testing/selftests/net/ioam6.sh deleted +0 -771

771 lines not on this page · raw message

tools/testing/selftests/net/ioam6_parser.c deleted +0 -674

674 lines not on this page · raw message

Signature · 1 line
2.34.1
#2 lore raw

PATCH v2 2/2 selftests: net: add new ioam tests

In reply to Justin Iurman

This patch re-adds the (updated) ioam selftests with support for the tunsrc feature.

---
 tools/testing/selftests/net/Makefile       |    2 +
 tools/testing/selftests/net/config         |    1 +
 tools/testing/selftests/net/ioam6.sh       | 1683 ++++++++++++++++++++
 tools/testing/selftests/net/ioam6_parser.c | 1101 +++++++++++++
 4 files changed, 2787 insertions(+)
 create mode 100755 tools/testing/selftests/net/ioam6.sh
 create mode 100644 tools/testing/selftests/net/ioam6_parser.c
tools/testing/selftests/net/Makefile +2 -0
index ef40d099aa1c..649f1fe0dc46 100644
@@ -28,6 +28,7 @@ TEST_PROGS += unicast_extensions.sh
 TEST_PROGS += udpgro_fwd.sh
 TEST_PROGS += udpgro_frglist.sh
 TEST_PROGS += veth.sh
+TEST_PROGS += ioam6.sh
 TEST_PROGS += gro.sh
 TEST_PROGS += gre_gso.sh
 TEST_PROGS += cmsg_so_mark.sh
@@ -66,6 +67,7 @@ TEST_GEN_FILES += fin_ack_lat
 TEST_GEN_FILES += reuseaddr_ports_exhausted
 TEST_GEN_FILES += hwtstamp_config rxtimestamp timestamping txtimestamp
 TEST_GEN_FILES += ipsec
+TEST_GEN_FILES += ioam6_parser
 TEST_GEN_FILES += gro
 TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa
 TEST_GEN_PROGS += reuseport_dualstack reuseaddr_conflict tls tun tap epoll_busy_poll
tools/testing/selftests/net/config +1 -0
index 3f0b02835e78..5b9baf708950 100644
@@ -95,6 +95,7 @@ CONFIG_NET_CLS_FLOWER=m
 CONFIG_NET_ACT_TUNNEL_KEY=m
 CONFIG_NET_ACT_MIRRED=m
 CONFIG_BAREUDP=m
+CONFIG_IPV6_IOAM6_LWTUNNEL=y
 CONFIG_CRYPTO_SM4_GENERIC=y
 CONFIG_AMT=m
 CONFIG_TUN=y
tools/testing/selftests/net/ioam6.sh new file +1683 -0

1,683 lines not on this page · raw message

tools/testing/selftests/net/ioam6_parser.c new file +1101 -0

1,101 lines not on this page · raw message

Signature · 1 line
2.34.1
#3 lore raw
In reply to Justin Iurman
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Wed, 2 Oct 2024 18:27:29 +0200 you wrote:

v2:
- v1 missed the merge window, so while we're at it...
- split changes into two patches instead of one for readability (#1 removes the ioam selftests, #2 adds the updated ioam selftests)

TL;DR This patch comes from a discussion we had with Jakub and Paolo on aligning the ioam selftests with its new "tunsrc" feature.

[...]

Here is the summary with links:
- [net-next,v2,1/2] selftests: net: remove ioam tests

    https://git.kernel.org/netdev/net-next/c/897408d5e224
  - [net-next,v2,2/2] selftests: net: add new ioam tests
    https://git.kernel.org/netdev/net-next/c/2d2b5028b4ab

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html