From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B5AB6A0471 for ; Tue, 13 Aug 2019 08:40:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ACDAD1BE0C; Tue, 13 Aug 2019 08:40:20 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id C3C3B1BE0C for ; Tue, 13 Aug 2019 08:40:18 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Aug 2019 23:40:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,380,1559545200"; d="scan'208";a="187683111" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 12 Aug 2019 23:40:17 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 12 Aug 2019 23:40:16 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 12 Aug 2019 23:40:16 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.112]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.139]) with mapi id 14.03.0439.000; Tue, 13 Aug 2019 14:40:14 +0800 From: "Wang, Yinan" To: "Ma, LihongX" , "dts@dpdk.org" Thread-Topic: [dts][PATCH V2] tests: add testsuite dpdk gso lib Thread-Index: AQHVUZOoCOWLMUpaP0WAAgO1a6LH5qb4oL7Q Date: Tue, 13 Aug 2019 06:40:13 +0000 Message-ID: References: <1565645678-28714-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1565645678-28714-1-git-send-email-lihongx.ma@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTY5ZTc1ZDYtZjliZS00ZDJjLTkxN2MtYzc1NTA2ZDRjZDhmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiV1JcL0dEMFpDVHd4RzhLSnlUS2V0V0JWanZhNFB2eDdsUVJ3clwvcGFjRDZ4V0ZuZnU5YjdcL2wzWDJ3SnYwRHA3SiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V2] tests: add testsuite dpdk gso lib 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Acked-by: Wang, Yinan > -----Original Message----- > From: Ma, LihongX > Sent: 2019=1B$BG/=1B(B8=1B$B7n=1B(B13=1B$BF|=1B(B 5:35 > To: dts@dpdk.org > Cc: Wang, Yinan ; Ma, LihongX > Subject: [dts][PATCH V2] tests: add testsuite dpdk gso lib >=20 > Signed-off-by: lihong > --- > tests/TestSuite_dpdk_gso_lib.py | 546 > ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 546 insertions(+) > create mode 100644 tests/TestSuite_dpdk_gso_lib.py >=20 > diff --git a/tests/TestSuite_dpdk_gso_lib.py b/tests/TestSuite_dpdk_gso_l= ib.py > new file mode 100644 index 0000000..68d09cb > --- /dev/null > +++ b/tests/TestSuite_dpdk_gso_lib.py > @@ -0,0 +1,546 @@ > +# BSD LICENSE > +# > +# Copyright(c) <2019> Intel Corporation. > +# 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. > + > +DPDK gso lib test suite. > +In this suite, in order to check the performance of gso lib, will use > +one hostcpu to start qemu and only have one vcpu """ > +import time > +import utils > +import re > +from test_case import TestCase > +from virt_common import VM > +from config import UserConf > +import vhost_peer_conf as peer > + > + > +class TestDPDKGsoLib(TestCase): > + > + def set_up_all(self): > + # This suite will not use the port config in ports.cfg > + # it will use the port config in vhost_gro.cfg > + # And it need two interface reconnet in DUT > + > + # unbind the port which config in ports.cfg > + self.dut_ports =3D self.dut.get_ports() > + for i in self.dut_ports: > + port =3D self.dut.ports_info[i]['port'] > + port.bind_driver() > + > + # get and bind the port in conf file > + self.pci =3D peer.get_pci_info() > + self.pci_drv =3D peer.get_pci_driver_info() > + self.peer_pci =3D peer.get_pci_peer_info() > + self.nic_in_kernel =3D peer.get_pci_peer_intf_info() > + self.verify(len(self.pci) !=3D 0 and len(self.pci_drv) !=3D 0 > + and len(self.peer_pci) !=3D 0 > + and len(self.nic_in_kernel) !=3D 0, > + 'Pls config the direct connection info in > vhost_peer_conf.cfg') > + self.dut.send_expect( > + "./usertools/dpdk-devbind.py -b igb_uio %s" % > + self.pci, '#', 30) > + > + # get the numa info about the pci info which config in peer cfg > + bus =3D int(self.pci[5:7], base=3D16) > + if bus >=3D 128: > + self.socket =3D 1 > + else: > + self.socket =3D 0 > + # get core list on this socket, 2 cores for testpmd, 1 core for = qemu > + cores_config =3D '1S/3C/1T' > + self.verify(self.dut.number_of_cores >=3D 3, > + "There has not enought cores to test this case %s" % > self.suite_name) > + cores_list =3D self.dut.get_core_list("1S/3C/1T", socket=3Dself.= socket) > + vhost_list =3D cores_list[0:2] > + self.qemu_cpupin =3D cores_list[2:3][0] > + self.core_mask_vhost =3D utils.create_mask(vhost_list) > + > + # Set the params for VM > + self.virtio_ip1 =3D "1.1.1.2" > + self.virtio_mac1 =3D "52:54:00:00:00:01" > + self.memory_channel =3D self.dut.get_memory_channels() > + # set diff arg about mem_socket base on socket number > + if len(set([int(core['socket']) for core in self.dut.cores])) = =3D=3D 1: > + self.socket_mem =3D '1024' > + else: > + self.socket_mem =3D '1024,1024' > + > + self.prepare_dpdk() > + > + def set_up(self): > + # > + # Run before each test case. > + # Clean the execution ENV > + self.dut.send_expect("rm -rf ./vhost-net*", "#") > + self.dut.send_expect("killall -s INT testpmd", "#") > + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") > + > + def launch_testpmd_gso_on(self, mode=3D0): > + # mode =3D 0: DPDK GSO for TCP Traffic > + # mode =3D 1: DPDK GSO for UDP Traffic > + # mode =3D 2: DPDK GSO for Vxlan/GRE Traffic > + # mode =3D 3: TSO > + # mode =3D others: NO DPDK GSO/TSO > + self.testcmd =3D self.target + "/app/testpmd -c %s -n %d > --socket-mem %s --legacy-mem" \ > + + " --vdev 'net_vhost0,iface=3Dvhost-net,queues=3D1' -- -i > --tx-offloads=3D0x00 "\ > + + " --txd=3D1024 --rxd=3D1024" > + self.testcmd_start =3D self.testcmd % ( > + self.core_mask_vhost, self.memory_channel, self.socket_mem) > + self.vhost_user =3D self.dut.new_session(suite=3D"user") > + self.vhost_user.send_expect(self.testcmd_start, "testpmd> ", 120= ) > + self.vhost_user.send_expect("set fwd csum", "testpmd> ", 120) > + self.vhost_user.send_expect("stop", "testpmd> ", 120) > + if(mode =3D=3D 0): > + self.vhost_user.send_expect("port stop 0", "testpmd> ", 120) > + self.vhost_user.send_expect("csum set ip hw 0", "testpmd> ", > 120) > + self.vhost_user.send_expect("csum set tcp hw 0", "testpmd> "= , > 120) > + self.vhost_user.send_expect("set port 0 gso on", "testpmd> "= , > 120) > + self.vhost_user.send_expect("set gso segsz 1460", "testpmd> = ", > 120) > + self.vhost_user.send_expect("port start 0", "testpmd> ", 120= ) > + if (mode =3D=3D 1): > + self.vhost_user.send_expect("port stop 1", "testpmd> ", 120) > + self.vhost_user.send_expect("port stop 0", "testpmd> ", 120) > + self.vhost_user.send_expect("csum set ip hw 0", "testpmd> ", > 120) > + self.vhost_user.send_expect("csum set tcp hw 0", "testpmd> "= , > 120) > + self.vhost_user.send_expect("set port 0 gso on", "testpmd> "= , > 120) > + self.vhost_user.send_expect("set gso segsz 1460", "testpmd> = ", > 120) > + self.vhost_user.send_expect("port start 1", "testpmd> ", 120= ) > + self.vhost_user.send_expect("port start 0", "testpmd> ", 120= ) > + elif(mode =3D=3D 3): > + self.vhost_user.send_expect("port stop 0", "testpmd> ", 120) > + self.vhost_user.send_expect("csum set ip hw 0", "testpmd> ", > 120) > + self.vhost_user.send_expect("csum set tcp hw 0", "testpmd> "= , > 120) > + self.vhost_user.send_expect("tso set 1460 0", "testpmd> ", 1= 20) > + self.vhost_user.send_expect("port start 0", "testpmd> ", 120= ) > + elif (mode =3D=3D 2): > + self.vhost_user.send_expect("port stop 0", "testpmd> ", 120) > + self.vhost_user.send_expect("csum set ip hw 0", "testpmd> ", > 120) > + self.vhost_user.send_expect("csum set tcp hw 0", "testpmd> "= , > 120) > + self.vhost_user.send_expect("csum set outer-ip hw 0", "testp= md> > ", 120) > + self.vhost_user.send_expect("csum parse-tunnel on 0", "testp= md> > ", 120) > + self.vhost_user.send_expect("set port 0 gso on", "testpmd> "= , > 120) > + self.vhost_user.send_expect("set gso segsz 1400", "testpmd> = ", > 120) > + self.vhost_user.send_expect("port start 0", "testpmd> ", 120= ) > + else: > + self.vhost_user.send_expect("set fwd csum", "testpmd> ", 120= ) > + self.vhost_user.send_expect("start", "testpmd> ", 120) > + > + def quit_testpmd(self): > + # Quit testpmd and close temp ssh session > + self.vhost_user.send_expect("quit", "#", 120) > + self.dut.close_session(self.vhost_user) > + > + def config_kernel_nic_host(self): > + # > + self.dut.send_expect("ip netns del ns1", "#") > + self.dut.send_expect("ip netns add ns1", "#") > + self.dut.send_expect( > + "ip link set %s netns ns1" % > + self.nic_in_kernel, "#") > + self.dut.send_expect( > + "ip netns exec ns1 ifconfig %s 1.1.1.8 up" % > + self.nic_in_kernel, "#") > + self.dut.send_expect( > + "ip netns exec ns1 ethtool -K %s gro on" % > + self.nic_in_kernel, "#") > + > + def config_kernel_nic_host_for_vxlan(self): > + self.dut.send_expect("ip netns del ns1", "#") > + self.dut.send_expect("ip netns add ns1", "#") > + self.dut.send_expect( > + "ip link set %s netns ns1" % > + self.nic_in_kernel, "#") > + self.dut.send_expect( > + "ip netns exec ns1 ifconfig %s 188.0.0.1 up" % > + self.nic_in_kernel, "#") > + self.dut.send_expect( > + "ip netns exec ns1 ip link add vxlan100 type vxlan id 1000 r= emote > 188.0.0.2 local 188.0.0.1 dstport 4789 dev %s" % > + self.nic_in_kernel, "#") > + self.dut.send_expect( > + "ip netns exec ns1 ifconfig vxlan100 1.1.1.1/24 up", > + "#") > + > + def config_kernel_nic_host_for_gre(self): > + self.dut.send_expect("ip netns del ns1", "#") > + self.dut.send_expect("ip netns add ns1", "#") > + self.dut.send_expect( > + "ip link set %s netns ns1" % > + self.nic_in_kernel, "#") > + self.dut.send_expect( > + "ip netns exec ns1 ifconfig %s 188.0.0.1 up" % > + self.nic_in_kernel, "#") > + self.dut.send_expect( > + "ip netns exec ns1 ip tunnel add gre100 mode gre remote > 188.0.0.2 local 188.0.0.1", > + "#") > + self.dut.send_expect( > + "ip netns exec ns1 ifconfig gre100 1.1.1.1/24 up", > + "#") > + > + def prepare_dpdk(self): > + # Changhe the testpmd checksum fwd code for mac change > + self.dut.send_expect( > + > "cp ./app/test-pmd/csumonly.c ./app/test-pmd/csumonly_backup.c", > + "#") > + self.dut.send_expect( > + "sed -i '/ether_addr_copy(&peer_eth/i\#if > 0' ./app/test-pmd/csumonly.c", "#") > + self.dut.send_expect( > + "sed -i '/parse_ethernet(eth_hdr, > &info/i\#endif' ./app/test-pmd/csumonly.c", "#") > + self.dut.build_install_dpdk(self.dut.target) > + > + def unprepare_dpdk(self): > + # Recovery the DPDK code to original > + time.sleep(5) > + self.dut.send_expect( > + > "cp ./app/test-pmd/csumonly_backup.c ./app/test-pmd/csumonly.c ", > + "#") > + self.dut.send_expect("rm -rf ./app/test-pmd/csumonly_backup.c", > "#") > + self.dut.build_install_dpdk(self.dut.target) > + > + def set_vm_cpu_number(self, vm_config): > + # config the vcpu numbers =3D 1 > + # config the cpupin only have one core > + params_number =3D len(vm_config.params) > + for i in range(params_number): > + if vm_config.params[i].keys()[0] =3D=3D 'cpu': > + vm_config.params[i]['cpu'][0]['number'] =3D 1 > + vm_config.params[i]['cpu'][0]['cpupin'] =3D > + self.qemu_cpupin > + > + def start_vm(self, mode=3D0): > + ''' > + Start two VM, each VM has one virtio device > + mode 0 : VM will send big packet , above MTU > + mdoe 1: VM only send packet under MTU > + ''' > + self.vm1 =3D VM(self.dut, 'vm0', 'vhost_sample') > + self.vm1.load_config() > + vm_params_1 =3D {} > + vm_params_1['driver'] =3D 'vhost-user' > + vm_params_1['opt_path'] =3D './vhost-net' > + vm_params_1['opt_mac'] =3D self.virtio_mac1 > + # tcp and udp traffic > + if(mode =3D=3D 0): > + vm_params_1[ > + 'opt_settings'] =3D > 'mrg_rxbuf=3Don,csum=3Don,gso=3Don,host_tso4=3Don,guest_tso4=3Don,host_uf= o=3Don,gu > est_ufo=3Don' > + # no offload > + elif(mode =3D=3D 1): > + vm_params_1[ > + 'opt_settings'] =3D > 'mrg_rxbuf=3Don,csum=3Doff,gso=3Doff,host_tso4=3Doff,guest_tso4=3Doff' > + # gre and vxlan > + elif(mode =3D=3D 2): > + vm_params_1[ > + 'opt_settings'] =3D > 'mrg_rxbuf=3Don,csum=3Don,guest_csum=3Don,gso=3Don,host_tso4=3Don,guest_t= so4=3Don, > guest_ecn=3Don' > + self.vm1.set_vm_device(**vm_params_1) > + self.set_vm_cpu_number(self.vm1) > + > + time.sleep(5) > + try: > + self.vm1_dut =3D self.vm1.start(load_config=3DFalse) > + if self.vm1_dut is None: > + raise Exception("Set up VM ENV failed") > + except Exception as e: > + print utils.RED("Failure for %s" % str(e)) > + self.vm1_dut.restore_interfaces() > + > + def iperf_result_verify(self, vm_client): > + ''' > + Get the iperf test result > + ''' > + fmsg =3D vm_client.send_expect("cat /root/iperf_client.log", "#"= ) > + print fmsg > + iperfdata =3D re.compile('[\d+]*.[\d+]* [M|G|K]bits/sec').findal= l(fmsg) > + print iperfdata > + self.verify(iperfdata, 'There no data about this case') > + self.result_table_create(['Data', 'Unit']) > + results_row =3D ['GSO'] > + results_row.append(iperfdata[-1]) > + self.result_table_add(results_row) > + self.result_table_print() > + self.output_result =3D "Iperf throughput is %s" % iperfdata[-1] > + self.logger.info(self.output_result) > + > + def test_vhost_gso_dpdk_tcp(self): > + """ > + DPDK GSO test with tcp traffic > + """ > + # Config the NIC which will be assigned to another namespace > + self.config_kernel_nic_host() > + self.launch_testpmd_gso_on(0) > + self.start_vm(0) > + time.sleep(5) > + self.dut.get_session_output(timeout=3D2) > + # Get the virtio-net device name > + for port in self.vm1_dut.ports_info: > + self.vm1_intf =3D port['intf'] > + self.vm1_dut.send_expect("sh /home/lei/dpdk/Guest_script.sh", '#= ', > 60) > + self.vm1_dut.send_expect('ifconfig %s %s' % (self.vm1_intf, > self.virtio_ip1), '#', 10) > + self.vm1_dut.send_expect('ifconfig %s up' % self.vm1_intf, '#', = 10) > + self.vm1_dut.send_expect('ethtool -K %s gso off' % (self.vm1_int= f), '#', > 10) > + self.vm1_dut.send_expect('rm /root/iperf_client.log', '#', 10) > + self.dut.send_expect('ip netns exec ns1 iperf -s', '', 10) > + self.vm1_dut.send_expect('iperf -c 1.1.1.8 -i 1 -t 10 -P 5 > > /root/iperf_client.log &', '', 180) > + time.sleep(30) > + self.dut.send_expect('^C', '#', 10) > + self.iperf_result_verify(self.vm1_dut) > + print "the GSO lib for TCP traffic %s " % (self.output_result) > + self.vm1_dut.send_expect('rm /root/iperf_client.log', '#', 10) > + self.dut.send_expect("ip netns del ns1", "#") > + self.quit_testpmd() > + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") > + > + def test_vhost_gso_dpdk_udp(self): > + """ > + DPDK GSO test with udp traffic > + """ > + # Config the NIC which will be assigned to another namespace > + self.config_kernel_nic_host() > + self.launch_testpmd_gso_on(1) > + self.start_vm(0) > + time.sleep(5) > + self.dut.get_session_output(timeout=3D2) > + # Get the virtio-net device name > + for port in self.vm1_dut.ports_info: > + self.vm1_intf =3D port['intf'] > + self.vm1_dut.send_expect( > + 'ifconfig %s %s' % > + (self.vm1_intf, self.virtio_ip1), '#', 10) > + self.vm1_dut.send_expect('ifconfig %s up' % self.vm1_intf, '#', = 10) > + self.vm1_dut.send_expect('ethtool -K %s gso off' % (self.vm1_int= f), '#', > 10) > + self.vm1_dut.send_expect('rm /root/iperf_client.log', '#', 10) > + self.dut.send_expect('ip netns exec ns1 iperf -s -u', '', 10) > + self.vm1_dut.send_expect( > + 'iperf -c 1.1.1.8 -i 1 -u -t 10 -l 9000 -b 10G -P 5 > > /root/iperf_client.log &', > + '', > + 60) > + time.sleep(30) > + self.dut.send_expect('^C', '#', 10) > + self.iperf_result_verify(self.vm1_dut) > + print "the GSO lib for UDP traffic %s " % (self.output_result) > + self.vm1_dut.send_expect('rm /root/iperf_client.log', '#', 10) > + self.dut.send_expect("ip netns del ns1", "#") > + self.quit_testpmd() > + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") > + > + def test_vhost_tso_dpdk(self): > + self.config_kernel_nic_host() > + self.launch_testpmd_gso_on(3) > + self.start_vm(0) > + time.sleep(5) > + self.dut.get_session_output(timeout=3D2) > + # Get the virtio-net device name > + for port in self.vm1_dut.ports_info: > + self.vm1_intf =3D port['intf'] > + # Start the Iperf test > + self.vm1_dut.send_expect('ifconfig -a', '#', 30) > + self.vm1_dut.send_expect( > + 'ifconfig %s %s' % > + (self.vm1_intf, self.virtio_ip1), '#', 10) > + self.vm1_dut.send_expect('ifconfig %s up' % self.vm1_intf, '#', = 10) > + self.vm1_dut.send_expect( > + 'ethtool -K %s gso off' % > + (self.vm1_intf), '#', 10) > + self.vm1_dut.send_expect('rm /root/iperf_client.log', '#', 10) > + self.dut.send_expect( > + 'ip netns exec ns1 iperf -s', > + '', > + 10) > + self.vm1_dut.send_expect( > + 'iperf -c 1.1.1.8 -i 1 -t 10 -P 5 > /root/iperf_client.log &= ', > + '', > + 180) > + time.sleep(30) > + self.dut.send_expect('^C', '#', 10) > + self.iperf_result_verify(self.vm1_dut) > + print "the TSO lib %s " % (self.output_result) > + self.vm1_dut.send_expect('rm /root/iperf_client.log', '#', 10) > + self.quit_testpmd() > + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") > + > + def test_kernel_gso_dpdk(self): > + self.config_kernel_nic_host() > + self.launch_testpmd_gso_on(4) > + self.start_vm(1) > + time.sleep(5) > + self.dut.get_session_output(timeout=3D2) > + # Get the virtio-net device name > + for port in self.vm1_dut.ports_info: > + self.vm1_intf =3D port['intf'] > + # Start the Iperf test > + self.vm1_dut.send_expect('ifconfig -a', '#', 30) > + self.vm1_dut.send_expect( > + 'ifconfig %s %s' % > + (self.vm1_intf, self.virtio_ip1), '#', 10) > + self.vm1_dut.send_expect('ifconfig %s up' % self.vm1_intf, '#', = 10) > + self.vm1_dut.send_expect( > + 'ethtool -K %s gso on' % > + (self.vm1_intf), '#', 10) > + self.vm1_dut.send_expect('rm /root/iperf_client.log', '#', 10) > + self.dut.send_expect( > + 'ip netns exec ns1 iperf -s', > + '', > + 10) > + > + self.vm1_dut.send_expect( > + 'iperf -c 1.1.1.8 -i 1 -t 10 -P 5 > /root/iperf_client.log &= ', > + '', > + 180) > + time.sleep(30) > + self.dut.send_expect('^C', '#', 10) > + self.iperf_result_verify(self.vm1_dut) > + print "Kernel GSO %s " % (self.output_result) > + self.vm1_dut.send_expect('rm /root/iperf_client.log', '#', 10) > + self.quit_testpmd() > + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") > + > + def test_no_gso_dpdk(self): > + self.config_kernel_nic_host() > + self.launch_testpmd_gso_on(4) > + self.start_vm(1) > + time.sleep(5) > + self.dut.get_session_output(timeout=3D2) > + # Get the virtio-net device name > + for port in self.vm1_dut.ports_info: > + self.vm1_intf =3D port['intf'] > + # Start the Iperf test > + self.vm1_dut.send_expect('ifconfig -a', '#', 30) > + self.vm1_dut.send_expect( > + 'ifconfig %s %s' % > + (self.vm1_intf, self.virtio_ip1), '#', 10) > + self.vm1_dut.send_expect('ifconfig %s up' % self.vm1_intf, '#', = 10) > + self.vm1_dut.send_expect( > + 'ethtool -K %s gso off' % > + (self.vm1_intf), '#', 10) > + self.vm1_dut.send_expect('rm /root/iperf_client.log', '#', 10) > + self.dut.send_expect( > + 'ip netns exec ns1 iperf -s', > + '', > + 10) > + self.vm1_dut.send_expect( > + 'iperf -c 1.1.1.8 -i 1 -t 10 -P 5 > /root/iperf_client.log &= ', > + '', > + 180) > + time.sleep(30) > + self.dut.send_expect('^C', '#', 10) > + self.iperf_result_verify(self.vm1_dut) > + print "NO GSO/TSO %s " % (self.output_result) > + self.vm1_dut.send_expect('rm /root/iperf_client.log', '#', 10) > + self.quit_testpmd() > + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") > + > + def test_vhost_gso_with_vxlan(self): > + """ > + Test Performance with GSO for VXLAN traffic > + """ > + self.config_kernel_nic_host_for_vxlan() > + self.launch_testpmd_gso_on(2) > + self.start_vm(2) > + time.sleep(5) > + self.dut.get_session_output(timeout=3D2) > + # Get the virtio-net device name and unbind virtio net > + for port in self.vm1_dut.ports_info: > + self.vm1_intf =3D port['intf'] > + self.vm1_dut.send_expect( > + 'ifconfig %s 188.0.0.2 up' % > + self.vm1_intf, '#', 30) > + self.vm1_dut.send_expect( > + 'ip link add vxlan100 type vxlan id 1000 remote 188.0.0.1 lo= cal > 188.0.0.2 dstport 4789 dev %s' % > + self.vm1_intf, '#', 30) > + self.vm1_dut.send_expect('ifconfig vxlan100 1.1.1.2/24 up', '#',= 30) > + # Start Iperf test > + self.dut.send_expect('ip netns exec ns1 iperf -s ', '', 10) > + self.vm1_dut.send_expect('rm /root/iperf_client.log', '#', 10) > + self.vm1_dut.send_expect('iperf -c 1.1.1.1 -i 1 -t 10 -P 5 > > /root/iperf_client.log &', '', 60) > + time.sleep(30) > + self.dut.send_expect('^C', '#', 10) > + self.iperf_result_verify(self.vm1_dut) > + print "the GSO lib for Vxlan traffic %s " % (self.output_result) > + self.vm1_dut.send_expect('rm /root/iperf_client.log', '#', 10) > + self.dut.send_expect("ip netns del ns1", "#") > + self.quit_testpmd() > + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") > + > + def test_vhost_gso_with_gre(self): > + """ > + Test Performance with GSO for GRE traffic > + """ > + self.config_kernel_nic_host_for_gre() > + self.launch_testpmd_gso_on(2) > + self.start_vm(2) > + time.sleep(5) > + self.dut.get_session_output(timeout=3D2) > + # Get the virtio-net device name and unbind virtio net > + for port in self.vm1_dut.ports_info: > + self.vm1_intf =3D port['intf'] > + self.vm1_dut.send_expect( > + 'ifconfig %s 188.0.0.2 up' % > + self.vm1_intf, '#', 30) > + self.vm1_dut.send_expect( > + 'ip tunnel add gre100 mode gre remote 188.0.0.1 local 188.0.= 0.2', > + '#', > + 30) > + self.vm1_dut.send_expect('ifconfig gre100 1.1.1.2/24 up', '#', 3= 0) > + self.dut.send_expect('ip netns exec ns1 iperf -s', '', 10) > + self.vm1_dut.send_expect('rm /root/iperf_client.log', '#', 10) > + self.vm1_dut.send_expect('iperf -c 1.1.1.1 -i 1 -t 10 -P 5 > > /root/iperf_client.log &', '', 60) > + time.sleep(30) > + self.dut.send_expect('^C', '#', 10) > + self.iperf_result_verify(self.vm1_dut) > + self.vm1_dut.send_expect('rm /root/iperf_client.log', '#', 10) > + self.dut.send_expect("ip netns del ns1", "#") > + self.quit_testpmd() > + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") > + > + def tear_down(self): > + """ > + Run after each test case. > + """ > + self.dut.send_expect("killall -s INT testpmd", "#") > + self.dut.send_expect("killall -s INT qemu-system-x86_64", "#") > + self.dut.send_expect( > + "./usertools/dpdk-devbind.py -u %s" % (self.peer_pci), '# ',= 30) > + self.dut.send_expect( > + "./usertools/dpdk-devbind.py -b %s %s" % > + (self.pci_drv, self.peer_pci), '# ', 30) > + time.sleep(2) > + > + def tear_down_all(self): > + """ > + Run after each test suite. > + """ > + self.unprepare_dpdk() > + self.dut.send_expect("ip netns del ns1", "#", 30) > + self.dut.send_expect( > + "./usertools/dpdk-devbind.py -u %s" % (self.pci), '# ', 30) > + self.dut.send_expect( > + "./usertools/dpdk-devbind.py -b %s %s" % > + (self.pci_drv, self.pci), '# ', 30) > -- > 2.7.4