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.

I'll send out a v3 soon. I've modified the existing DPDK macros so they can be 
reused for DOCA. Thanks for the suggestion, as this cleaned it up nicely.

[...]

>> +
>> +# OVS_TRAFFIC_VSWITCHD_STOP([ALLOWLIST], [extra_cmds])
> See 75293d1eac1f ("tests: Remove ALLOW_LIST argument.")

This is for the START() macro, not the stop. But we reuse all the DPDK macro's 
now.

>> +#
>> +# 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.

Cleaned up by re-using DPDK code.

[...]


>> +# 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.

For now, I kept it as is, as we have no offload support for the netdev-doca 
series. The plan is to apply the patch at the same time as your series, so we 
have a test framework in place when we need to rebase dpdk-latest. Once the 
provider part is in, we can unify this into a macro. These two cases are there 
to test the VF infrastructure.

>> +
>> +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])]
>>   )
>> +
>> +
>> +#
>> ()
>
> 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.

For this patch, we just move the macro up so we can use it in the affected test 
cases. I guess we could add an option to dpctl/dump-flows to sort its output. 
If you have such a patch, please submit it for review.

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

Reply via email to