From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 546E5A00C2; Wed, 3 Mar 2021 06:31:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1FD3F40683; Wed, 3 Mar 2021 06:31:04 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 23B374067B for ; Wed, 3 Mar 2021 06:31:01 +0100 (CET) IronPort-SDR: pl/mkvRfwH5AvbmzBKHuC9gwNi9kR81LjSUjaAkcAFRP3k7O3KJPahiYcoggYxjKi4ZiLDSgGq 8CdBHuV1R4aw== X-IronPort-AV: E=McAfee;i="6000,8403,9911"; a="251153719" X-IronPort-AV: E=Sophos;i="5.81,219,1610438400"; d="scan'208";a="251153719" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2021 21:31:00 -0800 IronPort-SDR: fjH6BFyolz64WZ8gtdF7jmNnWrO8wEJkIjWrunfaS1TZnTaaWudQc6svgDxqHR5xBDuw7VVP57 YsdOzsK43iSw== X-IronPort-AV: E=Sophos;i="5.81,219,1610438400"; d="scan'208";a="399508550" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2021 21:30:58 -0800 From: Ling Wei To: dts@dpdk.org Cc: Ling Wei Date: Wed, 3 Mar 2021 13:30:14 +0800 Message-Id: <20210303053014.220817-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V3] tests/vm2vm_virtio_user:fix send packet count wrong issue sync with testplan and optimization script code X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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.Fix test case 12 and 13 check packet count wrong issue sync with testplan. 2.Modify send_* patch function name for increase readability. 3.Add check step about execution drivername is igb_uio or not when run CBDMA test case. Signed-off-by: Ling Wei --- tests/TestSuite_vm2vm_virtio_user.py | 86 ++++++++++++++++++---------- 1 file changed, 55 insertions(+), 31 deletions(-) diff --git a/tests/TestSuite_vm2vm_virtio_user.py b/tests/TestSuite_vm2vm_virtio_user.py index 815afbdd..7f63380d 100644 --- a/tests/TestSuite_vm2vm_virtio_user.py +++ b/tests/TestSuite_vm2vm_virtio_user.py @@ -160,12 +160,11 @@ class TestVM2VMVirtioUser(TestCase): 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): + def check_packet_payload_valid_with_cbdma(self, filename, total_pkts_num, large_8k_pkts_num, large_2k_pkts_num): """ check the payload is valid """ # stop pdump - total_pkts_num = small_pkts_num actual_8k_pkt_num = 0 actual_2k_pkt_num = 0 time.sleep(20) @@ -197,7 +196,10 @@ class TestVM2VMVirtioUser(TestCase): # the virtio0 will send 251 small pkts self.start_virtio_testpmd_with_vhost_net0_cbdma(path_mode, extern_param, ringsize) - def resend_32_large_pkt_from_virtio0(self): + def send_32_2k_pkts_from_virtio0(self): + """ + send 32 2k length packets from virtio_user0 testpmd + """ self.virtio_user0_pmd.execute_cmd('stop') self.virtio_user0_pmd.execute_cmd('set burst 32') self.virtio_user0_pmd.execute_cmd('set txpkts 2000') @@ -343,13 +345,13 @@ class TestVM2VMVirtioUser(TestCase): # then resend 32 large pkts, all will received self.logger.info('check pcap file info about virtio') self.get_dump_file_of_virtio_user(path_mode, extern_params, ringsize) - self.resend_32_large_pkt_from_virtio0() + self.send_32_2k_pkts_from_virtio0() self.check_packet_payload_valid(self.dump_virtio_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num) # get dump pcap file of vhost self.logger.info('check pcap file info about vhost') self.get_dump_file_of_vhost_user(path_mode, extern_params, ringsize) - self.resend_32_large_pkt_from_virtio0() + self.send_32_2k_pkts_from_virtio0() self.check_packet_payload_valid(self.dump_vhost_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num) self.logger.info('diff the pcap file of vhost and virtio') @@ -503,13 +505,13 @@ class TestVM2VMVirtioUser(TestCase): # then virtio send 32 large pkts, the virtio will all received self.logger.info('check pcap file info about virtio') self.get_dump_file_of_virtio_user(path_mode, extern_params, ringsize) - self.resend_32_large_pkt_from_virtio0() + self.send_32_2k_pkts_from_virtio0() self.check_packet_payload_valid(self.dump_virtio_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num) # get dump pcap file of vhost self.logger.info('check pcap file info about vhost') self.get_dump_file_of_vhost_user(path_mode, extern_params, ringsize) - self.resend_32_large_pkt_from_virtio0() + self.send_32_2k_pkts_from_virtio0() self.check_packet_payload_valid(self.dump_vhost_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num) self.logger.info('diff the pcap file of vhost and virtio') @@ -671,9 +673,9 @@ class TestVM2VMVirtioUser(TestCase): self.cbdma_nic_dev_num = 4 self.bind_nic_driver(self.dut_ports) self.get_cbdma_ports_info_and_bind_to_dpdk() - small_pkts_num = 512 large_8k_pkts_num = 502 - large_2k_pkts_num = 10 + large_2k_pkts_num = 64 + total_pkts_num = large_8k_pkts_num + large_2k_pkts_num self.queue_num=2 self.nopci=False path_mode = 'server=1,packed_vq=0,mrg_rxbuf=1,in_order=1' @@ -686,17 +688,22 @@ class TestVM2VMVirtioUser(TestCase): f"--vdev 'eth_vhost1,iface=vhost-net1,queues=2,client=1,dmas=[txq0@{self.cbdma_dev_infos[2]};txq1@{self.cbdma_dev_infos[3]}],dmathr=512'" self.get_dump_file_of_virtio_user_cbdma(path_mode, extern_params, ringsize, vdevs, no_pci=False) - self.send_8k_pkt() - self.check_packet_payload_valid_with_cbdma(self.dump_virtio_pcap, small_pkts_num, large_8k_pkts_num, - large_2k_pkts_num) + self.send_251_8k_and_32_2k_pkts() + # execute stop and port stop all to avoid testpmd tail_pkts issue. + self.vhost_user_pmd.execute_cmd('stop') + self.vhost_user_pmd.execute_cmd('port stop all') + self.check_packet_payload_valid_with_cbdma(self.dump_virtio_pcap, total_pkts_num, large_8k_pkts_num, large_2k_pkts_num) # get dump pcap file of vhost self.logger.info('check pcap file info about vhost') - small_pkts_num = 512 large_8k_pkts_num = 54 - large_2k_pkts_num = 458 + large_2k_pkts_num = 512 + total_pkts_num = large_8k_pkts_num + large_2k_pkts_num self.get_dump_file_of_virtio_user_cbdma(path_mode, extern_params, ringsize, vdevs, no_pci=False) - self.send_multiple_pkt() - self.check_packet_payload_valid_with_cbdma(self.dump_virtio_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num) + self.send_27_8k_and_256_2k_pkts() + # execute stop and port stop all to avoid testpmd tail_pkts issue. + self.vhost_user_pmd.execute_cmd('stop') + self.vhost_user_pmd.execute_cmd('port stop all') + self.check_packet_payload_valid_with_cbdma(self.dump_virtio_pcap, total_pkts_num, large_8k_pkts_num, large_2k_pkts_num) self.logger.info('diff the pcap file of vhost and virtio') @@ -708,9 +715,9 @@ class TestVM2VMVirtioUser(TestCase): self.cbdma_nic_dev_num = 4 self.bind_nic_driver(self.dut_ports) self.get_cbdma_ports_info_and_bind_to_dpdk() - small_pkts_num = 448 large_8k_pkts_num = 54 - large_2k_pkts_num = 394 + large_2k_pkts_num = 448 + total_pkts_num = large_8k_pkts_num + large_2k_pkts_num self.queue_num=2 self.nopci=False path_mode = 'server=1,packed_vq=0,mrg_rxbuf=1,in_order=0' @@ -723,20 +730,26 @@ class TestVM2VMVirtioUser(TestCase): f"--vdev 'eth_vhost1,iface=vhost-net1,queues=2,client=1,dmas=[txq0@{self.cbdma_dev_infos[2]};txq1@{self.cbdma_dev_infos[3]}],dmathr=512'" self.get_dump_file_of_virtio_user_cbdma(path_mode, extern_params, ringsize, vdevs, no_pci=False) - self.send_multiple_pkt_with_8k54_2k394() - self.check_packet_payload_valid_with_cbdma(self.dump_virtio_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num) + self.send_27_8k_and_224_2k_pkts() + # execute stop and port stop all to avoid testpmd tail_pkts issue. + self.vhost_user_pmd.execute_cmd('stop') + self.vhost_user_pmd.execute_cmd('port stop all') + self.check_packet_payload_valid_with_cbdma(self.dump_virtio_pcap, total_pkts_num, large_8k_pkts_num, large_2k_pkts_num) # get dump pcap file of vhost self.logger.info('check pcap file info about vhost') - small_pkts_num = 448 - large_8k_pkts_num = 448 + large_8k_pkts_num = 502 large_2k_pkts_num = 0 + total_pkts_num = large_8k_pkts_num + large_2k_pkts_num self.get_dump_file_of_virtio_user_cbdma(path_mode, extern_params, ringsize, vdevs, no_pci=False) - self.send_multiple_pkt_with_8k448() - self.check_packet_payload_valid_with_cbdma(self.dump_virtio_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num) + self.send_251_8k_pkts() + # execute stop and port stop all to avoid testpmd tail_pkts issue. + self.vhost_user_pmd.execute_cmd('stop') + self.vhost_user_pmd.execute_cmd('port stop all') + self.check_packet_payload_valid_with_cbdma(self.dump_virtio_pcap, total_pkts_num, large_8k_pkts_num, large_2k_pkts_num) self.logger.info('diff the pcap file of vhost and virtio') - def send_multiple_pkt_with_8k54_2k394(self): + def send_27_8k_and_224_2k_pkts(self): self.virtio_user0_pmd.execute_cmd('set burst 1') self.virtio_user0_pmd.execute_cmd('set txpkts 2000,2000,2000,2000') self.virtio_user0_pmd.execute_cmd('start tx_first 27') @@ -746,7 +759,10 @@ class TestVM2VMVirtioUser(TestCase): self.virtio_user0_pmd.execute_cmd('start tx_first 7') self.vhost_user_pmd.execute_cmd('start') - def send_multiple_pkt_with_8k448(self): + def send_251_8k_pkts(self): + """ + send 251 8k length packets from virtio_user0 testpmd + """ self.virtio_user0_pmd.execute_cmd('set burst 1') self.virtio_user0_pmd.execute_cmd('set txpkts 2000,2000,2000,2000') self.virtio_user0_pmd.execute_cmd('start tx_first 27') @@ -756,7 +772,10 @@ class TestVM2VMVirtioUser(TestCase): self.virtio_user0_pmd.execute_cmd('start tx_first 7') self.vhost_user_pmd.execute_cmd('start') - def send_8k_pkt(self): + def send_251_8k_and_32_2k_pkts(self): + """ + send 251 8k and 32 2k length packets from virtio_user0 testpmd + """ self.virtio_user0_pmd.execute_cmd('set burst 1') self.virtio_user0_pmd.execute_cmd('set txpkts 2000,2000,2000,2000') self.virtio_user0_pmd.execute_cmd('start tx_first 27') @@ -768,7 +787,10 @@ class TestVM2VMVirtioUser(TestCase): self.virtio_user0_pmd.execute_cmd('start tx_first 1') self.vhost_user_pmd.execute_cmd('start') - def send_multiple_pkt(self): + def send_27_8k_and_256_2k_pkts(self): + """ + send 27 8k and 256 2k length packets from virtio_user0 testpmd + """ self.virtio_user0_pmd.execute_cmd('set burst 1') self.virtio_user0_pmd.execute_cmd('set txpkts 2000,2000,2000,2000') self.virtio_user0_pmd.execute_cmd('start tx_first 27') @@ -785,9 +807,11 @@ class TestVM2VMVirtioUser(TestCase): """ get all cbdma ports """ + # check driver name in execution.cfg + self.verify(self.drivername == 'igb_uio', + "CBDMA test case only use igb_uio driver, need config drivername=igb_uio in execution.cfg") str_info = 'Misc (rawdev) devices using kernel driver' - out = self.dut.send_expect('./usertools/dpdk-devbind.py --status-dev misc', - '# ', 30) + out = self.dut.send_expect('./usertools/dpdk-devbind.py --status-dev misc', '# ', 30) device_info = out.split('\n') for device in device_info: pci_info = re.search('\s*(0000:\d*:\d*.\d*)', device) @@ -804,4 +828,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=%s %s' % (self.drivername, self.device_str), '# ', 60) -- 2.25.1