From patchwork Fri Jun 11 06:55:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meher Chinwala X-Patchwork-Id: 1490785 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.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) 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=X2Xf3md/; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4G1Wns3Bpbz9sW7 for ; Fri, 11 Jun 2021 16:55:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id CF87B6071C; Fri, 11 Jun 2021 06:55:42 +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 TZvIfESLjPMR; Fri, 11 Jun 2021 06:55:41 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id D3791606D6; Fri, 11 Jun 2021 06:55:40 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 97758C000D; Fri, 11 Jun 2021 06:55:40 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9DF1EC000B for ; Fri, 11 Jun 2021 06:55:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8554F606EE for ; Fri, 11 Jun 2021 06:55:39 +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 FveyYiSYBFrW for ; Fri, 11 Jun 2021 06:55:37 +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 smtp3.osuosl.org (Postfix) with ESMTPS id 72310606D6 for ; Fri, 11 Jun 2021 06:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623394536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VpQrYccD8FtSIIlCQ9waagVvDVeo/1t/mCHFoSHu4SI=; b=X2Xf3md/3SJrk13uxDPYxR7Wjl7Sfdd4sk3s6mdKafFrA3D8mHMrGIgNmeGm7kOccf9LfN LG90qChqv42LU/isCjYuiCyK27kFsDIF0cL57CiQYkmPzRmYT6FBvpFhsxFafNFco9iI9I Qm8oeM2r+n2lMSfpUfVW+CgLZKdfzWg= Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-402-OmjwjVd4MfqjzSIrWN_9mg-1; Fri, 11 Jun 2021 02:55:34 -0400 X-MC-Unique: OmjwjVd4MfqjzSIrWN_9mg-1 Received: by mail-pl1-f197.google.com with SMTP id t2-20020a170902b202b02900ec9b8c34b6so2332852plr.15 for ; Thu, 10 Jun 2021 23:55:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=VpQrYccD8FtSIIlCQ9waagVvDVeo/1t/mCHFoSHu4SI=; b=CgY/0HUMXzjgJ4/Pw+iMzDFulzuT/Ny4hqOpd2eShLrBqedzTn6wNcoB8OGbLCddi7 Lmfqk6reyseCzZhk0Nqig1haYlUgFWVunQr9HedLNOFnHx2Du53N/HHo0Tr/KCQdGxnK 4eS6p3Hi7+45FEvF8xlkB+pmZoTlwkkUnWn3UjTdcBvAmJhMQfNvqLixN2hyVvUC3w3h MYYE3chqsHcuGmtenz4tkYv2D0KZg67sXCVNYIg2IB8oTEPmlNI8LJsHSgR17cm5kaSR 0ZgW65S5qHc/5IrPwTP8urbflZUVe+62Wa9yTnt/l0JGzr5SBbbMJbZcIa3j0FmJbS/t pohw== X-Gm-Message-State: AOAM530whzHAgck0AZG0VGh9B6q0Oj8N11o0t1SnGdEM6HiC4qnTEl/4 aom5mfi2a7gmZaI7/HPZbEUMzk13sU0sCnYcVXXVtjVAvCTGrsEwYAex9C3yauUmSoOs+bvlFgN c6/bJNOUP6rvZoVPGQzZKUML3rZVcKoIxOkESS7fLI/BlH9f3zR3XwzuAJe7VSJMHJh6btw== X-Received: by 2002:a17:902:b482:b029:114:7531:a52e with SMTP id y2-20020a170902b482b02901147531a52emr2609978plr.70.1623394533097; Thu, 10 Jun 2021 23:55:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwegP6uLOslRwCOrGZGuCkFQe3qAAPjVreXxvbQEARAwjS5QPZ7ToE73MjD8HAH6H2Sy8N6Rw== X-Received: by 2002:a17:902:b482:b029:114:7531:a52e with SMTP id y2-20020a170902b482b02901147531a52emr2609941plr.70.1623394532616; Thu, 10 Jun 2021 23:55:32 -0700 (PDT) Received: from mchinwal.remote.csb ([103.240.169.224]) by smtp.gmail.com with ESMTPSA id j12sm4384849pgs.83.2021.06.10.23.55.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Jun 2021 23:55:32 -0700 (PDT) To: ovs-dev@openvswitch.org From: Meher Chinwala Message-ID: Date: Fri, 11 Jun 2021 12:25:29 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mchinwal@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Subject: [ovs-dev] [PATCH] system-dpdk: negotiation tests for TSO for OVS and TestPMD 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" Negotiation Tests for TSO This patch adds negotiation tests for checking whether TSO is enabled or not in OVS and in TestPMD for 4 diferent scenarios. Signed-off-by: Meher Chinwala --- tests/system-dpdk-macros.at | 43 ++++++++++++++++++++++ tests/system-dpdk.at | 71 +++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) +\@VHOST_CONFIG: failed to connect to $OVS_RUNDIR/dpdkvhostclient0: No such file or directory@d"]) +AT_CLEANUP + +dnl -------------------------------------------------------------------------- -- diff --git a/tests/system-dpdk-macros.at b/tests/system-dpdk-macros.at index c6708caaf..bdfdac1b0 100644 --- a/tests/system-dpdk-macros.at +++ b/tests/system-dpdk-macros.at @@ -63,3 +63,46 @@ m4_define([OVS_DPDK_START], AT_CAPTURE_FILE([ovs-vswitchd.log]) on_exit "kill_ovs_vswitchd `cat ovs-vswitchd.pid`" ]) + + +# NEGOTIATION_TEST_TSO([testpmd], [ovs]) +# +# Test whether TSO is being enabled for OVS and TestPMD. The arguments denote whether +# TSO is enabled for testpmd and ovs or not, respectively. +# +m4_define([NEGOTIATION_TEST_TSO], + [ + OVS_DPDK_START() + AS_IF([test $1 -eq 1], [AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:userspace-tso-enable=true])], [AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:userspace-tso-enable=false])]) + AS_IF([test $1 -eq 1], [OVS_WAIT_UNTIL([grep 'Userspace TCP Segmentation Offloading support enabled' ovs-vswitchd.log])], []) + AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev]) + 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]) + on_exit "pkill -f -x -9 'tail -f /dev/null'" + AT_CHECK([echo "show device info all" > CMDFILE]) + AT_CHECK([echo "stop" >> CMDFILE]) + AT_CHECK([echo "port stop 0" >> CMDFILE]) + AS_IF([test $2 -eq 1], [AT_CHECK([echo "tso set 1500 0" >> CMDFILE], [])], []) + AS_IF([test $2 -eq 1], [AT_CHECK([echo "csum set tcp hw 0" >> CMDFILE], [])], []) + AT_CHECK([echo "port start 0" >> CMDFILE]) + AT_CHECK([echo "start" >> CMDFILE]) + AT_CHECK([echo "show port 0 tx_offload capabilities" >> CMDFILE]) + AT_CHECK([echo "show port 0 tx_offload configuration" >> CMDFILE]) + AT_CHECK([lscpu], [], [stdout]) + AT_CHECK([cat stdout | grep "NUMA node(s)" | awk '{c=1; while (c++<$(3)) {printf "512,"}; print "512"}' > NUMA_NODE]) + tail -f /dev/null | dpdk-testpmd --socket-mem="$(cat NUMA_NODE)" --no-pci\ + --vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1" \ + --vdev="net_tap0,iface=tap0" --file-prefix page0 \ + --single-file-segments -- --cmdline-file=CMDFILE \ + -a >$OVS_RUNDIR/testpmd-dpdkvhostuserclient0.log 2>&1 & + + sleep 10 + pkill -f -x -9 'tail -f /dev/null' + + sleep 1 + AT_CHECK([awk '/negotiated Virtio features/ {a=$NF} END{print a}' ovs-vswitchd.log],[],[stdout]) + + AS_IF([test $1 -eq 1 && test $2 -eq 1], [AT_CHECK([printf "%X" $(( $(cat stdout) & ((1<<0)|(1<<11)|(1<<12)) ))],[],[1801])], [AT_CHECK([printf "%X" $(( $(cat stdout) & ((1<<0)|(1<<11)|(1<<12)) ))],[],[0])]) + AS_IF([test $2 -eq 1], [AT_CHECK([grep "Port : TCP_CKSUM TCP_TSO" $OVS_RUNDIR/testpmd-dpdkvhostuserclient0.log], [0], [stdout], [stderr])], []) + AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr]) + ]) diff --git a/tests/system-dpdk.at b/tests/system-dpdk.at index 802895488..d9399ecb9 100644 --- a/tests/system-dpdk.at +++ b/tests/system-dpdk.at @@ -232,3 +232,74 @@ OVS_VSWITCHD_STOP(["\@does not exist. The Open vSwitch kernel module is probably \@EAL: No free hugepages reported in hugepages-1048576kB@d"]) AT_CLEANUP dnl -------------------------------------------------------------------------- + + +dnl -------------------------------------------------------------------------- +dnl Negotiation tests for TSO - both OVS and TestPMD have TSO turned on + +AT_SETUP([NEGOTIATION TEST FOR TSO ENABLED FOR TESTPMD AND OVS]) +AT_KEYWORDS([dpdk]) +OVS_DPDK_PRE_CHECK() +OVS_DB_START() +NEGOTIATION_TEST_TSO([1],[1]) +OVS_VSWITCHD_STOP([" +\@EAL: No available hugepages reported in hugepages-1048576kB@d +\@EAL: Invalid NUMA socket, default to 0@d +\@VHOST_CONFIG: failed to connect to $OVS_RUNDIR/dpdkvhostclient0: No such file or directory@d"]) +AT_CLEANUP + +dnl -------------------------------------------------------------------------- + + + +dnl -------------------------------------------------------------------------- +dnl Negotiation tests - TSO enabled for OVS, disabled for TestPMD + +AT_SETUP([NEGOTIATION TEST FOR TSO ENABLED FOR OVS, DISABLED FOR TESTPMD]) +AT_KEYWORDS([dpdk]) +OVS_DPDK_PRE_CHECK() +OVS_DB_START() +NEGOTIATION_TEST_TSO([1],[0]) +OVS_VSWITCHD_STOP([" +\@EAL: No available hugepages reported in hugepages-1048576kB@d +\@EAL: Invalid NUMA socket, default to 0@d +\@VHOST_CONFIG: failed to connect to $OVS_RUNDIR/dpdkvhostclient0: No such file or directory@d"]) +AT_CLEANUP + +dnl -------------------------------------------------------------------------- + + + +dnl -------------------------------------------------------------------------- +dnl Negotiation tests - TSO enabled for TestPMD, disabled for OVS + +AT_SETUP([NEGOTIATION TEST FOR TSO ENABLED FOR TESTPMD, DISABLED FOR OVS]) +AT_KEYWORDS([dpdk]) +OVS_DPDK_PRE_CHECK() +OVS_DB_START() +NEGOTIATION_TEST_TSO([0],[1]) +OVS_VSWITCHD_STOP([" +\@EAL: No available hugepages reported in hugepages-1048576kB@d +\@EAL: Invalid NUMA socket, default to 0@d +\@VHOST_CONFIG: failed to connect to $OVS_RUNDIR/dpdkvhostclient0: No such file or directory@d"]) +AT_CLEANUP + +dnl -------------------------------------------------------------------------- + + + +dnl -------------------------------------------------------------------------- +dnl Negotiation tests - both OVS and TestPMD have TSO turned off + +AT_SETUP([NEGOTIATION TEST FOR TSO DISABLED FOR BOTH OVS AND TESTPMD]) +AT_KEYWORDS([dpdk]) +OVS_DPDK_PRE_CHECK() +OVS_DB_START() +NEGOTIATION_TEST_TSO([0],[0]) +OVS_VSWITCHD_STOP([" +\@EAL: No available hugepages reported in hugepages-1048576kB@d +\@EAL: Invalid NUMA socket, default to 0@d