{"id":1829630,"url":"http://patchwork.ozlabs.org/api/patches/1829630/","web_url":"http://patchwork.ozlabs.org/project/openvswitch/patch/20230904140502.1532791-6-david.marchand@redhat.com/","project":{"id":47,"url":"http://patchwork.ozlabs.org/api/projects/47/","name":"Open vSwitch","link_name":"openvswitch","list_id":"ovs-dev.openvswitch.org","list_email":"ovs-dev@openvswitch.org","web_url":"http://openvswitch.org/","scm_url":"git@github.com:openvswitch/ovs.git","webscm_url":"https://github.com/openvswitch/ovs","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20230904140502.1532791-6-david.marchand@redhat.com>","list_archive_url":null,"date":"2023-09-04T14:05:02","name":"[ovs-dev,v5,6/6] system-dpdk: Run traffic tests.","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"f7b76f5a3ba488b85297b9d0e4e720427d69191f","submitter":{"id":75396,"url":"http://patchwork.ozlabs.org/api/people/75396/","name":"David Marchand","email":"david.marchand@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/openvswitch/patch/20230904140502.1532791-6-david.marchand@redhat.com/mbox/","series":[{"id":371616,"url":"http://patchwork.ozlabs.org/api/series/371616/","web_url":"http://patchwork.ozlabs.org/project/openvswitch/list/?series=371616","date":"2023-09-04T14:04:57","name":"[ovs-dev,v5,1/6] system-dpdk: Introduce helpers for testpmd.","version":5,"mbox":"http://patchwork.ozlabs.org/series/371616/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/1829630/comments/","check":"fail","checks":"http://patchwork.ozlabs.org/api/patches/1829630/checks/","tags":{},"related":[],"headers":{"Return-Path":"<ovs-dev-bounces@openvswitch.org>","X-Original-To":["incoming@patchwork.ozlabs.org","dev@openvswitch.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ovs-dev@lists.linuxfoundation.org"],"Authentication-Results":"legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=140.211.166.138; helo=smtp1.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org)","Received":["from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4RfVm53NmHz1yhH\n\tfor <incoming@patchwork.ozlabs.org>; Tue,  5 Sep 2023 00:05:57 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id E28DB81EA7;\n\tMon,  4 Sep 2023 14:05:54 +0000 (UTC)","from smtp1.osuosl.org ([127.0.0.1])\n\tby localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id auy4gHqdQZXc; Mon,  4 Sep 2023 14:05:52 +0000 (UTC)","from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp1.osuosl.org (Postfix) with ESMTPS id 1422781EC5;\n\tMon,  4 Sep 2023 14:05:50 +0000 (UTC)","from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id B440EC0039;\n\tMon,  4 Sep 2023 14:05:50 +0000 (UTC)","from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 02C9FC0032\n for <dev@openvswitch.org>; Mon,  4 Sep 2023 14:05:49 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp3.osuosl.org (Postfix) with ESMTP id D5D5A610B6\n for <dev@openvswitch.org>; Mon,  4 Sep 2023 14:05:36 +0000 (UTC)","from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id ilb9zQAv799v for <dev@openvswitch.org>;\n Mon,  4 Sep 2023 14:05:35 +0000 (UTC)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by smtp3.osuosl.org (Postfix) with ESMTPS id 72278610A0\n for <dev@openvswitch.org>; Mon,  4 Sep 2023 14:05:34 +0000 (UTC)","from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-500-LoXVpVLaMveWv2cCbTe3Vw-1; Mon, 04 Sep 2023 10:05:30 -0400","from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com\n [10.11.54.1])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CF31E8759E0;\n Mon,  4 Sep 2023 14:05:29 +0000 (UTC)","from dmarchan.redhat.com (unknown [10.45.225.216])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 9B42540C206F;\n Mon,  4 Sep 2023 14:05:28 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 smtp1.osuosl.org E28DB81EA7","OpenDKIM Filter v2.11.0 smtp1.osuosl.org 1422781EC5","OpenDKIM Filter v2.11.0 smtp3.osuosl.org D5D5A610B6","OpenDKIM Filter v2.11.0 smtp3.osuosl.org 72278610A0"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org"],"X-MC-Unique":"LoXVpVLaMveWv2cCbTe3Vw-1","From":"David Marchand <david.marchand@redhat.com>","To":"dev@openvswitch.org","Date":"Mon,  4 Sep 2023 16:05:02 +0200","Message-ID":"<20230904140502.1532791-6-david.marchand@redhat.com>","In-Reply-To":"<20230904140502.1532791-1-david.marchand@redhat.com>","References":"<20230904140502.1532791-1-david.marchand@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.1 on 10.11.54.1","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Cc":"Flavio Leitner <fbl@redhat.com>, Ilya Maximets <i.maximets@ovn.org>","Subject":"[ovs-dev] [PATCH v5 6/6] system-dpdk: Run traffic tests.","X-BeenThere":"ovs-dev@openvswitch.org","X-Mailman-Version":"2.1.15","Precedence":"list","List-Id":"<ovs-dev.openvswitch.org>","List-Unsubscribe":"<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>","List-Archive":"<http://mail.openvswitch.org/pipermail/ovs-dev/>","List-Post":"<mailto:ovs-dev@openvswitch.org>","List-Help":"<mailto:ovs-dev-request@openvswitch.org?subject=help>","List-Subscribe":"<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"ovs-dev-bounces@openvswitch.org","Sender":"\"dev\" <ovs-dev-bounces@openvswitch.org>"},"content":"Integrate system-traffic.at tests as part of check-dpdk.\n\nSome tests that can't work with the userspace datapath are skipped by\noverriding some OVS_CHECK_* macros.\n\nADD_VETH is implemented using the net/af_xdp DPDK driver.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\nChanges since v4:\n- switched to net/af_xdp, this removes the tweaking needed for net/tap,\n  and it lets existing tool relying on kernel netdevs. veth offloading\n  still needs some tweaking,\n\nChanges since v3:\n- reverted --dummy-numa and opted for configuring a number of rxqs\n  relevant to the number of NUMA sockets,\n\nChanges since v2:\n- added ADD_VETH_IGNORE_LOGS and moved ignored error logs to\n  OVS_TRAFFIC_VSWITCHD_STOP,\n- added --no-pci to DPDK options to avoid failing the tests when\n  running in a vm with a virtio-net device,\n- faked a mono numa/mono core so that OVS requests at max 2 txqs on\n  the net/tap port,\n\n---\n .ci/dpdk-build.sh                    |  2 +-\n .github/workflows/build-and-test.yml |  2 +-\n tests/system-dpdk-macros.at          | 77 ++++++++++++++++++++++++++++\n tests/system-dpdk-testsuite.at       |  2 +\n tests/system-dpdk.at                 |  3 --\n 5 files changed, 81 insertions(+), 5 deletions(-)","diff":"diff --git a/.ci/dpdk-build.sh b/.ci/dpdk-build.sh\nindex a754809d3d..4004239130 100755\n--- a/.ci/dpdk-build.sh\n+++ b/.ci/dpdk-build.sh\n@@ -39,7 +39,7 @@ function build_dpdk()\n     # check-dpdk unit tests requires testpmd and some net/ driver.\n     # We can disable all drivers but them, in order to save compilation time.\n     DPDK_OPTS=\"$DPDK_OPTS -Denable_apps=test-pmd\"\n-    DPDK_OPTS=\"$DPDK_OPTS -Denable_drivers=net/null,net/tap,net/virtio\"\n+    DPDK_OPTS=\"$DPDK_OPTS -Denable_drivers=net/null,net/af_xdp,net/tap,net/virtio\"\n \n     # Install DPDK using prefix.\n     DPDK_OPTS=\"$DPDK_OPTS --prefix=$(pwd)/build\"\ndiff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml\nindex 4f62efb7c3..09654205e7 100644\n--- a/.github/workflows/build-and-test.yml\n+++ b/.github/workflows/build-and-test.yml\n@@ -5,7 +5,7 @@ on: [push, pull_request]\n jobs:\n   build-dpdk:\n     env:\n-      dependencies: gcc libnuma-dev ninja-build\n+      dependencies: gcc libbpf-dev libnuma-dev ninja-build pkgconf\n       CC: gcc\n       DPDK_GIT: https://dpdk.org/git/dpdk-stable\n       DPDK_VER: 22.11.1\ndiff --git a/tests/system-dpdk-macros.at b/tests/system-dpdk-macros.at\nindex f29b3c283f..c73d90e3e1 100644\n--- a/tests/system-dpdk-macros.at\n+++ b/tests/system-dpdk-macros.at\n@@ -124,3 +124,80 @@ m4_define([OVS_DPDK_STOP_TESTPMD],\n   [AT_CHECK([kill `cat testpmd.pid`])\n    OVS_WAIT([kill -0 `cat testpmd.pid`], [kill -9 `cat testpmd.pid`])\n ])\n+\n+\n+# OVS_TRAFFIC_VSWITCHD_START([vsctl-args], [vsctl-output], [dbinit-aux-args])\n+#\n+# Creates a database and starts ovsdb-server, starts ovs-vswitchd\n+# connected to that database, calls ovs-vsctl to create a bridge named\n+# br0 with predictable settings, passing 'vsctl-args' as additional\n+# commands to ovs-vsctl.  If 'vsctl-args' causes ovs-vsctl to provide\n+# output (e.g. because it includes \"create\" commands) then 'vsctl-output'\n+# specifies the expected output after filtering through uuidfilt.\n+# 'dbinit-aux-args' are passed as additional commands to 'ovs-vsctl init'\n+# before starting ovs-vswitchd.\n+m4_define([OVS_TRAFFIC_VSWITCHD_START],\n+  [\n+   OVS_DPDK_PRE_CHECK()\n+   OVS_WAIT_WHILE([ip link show ovs-netdev])\n+   dnl For functional tests, no need for DPDK PCI probing.\n+   OVS_DPDK_START([--no-pci], [--disable-system], [$3])\n+   dnl Add bridges, ports, etc.\n+   OVS_WAIT_WHILE([ip link show br0])\n+   AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [], [| uuidfilt])], [0], [$2])\n+])\n+\n+\n+# OVS_TRAFFIC_VSWITCHD_STOP([ALLOWLIST], [extra_cmds])\n+#\n+# Gracefully stops ovs-vswitchd and ovsdb-server, checking their log files\n+# for messages with severity WARN or higher and signaling an error if any\n+# is present.  The optional ALLOWLIST may contain shell-quoted \"sed\"\n+# commands to delete any warnings that are actually expected, e.g.:\n+#\n+#   OVS_TRAFFIC_VSWITCHD_STOP([\"/expected error/d\"])\n+#\n+# 'extra_cmds' are shell commands to be executed after OVS_VSWITCHD_STOP() is\n+# invoked. They can be used to perform additional cleanups such as name space\n+# removal.\n+m4_define([OVS_TRAFFIC_VSWITCHD_STOP],\n+  [OVS_DPDK_STOP_VSWITCHD([$1])\n+   AT_CHECK([:; $2])\n+])\n+\n+\n+# Plug a veth by into OVS via DPDK net/af_xdp.\n+m4_define([ADD_VETH],\n+    [ AT_CHECK([ip link add $1 type veth peer name ovs-$1 || return 77])\n+      CONFIGURE_VETH_OFFLOADS([$1])\n+      AT_CHECK([ip link set $1 netns $2])\n+      AT_CHECK([ip link set dev ovs-$1 up])\n+      AT_CHECK([ovs-vsctl add-port $3 ovs-$1 -- \\\n+                set interface ovs-$1 external-ids:iface-id=\"$1\" -- \\\n+                set interface ovs-$1 type=dpdk -- \\\n+                set interface ovs-$1 options:dpdk-devargs=net_af_xdp$1,iface=ovs-$1])\n+      NS_CHECK_EXEC([$2], [ip addr add $4 dev $1 $7])\n+      NS_CHECK_EXEC([$2], [ip link set dev $1 up])\n+      if test -n \"$5\"; then\n+        NS_CHECK_EXEC([$2], [ip link set dev $1 address $5])\n+      fi\n+      if test -n \"$6\"; then\n+        NS_CHECK_EXEC([$2], [ip route add default via $6])\n+      fi\n+      on_exit 'ip link del ovs-$1'\n+    ]\n+)\n+\n+\n+m4_define([OVS_CHECK_8021AD],\n+    [AT_SKIP_IF([:])])\n+\n+\n+m4_define([OVS_CHECK_TC_QDISC],\n+    [AT_SKIP_IF([:])])\n+\n+\n+m4_define([CONFIGURE_VETH_OFFLOADS],\n+    [AT_CHECK([ethtool -K $1 tx off], [0], [ignore], [ignore])\n+     AT_CHECK([ethtool -K $1 txvlan off], [0], [ignore], [ignore])]\n+)\ndiff --git a/tests/system-dpdk-testsuite.at b/tests/system-dpdk-testsuite.at\nindex 382f09e9ff..f61fbf9212 100644\n--- a/tests/system-dpdk-testsuite.at\n+++ b/tests/system-dpdk-testsuite.at\n@@ -20,6 +20,8 @@ m4_include([tests/ovs-macros.at])\n m4_include([tests/ovsdb-macros.at])\n m4_include([tests/ofproto-macros.at])\n m4_include([tests/system-common-macros.at])\n+m4_include([tests/system-userspace-macros.at])\n m4_include([tests/system-dpdk-macros.at])\n \n m4_include([tests/system-dpdk.at])\n+m4_include([tests/system-traffic.at])\ndiff --git a/tests/system-dpdk.at b/tests/system-dpdk.at\nindex e8a04d1d86..3e3223c02d 100644\n--- a/tests/system-dpdk.at\n+++ b/tests/system-dpdk.at\n@@ -1,6 +1,3 @@\n-m4_define([CONFIGURE_VETH_OFFLOADS],\n-   [AT_CHECK([ethtool -K $1 tx off], [0], [ignore], [ignore])])\n-\n AT_BANNER([OVS-DPDK unit tests])\n \n dnl CHECK_MEMPOOL_PARAM([mtu], [numa], [+line])\n","prefixes":["ovs-dev","v5","6/6"]}