From patchwork Fri May 27 03:30:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 111942 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D6D9DA055C; Fri, 27 May 2022 05:30:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D109D40E50; Fri, 27 May 2022 05:30:57 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 17E0E40DF7 for ; Fri, 27 May 2022 05:30:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653622257; x=1685158257; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=tsmYsuG8ZFi7aS4WxTzYGRaNZYzqxHsdJQzBzsE/cZM=; b=VQGtknSw5BgdSYbjOTmuCiQV+PICWsH6ZdTkQgF+3W24mRhiKR8tMYb5 IDjjHxrH0L+1P4qv4ZerGbX4LxpEEBdzGUaHDl3iZGVCDsZd6Yf9bHftN s40sv/Ph04PpiAf+JPCFbigr3UJSUL5tnLwO2y13W+YSt8KwoAuaIO8Tw OXEjLGPpFfvrwxpoIKDPqCLfgJ8pSjoE41FhnDkGxH3L0j/nYKx/PIpeG vXFhPofKnlaFCifztJUqiL27AkOOZNxLvYrAUeS95fHVbJArVQ0wytKnh c9K9kvoWmYgBD3F4q0uNccTMnvt9ToNVQim52xMHTQ/NHgH48RsQN9DKb A==; X-IronPort-AV: E=McAfee;i="6400,9594,10359"; a="274372885" X-IronPort-AV: E=Sophos;i="5.91,254,1647327600"; d="scan'208";a="274372885" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2022 20:30:56 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647327600"; d="scan'208";a="603614961" Received: from unknown (HELO localhost.localdomain) ([10.239.251.222]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2022 20:30:54 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V2 1/2] test_plans/vm2vm_virtio_user_test_plan: revert testcase 12 Date: Thu, 26 May 2022 23:30:04 -0400 Message-Id: <20220527033004.529667-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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 Revert testcase 12. Signed-off-by: Wei Ling --- test_plans/vm2vm_virtio_user_test_plan.rst | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/test_plans/vm2vm_virtio_user_test_plan.rst b/test_plans/vm2vm_virtio_user_test_plan.rst index c6e4b2ec..ede6e99e 100644 --- a/test_plans/vm2vm_virtio_user_test_plan.rst +++ b/test_plans/vm2vm_virtio_user_test_plan.rst @@ -763,3 +763,43 @@ Test Case 11: packed virtqueue vm2vm vectorized path test with ring size is not testpmd>start tx_first 7 9. Quit pdump,vhost received packets in pdump-vhost-rx.pcap,check headers and payload of all packets in pdump-virtio-rx.pcap and pdump-vhost-rx.pcap and ensure the content are same. + +Test Case 12: packed virtqueue vm2vm vectorized-tx path multi-queues test indirect descriptor +============================================================================================= + +1. Launch vhost by below command:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd/app/dpdk-testpmd -l 1-2 -n 4 --no-pci \ + --vdev 'eth_vhost0,iface=vhost-net,queues=1' --vdev 'eth_vhost1,iface=vhost-net1,queues=1' -- \ + -i --nb-cores=1 --no-flush-rx + +2. Launch virtio-user1 by below command:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd/app/dpdk-testpmd -n 4 -l 7-8 --no-pci --file-prefix=virtio1 --force-max-simd-bitwidth=512 \ + --vdev=net_virtio_user1,mac=00:01:02:03:04:05,path=./vhost-net1,queues=1,packed_vq=1,mrg_rxbuf=1,in_order=1,vectorized=1,queue_size=256 \ + -- -i --nb-cores=1 --txd=256 --rxd=256 + testpmd>set fwd rxonly + testpmd>start + +3. Attach pdump secondary process to primary process by same file-prefix:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-pdump -v --file-prefix=virtio1 -- --pdump 'device_id=net_virtio_user1,queue=*,rx-dev=./pdump-virtio-rx.pcap,mbuf-size=8000' + +4. Launch virtio-user0 and send 8k length packets:: + + ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --force-max-simd-bitwidth=512 --no-pci --file-prefix=virtio \ + --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=1,packed_vq=1,mrg_rxbuf=1,in_order=1,vectorized=1,queue_size=256 \ + -- -i --nb-cores=1 --txd=256 --rxd=256 + + testpmd>set burst 1 + testpmd>start tx_first 27 + testpmd>stop + testpmd>set burst 32 + testpmd>start tx_first 7 + testpmd>stop + testpmd>set txpkts 2000,2000,2000,2000 + testpmd>start tx_first 1 + testpmd>stop + +5. Start vhost, then quit pdump and three testpmd, about packed virtqueue vectorized-tx path, it use the indirect descriptors, the 8k length pkt will just occupies one ring. +So check 256 packets and 56064 bytes received by virtio-user1 and 251 packets with 64 length and 5 packets with 8K length in pdump-virtio-rx.pcap. From patchwork Fri May 27 03:30:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ling, WeiX" X-Patchwork-Id: 111943 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0DE64A055C; Fri, 27 May 2022 05:31:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0423F40E5A; Fri, 27 May 2022 05:31:10 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id CBC9240DF7 for ; Fri, 27 May 2022 05:31:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653622267; x=1685158267; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=yzQe9ELX19eXcEQpuOJ1Ssqo5Sjq0ojNO0sJDwom0HY=; b=AFjiZW/reMW8DRJPomgQ7HYwopsE4eNUOpKPhULmtCv0yV/aT4DoEPCO uqJQuZ0EYfELZgFuf0iYZZuG1Axf11h1kOWaOlMSzOM+ey//50WZg2ODV CJoIwjEIDbN/Srj/WE85F6DS6kT5neciReWyW6v8Jq2fYDSv9+3ZzNntS 8cJb+f4kDCqW/FDZRLBoY8FyB9f4MfX3kvww8tl4byr27MtcNAtbJutxu PsAigSiAVJ5I6x+9FK0FDBasMz+gMUvgwLeqI4if5MCSN0cUjA+61EpgQ 7Zn2TKUshNSuF0uaykyd8/vY+rbvpvr8tqZIovKeGtzaktPpPgbohjPvJ g==; X-IronPort-AV: E=McAfee;i="6400,9594,10359"; a="299708651" X-IronPort-AV: E=Sophos;i="5.91,254,1647327600"; d="scan'208";a="299708651" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2022 20:31:06 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647327600"; d="scan'208";a="603615043" Received: from unknown (HELO localhost.localdomain) ([10.239.251.222]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2022 20:31:04 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V2 2/2] tests/vm2vm_virtio_user: revert testcase 12 and optimize code Date: Thu, 26 May 2022 23:30:14 -0400 Message-Id: <20220527033014.529727-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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 Revert testcase 12 and optimize code, such as delete the useless code. Signed-off-by: Wei Ling Acked-by: Xingguang He Tested-by: Xingguang He --- tests/TestSuite_vm2vm_virtio_user.py | 279 +++++++-------------------- 1 file changed, 71 insertions(+), 208 deletions(-) diff --git a/tests/TestSuite_vm2vm_virtio_user.py b/tests/TestSuite_vm2vm_virtio_user.py index 5b833644..f73a63a3 100644 --- a/tests/TestSuite_vm2vm_virtio_user.py +++ b/tests/TestSuite_vm2vm_virtio_user.py @@ -42,7 +42,6 @@ class TestVM2VMVirtioUser(TestCase): 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() self.dump_port = "device_id=net_virtio_user1" def set_up(self): @@ -172,62 +171,6 @@ class TestVM2VMVirtioUser(TestCase): self.virtio_user0_pmd.execute_cmd("set txpkts 2000") self.virtio_user0_pmd.execute_cmd("start tx_first 1") - def send_251_64_and_32_8k_pkts(self): - """ - send 251 small packets and 32 8K packets from virtio_user0 testpmd - """ - 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") - self.virtio_user0_pmd.execute_cmd("set burst 32") - self.virtio_user0_pmd.execute_cmd("start tx_first 7") - self.virtio_user0_pmd.execute_cmd("stop") - self.virtio_user0_pmd.execute_cmd("set txpkts 2000,2000,2000,2000") - self.virtio_user0_pmd.execute_cmd("start tx_first 1") - self.virtio_user0_pmd.execute_cmd("stop") - - def send_251_960byte_and_32_64byte_pkts(self): - """ - imix small pkts - send 960byte and 64byte length packets from virtio_user0 testpmd - """ - self.virtio_user0_pmd.execute_cmd("set burst 1") - self.virtio_user0_pmd.execute_cmd("set txpkts 64,128,256,512") - self.virtio_user0_pmd.execute_cmd("start tx_first 27") - self.virtio_user0_pmd.execute_cmd("stop") - self.virtio_user0_pmd.execute_cmd("set burst 32") - self.virtio_user0_pmd.execute_cmd("start tx_first 7") - self.virtio_user0_pmd.execute_cmd("stop") - self.virtio_user0_pmd.execute_cmd("set txpkts 64") - self.virtio_user0_pmd.execute_cmd("start tx_first 1") - self.virtio_user0_pmd.execute_cmd("stop") - - def send_27_4640byte_and_224_64byte_pkts(self): - """ - send 27 4640byte and 224 64byte length packets from virtio_user0 testpmd - """ - self.virtio_user0_pmd.execute_cmd("set burst 1") - self.virtio_user0_pmd.execute_cmd("set txpkts 64,256,2000,64,256,2000") - self.virtio_user0_pmd.execute_cmd("start tx_first 27") - self.virtio_user0_pmd.execute_cmd("stop") - self.virtio_user0_pmd.execute_cmd("set burst 32") - self.virtio_user0_pmd.execute_cmd("set txpkts 64") - self.virtio_user0_pmd.execute_cmd("start tx_first 7") - self.virtio_user0_pmd.execute_cmd("stop") - - def send_224_64byte_and_27_4640byte_pkts(self): - """ - send 224 64byte and 27 4640byte length packets from virtio_user0 testpmd - """ - self.virtio_user0_pmd.execute_cmd("set burst 32") - self.virtio_user0_pmd.execute_cmd("set txpkts 64") - self.virtio_user0_pmd.execute_cmd("start tx_first 7") - self.virtio_user0_pmd.execute_cmd("stop") - self.virtio_user0_pmd.execute_cmd("set burst 1") - self.virtio_user0_pmd.execute_cmd("set txpkts 64,256,2000,64,256,2000") - self.virtio_user0_pmd.execute_cmd("start tx_first 27") - self.virtio_user0_pmd.execute_cmd("stop") - def launch_pdump_to_capture_pkt(self, dump_port, file_prefix, filename): """ launch pdump app with dump_port and file_prefix @@ -236,7 +179,7 @@ class TestVM2VMVirtioUser(TestCase): if dump the virtio-testpmd, the virtio-testpmd should started before launch pdump """ eal_params = self.dut.create_eal_parameters( - cores="Default", prefix=file_prefix, fixed_prefix=True + cores="Default", prefix=file_prefix, fixed_prefix=True, ports=[] ) command_line = ( self.app_pdump @@ -299,40 +242,23 @@ 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") - def check_packet_payload_valid( - self, filename, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ): + def check_packet_payload_valid(self, filename, check_dict): """ check the payload is valid """ - # stop pdump - total_pkts_num = small_pkts_num + large_8k_pkts_num + large_2k_pkts_num - time.sleep(20) self.pdump_user.send_expect("^c", "# ", 60) - # quit testpmd - self.quit_all_testpmd() - time.sleep(2) - self.dut.session.copy_file_from(src="%s" % filename, dst="%s" % filename) + self.dut.session.copy_file_from(src=filename, dst=filename) pkt = Packet() pkts = pkt.read_pcapfile(filename) - self.verify( - pkts is not None and len(pkts) == total_pkts_num, - "The virtio/vhost do not capture all the packets" - "expect pkt num is: %d, actual pkt num is: %d" - % (total_pkts_num, len(pkts)), - ) - for i in range(len(pkts)): - if i < small_pkts_num: - pkt_len = 64 - elif i >= small_pkts_num and i < small_pkts_num + large_8k_pkts_num: - pkt_len = 8000 - else: - pkt_len = 2000 + for key, value in check_dict.items(): + count = 0 + for i in range(len(pkts)): + if len(pkts[i]) == key: + count += 1 self.verify( - len(pkts[i]) == pkt_len, - "the received pkts len is wrong," - "the received pkt len is: %d, expect pkt len is: %d" - % (len(pkts[i]), pkt_len), + value == count, + "pdump file: have not include enough packets, length %d, count: %d" + % (key, count), ) def check_vhost_and_virtio_pkts_content(self): @@ -402,30 +328,23 @@ class TestVM2VMVirtioUser(TestCase): Test Case 1: packed virtqueue vm2vm mergeable path test about packed virtqueue path, the 8k length pkt will occupies 1 ring since indirect feature enabled """ - small_pkts_num = 251 - large_8k_pkts_num = 5 - large_2k_pkts_num = 32 path_mode = "packed_vq=1,mrg_rxbuf=1,in_order=0" ringsize = 256 extern_params = "" # get dump pcap file of virtio # the virtio0 will send 283 pkts, but the virtio only will received 256 pkts - # then resend 32 large pkts, all will received + # then resend 32(5 8k and 32 2k) 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.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 - ) - + check_dict = {64: 251, 2000: 32, 8000: 5} + self.check_packet_payload_valid(self.dump_virtio_pcap, check_dict) # get dump pcap file of vhost self.logger.info("check pcap file info about vhost") + self.quit_all_testpmd() self.get_dump_file_of_vhost_user(path_mode, extern_params, ringsize) 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.check_packet_payload_valid(self.dump_vhost_pcap, check_dict) self.logger.info("diff the pcap file of vhost and virtio") self.check_vhost_and_virtio_pkts_content() @@ -434,9 +353,6 @@ class TestVM2VMVirtioUser(TestCase): Test Case 2: packed virtqueue vm2vm inorder mergeable path test about packed inorder mergeable path, the 8k length pkt will occupies 1 ring since indirect feature enabled """ - small_pkts_num = 251 - large_8k_pkts_num = 5 - large_2k_pkts_num = 0 path_mode = "packed_vq=1,mrg_rxbuf=1,in_order=1" ringsize = 256 extern_params = "" @@ -444,17 +360,13 @@ class TestVM2VMVirtioUser(TestCase): # the virtio0 will send 283 pkts, but the virtio only will received 256 pkts self.logger.info("check pcap file info about virtio") self.get_dump_file_of_virtio_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_virtio_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + check_dict = {64: 251, 2000: 0, 8000: 5} + self.check_packet_payload_valid(self.dump_virtio_pcap, check_dict) # get dump pcap file of vhost self.logger.info("check pcap file info about vhost") + self.quit_all_testpmd() self.get_dump_file_of_vhost_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_vhost_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + self.check_packet_payload_valid(self.dump_vhost_pcap, check_dict) self.logger.info("diff the pcap file of vhost and virtio") self.check_vhost_and_virtio_pkts_content() @@ -463,9 +375,6 @@ class TestVM2VMVirtioUser(TestCase): Test Case 3: packed virtqueue vm2vm non-mergeable path test about non-mergeable path, it can not received large pkts """ - small_pkts_num = 251 - large_8k_pkts_num = 0 - large_2k_pkts_num = 0 path_mode = "packed_vq=1,mrg_rxbuf=0,in_order=0" ringsize = 256 extern_params = "" @@ -474,17 +383,13 @@ class TestVM2VMVirtioUser(TestCase): # the no-mergeable path can not received large pkts self.logger.info("check pcap file info about virtio") self.get_dump_file_of_virtio_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_virtio_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + check_dict = {64: 251, 2000: 0, 8000: 0} + self.check_packet_payload_valid(self.dump_virtio_pcap, check_dict) # get dump pcap file of vhost self.logger.info("check pcap file info about vhost") + self.quit_all_testpmd() self.get_dump_file_of_vhost_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_vhost_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + self.check_packet_payload_valid(self.dump_vhost_pcap, check_dict) self.logger.info("diff the pcap file of vhost and virtio") self.check_vhost_and_virtio_pkts_content() @@ -493,9 +398,6 @@ class TestVM2VMVirtioUser(TestCase): Test Case 4: packed virtqueue vm2vm inorder non-mergeable path test about non-mergeable path, it can not received large pkts """ - small_pkts_num = 251 - large_8k_pkts_num = 0 - large_2k_pkts_num = 0 path_mode = "packed_vq=1,mrg_rxbuf=0,in_order=1,vectorized=1" extern_params = "--rx-offloads=0x10" ringsize = 256 @@ -504,17 +406,13 @@ class TestVM2VMVirtioUser(TestCase): # the no-mergeable path can not received large pkts self.logger.info("check pcap file info about virtio") self.get_dump_file_of_virtio_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_virtio_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + check_dict = {64: 251, 2000: 0, 8000: 0} + self.check_packet_payload_valid(self.dump_virtio_pcap, check_dict) # get dump pcap file of vhost self.logger.info("check pcap file info about vhost") + self.quit_all_testpmd() self.get_dump_file_of_vhost_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_vhost_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + self.check_packet_payload_valid(self.dump_vhost_pcap, check_dict) self.logger.info("diff the pcap file of vhost and virtio") self.check_vhost_and_virtio_pkts_content() @@ -523,9 +421,6 @@ class TestVM2VMVirtioUser(TestCase): Test Case 10: packed virtqueue vm2vm inorder non-mergeable path test about non-mergeable path, it can not received large pkts """ - small_pkts_num = 251 - large_8k_pkts_num = 0 - large_2k_pkts_num = 0 path_mode = "packed_vq=1,mrg_rxbuf=0,in_order=1,vectorized=1" extern_params = "" ringsize = 256 @@ -534,17 +429,13 @@ class TestVM2VMVirtioUser(TestCase): # the no-mergeable path can not received large pkts self.logger.info("check pcap file info about virtio") self.get_dump_file_of_virtio_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_virtio_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + check_dict = {64: 251, 2000: 0, 8000: 0} + self.check_packet_payload_valid(self.dump_virtio_pcap, check_dict) # get dump pcap file of vhost self.logger.info("check pcap file info about vhost") + self.quit_all_testpmd() self.get_dump_file_of_vhost_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_vhost_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + self.check_packet_payload_valid(self.dump_vhost_pcap, check_dict) self.logger.info("diff the pcap file of vhost and virtio") self.check_vhost_and_virtio_pkts_content() @@ -555,9 +446,6 @@ class TestVM2VMVirtioUser(TestCase): Test Case 11: packed virtqueue vm2vm inorder non-mergeable path test about non-mergeable path, it can not received large pkts """ - small_pkts_num = 251 - large_8k_pkts_num = 0 - large_2k_pkts_num = 0 path_mode = "packed_vq=1,mrg_rxbuf=0,in_order=1,vectorized=1" extern_params = "" ringsize = 255 @@ -566,17 +454,13 @@ class TestVM2VMVirtioUser(TestCase): # the no-mergeable path can not received large pkts self.logger.info("check pcap file info about virtio") self.get_dump_file_of_virtio_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_virtio_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + check_dict = {64: 251, 2000: 0, 8000: 0} + self.check_packet_payload_valid(self.dump_virtio_pcap, check_dict) # get dump pcap file of vhost self.logger.info("check pcap file info about vhost") + self.quit_all_testpmd() self.get_dump_file_of_vhost_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_vhost_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + self.check_packet_payload_valid(self.dump_vhost_pcap, check_dict) self.logger.info("diff the pcap file of vhost and virtio") self.check_vhost_and_virtio_pkts_content() @@ -586,9 +470,6 @@ class TestVM2VMVirtioUser(TestCase): about split virtqueue path, the 8k length pkt will occupies 1 ring, so, as the rxt=256, if received pkts include 8k chain pkt, also will received up to 256 pkts """ - small_pkts_num = 251 - large_8k_pkts_num = 5 - large_2k_pkts_num = 32 path_mode = "packed_vq=0,mrg_rxbuf=1,in_order=0" ringsize = 256 extern_params = "" @@ -596,20 +477,16 @@ class TestVM2VMVirtioUser(TestCase): # the virtio0 will send 283 pkts, but the virtio only will received 256 pkts # then virtio send 32 large pkts, the virtio will all received self.logger.info("check pcap file info about virtio") + check_dict = {64: 251, 2000: 32, 8000: 5} self.get_dump_file_of_virtio_user(path_mode, extern_params, ringsize) 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 - ) - + self.check_packet_payload_valid(self.dump_virtio_pcap, check_dict) # get dump pcap file of vhost self.logger.info("check pcap file info about vhost") + self.quit_all_testpmd() self.get_dump_file_of_vhost_user(path_mode, extern_params, ringsize) 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.check_packet_payload_valid(self.dump_vhost_pcap, check_dict) self.logger.info("diff the pcap file of vhost and virtio") self.check_vhost_and_virtio_pkts_content() @@ -620,27 +497,20 @@ class TestVM2VMVirtioUser(TestCase): 2000,2000,2000,2000 will need 4 consequent ring, still need one ring put header so, as the rxt=256, if received pkts include 8k chain pkt, it will received up to 252 pkts """ - small_pkts_num = 251 - large_8k_pkts_num = 1 - large_2k_pkts_num = 0 path_mode = "packed_vq=0,mrg_rxbuf=1,in_order=1" ringsize = 256 extern_params = "" # get dump pcap file of virtio # the virtio0 will send 283 pkts, but the virtio only will received 252 pkts self.logger.info("check pcap file info about virtio") + check_dict = {64: 251, 2000: 0, 8000: 1} self.get_dump_file_of_virtio_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_virtio_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + self.check_packet_payload_valid(self.dump_virtio_pcap, check_dict) # get dump pcap file of vhost self.logger.info("check pcap file info about vhost") + self.quit_all_testpmd() self.get_dump_file_of_vhost_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_vhost_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + self.check_packet_payload_valid(self.dump_vhost_pcap, check_dict) self.logger.info("diff the pcap file of vhost and virtio") self.check_vhost_and_virtio_pkts_content() @@ -649,27 +519,20 @@ class TestVM2VMVirtioUser(TestCase): Test Case 7: split virtqueue vm2vm non-mergeable path test about non-mergeable path, it can not received large pkts """ - small_pkts_num = 251 - large_8k_pkts_num = 0 - large_2k_pkts_num = 0 path_mode = "packed_vq=0,mrg_rxbuf=0,in_order=0,vectorized=1" ringsize = 256 extern_params = "--enable-hw-vlan-strip" # get dump pcap file of virtio # the virtio0 will send 283 pkts, but the virtio only will received 251 pkts self.logger.info("check pcap file info about virtio") + check_dict = {64: 251, 2000: 0, 8000: 0} self.get_dump_file_of_virtio_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_virtio_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + self.check_packet_payload_valid(self.dump_virtio_pcap, check_dict) # get dump pcap file of vhost self.logger.info("check pcap file info about vhost") + self.quit_all_testpmd() self.get_dump_file_of_vhost_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_vhost_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + self.check_packet_payload_valid(self.dump_vhost_pcap, check_dict) self.logger.info("diff the pcap file of vhost and virtio") self.check_vhost_and_virtio_pkts_content() @@ -678,27 +541,20 @@ class TestVM2VMVirtioUser(TestCase): Test Case 8: split virtqueue vm2vm inorder non-mergeable path test about non-mergeable path, it can not received large pkts """ - small_pkts_num = 251 - large_8k_pkts_num = 0 - large_2k_pkts_num = 0 path_mode = "packed_vq=0,mrg_rxbuf=0,in_order=1" ringsize = 256 extern_params = "--rx-offloads=0x10" # get dump pcap file of virtio # the virtio0 will send 283 pkts, but the virtio only will received 251 pkts self.logger.info("check pcap file info about virtio") + check_dict = {64: 251, 2000: 0, 8000: 0} self.get_dump_file_of_virtio_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_virtio_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + self.check_packet_payload_valid(self.dump_virtio_pcap, check_dict) # get dump pcap file of vhost self.logger.info("check pcap file info about vhost") + self.quit_all_testpmd() self.get_dump_file_of_vhost_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_vhost_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + self.check_packet_payload_valid(self.dump_vhost_pcap, check_dict) self.logger.info("diff the pcap file of vhost and virtio") self.check_vhost_and_virtio_pkts_content() @@ -707,30 +563,38 @@ class TestVM2VMVirtioUser(TestCase): Test Case 9: split virtqueue vm2vm vector_rx path test about vector_rx path, it can not received large pkts """ - small_pkts_num = 251 - large_8k_pkts_num = 0 - large_2k_pkts_num = 0 path_mode = "packed_vq=0,mrg_rxbuf=0,in_order=0,vectorized=1" ringsize = 256 extern_params = "" # get dump pcap file of virtio # the virtio0 will send 283 pkts, but the virtio only will received 251 pkts self.logger.info("check pcap file info about virtio") + check_dict = {64: 251, 2000: 0, 8000: 0} self.get_dump_file_of_virtio_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_virtio_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + self.check_packet_payload_valid(self.dump_virtio_pcap, check_dict) # get dump pcap file of vhost self.logger.info("check pcap file info about vhost") + self.quit_all_testpmd() self.get_dump_file_of_vhost_user(path_mode, extern_params, ringsize) - self.check_packet_payload_valid( - self.dump_vhost_pcap, small_pkts_num, large_8k_pkts_num, large_2k_pkts_num - ) - + self.check_packet_payload_valid(self.dump_vhost_pcap, check_dict) self.logger.info("diff the pcap file of vhost and virtio") self.check_vhost_and_virtio_pkts_content() + def test_vm2vm_virtio_user_packed_virtqueue_vectorized_path_test_indirect_desc( + self, + ): + """ + Test Case 12: packed virtqueue vm2vm vectorized-tx path multi-queues test indirect descriptor + """ + path_mode = "packed_vq=1,mrg_rxbuf=1,in_order=1,vectorized=1" + ringsize = 256 + extern_params = "" + # get dump pcap file of virtio + self.logger.info("check pcap file info about virtio") + check_dict = {64: 251, 2000: 0, 8000: 5} + self.get_dump_file_of_virtio_user(path_mode, extern_params, ringsize) + self.check_packet_payload_valid(self.dump_virtio_pcap, check_dict) + def close_all_session(self): if getattr(self, "vhost_user", None): self.dut.close_session(self.vhost_user) @@ -753,5 +617,4 @@ class TestVM2VMVirtioUser(TestCase): """ Run after each test suite. """ - self.bind_nic_driver(self.dut_ports, self.drivername) self.close_all_session()