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 A523CA055C; Fri, 27 May 2022 05:21:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C21740E50; Fri, 27 May 2022 05:21:40 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 1436D40DF7 for ; Fri, 27 May 2022 05:21:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653621698; x=1685157698; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=7ctYOzuNBa/Cfr5+LQ2pmIbilS1xhuFYQG/JhYkY76A=; b=EBLA8k9U96y6bRAA0PiscNO6Rh0uw3+bH16PF/reuCFrznfodoBkNJpD e6v8c453hayqkVdRQcv7Mcz6J6BZGQhl1pVSsKMB/AbLo2dgF4v9AKNP+ 8ax0Ay+DR1B8UCROrYFn4F8RbqGi81eKPnar1OTt4nOzPBy5TKGD5EBtj 79vQMR6x26kyG2BM472lgKowEAimSoMd+YshS7oTM4KAxil6IeCvOl/AB 82Lt61H9NTgC8B0s34TfbROonQCmuUATwunhVXxZh0Ef+xuTVVXFk4G1n eS5iGY87lw6V9dZhM3rB+glyY+CG1ador2SDZ5c1Pu7IdQOR1+HxY8XDV A==; X-IronPort-AV: E=McAfee;i="6400,9594,10359"; a="274371814" X-IronPort-AV: E=Sophos;i="5.91,254,1647327600"; d="scan'208";a="274371814" 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:21:36 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647327600"; d="scan'208";a="603610808" 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:21:35 -0700 From: Wei Ling To: dts@dpdk.org Cc: Wei Ling Subject: [dts][PATCH V1 2/2] tests/vm2vm_virtio_user: revert testcase 12 and optimize code Date: Thu, 26 May 2022 23:20:45 -0400 Message-Id: <20220527032045.529149-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- tests/TestSuite_vm2vm_virtio_user.py | 278 +++++++-------------------- 1 file changed, 70 insertions(+), 208 deletions(-) diff --git a/tests/TestSuite_vm2vm_virtio_user.py b/tests/TestSuite_vm2vm_virtio_user.py index 5b833644..4245f96d 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,24 @@ 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 +329,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 +354,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 +361,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 +376,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 +384,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 +399,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 +407,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 +422,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 +430,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 +447,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 +455,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 +471,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 +478,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 +498,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 +520,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 +542,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 +564,36 @@ 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 +616,4 @@ class TestVM2VMVirtioUser(TestCase): """ Run after each test suite. """ - self.bind_nic_driver(self.dut_ports, self.drivername) self.close_all_session() -- 2.25.1