diff mbox series

[ovs-dev,v11,01/11] tests: Include working system-traffic tests into the system-offloads-testsuite.

Message ID 167577863568.1166983.7364980805715913398.stgit@ebuild.local
State Accepted
Commit f68e757ef1f6f3b10e7d5fabdd09631f9fe20da1
Headers show
Series tests: Add system-traffic.at tests to check-offloads. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/intel-ovs-compilation success test: success
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Eelco Chaudron Feb. 7, 2023, 2:03 p.m. UTC
Include and run the system-traffic.at tests as part of the system offload
testsuite. Exclude all the tests that will not run without any special
modifications.

Lowered log level for "recirc_id sharing not supported" message, so tests
will not fail with older kernels. This is not an error level message, but
should be debug, like all other, EOPNOTSUPP, related log messages.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Roi Dayan <roid@nvidia.com>
---
 lib/netdev-offload-tc.c                   |    2 +-
 tests/automake.mk                         |    3 ++
 tests/system-kmod-macros.at               |    5 ++++
 tests/system-offloads-testsuite-macros.at |   36 +++++++++++++++++++++++++++++
 tests/system-offloads-testsuite.at        |    3 ++
 tests/system-traffic.at                   |   27 ++++++++++++++++++++++
 tests/system-userspace-macros.at          |    5 ++++
 7 files changed, 79 insertions(+), 2 deletions(-)
 create mode 100644 tests/system-offloads-testsuite-macros.at

Comments

Simon Horman Feb. 8, 2023, 4:32 p.m. UTC | #1
On Tue, Feb 07, 2023 at 03:03:57PM +0100, Eelco Chaudron wrote:
> Include and run the system-traffic.at tests as part of the system offload
> testsuite. Exclude all the tests that will not run without any special
> modifications.
> 
> Lowered log level for "recirc_id sharing not supported" message, so tests
> will not fail with older kernels. This is not an error level message, but
> should be debug, like all other, EOPNOTSUPP, related log messages.
> 
> Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
> Acked-by: Roi Dayan <roid@nvidia.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>
Tested-by: Simon Horman <simon.horman@corigine.com>
Simon Horman Feb. 8, 2023, 4:33 p.m. UTC | #2
On Tue, Feb 07, 2023 at 03:03:57PM +0100, Eelco Chaudron wrote:
> Include and run the system-traffic.at tests as part of the system offload
> testsuite. Exclude all the tests that will not run without any special
> modifications.
> 
> Lowered log level for "recirc_id sharing not supported" message, so tests
> will not fail with older kernels. This is not an error level message, but
> should be debug, like all other, EOPNOTSUPP, related log messages.
> 
> Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
> Acked-by: Roi Dayan <roid@nvidia.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>
Tested-by: Simon Horman <simon.horman@corigine.com>
Simon Horman Feb. 8, 2023, 4:52 p.m. UTC | #3
On Wed, Feb 08, 2023 at 05:32:30PM +0100, Simon Horman wrote:
> On Tue, Feb 07, 2023 at 03:03:57PM +0100, Eelco Chaudron wrote:
> > Include and run the system-traffic.at tests as part of the system offload
> > testsuite. Exclude all the tests that will not run without any special
> > modifications.
> > 
> > Lowered log level for "recirc_id sharing not supported" message, so tests
> > will not fail with older kernels. This is not an error level message, but
> > should be debug, like all other, EOPNOTSUPP, related log messages.
> > 
> > Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
> > Acked-by: Roi Dayan <roid@nvidia.com>
> 
> Reviewed-by: Simon Horman <simon.horman@corigine.com>
> Tested-by: Simon Horman <simon.horman@corigine.com>

Sorry for the misfire here, and the resulting miss-match
between the tags and the from address.

I hit mixed things up and send the previous email from my non-work address.
I've resent from my work address, which was my original intention.
Eelco Chaudron Feb. 8, 2023, 5:29 p.m. UTC | #4
On 8 Feb 2023, at 17:32, Simon Horman wrote:

> On Tue, Feb 07, 2023 at 03:03:57PM +0100, Eelco Chaudron wrote:
>> Include and run the system-traffic.at tests as part of the system offload
>> testsuite. Exclude all the tests that will not run without any special
>> modifications.
>>
>> Lowered log level for "recirc_id sharing not supported" message, so tests
>> will not fail with older kernels. This is not an error level message, but
>> should be debug, like all other, EOPNOTSUPP, related log messages.
>>
>> Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
>> Acked-by: Roi Dayan <roid@nvidia.com>
>
> Reviewed-by: Simon Horman <simon.horman@corigine.com>
> Tested-by: Simon Horman <simon.horman@corigine.com>

Thanks Simon for testing and reviewing the series!

//Eelco
diff mbox series

Patch

diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
index 134c24157..a13f2fe6b 100644
--- a/lib/netdev-offload-tc.c
+++ b/lib/netdev-offload-tc.c
@@ -2417,7 +2417,7 @@  netdev_tc_flow_put(struct netdev *netdev, struct match *match,
     }
 
     if ((chain || recirc_act) && !info->recirc_id_shared_with_tc) {
-        VLOG_ERR_RL(&error_rl, "flow_put: recirc_id sharing not supported");
+        VLOG_DBG_RL(&rl, "flow_put: recirc_id sharing not supported");
         return EOPNOTSUPP;
     }
 
diff --git a/tests/automake.mk b/tests/automake.mk
index c8de3fe28..86e496a5b 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -186,7 +186,8 @@  SYSTEM_TESTSUITE_AT = \
 SYSTEM_OFFLOADS_TESTSUITE_AT = \
 	tests/system-common-macros.at \
 	tests/system-offloads-traffic.at \
-	tests/system-offloads-testsuite.at
+	tests/system-offloads-testsuite.at \
+	tests/system-offloads-testsuite-macros.at
 
 SYSTEM_DPDK_TESTSUITE_AT = \
 	tests/system-common-macros.at \
diff --git a/tests/system-kmod-macros.at b/tests/system-kmod-macros.at
index 11920e60b..822a80618 100644
--- a/tests/system-kmod-macros.at
+++ b/tests/system-kmod-macros.at
@@ -224,3 +224,8 @@  m4_define([VSCTL_ADD_DATAPATH_TABLE],
 # or necessary for the userspace datapath as it is checking for a kernel
 # specific regression.
 m4_define([CHECK_L3L4_CONNTRACK_REASM])
+
+# CHECK_NO_TC_OFFLOAD
+#
+# The kernel module tests do not use TC offload.
+m4_define([CHECK_NO_TC_OFFLOAD])
diff --git a/tests/system-offloads-testsuite-macros.at b/tests/system-offloads-testsuite-macros.at
new file mode 100644
index 000000000..2129cf7f0
--- /dev/null
+++ b/tests/system-offloads-testsuite-macros.at
@@ -0,0 +1,36 @@ 
+AT_COPYRIGHT([Copyright (c) 2022 Red Hat, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at:
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.])
+
+# The goal is to run as many as possible of the system-traffic tests with
+# OVS tc offload enabled. We do this by overriding the
+# OVS_TRAFFIC_VSWITCHD_START() with offloading enabled.
+m4_define([OVS_TRAFFIC_VSWITCHD_START],
+  [AT_CHECK([modprobe openvswitch])
+   on_exit 'modprobe -r openvswitch'
+   m4_foreach([mod], [[vport_geneve], [vport_gre], [vport_lisp], [vport_stt], [vport_vxlan]],
+              [modprobe -q mod || echo "Module mod not loaded."
+               on_exit 'modprobe -q -r mod'
+              ])
+   on_exit 'ovs-dpctl del-dp ovs-system'
+   on_exit 'ovs-appctl dpctl/flush-conntrack'
+   _OVS_VSWITCHD_START([], [-- set Open_vSwitch . other_config:hw-offload=true $3])
+   dnl Add bridges, ports, etc.
+   AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [], [| uuidfilt])], [0], [$2])
+])
+
+# Macro to exclude tests that will fail with TC offload enabled.
+m4_define([CHECK_NO_TC_OFFLOAD],
+[
+     AT_SKIP_IF([:])
+])
diff --git a/tests/system-offloads-testsuite.at b/tests/system-offloads-testsuite.at
index eb5d2d4b3..23637d4f5 100644
--- a/tests/system-offloads-testsuite.at
+++ b/tests/system-offloads-testsuite.at
@@ -23,3 +23,6 @@  m4_include([tests/system-common-macros.at])
 m4_include([tests/system-kmod-macros.at])
 
 m4_include([tests/system-offloads-traffic.at])
+
+m4_include([tests/system-offloads-testsuite-macros.at])
+m4_include([tests/system-traffic.at])
diff --git a/tests/system-traffic.at b/tests/system-traffic.at
index b1b01380a..5d15c4712 100644
--- a/tests/system-traffic.at
+++ b/tests/system-traffic.at
@@ -1199,6 +1199,7 @@  OVS_TRAFFIC_VSWITCHD_STOP
 AT_CLEANUP
 
 AT_SETUP([datapath - mpls actions])
+CHECK_NO_TC_OFFLOAD()
 OVS_TRAFFIC_VSWITCHD_START([_ADD_BR([br1])])
 
 ADD_NAMESPACES(at_ns0, at_ns1)
@@ -1236,6 +1237,7 @@  OVS_TRAFFIC_VSWITCHD_STOP
 AT_CLEANUP
 
 AT_SETUP([datapath - multiple mpls label pop])
+CHECK_NO_TC_OFFLOAD()
 OVS_TRAFFIC_VSWITCHD_START([_ADD_BR([br1])])
 
 ADD_NAMESPACES(at_ns0, at_ns1)
@@ -1638,6 +1640,7 @@  dnl   br-underlay: with IP: 172.31.1.100
 dnl   ns0: connect to br-underlay, with IP: 10.1.1.1
 AT_SETUP([datapath - truncate and output to gre tunnel by simulated packets])
 OVS_CHECK_MIN_KERNEL(3, 10)
+CHECK_NO_TC_OFFLOAD()
 AT_SKIP_IF([test $HAVE_NC = no])
 OVS_TRAFFIC_VSWITCHD_START()
 
@@ -1772,6 +1775,7 @@  AT_SETUP([datapath - truncate and output to gre tunnel])
 AT_SKIP_IF([test $HAVE_NC = no])
 OVS_CHECK_KERNEL_EXCL(3, 10, 4, 15)
 OVS_CHECK_GRE()
+CHECK_NO_TC_OFFLOAD()
 OVS_TRAFFIC_VSWITCHD_START()
 
 ADD_BR([br-underlay])
@@ -2919,6 +2923,7 @@  AT_CLEANUP
 
 AT_SETUP([conntrack - zones from other field, more tests])
 CHECK_CONNTRACK()
+CHECK_NO_TC_OFFLOAD()
 OVS_TRAFFIC_VSWITCHD_START()
 
 ADD_NAMESPACES(at_ns0, at_ns1)
@@ -3050,6 +3055,7 @@  AT_CLEANUP
 AT_SETUP([conntrack - multiple namespaces, internal ports])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_LOCAL_STACK()
+CHECK_NO_TC_OFFLOAD()
 OVS_TRAFFIC_VSWITCHD_START(
    [set-fail-mode br0 secure -- ])
 
@@ -3672,6 +3678,7 @@  AT_CLEANUP
 
 AT_SETUP([conntrack - IPv4 fragmentation + cvlan])
 CHECK_CONNTRACK()
+CHECK_NO_TC_OFFLOAD()
 OVS_TRAFFIC_VSWITCHD_START([set Open_vSwitch . other_config:vlan-limit=0])
 OVS_CHECK_8021AD()
 
@@ -4195,6 +4202,7 @@  AT_SETUP([conntrack - Fragmentation over vxlan])
 OVS_CHECK_VXLAN()
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_LOCAL_STACK()
+CHECK_NO_TC_OFFLOAD()
 
 OVS_TRAFFIC_VSWITCHD_START()
 ADD_BR([br-underlay])
@@ -4385,6 +4393,7 @@  AT_CLEANUP
 AT_SETUP([conntrack - zone-based timeout policy])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_TIMEOUT()
+CHECK_NO_TC_OFFLOAD()
 OVS_TRAFFIC_VSWITCHD_START()
 
 ADD_NAMESPACES(at_ns0, at_ns1)
@@ -4878,6 +4887,7 @@  OVS_TRAFFIC_VSWITCHD_STOP
 AT_CLEANUP
 
 AT_SETUP([conntrack - FTP])
+CHECK_NO_TC_OFFLOAD()
 AT_SKIP_IF([test $HAVE_FTP = no])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_ALG()
@@ -4987,6 +4997,7 @@  AT_SETUP([conntrack - FTP over IPv6])
 AT_SKIP_IF([test $HAVE_FTP = no])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_ALG()
+CHECK_NO_TC_OFFLOAD()
 OVS_TRAFFIC_VSWITCHD_START()
 
 ADD_NAMESPACES(at_ns0, at_ns1)
@@ -5042,6 +5053,7 @@  AT_SETUP([conntrack - IPv6 FTP Passive])
 AT_SKIP_IF([test $HAVE_FTP = no])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_ALG()
+CHECK_NO_TC_OFFLOAD()
 OVS_TRAFFIC_VSWITCHD_START()
 
 ADD_NAMESPACES(at_ns0, at_ns1)
@@ -5101,6 +5113,7 @@  AT_SETUP([conntrack - FTP with multiple expectations])
 AT_SKIP_IF([test $HAVE_FTP = no])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_ALG()
+CHECK_NO_TC_OFFLOAD()
 OVS_TRAFFIC_VSWITCHD_START()
 
 ADD_NAMESPACES(at_ns0, at_ns1)
@@ -5167,6 +5180,7 @@  AT_SETUP([conntrack - TFTP])
 AT_SKIP_IF([test $HAVE_TFTP = no])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_ALG()
+CHECK_NO_TC_OFFLOAD()
 OVS_TRAFFIC_VSWITCHD_START()
 
 ADD_NAMESPACES(at_ns0, at_ns1)
@@ -5802,6 +5816,7 @@  m4_define([CHECK_FTP_NAT],
     CHECK_CONNTRACK()
     CHECK_CONNTRACK_NAT()
     CHECK_CONNTRACK_ALG()
+    CHECK_NO_TC_OFFLOAD()
 
     OVS_TRAFFIC_VSWITCHD_START()
 
@@ -6109,6 +6124,7 @@  AT_SKIP_IF([test $HAVE_FTP = no])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_NAT()
 CHECK_CONNTRACK_ALG()
+CHECK_NO_TC_OFFLOAD()
 
 OVS_TRAFFIC_VSWITCHD_START()
 
@@ -6169,6 +6185,7 @@  AT_SKIP_IF([test $HAVE_FTP = no])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_NAT()
 CHECK_CONNTRACK_ALG()
+CHECK_NO_TC_OFFLOAD()
 
 OVS_TRAFFIC_VSWITCHD_START()
 
@@ -6229,6 +6246,7 @@  AT_SKIP_IF([test $HAVE_FTP = no])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_NAT()
 CHECK_CONNTRACK_ALG()
+CHECK_NO_TC_OFFLOAD()
 
 OVS_TRAFFIC_VSWITCHD_START()
 
@@ -6289,6 +6307,7 @@  AT_SKIP_IF([test $HAVE_FTP = no])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_NAT()
 CHECK_CONNTRACK_ALG()
+CHECK_NO_TC_OFFLOAD()
 
 OVS_TRAFFIC_VSWITCHD_START()
 
@@ -6349,6 +6368,7 @@  AT_SKIP_IF([test $HAVE_FTP = no])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_NAT()
 CHECK_CONNTRACK_ALG()
+CHECK_NO_TC_OFFLOAD()
 
 OVS_TRAFFIC_VSWITCHD_START()
 
@@ -6551,6 +6571,7 @@  AT_SKIP_IF([test $HAVE_FTP = no])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_NAT()
 CHECK_CONNTRACK_ALG()
+CHECK_NO_TC_OFFLOAD()
 
 OVS_TRAFFIC_VSWITCHD_START()
 
@@ -6611,6 +6632,7 @@  AT_SKIP_IF([test $HAVE_FTP = no])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_NAT()
 CHECK_CONNTRACK_ALG()
+CHECK_NO_TC_OFFLOAD()
 
 OVS_TRAFFIC_VSWITCHD_START()
 
@@ -6672,6 +6694,7 @@  AT_SKIP_IF([test $HAVE_FTP = no])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_NAT()
 CHECK_CONNTRACK_ALG()
+CHECK_NO_TC_OFFLOAD()
 OVS_TRAFFIC_VSWITCHD_START()
 
 ADD_NAMESPACES(at_ns0, at_ns1)
@@ -6732,6 +6755,7 @@  AT_SKIP_IF([test $HAVE_TFTP = no])
 CHECK_CONNTRACK()
 CHECK_CONNTRACK_NAT()
 CHECK_CONNTRACK_ALG()
+CHECK_NO_TC_OFFLOAD()
 
 OVS_TRAFFIC_VSWITCHD_START()
 
@@ -7106,6 +7130,7 @@  AT_SETUP([conntrack - Multiple ICMP traverse])
 dnl This tracks sending ICMP packets via conntrack multiple times for the
 dnl same packet
 CHECK_CONNTRACK()
+CHECK_NO_TC_OFFLOAD()
 OVS_TRAFFIC_VSWITCHD_START()
 OVS_CHECK_CT_CLEAR()
 
@@ -7148,6 +7173,7 @@  AT_CLEANUP
 
 AT_SETUP([conntrack - can match and clear ct_state from outside OVS])
 CHECK_CONNTRACK_LOCAL_STACK()
+CHECK_NO_TC_OFFLOAD()
 OVS_CHECK_TUNNEL_TSO()
 OVS_CHECK_GENEVE()
 
@@ -7196,6 +7222,7 @@  AT_CLEANUP
 AT_BANNER([IGMP])
 
 AT_SETUP([IGMP - flood under normal action])
+CHECK_NO_TC_OFFLOAD()
 
 OVS_TRAFFIC_VSWITCHD_START()
 ADD_NAMESPACES(at_ns0, at_ns1)
diff --git a/tests/system-userspace-macros.at b/tests/system-userspace-macros.at
index b34a84775..610fa2e94 100644
--- a/tests/system-userspace-macros.at
+++ b/tests/system-userspace-macros.at
@@ -325,3 +325,8 @@  m4_define([CHECK_L3L4_CONNTRACK_REASM],
 [
     AT_SKIP_IF([:])
 ])
+
+# CHECK_NO_TC_OFFLOAD
+#
+# Userspace tests do not use TC offload.
+m4_define([CHECK_NO_TC_OFFLOAD])