summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@ovn.org>2022-08-05 13:17:08 +0200
committerIlya Maximets <i.maximets@ovn.org>2022-08-08 12:36:45 +0200
commit6fcd733f758e6b1adb668e373fea187f9c4e9605 (patch)
tree603fc4c3c651c74c6f66d85cb769d12b95d68906 /tests
parent434025a15453452f76962b5f625dbe30c61615fd (diff)
downloadopenvswitch-6fcd733f758e6b1adb668e373fea187f9c4e9605.tar.gz
system-traffic: Don't run IPv6 header modification test on kernels < 5.19.
OVS kernel module is incorrectly updating checksums while changing IPv6 fields of later fragments that doesn't really have L4 headers. This makes the 'ping6 between two ports with header modify' test fail on most of the distribution kernels. The issue got indirectly fixed in latest 5.19 with commit: 12378a5a75e3 ("net: openvswitch: fix parsing of nw_proto for IPv6 fragments") The reason is that set_ipv6() function in net/openvswitch/actions.c is using the protocol number from the parsed flow key and not from the packet itself, and nw_proto=44 is not a protocol where we can update the checksum. It was backported to all supported upstream stable trees, but didn't find its way to most of the distributions yet. Restricting the test to 5.19+ kernels to avoid failures on distro kernels. Additionally allowing the previous test for later fragments to be executed in userspace testsuite. Fixes: 2ff43c78c685 ("packets: Re-calculate IPv6 checksum only for first frag upon modify.") Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/system-kmod-macros.at7
-rw-r--r--tests/system-traffic.at3
-rw-r--r--tests/system-userspace-macros.at5
3 files changed, 14 insertions, 1 deletions
diff --git a/tests/system-kmod-macros.at b/tests/system-kmod-macros.at
index 9ee1b1059..11920e60b 100644
--- a/tests/system-kmod-macros.at
+++ b/tests/system-kmod-macros.at
@@ -202,6 +202,13 @@ m4_define([OVS_CHECK_KERNEL_EXCL],
AT_SKIP_IF([ ! ( test $version -lt $1 || ( test $version -eq $1 && test $sublevel -lt $2 ) || test $version -gt $3 || ( test $version -eq $3 && test $sublevel -gt $4 ) ) ])
])
+# CHECK_LATER_IPV6_FRAGMENTS()
+#
+# Upstream kernels beetween 4.20 and 5.19 are not parsing IPv6 fragments
+# correctly. The issue was also backported in some older distribution
+# kernels, so kernels below 4.20 are not reliable.
+m4_define([CHECK_LATER_IPV6_FRAGMENTS], [OVS_CHECK_MIN_KERNEL(5, 19)])
+
# VSCTL_ADD_DATAPATH_TABLE()
#
# Create system datapath table "system" for kernel tests in ovsdb
diff --git a/tests/system-traffic.at b/tests/system-traffic.at
index 69e8b45da..53ae80f4e 100644
--- a/tests/system-traffic.at
+++ b/tests/system-traffic.at
@@ -194,7 +194,7 @@ AT_CLEANUP
AT_SETUP([datapath - ping6 between two ports IPv6 later fragments])
OVS_TRAFFIC_VSWITCHD_START()
-OVS_CHECK_MIN_KERNEL(5, 19)
+CHECK_LATER_IPV6_FRAGMENTS()
AT_CHECK([ovs-ofctl add-flow br0 "priority=1,actions=normal"])
AT_CHECK([ovs-ofctl add-flow br0 "priority=2,tcp6,actions=drop"])
@@ -228,6 +228,7 @@ AT_CLEANUP
AT_SETUP([datapath - ping6 between two ports with header modify])
OVS_TRAFFIC_VSWITCHD_START()
+CHECK_LATER_IPV6_FRAGMENTS()
AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"])
diff --git a/tests/system-userspace-macros.at b/tests/system-userspace-macros.at
index 7910cb7f7..b34a84775 100644
--- a/tests/system-userspace-macros.at
+++ b/tests/system-userspace-macros.at
@@ -301,6 +301,11 @@ m4_define([OVS_CHECK_KERNEL_EXCL],
AT_SKIP_IF([:])
])
+# CHECK_LATER_IPV6_FRAGMENTS()
+#
+# Userspace is parsing later IPv6 fragments correctly.
+m4_define([CHECK_LATER_IPV6_FRAGMENTS], [])
+
# VSCTL_ADD_DATAPATH_TABLE()
#
# Create datapath table "netdev" for userspace tests in ovsdb