On 3 Sep 2026, at 16:36, Eli Britstein wrote:
> On 03/09/2026 15:48, 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]>
>>
>> ---
>> v4 changes:
>> - Moved the system-traffic related changes to a different patch,
>> which can be applied to main rather than dpdk-latest.
> LGTM. Ack.
Thanks for the review!
//Eelco
>> v3 changes:
>> - Shared DPDK offload macros to avoid duplicate code.
>>
>> 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=515611
>> ---
>> Documentation/topics/testing.rst | 23 ++++++
>> tests/.gitignore | 3 +
>> tests/automake.mk | 25 ++++++
>> tests/system-doca-offloads-macros.at | 20 +++++
>> tests/system-doca-offloads-testsuite.at | 28 +++++++
>> tests/system-doca-offloads.at | 104 ++++++++++++++++++++++++
>> tests/system-dpdk-offloads-macros.at | 40 +++++++--
>> 7 files changed, 234 insertions(+), 9 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
>>
>> 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..f2f2535b9 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,14 @@ 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 \
>> + tests/system-dpdk-offloads-macros.at
>> +
>> SYSTEM_DPDK_OFFLOADS_TESTSUITE_AT = \
>> tests/system-common-macros.at \
>> tests/system-dpdk-macros.at \
>> @@ -211,6 +221,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 +336,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 +390,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 +436,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..c440f1d22
>> --- /dev/null
>> +++ b/tests/system-doca-offloads-macros.at
>> @@ -0,0 +1,20 @@
>> +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.])
>> +
>> +# The OVS_DOCA_OFFLOAD flag is defined here before including
>> +# system-dpdk-offloads-macros.at, so that its m4_ifdef blocks expand
>> +# with DOCA-specific settings. This avoids code duplication between
>> +# the two offload macro files.
>> +m4_define([OVS_DOCA_OFFLOAD], [])
>> +m4_include([tests/system-dpdk-offloads-macros.at])
>> 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..9de982e59
>> --- /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_DPDK_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_DPDK_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])
>> +
>> +OVS_TRAFFIC_VSWITCHD_STOP
>> +AT_CLEANUP
>> diff --git a/tests/system-dpdk-offloads-macros.at
>> b/tests/system-dpdk-offloads-macros.at
>> index 8004966df..eae9130f0 100644
>> --- a/tests/system-dpdk-offloads-macros.at
>> +++ b/tests/system-dpdk-offloads-macros.at
>> @@ -69,11 +69,20 @@ m4_define([OVS_TRAFFIC_VSWITCHD_START],
>> OVS_DPDK_OFFLOAD_PRE_CHECK()
>> OVS_WAIT_WHILE([ip link show ovs-netdev])
>> OVS_DPDK_START([--disable-system],
>> - [-- set Open_vSwitch . other_config:hw-offload=true $3])
>> + [m4_ifdef([OVS_DOCA_OFFLOAD],
>> + [-- set Open_vSwitch . other_config:doca-init=true dnl
>> + -- set Open_vSwitch . other_config:hw-offload=true $3],
>> + [-- 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])
>> + m4_ifdef([OVS_DOCA_OFFLOAD], [
>> + pf_net=/sys/bus/pci/devices/$OVS_PF_PCI/net
>> + OVS_DOCA_PF_PORT=$(basename $(ls -d $pf_net/* 2>/dev/null | head -n 1))
>> + 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])
>> @@ -108,14 +117,23 @@ m4_define([ADD_VF],
>> VF=$(ovs_get_vf_port $OVS_PF_PCI $VF_IDX)
>> AT_CHECK([test -n "$VF"])
>>
>> + m4_ifdef([OVS_DOCA_OFFLOAD], [
>> + REP=$(ovs_get_representor_port $OVS_PF_PCI $VF_IDX)
>> + AT_CHECK([test -n "$REP"])
>> + AT_CHECK([ip link set $REP name ovs-$1 && \
>> + printf '%s\n' "$REP" > ORIG_REP_$1])])
>> +
>> AT_CHECK([ip link set $VF down])
>> AT_CHECK([ip link set $VF netns $2])
>> - AT_CHECK([ip netns exec $2 ip link set $VF name $1 && printf '%s\n'
>> "$VF" > ORIG_$1])
>> + AT_CHECK([ip netns exec $2 ip link set $VF name $1 && \
>> + printf '%s\n' "$VF" > ORIG_VF_$1])
>> AT_CHECK([ovs-vsctl add-port $3 ovs-$1 -- \
>> set interface ovs-$1 external-ids:iface-id="$1" -- \
>> - set interface ovs-$1 type=dpdk -- \
>> - set interface ovs-$1 \
>> - options:dpdk-devargs=$OVS_PF_PCI,representor=vf$VF_IDX])
>> + m4_ifdef([OVS_DOCA_OFFLOAD],
>> + [set interface ovs-$1 type=doca],
>> + [set interface ovs-$1 type=dpdk -- \
>> + set interface ovs-$1 \
>> +
>> options:dpdk-devargs=$OVS_PF_PCI,representor=vf$VF_IDX])])
>> 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
>> @@ -127,11 +145,15 @@ m4_define([ADD_VF],
>> if test -n "$6"; then
>> NS_CHECK_EXEC([$2], [ip route add default via $6])
>> fi
>> - on_exit "orig=\$(cat ORIG_$1); \
>> - rm -f ORIG_$1; \
>> + on_exit "orig_vf=\$(cat ORIG_VF_$1); \
>> + rm -f ORIG_VF_$1; \
>> ip netns exec $2 ip link set $1 down; \
>> - ip netns exec $2 ip link set $1 name \"\$orig\"; \
>> - ip netns exec $2 ip link set \"\$orig\" netns 1"
>> + ip netns exec $2 ip link set $1 name \"\$orig_vf\"; \
>> + ip netns exec $2 ip link set \"\$orig_vf\" netns 1"
>> + m4_ifdef([OVS_DOCA_OFFLOAD], [
>> + on_exit "orig_rep=\$(cat ORIG_REP_$1); \
>> + rm -f ORIG_REP_$1; \
>> + ip link set ovs-$1 name \"\$orig_rep\""])
>> ]
>> )
>> m4_define([ADD_VETH], [ADD_VF($@)])
>> --
>> 2.52.0
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev