From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id DC5A1A3 for ; Tue, 5 Mar 2019 06:37:24 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Mar 2019 21:37:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,442,1544515200"; d="scan'208";a="279799192" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga004.jf.intel.com with ESMTP; 04 Mar 2019 21:37:23 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 4 Mar 2019 21:37:22 -0800 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 4 Mar 2019 21:37:21 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.74]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.144]) with mapi id 14.03.0415.000; Tue, 5 Mar 2019 13:37:20 +0800 From: "Wang, Yinan" To: "Ma, LihongX" , "dts@dpdk.org" CC: "Ma, LihongX" Thread-Topic: [dts] [PATCH V1] Add test suite about pvp multi path vhost single core performance Thread-Index: AQHU0j5SPfk2Uz31YEyDH2Un3G+qmKX8hcSw Date: Tue, 5 Mar 2019 05:37:19 +0000 Message-ID: References: <1551645447-5883-1-git-send-email-lihongx.ma@intel.com> In-Reply-To: <1551645447-5883-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGFhZjY5ZGUtODM1ZS00YmJkLWE2YTEtZDU2NTZhYmJiMDFhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiaGZaa2lXWFwvTG9WeTNNclM2SHFRUDlSbzRUcFNNdzIrOG4yaDNpeklNcmJ5ZmdUSEJGVVdwTVk3WUo1OUljZncifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 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 V1] Add test suite about pvp multi path vhost single core performance 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: Tue, 05 Mar 2019 05:37:25 -0000 -----Original Message----- From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of lihong Sent: 2019=1B$BG/=1B(B3=1B$B7n=1B(B4=1B$BF|=1B(B 4:37 To: dts@dpdk.org Cc: Ma, LihongX Subject: [dts] [PATCH V1] Add test suite about pvp multi path vhost single = core performance Signed-off-by: lihong Acked-by: Wang, Yinan --- ...vp_multi_paths_vhost_single_core_performance.py | 285 +++++++++++++++++= ++++ 1 file changed, 285 insertions(+) create mode 100644 tests/TestSuite_pvp_multi_paths_vhost_single_core_perfo= rmance.py diff --git a/tests/TestSuite_pvp_multi_paths_vhost_single_core_performance.= py b/tests/TestSuite_pvp_multi_paths_vhost_single_core_performance.py new file mode 100644 index 0000000..c085e6e --- /dev/null +++ b/tests/TestSuite_pvp_multi_paths_vhost_single_core_performance.py @@ -0,0 +1,285 @@ +# BSD LICENSE +# +# Copyright(c) 2010-2019 Intel Corporation. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without #=20 +modification, are permitted provided that the following conditions #=20 +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 #=20 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #=20 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR #=20 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT #=20 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, #=20 +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT #=20 +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, #=20 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY #=20 +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT #=20 +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #=20 +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +""" +DPDK Test suite. +Test PVP vhost single core performance using virtio_user on 7 tx/rx path. +""" + +import utils +from test_case import TestCase +from settings import HEADER_SIZE + + +class TestPVPMultiPathVhostPerformance(TestCase): + + def set_up_all(self): + """ + Run at the start of each test suite. + """ + self.frame_sizes =3D [64, 128, 256, 512, 1024, 1518] + self.test_cycles =3D {'Mpps': {}, 'pct': {}} + self.core_config =3D "1S/5C/1T" + self.number_of_ports =3D 1 + self.headers_size =3D HEADER_SIZE['eth'] + HEADER_SIZE['ip'] + \ + HEADER_SIZE['udp'] + self.dut_ports =3D self.dut.get_ports() + self.ports_socket =3D self.dut.get_numa_id(self.dut_ports[0]) + ports =3D [] + for port in xrange(self.number_of_ports): + ports.append(self.dut_ports[port]) + self.core_list =3D self.dut.get_core_list( + self.core_config, socket=3Dself.ports_socket) + self.core_list_user =3D self.core_list[0:3] + self.core_list_host =3D self.core_list[3:5] + self.port_mask =3D utils.create_mask(ports) + self.core_mask_user =3D utils.create_mask(self.core_list_user) + self.core_mask_host =3D utils.create_mask(self.core_list_host) + if self.dut.cores[len(self.dut.cores) - 1]['socket'] =3D=3D '0': + self.socket_mem =3D '1024' + else: + self.socket_mem =3D '1024,1024' + + def set_up(self): + """ + Run before each test case. + """ + # Prepare the result table + self.table_header =3D ['Frame'] + self.table_header.append("Mode") + self.table_header.append("Mpps") + self.table_header.append("% linerate") + self.result_table_create(self.table_header) + + def send_and_verify(self, case_info, frame_size): + """ + Send packet with packet generator and verify + """ + payload_size =3D frame_size - self.headers_size + tgen_input =3D [] + for port in xrange(self.number_of_ports): + rx_port =3D self.tester.get_local_port( + self.dut_ports[port % self.number_of_ports]) + tx_port =3D self.tester.get_local_port( + self.dut_ports[(port) % self.number_of_ports]) + destination_mac =3D self.dut.get_mac_address( + self.dut_ports[(port) % self.number_of_ports]) + self.tester.scapy_append( + 'wrpcap("l2fwd_%d.pcap", [Ether(dst=3D"%s")/IP()/UDP()/("X= "*%d)])' % + (port, destination_mac, payload_size)) + + tgen_input.append((tx_port, rx_port, "l2fwd_%d.pcap" %=20 + port)) + + self.tester.scapy_execute() + _, pps =3D self.tester.traffic_generator_throughput(tgen_input) + Mpps =3D pps / 1000000.0 + self.verify(Mpps > 0, "%s can not receive packets of frame size=20 + %d" % (self.running_case, frame_size)) + + throughput =3D Mpps * 100 / \ + float(self.wirespeed(self.nic, frame_size,=20 + self.number_of_ports)) + + results_row =3D [frame_size] + results_row.append(case_info) + results_row.append(Mpps) + results_row.append(throughput) + self.result_table_add(results_row) + + def start_vhost_testpmd(self): + """ + start testpmd on vhost + """ + # Clean the execution ENV + self.dut.send_expect("rm -rf ./vhost.out", "#") + 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", "#") + command_line_client =3D "./x86_64-native-linuxapp-gcc/app/testpmd = -n %d -c %s --socket-mem " + \ + " %s --legacy-mem --no-pci --file-prefix=3Dv= host --vdev " + \ + "'net_vhost0,iface=3Dvhost-net,queues=3D1' -= - -i --nb-cores=3D1 --txd=3D1024 --rxd=3D1024" + command_line_client =3D command_line_client % ( + self.dut.get_memory_channels(), self.core_mask_host, self.sock= et_mem) + self.vhost.send_expect(command_line_client, "testpmd> ", 120) + self.vhost.send_expect("set fwd mac", "testpmd> ", 120) + self.vhost.send_expect("start", "testpmd> ", 120) + + def start_virtio_testpmd(self, args): + """ + start testpmd on virtio + """ + command_line_user =3D "./x86_64-native-linuxapp-gcc/app/testpmd -n= %d -c %s " + \ + " --socket-mem %s --legacy-mem --file-prefix= =3Dvirtio " + \ + "--vdev=3Dvirtio_user0,mac=3D00:01:02:03:04:05= ,path=3D./vhost-net,queues=3D1,%s " + \ + "-- -i %s --nb-cores=3D2 --txd=3D1024 --rxd=3D= 1024" + command_line_user =3D command_line_user % ( + self.dut.get_memory_channels(), self.core_mask_user, self.sock= et_mem, args["version"], args["path"]) + self.vhost_user.send_expect(command_line_user, "testpmd> ", 120) + self.vhost_user.send_expect("set fwd io", "testpmd> ", 120) + self.vhost_user.send_expect("start", "testpmd> ", 120) + + def close_all_testpmd(self): + """ + close all testpmd of vhost and virtio + """ + self.vhost.send_expect("quit", "#", 60) + self.vhost_user.send_expect("quit", "#", 60) + + def close_all_session(self): + """ + close all session of vhost and vhost-user + """ + self.dut.close_session(self.vhost_user) + self.dut.close_session(self.vhost) + + def test_perf_vhost_single_core_virtio11_mergeable(self): + """ + performance for Vhost PVP virtio 1.1 Mergeable Path. + """ + virtio_pmd_arg =3D {"version": "in_order=3D0,packed_vq=3D1,mrg_rxb= uf=3D1", + "path": "--tx-offloads=3D0x0 --enable-hw-vlan-= strip --rss-ip"} + self.vhost_user =3D self.dut.new_session(suite=3D"user") + self.vhost =3D self.dut.new_session(suite=3D"vhost") + for frame_size in self.frame_sizes: + self.start_vhost_testpmd() + self.start_virtio_testpmd(virtio_pmd_arg) + self.send_and_verify("virtio_1.1_mergeable on", frame_size) + self.close_all_testpmd() + + self.close_all_session() + self.result_table_print() + + def test_perf_vhost_single_core_virtio11_no_mergeable(self): + """ + performance for Vhost PVP virtio1.1 Normal Path. + """ + virtio_pmd_arg =3D {"version": "in_order=3D0,packed_vq=3D1,mrg_rxb= uf=3D0", + "path": "--tx-offloads=3D0x0 --enable-hw-vlan-= strip --rss-ip"} + self.vhost_user =3D self.dut.new_session(suite=3D"user") + self.vhost =3D self.dut.new_session(suite=3D"vhost") + for frame_size in self.frame_sizes: + self.start_vhost_testpmd() + self.start_virtio_testpmd(virtio_pmd_arg) + self.send_and_verify("virtio_1.1_mergeable off", frame_size) + self.close_all_testpmd() + self.close_all_session() + self.result_table_print() + + def test_perf_vhost_single_core_inorder_mergeable(self): + """ + performance for Vhost PVP In_order mergeable Path. + """ + virtio_pmd_arg =3D {"version": "in_order=3D1,mrg_rxbuf=3D1", + "path": "--tx-offloads=3D0x0 --enable-hw-vlan-= strip --rss-ip"} + self.vhost_user =3D self.dut.new_session(suite=3D"user") + self.vhost =3D self.dut.new_session(suite=3D"vhost") + for frame_size in self.frame_sizes: + self.start_vhost_testpmd() + self.start_virtio_testpmd(virtio_pmd_arg) + self.send_and_verify("inoder mergeable on", frame_size) + self.close_all_testpmd() + self.close_all_session() + self.result_table_print() + + def test_perf_vhost_single_core_inorder_no_mergeable(self): + """ + performance for Vhost PVP In_order no_mergeable Path. + """ + virtio_pmd_arg =3D {"version": "in_order=3D1,mrg_rxbuf=3D0", + "path": "--tx-offloads=3D0x0 --enable-hw-vlan-stri= p --rss-ip"} + self.vhost_user =3D self.dut.new_session(suite=3D"user") + self.vhost =3D self.dut.new_session(suite=3D"vhost") + for frame_size in self.frame_sizes: + self.start_vhost_testpmd() + self.start_virtio_testpmd(virtio_pmd_arg) + self.send_and_verify("inoder mergeable off", frame_size) + self.close_all_testpmd() + self.close_all_session() + self.result_table_print() + + def test_perf_vhost_single_core_mergeable(self): + """ + performance for Vhost PVP Mergeable Path. + """ + virtio_pmd_arg =3D {"version": "in_order=3D0,mrg_rxbuf=3D1", + "path": "--tx-offloads=3D0x0 --enable-hw-vlan-= strip --rss-ip"} + self.vhost_user =3D self.dut.new_session(suite=3D"user") + self.vhost =3D self.dut.new_session(suite=3D"vhost") + for frame_size in self.frame_sizes: + self.start_vhost_testpmd() + self.start_virtio_testpmd(virtio_pmd_arg) + self.send_and_verify("mergeable on", frame_size) + self.close_all_testpmd() + self.close_all_session() + self.result_table_print() + + def test_perf_vhost_single_core_normal(self): + """ + performance for Vhost PVP Normal Path. + """ + virtio_pmd_arg =3D {"version": "in_order=3D0,mrg_rxbuf=3D0", + "path": "--tx-offloads=3D0x0 --enable-hw-vlan-= strip --rss-ip"} + self.vhost_user =3D self.dut.new_session(suite=3D"user") + self.vhost =3D self.dut.new_session(suite=3D"vhost") + for frame_size in self.frame_sizes: + self.start_vhost_testpmd() + self.start_virtio_testpmd(virtio_pmd_arg) + self.send_and_verify("normal", frame_size) + self.close_all_testpmd() + self.close_all_session() + self.result_table_print() + + def test_perf_vhost_single_core_vector_rx(self): + """ + performance for Vhost PVP Vector_RX Path + """ + virtio_pmd_arg =3D {"version": "in_order=3D0,mrg_rxbuf=3D0", + "path": "--tx-offloads=3D0x0"} + self.vhost_user =3D self.dut.new_session(suite=3D"user") + self.vhost =3D self.dut.new_session(suite=3D"vhost") + for frame_size in self.frame_sizes: + self.start_vhost_testpmd() + self.start_virtio_testpmd(virtio_pmd_arg) + self.send_and_verify("vector rx", frame_size) + self.close_all_testpmd() + self.close_all_session() + self.result_table_print() + + def tear_down(self): + """ + Run after each test case. + """ + self.dut.send_expect("killall -s INT testpmd", "#") + self.close_all_session() + + def tear_down_all(self): + """ + Run after each test suite. + """ + pass -- 2.7.4