On 29 Jul 2026, at 13:38, Eli Britstein wrote:

> On 08/07/2026 16:17, Eelco Chaudron wrote:
>> External email: Use caution opening links or attachments
>>
>>
>> This patch adds userspace DOCA offload unit tests. They can be run
>> with the 'make check-doca-offloads' command. More details on how to
>> set this up can be found in the testing.rst file.
>>
>> Signed-off-by: Eelco Chaudron <[email protected]>
>> ---
>>
>> v2 changes:
>>    - Fixed some style issues.
>>
>> NOTE: This patch requires the netdev-doca series patch sent out
>>        earlier by Eli Britstein. With the below version it's
>>        passing all the tests.
>>       https://patchwork.ozlabs.org/project/openvswitch/list/?series=511592
>> ---
>>   Documentation/topics/testing.rst        |  23 +++++
>>   tests/.gitignore                        |   3 +
>>   tests/automake.mk                       |  24 +++++
>>   tests/system-doca-offloads-macros.at    | 117 ++++++++++++++++++++++++
>>   tests/system-doca-offloads-testsuite.at |  28 ++++++
>>   tests/system-doca-offloads.at           | 104 +++++++++++++++++++++
>>   tests/system-dpdk-macros.at             |  10 ++
>>   tests/system-dpdk-offloads-macros.at    |   9 --
>>   tests/system-traffic.at                 |  24 ++---
>>   9 files changed, 321 insertions(+), 21 deletions(-)
>>   create mode 100644 tests/system-doca-offloads-macros.at
>>   create mode 100644 tests/system-doca-offloads-testsuite.at
>>   create mode 100644 tests/system-doca-offloads.at
>
> Hi Eelco,
>
>
> Thanks for working on this!
>
>
> There is a lot of duplication with system-dpdk-* files. It causes mistakes, 
> like missing applying relevant fixes like:
>
> ea43238cc23e ("tests: Fix VF name restore.")
>
> Maybe it worth to think of common files and dpdk/doca specialized files just 
> for the differences, or maybe one with "if dpdk, else if doca...".
>
> Some differences are not mandatory.  For example, with doca we must add the 
> ESW to ovs.  In dpdk we currently don't have to do it, but it won't matter if 
> we do.
>
> BTW, if/when dpdk deprecate the individual port offload and force using a 
> proxy ovs will have to migrate as well.
>
>
> See some more comments below.

Thanks for the feedback Eli! I'll be on PTO starting this Friday, but will 
rework the patch once I get back.

//Eelco

>>
>> diff --git a/Documentation/topics/testing.rst 
>> b/Documentation/topics/testing.rst
>> index 278b5c1d0..17bcf709b 100644
>> --- a/Documentation/topics/testing.rst
>> +++ b/Documentation/topics/testing.rst
>> @@ -262,6 +262,8 @@ The results of the testsuite are in 
>> ``tests/system-userspace-testsuite.dir``.
>>   All the features documented under `Unit Tests`_ are available for the 
>> userspace
>>   datapath testsuite.
>>
>> +.. _userspace-datapath-dpdk:
>> +
>>   Userspace datapath with DPDK
>>   ++++++++++++++++++++++++++++
>>
>> @@ -326,6 +328,27 @@ To invoke the DPDK offloads testsuite with the 
>> userspace datapath, run::
>>      This has only been tested on NVIDIA blades due to the limited 
>> availability
>>      of other blades that support rte_flow.
>>
>> +Userspace datapath with DOCA offload
>> +++++++++++++++++++++++++++++++++++++
>> +
>> +To invoke the userspace datapath tests with DOCA offload,
>> +the same prerequisites apply as for :ref:`userspace-datapath-dpdk`.
>> +In addition, six Virtual Function (VF) interfaces must be preconfigured on a
>> +single Physical Function (PF) that supports DOCA hardware offload.
>> +
>> +This is an example on how to set this up for an NVIDIA blade on port
>> +``ens2f0np0``::
>> +
>> +    OVS_PF_PCI=$(basename $(readlink /sys/class/net/ens2f0np0/device))
>> +    echo 0 > /sys/bus/pci/devices/$OVS_PF_PCI/sriov_numvfs
>> +    devlink dev eswitch set pci/$OVS_PF_PCI mode switchdev
>> +    echo 6 > /sys/bus/pci/devices/$OVS_PF_PCI/sriov_numvfs
>> +
>> +This PF's PCI ID needs to be passed with the OVS_PF_PCI variable.
>> +To invoke the DOCA offloads testsuite with the userspace datapath, run::
>> +
>> +    make check-doca-offloads OVS_PF_PCI=0000:17:00.0
>> +
>>   Kernel datapath
>>   +++++++++++++++
>>
>> diff --git a/tests/.gitignore b/tests/.gitignore
>> index b76025d9a..597c83a7f 100644
>> --- a/tests/.gitignore
>> +++ b/tests/.gitignore
>> @@ -32,6 +32,9 @@
>>   /system-offloads-testsuite
>>   /system-offloads-testsuite.dir/
>>   /system-offloads-testsuite.log
>> +/system-doca-offloads-testsuite
>> +/system-doca-offloads-testsuite.dir/
>> +/system-doca-offloads-testsuite.log
>>   /system-dpdk-offloads-testsuite
>>   /system-dpdk-offloads-testsuite.dir/
>>   /system-dpdk-offloads-testsuite.log
>> diff --git a/tests/automake.mk b/tests/automake.mk
>> index 544d91512..f60ff97bb 100644
>> --- a/tests/automake.mk
>> +++ b/tests/automake.mk
>> @@ -7,6 +7,7 @@ EXTRA_DIST += \
>>          $(SYSTEM_TSO_TESTSUITE_AT) \
>>          $(SYSTEM_AFXDP_TESTSUITE_AT) \
>>          $(SYSTEM_OFFLOADS_TESTSUITE_AT) \
>> +       $(SYSTEM_DOCA_OFFLOADS_TESTSUITE_AT) \
>>          $(SYSTEM_DPDK_OFFLOADS_TESTSUITE_AT) \
>>          $(SYSTEM_DPDK_TESTSUITE_AT) \
>>          $(OVSDB_CLUSTER_TESTSUITE_AT) \
>> @@ -16,6 +17,7 @@ EXTRA_DIST += \
>>          $(SYSTEM_TSO_TESTSUITE) \
>>          $(SYSTEM_AFXDP_TESTSUITE) \
>>          $(SYSTEM_OFFLOADS_TESTSUITE) \
>> +       $(SYSTEM_DOCA_OFFLOADS_TESTSUITE) \
>>          $(SYSTEM_DPDK_OFFLOADS_TESTSUITE) \
>>          $(SYSTEM_DPDK_TESTSUITE) \
>>          $(OVSDB_CLUSTER_TESTSUITE) \
>> @@ -189,6 +191,13 @@ SYSTEM_OFFLOADS_TESTSUITE_AT = \
>>          tests/system-offloads-testsuite.at \
>>          tests/system-offloads-testsuite-macros.at
>>
>> +SYSTEM_DOCA_OFFLOADS_TESTSUITE_AT = \
>> +       tests/system-common-macros.at \
>> +       tests/system-doca-offloads.at \
>> +       tests/system-doca-offloads-macros.at \
>> +       tests/system-doca-offloads-testsuite.at \
>> +       tests/system-dpdk-macros.at
>> +
>>   SYSTEM_DPDK_OFFLOADS_TESTSUITE_AT = \
>>          tests/system-common-macros.at \
>>          tests/system-dpdk-macros.at \
>> @@ -211,6 +220,7 @@ SYSTEM_USERSPACE_TESTSUITE = 
>> $(srcdir)/tests/system-userspace-testsuite
>>   SYSTEM_TSO_TESTSUITE = $(srcdir)/tests/system-tso-testsuite
>>   SYSTEM_AFXDP_TESTSUITE = $(srcdir)/tests/system-afxdp-testsuite
>>   SYSTEM_OFFLOADS_TESTSUITE = $(srcdir)/tests/system-offloads-testsuite
>> +SYSTEM_DOCA_OFFLOADS_TESTSUITE = 
>> $(srcdir)/tests/system-doca-offloads-testsuite
>>   SYSTEM_DPDK_OFFLOADS_TESTSUITE = 
>> $(srcdir)/tests/system-dpdk-offloads-testsuite
>>   SYSTEM_DPDK_TESTSUITE = $(srcdir)/tests/system-dpdk-testsuite
>>   OVSDB_CLUSTER_TESTSUITE = $(srcdir)/tests/ovsdb-cluster-testsuite
>> @@ -325,6 +335,12 @@ check-offloads-valgrind: all $(valgrind_wrappers) 
>> $(check_DATA)
>>          @echo 
>> '----------------------------------------------------------------------'
>>          @echo 'Valgrind output can be found in 
>> tests/system-offloads-testsuite.dir/*/valgrind.*'
>>          @echo 
>> '----------------------------------------------------------------------'
>> +check-doca-offloads-valgrind: all $(valgrind_wrappers) $(check_DATA)
>> +       $(SHELL) '$(SYSTEM_DOCA_OFFLOADS_TESTSUITE)' -C tests 
>> VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d 
>> $(TESTSUITEFLAGS) -j1
>> +       @echo
>> +       @echo 
>> '----------------------------------------------------------------------'
>> +       @echo 'Valgrind output can be found in 
>> tests/system-doca-offloads-testsuite.dir/*/valgrind.*'
>> +       @echo 
>> '----------------------------------------------------------------------'
>>   check-dpdk-offloads-valgrind: all $(valgrind_wrappers) $(check_DATA)
>>          $(SHELL) '$(SYSTEM_DPDK_OFFLOADS_TESTSUITE)' -C tests 
>> VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d 
>> $(TESTSUITEFLAGS) -j1
>>          @echo
>> @@ -373,6 +389,10 @@ check-offloads: all
>>          set $(SHELL) '$(SYSTEM_OFFLOADS_TESTSUITE)' -C tests  
>> AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
>>          "$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
>> --recheck)
>>
>> +check-doca-offloads: all
>> +       set $(SHELL) '$(SYSTEM_DOCA_OFFLOADS_TESTSUITE)' -C tests  
>> AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
>> +       "$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
>> --recheck)
>> +
>>   check-dpdk-offloads: all
>>          set $(SHELL) '$(SYSTEM_DPDK_OFFLOADS_TESTSUITE)' -C tests  
>> AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
>>          "$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" 
>> --recheck)
>> @@ -415,6 +435,10 @@ $(SYSTEM_OFFLOADS_TESTSUITE): package.m4 
>> $(SYSTEM_TESTSUITE_AT) $(SYSTEM_OFFLOAD
>>          $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o [email protected] [email protected]
>>          $(AM_V_at)mv [email protected] $@
>>
>> +$(SYSTEM_DOCA_OFFLOADS_TESTSUITE): package.m4 $(SYSTEM_TESTSUITE_AT) 
>> $(SYSTEM_DOCA_OFFLOADS_TESTSUITE_AT) $(COMMON_MACROS_AT)
>> +       $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o [email protected] [email protected]
>> +       $(AM_V_at)mv [email protected] $@
>> +
>>   $(SYSTEM_DPDK_OFFLOADS_TESTSUITE): package.m4 $(SYSTEM_TESTSUITE_AT) 
>> $(SYSTEM_DPDK_OFFLOADS_TESTSUITE_AT) $(COMMON_MACROS_AT)
>>          $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o [email protected] [email protected]
>>          $(AM_V_at)mv [email protected] $@
>> diff --git a/tests/system-doca-offloads-macros.at 
>> b/tests/system-doca-offloads-macros.at
>> new file mode 100644
>> index 000000000..71652210c
>> --- /dev/null
>> +++ b/tests/system-doca-offloads-macros.at
>> @@ -0,0 +1,117 @@
>> +AT_COPYRIGHT([Copyright (c) 2026 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.])
>> +
>> +# We also skip any DPDK_OFFLOAD-skipped tests for the same reasons.  For
>> +# details, see the macro definition in the system-dpdk-offloads-macros.at 
>> file.
>> +m4_define([CHECK_NO_DPDK_OFFLOAD],
>> +[
>> +     AT_SKIP_IF([:])
>> +])
>> +
>> +# OVS_DOCA_OFFLOAD_PRE_CHECK()
>> +#
>> +# Check prerequisites for DOCA tests, i.e. make sure PF exists with the
>> +# corresponding VFs.
>> +#
>> +m4_define([OVS_DOCA_OFFLOAD_PRE_CHECK], [
>> +  OVS_DPDK_PRE_CHECK()
>> +  AT_SKIP_IF([test -z "$OVS_PF_PCI"])
>> +  AT_SKIP_IF([! ovs_verify_pf_cfg "$OVS_PF_PCI"])
>> +])
>> +
>> +# OVS_TRAFFIC_VSWITCHD_START([vsctl-args], [vsctl-output], 
>> [dbinit-aux-args])
>> +#
>> +# This is a copy from system-dpdk-macro.at with the following changes:
>> +#  1) Use OVS_DOCA_OFFLOAD_PRE_CHECK() instead of OVS_DPDK_PRE_CHECK().
>> +#  2) Enable DOCA and hardware offload.
>> +#
>> +m4_define([OVS_TRAFFIC_VSWITCHD_START],
>> +  [
>> +   OVS_DOCA_OFFLOAD_PRE_CHECK()
>> +   OVS_DOCA_PF_PORT=$(basename $(ls -d 
>> /sys/bus/pci/devices/$OVS_PF_PCI/net/* \
>> +                                 2>/dev/null | head -n 1))
>> +   OVS_WAIT_WHILE([ip link show ovs-netdev])
>> +   OVS_DPDK_START([--disable-system],
>> +                  [-- set Open_vSwitch . other_config:doca-init=true dnl
> The first versions implied dpdk-init=true by doca-init=true.  You asked to 
> make it explicit.
>> +                   -- set Open_vSwitch . other_config:hw-offload=true $3])
>> +   dnl Add bridges, ports, etc.
>> +   OVS_WAIT_WHILE([ip link show br0])
>> +   AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [],
>> +            [| uuidfilt])], [0], [$2])
>> +   AT_CHECK([ovs-vsctl -- _ADD_BR([brPF])])
>> +   AT_CHECK([ovs-vsctl add-port brPF $OVS_DOCA_PF_PORT -- dnl
>> +             set interface $OVS_DOCA_PF_PORT type=doca])
>> +])
>> +
>> +# OVS_TRAFFIC_VSWITCHD_STOP([ALLOWLIST], [extra_cmds])
> See 75293d1eac1f ("tests: Remove ALLOW_LIST argument.")
>> +#
>> +# This is a copy from system-dpdk-macro.at adding some doca offload specific
>> +# error message exclusion.
>> +#
>> +m4_define([OVS_TRAFFIC_VSWITCHD_STOP],
>> +  [OVS_DPDK_STOP_VSWITCHD([dnl
>> +$1";/mlx5_net: Failed to update link status: /d"])
>> +   AT_CHECK([:; $2])
>> +])
>> +
>> +# ADD_{VF|VETH}([port], [namespace], [ovs-br], [ip_addr] [mac_addr], 
>> [gateway],
>> +#               [ip_addr_flags])
>> +#
>> +# Simulate the ADD_VETH() macro defined in system-common-macros.at, allowing
>> +# us to run the existing system-traffic unit tests without any test-specific
>> +# changes.  This is consistent with how DPDK and AF_XDP run the system 
>> tests,
>> +# except that we are not using actual veth devices, but VF representor 
>> ports.
>> +#
>> +m4_define([ADD_VF],
>> +    [ USER_PORT=$1
>> +      case "$USER_PORT" in
>> +        client) PORT_NO=0 ;;
>> +        server) PORT_NO=1 ;;
>
> The duplicated code for dpdk uses VF_IDX.  As written above, the preferred 
> way is common infrastructure to avoid as much as possible the duplication.
>
> If we must have some, let's keep them the same, without such differences.
>
>> +        *) PORT_NO=${USER_PORT##*[!0-9]} ;;
>> +      esac
>> +
>> +      AT_CHECK([[[ "$PORT_NO" -ge 0 ]] && [[ "$PORT_NO" -le 5 ]] || return 
>> 66])
>> +
>> +      VF=$(ovs_get_vf_port $OVS_PF_PCI $PORT_NO)
>> +      REP=$(ovs_get_representor_port $OVS_PF_PCI $PORT_NO)
>> +      AT_CHECK([test -n "$VF"])
>> +      AT_CHECK([test -n "$REP"])
>> +
>> +      AT_CHECK([ip link set $REP name ovs-$1])
>> +      AT_CHECK([ip link set $VF down])
>> +      AT_CHECK([ip link set $VF name $1])
>> +      AT_CHECK([ip link set $1 netns $2])
>> +      AT_CHECK([ovs-vsctl add-port $3 ovs-$1 -- \
>> +                set interface ovs-$1 external-ids:iface-id="$1" -- \
>> +                set interface ovs-$1 type=doca])
>> +
>> +      NS_CHECK_EXEC([$2], [ip addr add $4 dev $1 $7])
>> +      NS_CHECK_EXEC([$2], [ip link set dev $1 up])
>> +      if test -n "$5"; then
>> +        NS_CHECK_EXEC([$2], [ip link set dev $1 address $5])
>> +      else
>> +        NS_CHECK_EXEC([$2],
>> +                      [ip link set dev $1 address 02:00:00:00:EC:0$PORT_NO])
>> +      fi
>> +      if test -n "$6"; then
>> +        NS_CHECK_EXEC([$2], [ip route add default via $6])
>> +      fi
>> +      on_exit "ip netns exec $2 ip link set $1 netns 1; \
>> +               ip link property del dev $1 altname $VF; \
>> +               ip link property del dev ovs-$1 altname $REP; \
>> +               ip link set $1 name $VF; \
>> +               ip link set ovs-$1 name $REP"
> See ea43238cc23e ("tests: Fix VF name restore.")
>> +    ]
>> +)
>> +m4_define([ADD_VETH], [ADD_VF($@)])
>> diff --git a/tests/system-doca-offloads-testsuite.at 
>> b/tests/system-doca-offloads-testsuite.at
>> new file mode 100644
>> index 000000000..f69d872bf
>> --- /dev/null
>> +++ b/tests/system-doca-offloads-testsuite.at
>> @@ -0,0 +1,28 @@
>> +AT_INIT
>> +
>> +AT_COPYRIGHT([Copyright (c) 2026 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.])
>> +
>> +m4_ifdef([AT_COLOR_TESTS], [AT_COLOR_TESTS])
>> +
>> +m4_include([tests/ovs-macros.at])
>> +m4_include([tests/ovsdb-macros.at])
>> +m4_include([tests/ofproto-macros.at])
>> +m4_include([tests/system-common-macros.at])
>> +m4_include([tests/system-userspace-macros.at])
>> +m4_include([tests/system-dpdk-macros.at])
>> +m4_include([tests/system-doca-offloads-macros.at])
>> +
>> +m4_include([tests/system-doca-offloads.at])
>> +m4_include([tests/system-traffic.at])
>> diff --git a/tests/system-doca-offloads.at b/tests/system-doca-offloads.at
>> new file mode 100644
>> index 000000000..0b579a58c
>> --- /dev/null
>> +++ b/tests/system-doca-offloads.at
>> @@ -0,0 +1,104 @@
>> +AT_COPYRIGHT([Copyright (c) 2026 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.])
>> +
>> +AT_BANNER([DOCA offload unit tests])
>> +
>> +AT_SETUP([doca offload - ping between two hardware offloaded ports])
>> +OVS_DOCA_OFFLOAD_PRE_CHECK()
>> +OVS_TRAFFIC_VSWITCHD_START()
>> +AT_CHECK([ovs-appctl vlog/set netdev_doca:dbg])
>> +
>> +AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"])
>> +ADD_NAMESPACES(at_ns0, at_ns1)
>> +ADD_VF(p0, at_ns0, br0, "10.1.1.1/24")
>> +ADD_VF(p1, at_ns1, br0, "10.1.1.2/24")
>> +
>> +NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -W 2 10.1.1.2 \
>> +                         | FORMAT_PING], [0], [dnl
>> +3 packets transmitted, 3 received, 0% packet loss, time 0ms
>> +])
>> +
>> +# Once actual hardware offload is supported, type should be changed from 
>> 'ovs'
>> +# to 'doca,offloaded'.
>> +OVS_WAIT_UNTIL_EQUAL(
>> +  [ovs-appctl dpctl/dump-flows --names type=ovs \
>> +   | DUMP_DP_IP_CLEAN_SORTED], [dnl
>> +in_port(ovs-p0),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p1
>> +in_port(ovs-p1),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p0])
>> +
>> +OVS_TRAFFIC_VSWITCHD_STOP
>> +AT_CLEANUP
>> +
>> +AT_SETUP([doca offload - ping between six hardware offloaded ports])
>> +OVS_DOCA_OFFLOAD_PRE_CHECK()
>> +OVS_TRAFFIC_VSWITCHD_START()
>> +
>> +AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"])
>> +AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:max-idle=20000])
>> +ADD_NAMESPACES(at_ns0, at_ns1, at_ns2, at_ns3, at_ns4, at_ns5)
>> +ADD_VF(p0, at_ns0, br0, "10.1.1.1/24")
>> +ADD_VF(p1, at_ns1, br0, "10.1.1.2/24")
>> +ADD_VF(p2, at_ns2, br0, "10.1.1.3/24")
>> +ADD_VF(p3, at_ns3, br0, "10.1.1.4/24")
>> +ADD_VF(p4, at_ns4, br0, "10.1.1.5/24")
>> +ADD_VF(p5, at_ns5, br0, "10.1.1.6/24")
>> +
>> +for NS in $(seq 0 5); do
>> +    START=$((NS + 2))
>> +    for IP in $(seq "$START" 6); do
>> +        NS_CHECK_EXEC([at_ns$NS], [ping -q -c 3 -i 0.3 -W 2 10.1.1.$IP \
>> +                                   | FORMAT_PING], [0], [dnl
>> +3 packets transmitted, 3 received, 0% packet loss, time 0ms
>> +])
>> +    done
>> +done
>> +
>> +# Once actual hardware offload is supported, type should be changed from 
>> 'ovs'
>> +# to 'doca,offloaded'.
>> +OVS_WAIT_UNTIL_EQUAL(
>> +  [ovs-appctl dpctl/dump-flows --names type=ovs \
>> +   | DUMP_DP_IP_CLEAN_SORTED], [dnl
>> +in_port(ovs-p0),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p1
>> +in_port(ovs-p0),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p2
>> +in_port(ovs-p0),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p3
>> +in_port(ovs-p0),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p4
>> +in_port(ovs-p0),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p5
>> +in_port(ovs-p1),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p0
>> +in_port(ovs-p1),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p2
>> +in_port(ovs-p1),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p3
>> +in_port(ovs-p1),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p4
>> +in_port(ovs-p1),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p5
>> +in_port(ovs-p2),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p0
>> +in_port(ovs-p2),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p1
>> +in_port(ovs-p2),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p3
>> +in_port(ovs-p2),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p4
>> +in_port(ovs-p2),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p5
>> +in_port(ovs-p3),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p0
>> +in_port(ovs-p3),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p1
>> +in_port(ovs-p3),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p2
>> +in_port(ovs-p3),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p4
>> +in_port(ovs-p3),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p5
>> +in_port(ovs-p4),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p0
>> +in_port(ovs-p4),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p1
>> +in_port(ovs-p4),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p2
>> +in_port(ovs-p4),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p3
>> +in_port(ovs-p4),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p5
>> +in_port(ovs-p5),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p0
>> +in_port(ovs-p5),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p1
>> +in_port(ovs-p5),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p2
>> +in_port(ovs-p5),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p3
>> +in_port(ovs-p5),eth(macs),eth_type(0x0800),ipv4(frag=no), packets:2, 
>> bytes:196, used:0.0s, actions:ovs-p4])
> For dpdk there are more tests that we can run here as well (again, 
> duplicated...), even without offload support.  Those check more of 
> functionality than offloads anyway.
>> +
>> +OVS_TRAFFIC_VSWITCHD_STOP
>> +AT_CLEANUP
>> diff --git a/tests/system-dpdk-macros.at b/tests/system-dpdk-macros.at
>> index 3f0df2d9b..9575c90e9 100644
>> --- a/tests/system-dpdk-macros.at
>> +++ b/tests/system-dpdk-macros.at
>> @@ -200,3 +200,13 @@ m4_define([CONFIGURE_VETH_OFFLOADS],
>>       [AT_CHECK([ethtool -K $1 tx off], [0], [ignore], [ignore])
>>        AT_CHECK([ethtool -K $1 txvlan off], [0], [ignore], [ignore])]
>>   )
>> +
>> +
>> +# DUMP_DP_IP_CLEAN_SORTED()
>
> I would suggest to have it sorted as part of the code for dpctl/dump-flows 
> (we have such commit btw in our downstream version).
>
> It makes it easier to review as well, not only for testsuite. Once we have it 
> in place it can be used for the tests as well.
>
> If you want to keep it localized for the tests only, it should be done in 
> another commit.
>
>> +#
>> +# Clean up and sort the ovs-appctl dpctl/dump-flows output for comparing.
>> +#
>> +m4_define([DUMP_DP_IP_CLEAN_SORTED], [dnl
>> +  grep 'eth_type(0x0800)' \
>> +    | sed -e 
>> 's/eth(src=[[a-z0-9:]]*,dst=[[a-z0-9:]]*)/eth(macs)/;s/recirc_id(0),//' \
>> +    | strip_used | strip_ptype | sort])
>> diff --git a/tests/system-dpdk-offloads-macros.at 
>> b/tests/system-dpdk-offloads-macros.at
>> index 3c6cce1a8..8004966df 100644
>> --- a/tests/system-dpdk-offloads-macros.at
>> +++ b/tests/system-dpdk-offloads-macros.at
>> @@ -135,12 +135,3 @@ m4_define([ADD_VF],
>>       ]
>>   )
>>   m4_define([ADD_VETH], [ADD_VF($@)])
>> -
>> -# DUMP_DP_IP_CLEAN_SORTED()
>> -#
>> -# Clean up and sort the ovs-dpctl dump-flow output for comparing.
>> -#
>> -m4_define([DUMP_DP_IP_CLEAN_SORTED], [dnl
>> -  grep 'eth_type(0x0800)' \
>> -    | sed -e 
>> 's/eth(src=[[a-z0-9:]]*,dst=[[a-z0-9:]]*)/eth(macs)/;s/recirc_id(0),//' \
>> -    | strip_used | strip_ptype | sort])
>> diff --git a/tests/system-traffic.at b/tests/system-traffic.at
>> index f67e7d17a..19308b5c2 100644
>> --- a/tests/system-traffic.at
>> +++ b/tests/system-traffic.at
>> @@ -2207,9 +2207,9 @@ dnl SLOW_ACTION test1: check datapatch actions
>>   AT_CHECK([ovs-ofctl del-flows br0])
>>   AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
>>
>> -AT_CHECK([ovs-appctl ofproto/trace br0 
>> "in_port=1,dl_type=0x800,dl_src=e6:66:c1:11:11:11,dl_dst=e6:66:c1:22:22:22,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,tp_src=8,tp_dst=9"],
>>  [0], [stdout])
>> +AT_CHECK([ovs-appctl ofproto/trace --names br0 
>> "in_port=1,dl_type=0x800,dl_src=e6:66:c1:11:11:11,dl_dst=e6:66:c1:22:22:22,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,tp_src=8,tp_dst=9"],
>>  [0], [stdout])
>>   AT_CHECK([tail -3 stdout], [0],
>> -[Datapath actions: 
>> trunc(100),3,5,trunc(100),3,trunc(100),5,3,trunc(200),5,trunc(65535),3
>> +[Datapath actions: 
>> trunc(100),ovs-p1,ovs-p2,trunc(100),ovs-p1,trunc(100),ovs-p2,ovs-p1,trunc(200),ovs-p2,trunc(65535),ovs-p1
>>   This flow is handled by the userspace slow path because it:
>>     - Uses action(s) not supported by datapath.
>>   ])
>> @@ -2548,10 +2548,10 @@ AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
>>   dnl Generate some traffic.
>>   NS_CHECK_EXEC([at_ns0], [ping -q -c 10 -i 0.1 -w 2 10.1.1.2], [1], 
>> [ignore])
>>
>> -OVS_WAIT_UNTIL_EQUAL([ovs-appctl dpctl/dump-flows | grep "eth_type(0x0800)" 
>> | dnl
>> -                      strip_ptype | strip_eth | strip_recirc | strip_stats 
>> | dnl
>> -                      strip_used | sort], [dnl
>> -recirc_id(<recirc>),in_port(2),eth_type(0x0800),ipv4(frag=no), packets:0, 
>> bytes:0, used:0.0s, actions:drop])
>> +OVS_WAIT_UNTIL_EQUAL([ovs-appctl dpctl/dump-flows --names | dnl
>> +                      grep "eth_type(0x0800)" | strip_ptype | strip_eth | 
>> dnl
>> +                      strip_recirc | strip_stats | strip_used | sort], [dnl
>> +recirc_id(<recirc>),in_port(ovs-p0),eth_type(0x0800),ipv4(frag=no), 
>> packets:0, bytes:0, used:0.0s, actions:drop])
>>
>>   OVS_TRAFFIC_VSWITCHD_STOP(["/WARN/d"])
>>   AT_CLEANUP
>> @@ -2703,11 +2703,11 @@ NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py 
>> p0 \
>>       $(ovs-ofctl compose-packet --bare 
>> 'ND_NS_PKT,nd_target=2001::1:0:392')],
>>     [0], [ignore])
>>
>> -AT_CHECK([ovs-appctl dpctl/dump-flows | strip_stats | strip_used | dnl
>> +AT_CHECK([ovs-appctl dpctl/dump-flows --names | strip_stats | strip_used | 
>> dnl
>>             strip_key32 | strip_ptype | strip_eth | strip_recirc | dnl
>>             grep ",nd" | sort], [0], [dnl
>> -recirc_id(<recirc>),in_port(2),eth(src=36:b1:ee:7c:01:03,dst=36:b1:ee:7c:01:02),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=136),nd(target=2001::1:0:392),
>>  packets:0, bytes:0, used:never, actions:1,3
>> -recirc_id(<recirc>),in_port(2),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=136),nd(target=3000::1),
>>  packets:0, bytes:0, used:never, actions:drop
>> +recirc_id(<recirc>),in_port(ovs-p0),eth(src=36:b1:ee:7c:01:03,dst=36:b1:ee:7c:01:02),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=136),nd(target=2001::1:0:392),
>>  packets:0, bytes:0, used:never, actions:br0,ovs-p1
>> +recirc_id(<recirc>),in_port(ovs-p0),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=136),nd(target=3000::1),
>>  packets:0, bytes:0, used:never, actions:drop
>>   ])
>>
>>   OVS_WAIT_UNTIL([ovs-appctl dpctl/dump-flows | grep ",nd" | wc -l | grep -E 
>> ^0])
>> @@ -2722,11 +2722,11 @@ NS_CHECK_EXEC([at_ns0], [$PYTHON3 $srcdir/sendpkt.py 
>> p0 \
>>       $(ovs-ofctl compose-packet --bare 'ND_NS_PKT,nd_target=3000::1')],
>>     [0], [ignore])
>>
>> -AT_CHECK([ovs-appctl dpctl/dump-flows | strip_stats | strip_used | dnl
>> +AT_CHECK([ovs-appctl dpctl/dump-flows --names | strip_stats | strip_used | 
>> dnl
>>             strip_key32 | strip_ptype | strip_eth | strip_recirc | dnl
>>             grep ",nd" | sort], [0], [dnl
>> -recirc_id(<recirc>),in_port(2),eth(src=36:b1:ee:7c:01:03,dst=36:b1:ee:7c:01:02),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=136),nd(target=2001::1:0:392),
>>  packets:0, bytes:0, used:never, actions:1,3
>> -recirc_id(<recirc>),in_port(2),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=136),nd(target=3000::1),
>>  packets:0, bytes:0, used:never, actions:drop
>> +recirc_id(<recirc>),in_port(ovs-p0),eth(src=36:b1:ee:7c:01:03,dst=36:b1:ee:7c:01:02),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=136),nd(target=2001::1:0:392),
>>  packets:0, bytes:0, used:never, actions:br0,ovs-p1
>> +recirc_id(<recirc>),in_port(ovs-p0),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=136),nd(target=3000::1),
>>  packets:0, bytes:0, used:never, actions:drop
>>   ])
>>
>>   OVS_TRAFFIC_VSWITCHD_STOP
>> --
>> 2.54.0
>>

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to