From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D3BA2A0573; Thu, 5 Mar 2020 06:13:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 983932BE3; Thu, 5 Mar 2020 06:13:37 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D4C232BB8 for ; Thu, 5 Mar 2020 06:13:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Mar 2020 21:13:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,516,1574150400"; d="scan'208";a="244168396" Received: from dpdk-yinan-purley.sh.intel.com ([10.67.117.227]) by orsmga006.jf.intel.com with ESMTP; 04 Mar 2020 21:13:33 -0800 From: Yinan To: dts@dpdk.org Cc: Wang Yinan Date: Wed, 4 Mar 2020 22:08:04 +0000 Message-Id: <20200304220804.8520-1-yinan.wang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH v1] tests: add packed ring test for loopback_virtio_user_server_mode 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" From: Wang Yinan Signed-off-by: Wang Yinan --- ...tSuite_loopback_virtio_user_server_mode.py | 110 +++++++++++++++--- 1 file changed, 92 insertions(+), 18 deletions(-) diff --git a/tests/TestSuite_loopback_virtio_user_server_mode.py b/tests/TestSuite_loopback_virtio_user_server_mode.py index ec4dfc1..b3a73af 100644 --- a/tests/TestSuite_loopback_virtio_user_server_mode.py +++ b/tests/TestSuite_loopback_virtio_user_server_mode.py @@ -82,11 +82,11 @@ class TestLoopbackVirtioUserServerMode(TestCase): self.vhost.send_expect(command_line_client, "testpmd> ", 120) self.vhost.send_expect("set fwd mac", "testpmd> ", 120) - def lanuch_virtio_user_testpmd(self): + def lanuch_virtio_user_testpmd(self, args): """ start testpmd of vhost user """ - eal_param = self.dut.create_eal_parameters(cores=self.core_list_user, prefix='virtio', no_pci=True, vdevs=['net_virtio_user0,mac=00:01:02:03:04:05,path=vhost-net,server=1,queues=1']) + eal_param = self.dut.create_eal_parameters(cores=self.core_list_user, prefix='virtio', no_pci=True, vdevs=['net_virtio_user0,mac=00:01:02:03:04:05,path=vhost-net,server=1,queues=1,%s' % args["version"]]) command_line_user = self.dut.target + "/app/testpmd " + eal_param + " -- -i --rxq=1 --txq=1 --no-numa" self.virtio_user.send_expect(command_line_user, "testpmd> ", 120) self.virtio_user.send_expect("set fwd mac", "testpmd> ", 120) @@ -222,26 +222,30 @@ class TestLoopbackVirtioUserServerMode(TestCase): self.dut.close_session(self.vhost) self.dut.close_session(self.virtio_user) - def test_server_mode_launch_vhost_first(self): + def test_server_mode_launch_virtio_first(self): """ - basic test for virtio-user server mode, launch vhost first + basic test for virtio-user server mode, launch virtio-user first """ self.queue_number = 1 self.nb_cores = 1 + virtio_pmd_arg = {"version": "packed_vq=0,in_order=0,mrg_rxbuf=1", + "path": "--tx-offloads=0x0 --enable-hw-vlan-strip"} + self.lanuch_virtio_user_testpmd(virtio_pmd_arg) self.lanuch_vhost_testpmd() - self.lanuch_virtio_user_testpmd() - self.start_to_send_packets(self.vhost, self.virtio_user) - self.calculate_avg_throughput("lanuch vhost first", "") + self.start_to_send_packets(self.virtio_user, self.vhost) + self.calculate_avg_throughput("lanuch virtio first", "") self.result_table_print() self.close_all_testpmd() - def test_server_mode_launch_virtio_first(self): + def test_server_mode_launch_virtio11_first(self): """ basic test for virtio-user server mode, launch virtio-user first """ self.queue_number = 1 self.nb_cores = 1 - self.lanuch_virtio_user_testpmd() + virtio_pmd_arg = {"version": "packed_vq=1,in_order=0,mrg_rxbuf=1", + "path": "--tx-offloads=0x0 --enable-hw-vlan-strip"} + self.lanuch_virtio_user_testpmd(virtio_pmd_arg) self.lanuch_vhost_testpmd() self.start_to_send_packets(self.virtio_user, self.vhost) self.calculate_avg_throughput("lanuch virtio first", "") @@ -283,13 +287,13 @@ class TestLoopbackVirtioUserServerMode(TestCase): self.check_packets_of_each_queue() self.close_all_testpmd() - def test_server_mode_reconnect_with_virtio11_normal_path(self): + def test_server_mode_reconnect_with_virtio11_non_mergeable_path(self): """ - reconnect test with virtio 1.1 normal path and server mode + reconnect test with virtio 1.1 non_mergeable path and server mode """ self.queue_number = 2 self.nb_cores = 2 - case_info = 'virtio1.1 normal path' + case_info = 'virtio1.1 non_mergeable path' mode = "packed_vq=1,in_order=0,mrg_rxbuf=0" extern_params = '--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip' self.lanuch_vhost_testpmd_with_multi_queue() @@ -318,6 +322,76 @@ class TestLoopbackVirtioUserServerMode(TestCase): self.check_packets_of_each_queue() self.close_all_testpmd() + def test_server_mode_reconnect_with_virtio11_inorder_mergeable_path(self): + """ + reconnect test with virtio 1.1 inorder mergeable path and server mode + """ + self.queue_number = 2 + self.nb_cores = 2 + case_info = 'virtio1.1 inorder mergeable path' + mode = "packed_vq=1,in_order=1,mrg_rxbuf=1" + extern_params = '--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip' + self.lanuch_vhost_testpmd_with_multi_queue() + self.lanuch_virtio_user_testpmd_with_multi_queue(mode=mode, extern_params=extern_params) + self.start_to_send_packets(self.vhost, self.virtio_user) + self.calculate_avg_throughput(case_info, "before reconnet") + + # reconnect from vhost + self.logger.info('now reconnet from vhost') + self.relanuch_vhost_testpmd_with_multi_queue() + self.start_to_send_packets(self.virtio_user, self.vhost) + self.calculate_avg_throughput(case_info, "reconnet from vhost") + + # reconnet from virtio + self.logger.info('now reconnet from virtio_user') + self.relanuch_virtio_testpmd_with_multi_queue(mode=mode, extern_params=extern_params) + self.start_to_send_packets(self.vhost, self.virtio_user) + self.calculate_avg_throughput(case_info, "reconnet from virtio user") + + # port restart + self.logger.info('now vhost port restart') + self.port_restart() + self.calculate_avg_throughput(case_info, "after port restart") + + self.result_table_print() + self.check_packets_of_each_queue() + self.close_all_testpmd() + + def test_server_mode_reconnect_with_virtio11_inorder_non_mergeable_path(self): + """ + reconnect test with virtio 1.1 inorder non_mergeable path and server mode + """ + self.queue_number = 2 + self.nb_cores = 2 + case_info = 'virtio1.1 non_mergeable path' + mode = "packed_vq=1,in_order=1,mrg_rxbuf=0" + extern_params = '--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip' + self.lanuch_vhost_testpmd_with_multi_queue() + self.lanuch_virtio_user_testpmd_with_multi_queue(mode=mode, extern_params=extern_params) + self.start_to_send_packets(self.vhost, self.virtio_user) + self.calculate_avg_throughput(case_info, "before reconnet") + + # reconnect from vhost + self.logger.info('now reconnet from vhost') + self.relanuch_vhost_testpmd_with_multi_queue() + self.start_to_send_packets(self.virtio_user, self.vhost) + self.calculate_avg_throughput(case_info, "reconnet from vhost") + + # reconnet from virtio + self.logger.info('now reconnet from virtio_user') + self.relanuch_virtio_testpmd_with_multi_queue(mode=mode, extern_params=extern_params) + self.start_to_send_packets(self.vhost, self.virtio_user) + self.calculate_avg_throughput(case_info, "reconnet from virtio_user") + + # port restart + self.logger.info('now vhost port restart') + self.port_restart() + self.calculate_avg_throughput(case_info, "after port restart") + + self.result_table_print() + self.check_packets_of_each_queue() + self.close_all_testpmd() + def test_server_mode_reconnect_with_virtio10_inorder_mergeable_path(self): """ reconnect test with virtio 1.0 inorder mergeable path and server mode @@ -353,13 +427,13 @@ class TestLoopbackVirtioUserServerMode(TestCase): self.check_packets_of_each_queue() self.close_all_testpmd() - def test_server_mode_reconnect_with_virtio10_inorder_no_mergeable_path(self): + def test_server_mode_reconnect_with_virtio10_inorder_non_mergeable_path(self): """ - reconnect test with virtio 1.0 inorder no_mergeable path and server mode + reconnect test with virtio 1.0 inorder non_mergeable path and server mode """ self.queue_number = 2 self.nb_cores = 2 - case_info = 'virtio1.0 inorder no_mergeable path' + case_info = 'virtio1.0 inorder non_mergeable path' mode = "in_order=1,mrg_rxbuf=0" extern_params = '--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip' self.lanuch_vhost_testpmd_with_multi_queue() @@ -423,13 +497,13 @@ class TestLoopbackVirtioUserServerMode(TestCase): self.check_packets_of_each_queue() self.close_all_testpmd() - def test_server_mode_reconnect_with_virtio10_normal_path(self): + def test_server_mode_reconnect_with_virtio10_non_mergeable_path(self): """ - reconnect test with virtio 1.0 normal path and server mode + reconnect test with virtio 1.0 non_mergeable path and server mode """ self.queue_number = 2 self.nb_cores = 2 - case_info = 'virtio1.0 normal path' + case_info = 'virtio1.0 non_mergeable path' mode = "in_order=0,mrg_rxbuf=0" extern_params = '--tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip' self.lanuch_vhost_testpmd_with_multi_queue() -- 2.17.1