From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 6D164DE6 for ; Thu, 21 Jan 2016 09:04:10 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 21 Jan 2016 00:04:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,324,1449561600"; d="scan'208";a="895200915" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 21 Jan 2016 00:03:18 -0800 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 21 Jan 2016 00:03:08 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 21 Jan 2016 00:03:08 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.172]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.117]) with mapi id 14.03.0248.002; Thu, 21 Jan 2016 16:03:06 +0800 From: "Xu, Qian Q" To: "Fu, JingguoX" , "dts@dpdk.org" Thread-Topic: [DTS][PATCH 1/3] virtio: update vhost cuse cases Thread-Index: AQHRVBcB7kEWctFpuEy9EgemKP2K+p8FmxKQ Date: Thu, 21 Jan 2016 08:03:05 +0000 Message-ID: <82F45D86ADE5454A95A89742C8D1410E031BBF50@shsmsx102.ccr.corp.intel.com> References: <1453358572-30310-1-git-send-email-jingguox.fu@intel.com> In-Reply-To: <1453358572-30310-1-git-send-email-jingguox.fu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjg4NDI5NzctMjhjOS00NjkxLWIzZmEtNDUxZmM5MmJjOWYwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMFVLSTYrSTluVmxJdzJVVXFHQWZXVlpicjA3ZmxDc2ZKbUoyNTVcL25Eb1E9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [DTS][PATCH 1/3] virtio: update vhost cuse cases X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2016 08:04:11 -0000 Thanks Qian -----Original Message----- From: Fu, JingguoX=20 Sent: Thursday, January 21, 2016 2:43 PM To: dts@dpdk.org Cc: Liu, Yong; Xu, Qian Q; Fu, JingguoX Subject: [DTS][PATCH 1/3] virtio: update vhost cuse cases 1: optimize case 2: add get rx rate for generator 3: better way to check vhost.out file Signed-off-by: Jingguo Fu --- tests/TestSuite_vhost_cuse_one_copy_one_vm.py | 438 ++++++++++++++++++++++= +++ tests/TestSuite_vhost_cuse_sample.py | 454 ----------------------= ---- tests/TestSuite_vhost_sample.py | 425 ----------------------= -- tests/TestSuite_vhost_user_one_copy_one_vm.py | 425 ++++++++++++++++++++++= ++ 4 files changed, 863 insertions(+), 879 deletions(-) create mode 100644 tests/TestSuite_vhost_cuse_one_copy_one_vm.py delete mode 100644 tests/TestSuite_vhost_cuse_sample.py delete mode 100644 tests/TestSuite_vhost_sample.py create mode 100644 tests/TestSuite_vhost_user_one_copy_one_vm.py diff --git a/tests/TestSuite_vhost_cuse_one_copy_one_vm.py b/tests/TestSuit= e_vhost_cuse_one_copy_one_vm.py new file mode 100644 index 0000000..bff5760 --- /dev/null +++ b/tests/TestSuite_vhost_cuse_one_copy_one_vm.py @@ -0,0 +1,438 @@ +# BSD LICENSE +# +# Copyright(c) 2010-2015 Intel Corporation. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +""" +DPDK Test suite. + +Vhost Cuse one-copy sample test suite. +""" +import os +import dts +import string +import re +import time +from scapy.utils import wrpcap, rdpcap +from test_case import TestCase +from exception import VerifyFailure +from settings import HEADER_SIZE +from etgen import IxiaPacketGenerator +from qemu_kvm import QEMUKvm + + +class TestVhostCuseOneCopyOneVm(TestCase, IxiaPacketGenerator): + + def set_up_all(self): + # To Extend IXIA packet generator method, call the tester's method= . + self.tester.extend_external_packet_generator(TestVhostCuseOneCopyO= neVm, self) + + # Change config file to enable vhost-cuse compiled. + self.dut.send_expect( + "sed -i -e 's/CONFIG_RTE_LIBRTE_VHOST_USER=3D.*$/CONFIG_RTE_LI= BRTE" + "_VHOST_USER=3Dn/' ./config/common_linuxapp", + "# ", + 30) + self.dut.build_install_dpdk(self.target) + self.dut.send_expect("cd ./lib/librte_vhost", "#", 30) + print self.dut.send_expect("make", "#", 30) + self.dut.send_expect("cd ./eventfd_link", "#", 30) + print self.dut.send_expect("make", "#", 30) + self.dut.send_expect("cd ~/dpdk", "#", 30) + + # build the vhost sample in vhost-cuse mode. + if self.nic in ['niantic']: + self.dut.send_expect( + "sed -i -e 's/#define MAX_QUEUES.*$/#define MAX_QUEUES 128= /' " + "./examples/vhost/main.c", + "#") + else: + self.dut.send_expect( + "sed -i -e 's/#define MAX_QUEUES.*$/#define MAX_QUEUES 512= /' " + "./examples/vhost/main.c", + "#") + out =3D self.dut.send_expect("make -C examples/vhost", "#") + self.verify("Error" not in out, "compilation error") + self.verify("No such file" not in out, "Not found file error") + + # Build target with modified config file + self.dut.build_install_dpdk(self.target) + + # Get and verify the ports + self.dut_ports =3D self.dut.get_ports() + self.verify(len(self.dut_ports) >=3D 1, "Insufficient ports for te= sting") + + # Get the port's socket + self.pf =3D self.dut_ports[0] + netdev =3D self.dut.ports_info[self.pf]['port'] + self.socket =3D netdev.get_nic_socket() + self.cores =3D self.dut.get_core_list("1S/3C/1T", socket=3Dself.so= cket) + + # Set the params of vhost-cuse sample + self.vhost_app =3D "./examples/vhost/build/vhost-switch" + self.zero_copy =3D 0 + self.vm2vm =3D 0 + self.jumbo =3D 0 + self.vhost_test =3D self.vhost_app + \ + " -c %s -n %d --socket-mem 1024,1024 -- -p 0x1 --mergeable %d"= + \ + " --zero-copy %d --vm2vm %d 2 > ./vhost.out &" + + # Define the virtio/VM variables + self.virtio1 =3D "eth1" + self.virtio2 =3D "eth2" + self.virtio1_mac =3D "52:54:00:00:00:01" + self.virtio2_mac =3D "52:54:00:00:00:02" + self.src1 =3D "192.168.4.1" + self.src2 =3D "192.168.3.1" + self.dst1 =3D "192.168.3.1" + self.dst2 =3D "192.168.4.1" + self.vm_dut =3D None + self.virtio_cmd_params =3D \ + 'csum=3Doff,gso=3Doff,guest_csum=3Doff,guest_tso4=3Doff,guest_tso6= =3Doff,guest_ecn=3Doff' + # Define the table columns + self.header_row =3D ["FrameSize(B)", "RecvPackets(Mpps)", "SendPac= kets(Mpps)", "LineRate(%)"] + self.memory_channel =3D 4 Similar comments as vhost-user, suggest to remove RecvPackets(Mpps).=20 Qian=20 Thx.=20