From patchwork Thu May 14 11:48:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gowrishankar Muthukrishnan X-Patchwork-Id: 1290185 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: 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=SWInS0VK; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49N8tx0mSVz9sTL for ; Thu, 14 May 2020 21:48:24 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 93ED188A32; Thu, 14 May 2020 11:48:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uaC+rB4z1mQt; Thu, 14 May 2020 11:48:20 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 5BCBF86959; Thu, 14 May 2020 11:48:20 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3BDB8C0891; Thu, 14 May 2020 11:48:20 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 16E74C016F for ; Thu, 14 May 2020 11:48:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 06E9687A32 for ; Thu, 14 May 2020 11:48:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rOIoOsZIMK4s for ; Thu, 14 May 2020 11:48:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 2503987A35 for ; Thu, 14 May 2020 11:48:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589456896; 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=+iqrccw4Oz+P7IrCqlVBHISb14qEj5fFjxvYJ3fNPFY=; b=SWInS0VKjq+F3CwWMXrjznlB5lwpHCXvFXCYuQd/yyjfuURgJ+kI8WgnhAVGTNY5QMV0kb RHDkXi1K3IIHjIxomYlWrChjDC/0GecvQ4a1vAgu9cBwMuD8Yyv5pbMZBow9OUJLcjdENo 4gfdnJwaf5pGqAnuRqdyQlSbBXPaTm0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-74-Qjdf47HnP8i9qvY8CdSuqQ-1; Thu, 14 May 2020 07:48:15 -0400 X-MC-Unique: Qjdf47HnP8i9qvY8CdSuqQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 32B768018AC; Thu, 14 May 2020 11:48:14 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-70.sin2.redhat.com [10.67.116.70]) by smtp.corp.redhat.com (Postfix) with ESMTP id A56871054FFD; Thu, 14 May 2020 11:48:12 +0000 (UTC) From: Gowrishankar Muthukrishnan To: dev@openvswitch.org Date: Thu, 14 May 2020 17:18:03 +0530 Message-Id: <3bea47d5007ded2b8f9685a1665051660667f0e3.1589456076.git.gmuthukr@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Flavio Leitner Subject: [ovs-dev] [PATCH 3/3] system-dpdk: add negotiation check for userspace-tso 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 minimal check for userspace-tso in system-dpdk tests, starting with verification on virtio negotiation. Signed-off-by: Gowrishankar Muthukrishnan --- tests/system-dpdk-macros.at | 16 +++++-- tests/system-dpdk.at | 102 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 4 deletions(-) diff --git a/tests/system-dpdk-macros.at b/tests/system-dpdk-macros.at index 943cbdf..b5c0648 100644 --- a/tests/system-dpdk-macros.at +++ b/tests/system-dpdk-macros.at @@ -61,12 +61,12 @@ m4_define([OVS_DPDK_SET_SOCKET_MEM], ]) +# OVS_DB_START() # # Create an empty database and start ovsdb-server. Add special configuration -# dpdk-init to enable DPDK functionality. Start ovs-vswitchd connected to that -# database using system devices (no dummies). +# dpdk-init to enable DPDK functionality. # -m4_define([OVS_DPDK_START], +m4_define([OVS_DB_START], [dnl Create database. AT_CHECK([touch .conf.db.~lock~]) AT_CHECK([ovsdb-tool create conf.db $abs_top_srcdir/vswitchd/vswitch.ovsschema]) @@ -81,8 +81,16 @@ m4_define([OVS_DPDK_START], dnl Initialize database. AT_CHECK([ovs-vsctl --no-wait init]) +]) - dnl Enable DPDK functionality +# OVS_DPDK_START() +# +# Create an empty database and start ovsdb-server. Add special configuration +# dpdk-init to enable DPDK functionality. Start ovs-vswitchd connected to that +# database using system devices (no dummies). +# +m4_define([OVS_DPDK_START], + [dnl Enable DPDK functionality AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true]) OVS_DPDK_SET_SOCKET_MEM() AT_CHECK([lscpu], [], [stdout]) diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at index b032c5b..ab100b8 100644 --- a/tests/system-dpdk.at +++ b/tests/system-dpdk.at @@ -8,6 +8,7 @@ dnl Check if EAL init is successful AT_SETUP([OVS-DPDK - EAL init]) AT_KEYWORDS([dpdk]) OVS_DPDK_PRE_CHECK() +OVS_DB_START() OVS_DPDK_START() AT_CHECK([grep "DPDK Enabled - initializing..." ovs-vswitchd.log], [], [stdout]) AT_CHECK([grep "EAL" ovs-vswitchd.log], [], [stdout]) @@ -28,6 +29,7 @@ AT_SETUP([OVS-DPDK - add standard DPDK port]) AT_KEYWORDS([dpdk]) OVS_DPDK_PRE_PHY_SKIP() +OVS_DB_START() OVS_DPDK_START() dnl Add userspace bridge and attach it to OVS @@ -55,6 +57,7 @@ dnl Add vhost-user-client port AT_SETUP([OVS-DPDK - add vhost-user-client port]) AT_KEYWORDS([dpdk]) OVS_DPDK_PRE_CHECK() +OVS_DB_START() OVS_DPDK_START() dnl Add userspace bridge and attach it to OVS @@ -89,6 +92,7 @@ AT_SETUP([OVS-DPDK - ping vhost-user ports]) AT_KEYWORDS([dpdk]) OVS_DPDK_PRE_CHECK() AT_SKIP_IF([! which testpmd >/dev/null 2>/dev/null]) +OVS_DB_START() OVS_DPDK_START() dnl Find number of sockets @@ -127,6 +131,12 @@ tail -f /dev/null | testpmd --no-pci \ dnl Give settling time to the testpmd processes - NOTE: this is bad form. sleep 10 +dnl Check whether TSO is turned off +AT_CHECK([grep -c 'negotiated Virtio features: 0x910008182' \ + ovs-vswitchd.log],[0],[dnl +1 +]) + dnl Move the tap devices to the namespaces AT_CHECK([ps aux | grep testpmd], [], [stdout], [stderr]) AT_CHECK([ip link show], [], [stdout], [stderr]) @@ -169,6 +179,7 @@ AT_SETUP([OVS-DPDK - ping vhost-user-client ports]) AT_KEYWORDS([dpdk]) OVS_DPDK_PRE_CHECK() AT_SKIP_IF([! which testpmd >/dev/null 2>/dev/null]) +OVS_DB_START() OVS_DPDK_START() dnl Find number of sockets @@ -206,6 +217,12 @@ tail -f /dev/null | testpmd --no-pci \ dnl Give settling time to the testpmd processes - NOTE: this is bad form. sleep 10 +dnl Check whether TSO is turned off +AT_CHECK([grep -c 'negotiated Virtio features: 0x910008182' \ + ovs-vswitchd.log],[0],[dnl +1 +]) + dnl Move the tap devices to the namespaces AT_CHECK([ps aux | grep testpmd], [], [stdout], [stderr]) AT_CHECK([ip link show], [], [stdout], [stderr]) @@ -241,3 +258,88 @@ OVS_DPDK_HUGEPAGE_CLEANUP([rtemap_*]) OVS_DPDK_HUGEPAGE_CLEANUP([page0map_0]) AT_CLEANUP dnl -------------------------------------------------------------------------- + +dnl -------------------------------------------------------------------------- +dnl validate tso negotiation +AT_SETUP([OVS-DPDK - validate tso negotiation]) +AT_KEYWORDS([dpdk]) +OVS_DPDK_PRE_CHECK() +AT_SKIP_IF([! which testpmd >/dev/null 2>/dev/null]) +OVS_DB_START() +AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:userspace-tso-enable=true]) +OVS_DPDK_START() +AT_CHECK([grep -c 'Userspace TCP Segmentation Offloading support enabled' \ + ovs-vswitchd.log],[0],[dnl +1 +]) +dnl Find number of sockets +AT_CHECK([lscpu], [], [stdout]) +AT_CHECK([cat stdout | grep "NUMA node(s)" | awk '{c=1; while (c++<$(3)) {printf "448,"}; print "448"}' > NUMA_NODE]) + +dnl Add userspace bridge and attach it to OVS +AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev]) + +dnl Add vhostuser port (client mode) +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 Execute testpmd in background +on_exit "pkill -f -x -9 'tail -f /dev/null'" +tail -f /dev/null | testpmd --no-pci \ + --socket-mem="$(cat NUMA_NODE)" --socket-limit="$(cat NUMA_NODE)" \ + --vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1" \ + --vdev="net_tap0,iface=tap0" --file-prefix page0 \ + --single-file-segments -- -a >$OVS_RUNDIR/testpmd-dpdkvhostuserclient0.log 2>&1 & + +dnl Give settling time to the testpmd processes - NOTE: this is bad form. +sleep 10 + +dnl Check whether TSO is turned on +AT_CHECK([grep -c 'negotiated Virtio features: 0x910009983' \ + ovs-vswitchd.log],[0],[dnl +1 +]) + +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]) + +dnl Add vhostuser port (server mode) +AT_CHECK([ovs-vsctl add-port br10 dpdkvhostuser0 -- set Interface dpdkvhostuser0 \ + type=dpdkvhostuser], [], + [stdout], [stderr]) +AT_CHECK([ovs-vsctl show], [], [stdout]) + +dnl Execute testpmd in background +on_exit "pkill -f -x -9 'tail -f /dev/null'" +tail -f /dev/null | testpmd --no-pci \ + --socket-mem="$(cat NUMA_NODE)" --socket-limit="$(cat NUMA_NODE)" \ + --vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostuser0" \ + --vdev="net_tap0,iface=tap0" --file-prefix page0 \ + --single-file-segments -- -a >$OVS_RUNDIR/testpmd-dpdkvhostuser0.log 2>&1 & + +dnl Give settling time to the testpmd processes - NOTE: this is bad form. +sleep 10 + +dnl Check whether TSO is turned off +AT_CHECK([grep -c 'negotiated Virtio features: 0x910008183' \ + ovs-vswitchd.log],[0],[dnl +1 +]) + +dnl Clean up the testpmd now +pkill -f -x -9 'tail -f /dev/null' + +dnl Clean up +AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuser0], [], [stdout], [stderr]) +OVS_VSWITCHD_STOP() +OVS_DPDK_HUGEPAGE_CLEANUP([rtemap_*]) +OVS_DPDK_HUGEPAGE_CLEANUP([page0map_0]) +AT_CLEANUP +dnl --------------------------------------------------------------------------