From patchwork Fri Dec 11 14:50:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 84995 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 97E5AA04DB; Fri, 11 Dec 2020 07:54:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 565C6BC84; Fri, 11 Dec 2020 07:54:39 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 8483B37B7 for ; Fri, 11 Dec 2020 07:54:37 +0100 (CET) IronPort-SDR: Gp84WzaCdUzEPmhwahambfYCE7t6YQ8MXOk16/PLij1BFdWdMiLjp18kUSlmPM255uvI0ufBpi c1eKB3pRj8gg== X-IronPort-AV: E=McAfee;i="6000,8403,9831"; a="171824756" X-IronPort-AV: E=Sophos;i="5.78,410,1599548400"; d="scan'208";a="171824756" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2020 22:54:35 -0800 IronPort-SDR: lnyqriBEhBUSWFDjRc61hBAuMlqCizmutFIh1mBMrtzZQG1l6HihkhEJr1PTsDTdBidBQZF7TD 9WNQa1sq0zVg== X-IronPort-AV: E=Sophos;i="5.78,410,1599548400"; d="scan'208";a="545095647" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2020 22:54:34 -0800 From: lingwei To: dts@dpdk.org Cc: lingwei Date: Fri, 11 Dec 2020 22:50:12 +0800 Message-Id: <20201211145012.57543-1-weix.ling@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1] tests/vm2vm_virtio_user: remove no-pci param when start vhost testpmd in cbdma case 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" 1.remove no-pci param when start vhost testpmd in cbdma case 2.use different prefix in vuser0 and vuser1 when start testpmd Signed-off-by: lingwei Tested-by: Wei Ling Acked-by: Haiyang Zhao --- tests/TestSuite_vm2vm_virtio_user.py | 78 ++++++++++++++-------------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/tests/TestSuite_vm2vm_virtio_user.py b/tests/TestSuite_vm2vm_virtio_user.py index b74567c3..910552c0 100644 --- a/tests/TestSuite_vm2vm_virtio_user.py +++ b/tests/TestSuite_vm2vm_virtio_user.py @@ -52,7 +52,8 @@ class TestVM2VMVirtioUser(TestCase): self.dump_virtio_pcap = "/tmp/pdump-virtio-rx.pcap" self.dump_vhost_pcap = "/tmp/pdump-vhost-rx.pcap" self.vhost_prefix = 'vhost' - self.virtio_prefix = 'virtio' + self.virtio_prefix_0 = 'virtio0' + self.virtio_prefix_1 = 'virtio1' socket_num = len(set([int(core['socket']) for core in self.dut.cores])) self.socket_mem = ','.join(['1024']*socket_num) self.get_core_list() @@ -63,13 +64,14 @@ class TestVM2VMVirtioUser(TestCase): self.ports_socket = self.dut.get_numa_id(self.dut_ports[0]) self.queue_num=1 self.device_str='' - self.vhost_pmd_session = self.dut.new_session(suite="vhost-user") - self.virtio_user0_pmd_session = self.dut.new_session(suite="virtio-user0") - self.virtio_user1_pmd_session = self.dut.new_session(suite="virtio-user1") - self.pdump_session = self.dut.new_session(suite="pdump") - self.vhost_pmd = PmdOutput(self.dut, self.vhost_pmd_session) - self.virtio_user0_pmd = PmdOutput(self.dut, self.virtio_user0_pmd_session) - self.virtio_user1_pmd = PmdOutput(self.dut, self.virtio_user1_pmd_session) + self.vhost_user = self.dut.new_session(suite="vhost-user") + self.virtio_user0 = self.dut.new_session(suite="virtio-user0") + self.virtio_user1 = self.dut.new_session(suite="virtio-user1") + self.pdump_user = self.dut.new_session(suite="pdump-user") + self.vhost_user_pmd = PmdOutput(self.dut, self.vhost_user) + self.virtio_user0_pmd = PmdOutput(self.dut, self.virtio_user0) + self.virtio_user1_pmd = PmdOutput(self.dut, self.virtio_user1) + self.dut.restore_interfaces() def set_up(self): """ @@ -91,7 +93,7 @@ class TestVM2VMVirtioUser(TestCase): self.core_list_virtio0 = self.cores_list[2:4] self.core_list_virtio1 = self.cores_list[4:6] - def launch_vhost_testpmd(self, vdev_num, fixed_prefix=False, fwd_mode='io',vdevs=None): + def launch_vhost_testpmd(self, vdev_num, fixed_prefix=False, fwd_mode='io',vdevs=None, no_pci=True): eal_params = '' if vdevs: eal_params = vdevs @@ -100,9 +102,9 @@ class TestVM2VMVirtioUser(TestCase): for i in range(vdev_num): eal_params += "--vdev 'net_vhost{},iface=./vhost-net{},queues=1' ".format(i, i) params = "--nb-cores=1 --no-flush-rx" - self.vhost_pmd.start_testpmd(cores=self.core_list_vhost, param=params, eal_param=eal_params, \ - no_pci=True, ports=[],prefix=self.vhost_prefix, fixed_prefix=fixed_prefix) - self.vhost_pmd.execute_cmd('set fwd %s' % fwd_mode) + self.vhost_user_pmd.start_testpmd(cores=self.core_list_vhost, param=params, eal_param=eal_params, \ + no_pci=no_pci, ports=[],prefix=self.vhost_prefix, fixed_prefix=fixed_prefix) + self.vhost_user_pmd.execute_cmd('set fwd %s' % fwd_mode) @property def check_2M_env(self): @@ -121,7 +123,7 @@ class TestVM2VMVirtioUser(TestCase): eal_params += " --force-max-simd-bitwidth=512" params = "--nb-cores=1 --txd={} --rxd={} {}".format(ringsize, ringsize, extern_params) self.virtio_user1_pmd.start_testpmd(cores=self.core_list_virtio1, param=params, eal_param=eal_params, \ - no_pci=True, ports=[], prefix=self.virtio_prefix, fixed_prefix=True) + no_pci=True, ports=[], prefix=self.virtio_prefix_1, fixed_prefix=True) self.virtio_user1_pmd.execute_cmd('set fwd rxonly') self.virtio_user1_pmd.execute_cmd('start') @@ -138,7 +140,7 @@ class TestVM2VMVirtioUser(TestCase): eal_params += " --force-max-simd-bitwidth=512" params = "--nb-cores=1 --txd={} --rxd={} {}".format(ringsize, ringsize, extern_params) self.virtio_user0_pmd.start_testpmd(cores=self.core_list_virtio0, param=params, eal_param=eal_params, \ - no_pci=True, ports=[], prefix='virtio0', fixed_prefix=True) + no_pci=True, ports=[], prefix=self.virtio_prefix_0, fixed_prefix=True) self.virtio_user0_pmd.execute_cmd('set burst 1') self.virtio_user0_pmd.execute_cmd('start tx_first 27') self.virtio_user0_pmd.execute_cmd('stop') @@ -155,8 +157,8 @@ class TestVM2VMVirtioUser(TestCase): if self.check_2M_env: eal_params += " --single-file-segments " params = "--nb-cores=1 --txd={} --rxd={} {}".format(ringsize, ringsize, extern_params) - self.virtio_user_pmd.start_testpmd(cores=self.core_list_virtio1, param=params, eal_param=eal_params, \ - no_pci=True, ports=[], prefix=self.virtio_prefix, fixed_prefix=True) + self.virtio_user0_pmd.start_testpmd(cores=self.core_list_virtio0, param=params, eal_param=eal_params, \ + no_pci=True, ports=[],prefix=self.virtio_prefix_0, fixed_prefix=True) def check_packet_payload_valid_with_cbdma(self, filename, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num): """ @@ -167,7 +169,7 @@ class TestVM2VMVirtioUser(TestCase): actual_8k_pkt_num = 0 actual_2k_pkt_num = 0 time.sleep(20) - self.pdump_session.send_expect('^c', '# ', 60) + self.pdump_user.send_expect('^c', '# ', 60) # quit testpmd self.quit_all_testpmd() time.sleep(2) @@ -187,11 +189,11 @@ class TestVM2VMVirtioUser(TestCase): self.verify(large_2k_pkts_num == actual_2k_pkt_num, f"2K packet quantity error,expected value:{large_2k_pkts_num}" f", actual value : {actual_2k_pkt_num}") - def get_dump_file_of_virtio_user_cbdma(self, path_mode, extern_param, ringsize, vdevs=None): + def get_dump_file_of_virtio_user_cbdma(self, path_mode, extern_param, ringsize, vdevs=None, no_pci=False): dump_port = 'device_id=net_virtio_user1' - self.launch_vhost_testpmd(vdev_num=2, vdevs=vdevs) + self.launch_vhost_testpmd(vdev_num=2, vdevs=vdevs, no_pci=no_pci) self.start_virtio_testpmd_with_vhost_net1(path_mode, extern_param, ringsize) - self.launch_pdump_to_capture_pkt(dump_port, self.virtio_prefix, self.dump_virtio_pcap) + self.launch_pdump_to_capture_pkt(dump_port, self.virtio_prefix_1, self.dump_virtio_pcap) # the virtio0 will send 251 small pkts self.start_virtio_testpmd_with_vhost_net0_cbdma(path_mode, extern_param, ringsize) @@ -212,7 +214,7 @@ class TestVM2VMVirtioUser(TestCase): prefix=file_prefix, fixed_prefix=True) command_line = self.app_pdump + " %s -v -- " + \ "--pdump '%s,queue=*,rx-dev=%s,mbuf-size=8000'" - self.pdump_session.send_expect(command_line % (eal_params, dump_port, filename), 'Port') + self.pdump_user.send_expect(command_line % (eal_params, dump_port, filename), 'Port') def get_dump_file_of_virtio_user(self, path_mode, extern_param, ringsize): """ @@ -223,7 +225,7 @@ class TestVM2VMVirtioUser(TestCase): dump_port = 'device_id=net_virtio_user1' self.launch_vhost_testpmd(vdev_num=2) self.start_virtio_testpmd_with_vhost_net1(path_mode, extern_param, ringsize) - self.launch_pdump_to_capture_pkt(dump_port, self.virtio_prefix, self.dump_virtio_pcap) + self.launch_pdump_to_capture_pkt(dump_port, self.virtio_prefix_1, self.dump_virtio_pcap) # the virtio0 will send 251 small pkts self.start_virtio_testpmd_with_vhost_net0(path_mode, extern_param, ringsize) # then send 32 large pkts @@ -232,7 +234,7 @@ class TestVM2VMVirtioUser(TestCase): self.virtio_user0_pmd.execute_cmd('set txpkts 2000,2000,2000,2000') self.virtio_user0_pmd.execute_cmd('start tx_first 1') # packet will fwd after vhost testpmd start - self.vhost_pmd.execute_cmd('start') + self.vhost_user_pmd.execute_cmd('start') def get_dump_file_of_vhost_user(self, path_mode, extern_params, ringsize): """ @@ -242,7 +244,7 @@ class TestVM2VMVirtioUser(TestCase): """ dump_port = 'port=0' self.launch_vhost_testpmd(vdev_num=1, fixed_prefix=True, fwd_mode='rxonly') - self.vhost_pmd.execute_cmd('start') + self.vhost_user_pmd.execute_cmd('start') self.launch_pdump_to_capture_pkt(dump_port, self.vhost_prefix, self.dump_vhost_pcap) # the virtio0 send 251 small pkts self.start_virtio_testpmd_with_vhost_net0(path_mode, extern_params, ringsize) @@ -269,7 +271,7 @@ class TestVM2VMVirtioUser(TestCase): # stop pdump total_pkts_num = small_pkts_num + large_8k_pkts_num + large_2k_pkts_num time.sleep(20) - self.pdump_session.send_expect('^c', '# ', 60) + self.pdump_user.send_expect('^c', '# ', 60) # quit testpmd self.quit_all_testpmd() time.sleep(2) @@ -320,10 +322,10 @@ class TestVM2VMVirtioUser(TestCase): 'pkt index is: %d, the load index include %s' % (i, diff_list)) def quit_all_testpmd(self): - self.vhost_pmd.quit() + self.vhost_user_pmd.quit() self.virtio_user0_pmd.quit() self.virtio_user1_pmd.quit() - self.pdump_session.send_expect('^c', '# ', 60) + self.pdump_user.send_expect('^c', '# ', 60) def test_vm2vm_virtio_user_packed_virtqueue_mergeable_path(self): """ @@ -617,13 +619,13 @@ class TestVM2VMVirtioUser(TestCase): def close_all_session(self): if getattr(self, 'vhost_user', None): - self.dut.close_session(self.vhost_pmd_session) + self.dut.close_session(self.vhost_user) if getattr(self, 'virtio-user0', None): - self.dut.close_session(self.virtio_user0_pmd_session) + self.dut.close_session(self.virtio_user0) if getattr(self, 'virtio-user1', None): - self.dut.close_session(self.virtio_user1_pmd_session) + self.dut.close_session(self.virtio_user1) if getattr(self, 'pdump_session', None): - self.dut.close_session(self.pdump_session) + self.dut.close_session(self.pdump_user) def bind_cbdma_device_to_kernel(self): if self.device_str is not None: @@ -742,7 +744,7 @@ class TestVM2VMVirtioUser(TestCase): self.virtio_user0_pmd.execute_cmd('set burst 32') self.virtio_user0_pmd.execute_cmd('set txpkts 2000') self.virtio_user0_pmd.execute_cmd('start tx_first 7') - self.vhost_pmd.execute_cmd('start') + self.vhost_user_pmd.execute_cmd('start') def send_multiple_pkt_with_8k448(self): self.virtio_user0_pmd.execute_cmd('set burst 1') @@ -752,7 +754,7 @@ class TestVM2VMVirtioUser(TestCase): self.virtio_user0_pmd.execute_cmd('set burst 32') self.virtio_user0_pmd.execute_cmd('set txpkts 2000,2000,2000,2000') self.virtio_user0_pmd.execute_cmd('start tx_first 7') - self.vhost_pmd.execute_cmd('start') + self.vhost_user_pmd.execute_cmd('start') def send_8k_pkt(self): self.virtio_user0_pmd.execute_cmd('set burst 1') @@ -764,7 +766,7 @@ class TestVM2VMVirtioUser(TestCase): self.virtio_user0_pmd.execute_cmd('stop') self.virtio_user0_pmd.execute_cmd('set txpkts 2000') self.virtio_user0_pmd.execute_cmd('start tx_first 1') - self.vhost_pmd.execute_cmd('start') + self.vhost_user_pmd.execute_cmd('start') def send_multiple_pkt(self): self.virtio_user0_pmd.execute_cmd('set burst 1') @@ -777,15 +779,12 @@ class TestVM2VMVirtioUser(TestCase): self.virtio_user0_pmd.execute_cmd('stop') self.virtio_user0_pmd.execute_cmd('set txpkts 2000') self.virtio_user0_pmd.execute_cmd('start tx_first 1') - self.vhost_pmd.execute_cmd('start') - - + self.vhost_user_pmd.execute_cmd('start') def get_cbdma_ports_info_and_bind_to_dpdk(self): """ get all cbdma ports """ - str_info = 'Misc (rawdev) devices using kernel driver' out = self.dut.send_expect('./usertools/dpdk-devbind.py --status-dev misc', '# ', 30) @@ -805,5 +804,4 @@ class TestVM2VMVirtioUser(TestCase): self.cbdma_dev_infos.append(pci_info.group(1)) self.verify(len(self.cbdma_dev_infos) >= 8, 'There no enough cbdma device to run this suite') self.device_str = ' '.join(self.cbdma_dev_infos[0:self.cbdma_nic_dev_num]) - self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=igb_uio %s' % - self.device_str, '# ', 60) + self.dut.send_expect('./usertools/dpdk-devbind.py --force --bind=igb_uio %s' % self.device_str, '# ', 60)