From patchwork Wed Nov 24 21:24:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 1559374 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AQ1OrE3u; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HzvDd19txz9sRN for ; Thu, 25 Nov 2021 08:25:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id EDE6C61BE5; Wed, 24 Nov 2021 21:25:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UA5VlhUgUfB0; Wed, 24 Nov 2021 21:25:18 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 1090160BC5; Wed, 24 Nov 2021 21:25:17 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DC02CC0039; Wed, 24 Nov 2021 21:25:16 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id E40A6C000A for ; Wed, 24 Nov 2021 21:25:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 038EE409A3 for ; Wed, 24 Nov 2021 21:24:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8JTx_LO3MLhc for ; Wed, 24 Nov 2021 21:24:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 162934093E for ; Wed, 24 Nov 2021 21:24:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637789082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LZVicWzdfn2RYQk1Lz27l66vjyi89zqoKAqCq8gHyXk=; b=AQ1OrE3udWBT8UO86D5CcTKVwW1lAJXrFsHQzIrWwHfTXZnw+vVVl9bahOL5WrsCaB618T Ss2EciDBHpf0rL5iYi7zPFkHpkgIwZDgqiYeRfr4Mi04wuEy2xdLwvqZnPFZ/Zb0o/4PHx OizJPE+wDNJ2iJK/TxVY8EcZrtt6PsE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-166-14m5ARH8N1qDSRO1KNkYYQ-1; Wed, 24 Nov 2021 16:24:38 -0500 X-MC-Unique: 14m5ARH8N1qDSRO1KNkYYQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D683FA40C1; Wed, 24 Nov 2021 21:24:37 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.39.208.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0715CADD6; Wed, 24 Nov 2021 21:24:24 +0000 (UTC) From: Maxime Coquelin To: dev@openvswitch.org Date: Wed, 24 Nov 2021 22:24:00 +0100 Message-Id: <20211124212400.70613-5-maxime.coquelin@redhat.com> In-Reply-To: <20211124212400.70613-1-maxime.coquelin@redhat.com> References: <20211124212400.70613-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: fbl@sysclose.org, Maxime Coquelin , i.maximets@ovn.org, david.marchand@redhat.com Subject: [ovs-dev] [PATCH 4/4] system-dpdk: Add tests for HXPS X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" This patch adds two tests for Vhost-user client ports with multiqueue. First test is with HXPS disabled, where the expectation is that a single queue Vhost-user queue receives the 256 packets injected on the dummy port. Second test is with HXPS enabled, where the expectation is that the 256 packets injected on the dummy port are are spread on the two vhsot-user queues. Signed-off-by: Maxime Coquelin --- tests/system-dpdk.at | 135 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at index 894e01316..2cb81729c 100644 --- a/tests/system-dpdk.at +++ b/tests/system-dpdk.at @@ -223,6 +223,141 @@ OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [ AT_CLEANUP dnl -------------------------------------------------------------------------- +dnl -------------------------------------------------------------------------- +dnl Multiqueue, HXPS disabled (default) with vhost-user-client port +AT_SETUP([OVS-DPDK - MQ, HXPS disabled with vhost-user-client port]) +AT_KEYWORDS([dpdk]) +OVS_DPDK_PRE_CHECK() +AT_SKIP_IF([! which dpdk-testpmd >/dev/null 2>/dev/null]) +AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], []) +OVS_DPDK_START() + +dnl Find number of sockets +AT_CHECK([lscpu], [], [stdout]) +AT_CHECK([cat stdout | grep "NUMA node(s)" | awk '{c=1; while (c++<$(3)) {printf "512,"}; print "512"}' > NUMA_NODE]) + +dnl Add userspace bridge and attach it to OVS +AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev]) +AT_CHECK([ovs-vsctl add-port br10 dummy0 -- set interface dummy0 type=dummy-pmd]) +AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface \ + dpdkvhostuserclient0 \ + type=dpdkvhostuserclient \ + options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], + [stdout], [stderr]) +AT_CHECK([ovs-vsctl show], [], [stdout]) + +dnl Parse log file +AT_CHECK([grep "VHOST_CONFIG: vhost-user client: socket created" ovs-vswitchd.log], [], [stdout]) +AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout]) +AT_CHECK([grep "VHOST_CONFIG: $OVS_RUNDIR/dpdkvhostclient0: reconnecting..." ovs-vswitchd.log], [], [stdout]) + +dnl Execute testpmd in background +on_exit "pkill -f -x -9 'tail -f /dev/null'" +tail -f /dev/null | dpdk-testpmd --socket-mem="$(cat NUMA_NODE)" --no-pci\ + --vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1,queues=2" \ + --file-prefix page0 --single-file-segments -- \ + --rxq=2 --txq=2 --nb-cores=1 --forward-mode=rxonly -a \ + >$OVS_RUNDIR/testpmd-dpdkvhostuserclient0.log 2>&1 & + +OVS_WAIT_UNTIL([grep "assigned port 'dpdkvhostuserclient0' rx queue 1" ovs-vswitchd.log]) + +on_exit "pkill -f -x -9 '$PYTHON3 $srcdir/mfex_pkts.py 256 fuzz'" +($PYTHON3 $srcdir/genpkts.py 256 fuzz | while read pkt; do + ovs-appctl netdev-dummy/receive dummy0 "$pkt" || break + done) + +OVS_WAIT_UNTIL([test `ovs-vsctl get Interface dpdkvhostuserclient0 statistics:tx_packets` -eq 256]) +AT_CHECK([ovs-vsctl get Interface dpdkvhostuserclient0 statistics], [], [stdout]) +AT_CHECK([[[[ `ovs-vsctl get Interface dpdkvhostuserclient0 statistics:tx_q0_packets` -eq 0 && \ + `ovs-vsctl get Interface dpdkvhostuserclient0 statistics:tx_q1_packets` -eq 256 ]]] || \ + [[[ `ovs-vsctl get Interface dpdkvhostuserclient0 statistics:tx_q0_packets` -eq 256 && \ + `ovs-vsctl get Interface dpdkvhostuserclient0 statistics:tx_q1_packets` -eq 0 ]]]]) + +dnl Clean up the testpmd now +pkill -f -x -9 'tail -f /dev/null' + +dnl Clean up +AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr]) +AT_CHECK([ovs-vsctl del-port br10 dummy0], [], [stdout], [stderr]) +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [ +\@Failed to enable flow control@d +\@VHOST_CONFIG: recvmsg failed@d +\@VHOST_CONFIG: failed to connect to $OVS_RUNDIR/dpdkvhostclient0: No such file or directory@d +\@dpdkvhostuser ports are considered deprecated; please migrate to dpdkvhostuserclient ports.@d +\@failed to enumerate system datapaths: No such file or directory@d +])") +AT_CLEANUP +dnl -------------------------------------------------------------------------- + +dnl -------------------------------------------------------------------------- +dnl Multiqueue, HXPS enabled with vhost-user-client port +AT_SETUP([OVS-DPDK - MQ, HXPS enabled with vhost-user-client port]) +AT_KEYWORDS([dpdk]) +OVS_DPDK_PRE_CHECK() +AT_SKIP_IF([! which dpdk-testpmd >/dev/null 2>/dev/null]) +AT_SKIP_IF([! $PYTHON3 -c "import scapy"], [], []) +OVS_DPDK_START() + +dnl Find number of sockets +AT_CHECK([lscpu], [], [stdout]) +AT_CHECK([cat stdout | grep "NUMA node(s)" | awk '{c=1; while (c++<$(3)) {printf "512,"}; print "512"}' > NUMA_NODE]) + +dnl Add userspace bridge and attach it to OVS +AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev]) +AT_CHECK([ovs-vsctl add-port br10 dummy0 -- set interface dummy0 type=dummy-pmd]) +AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuserclient0 -- set Interface \ + dpdkvhostuserclient0 \ + type=dpdkvhostuserclient \ + options:vhost-server-path=$OVS_RUNDIR/dpdkvhostclient0], [], + [stdout], [stderr]) +AT_CHECK([ovs-vsctl show], [], [stdout]) + +dnl Parse log file +AT_CHECK([grep "VHOST_CONFIG: vhost-user client: socket created" ovs-vswitchd.log], [], [stdout]) +AT_CHECK([grep "vHost User device 'dpdkvhostuserclient0' created in 'client' mode, using client socket" ovs-vswitchd.log], [], [stdout]) +AT_CHECK([grep "VHOST_CONFIG: $OVS_RUNDIR/dpdkvhostclient0: reconnecting..." ovs-vswitchd.log], [], [stdout]) + +dnl Enable HXPS +AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 other_config:hxps=true], + [], [stdout], [stderr]) +AT_CHECK([grep "dpdkvhostuserclient0: Txq HXPS mode has been enabled" ovs-vswitchd.log], [], [stdout]) + +dnl Execute testpmd in background +on_exit "pkill -f -x -9 'tail -f /dev/null'" +tail -f /dev/null | dpdk-testpmd --socket-mem="$(cat NUMA_NODE)" --no-pci\ + --vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1,queues=2" \ + --file-prefix page0 --single-file-segments -- \ + --rxq=2 --txq=2 --nb-cores=1 --forward-mode=rxonly -a \ + >$OVS_RUNDIR/testpmd-dpdkvhostuserclient0.log 2>&1 & + +OVS_WAIT_UNTIL([grep "assigned port 'dpdkvhostuserclient0' rx queue 1" ovs-vswitchd.log]) + +on_exit "pkill -f -x -9 '$PYTHON3 $srcdir/mfex_pkts.py 256 fuzz'" +($PYTHON3 $srcdir/genpkts.py 256 fuzz | while read pkt; do + ovs-appctl netdev-dummy/receive dummy0 "$pkt" || break + done) + +OVS_WAIT_UNTIL([test `ovs-vsctl get Interface dpdkvhostuserclient0 statistics:tx_packets` -eq 256]) +AT_CHECK([ovs-vsctl get Interface dpdkvhostuserclient0 statistics], [], [stdout]) +AT_CHECK([[[[ `ovs-vsctl get Interface dpdkvhostuserclient0 statistics:tx_q0_packets` -ge 0 && \ + `ovs-vsctl get Interface dpdkvhostuserclient0 statistics:tx_q1_packets` -ge 0 ]]]]) + +dnl Clean up the testpmd now +pkill -f -x -9 'tail -f /dev/null' + +dnl Clean up +AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr]) +AT_CHECK([ovs-vsctl del-port br10 dummy0], [], [stdout], [stderr]) +OVS_VSWITCHD_STOP("m4_join([], [SYSTEM_DPDK_ALLOWED_LOGS], [ +\@Failed to enable flow control@d +\@VHOST_CONFIG: recvmsg failed@d +\@VHOST_CONFIG: failed to connect to $OVS_RUNDIR/dpdkvhostclient0: No such file or directory@d +\@dpdkvhostuser ports are considered deprecated; please migrate to dpdkvhostuserclient ports.@d +\@failed to enumerate system datapaths: No such file or directory@d +])") +AT_CLEANUP +dnl -------------------------------------------------------------------------- + dnl -------------------------------------------------------------------------- dnl Add standard DPDK PHY port AT_SETUP([OVS-DPDK - MFEX Autovalidator])