From patchwork Fri Nov 20 12:15:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiang X-Patchwork-Id: 84405 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 68782A04DD; Fri, 20 Nov 2020 05:16:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5D630C87E; Fri, 20 Nov 2020 05:16:56 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 4D66F3B5 for ; Fri, 20 Nov 2020 05:16:54 +0100 (CET) IronPort-SDR: Ht0pdaIWHwYXjFRWgmhAq/G7Tnk2NXNaq4Rd4xdbZPBSX4kLGi4n8i0exJUr3gOcROb41OfOF8 OckwjQOHBDHQ== X-IronPort-AV: E=McAfee;i="6000,8403,9810"; a="256120405" X-IronPort-AV: E=Sophos;i="5.78,355,1599548400"; d="scan'208";a="256120405" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2020 20:16:52 -0800 IronPort-SDR: ox4Jz2pqk8GX3FDJYD4a8YQCSqQG2osfN/UxMb1gQNLVaf9b7rhQ/Z0j/rmAqM+fgi6COOche6 +9YZj2KNXMvQ== X-IronPort-AV: E=Sophos;i="5.78,355,1599548400"; d="scan'208";a="545292982" Received: from unknown (HELO localhost.localdomain) ([10.240.183.77]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2020 20:16:50 -0800 From: JiangYuX To: dts@dpdk.org Cc: JiangYu Date: Fri, 20 Nov 2020 12:15:38 +0000 Message-Id: <20201120121540.2063135-2-yux.jiang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201120121540.2063135-1-yux.jiang@intel.com> References: <20201120121540.2063135-1-yux.jiang@intel.com> MIME-Version: 1.0 Subject: [dts] [PATCH V1 1/3] tests/loopback_multi_paths_port_restart: Add param to enable AVX512 for vectorized_path 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: JiangYu 1, Add param to enable AVX512 for vectorized_path only 2, Optimize script: testpmd is called with framework unitified-interface Signed-off-by: JiangYu --- .../TestSuite_loopback_multi_paths_port_restart.py | 61 ++++++++++++---------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/tests/TestSuite_loopback_multi_paths_port_restart.py b/tests/TestSuite_loopback_multi_paths_port_restart.py index 54c9756..972a8b2 100644 --- a/tests/TestSuite_loopback_multi_paths_port_restart.py +++ b/tests/TestSuite_loopback_multi_paths_port_restart.py @@ -40,6 +40,7 @@ Inorder_no_mergeable, VIRTIO1.1_mergeable, VIRTIO1.1_normal Path. import utils import time import re +from pmd_output import PmdOutput from test_case import TestCase @@ -74,6 +75,8 @@ class TestLoopbackPortRestart(TestCase): self.vhost = self.dut.new_session(suite="vhost") self.virtio_user = self.dut.new_session(suite="virtio-user") + self.vhost_pmd = PmdOutput(self.dut, self.vhost) + self.virtio_user_pmd = PmdOutput(self.dut, self.virtio_user) def start_vhost_testpmd(self): """ @@ -81,10 +84,10 @@ class TestLoopbackPortRestart(TestCase): """ self.dut.send_expect("killall -s INT %s" % self.testpmd_name, "#") self.dut.send_expect("rm -rf ./vhost-net*", "#") - eal_param = self.dut.create_eal_parameters(cores=self.core_list_host, prefix='vhost', no_pci=True, vdevs=['net_vhost0,iface=vhost-net,queues=1,client=0']) - command_line_client = self.path + eal_param + " -- -i --nb-cores=1 --txd=1024 --rxd=1024" - self.vhost.send_expect(command_line_client, "testpmd> ", 120) - self.vhost.send_expect("set fwd mac", "testpmd> ", 120) + eal_params = "--vdev 'net_vhost0,iface=vhost-net,queues=1,client=0'" + param = "--nb-cores=1 --txd=1024 --rxd=1024" + self.vhost_pmd.start_testpmd(self.core_list_host, param=param, no_pci=True, ports=[], eal_param=eal_params, prefix='vhost', fixed_prefix=True) + self.vhost_pmd.execute_cmd("set fwd mac", "testpmd> ", 120) @property def check_2M_env(self): @@ -95,13 +98,17 @@ class TestLoopbackPortRestart(TestCase): """ 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,%s' % pmd_arg["version"]]) + eal_param = "--vdev 'net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,{}'".format(pmd_arg["version"]) if self.check_2M_env: eal_param += " --single-file-segments" - command_line_user = self.path + eal_param + " -- -i %s --rss-ip --nb-cores=1 --txd=1024 --rxd=1024" % pmd_arg["path"] - self.virtio_user.send_expect(command_line_user, "testpmd> ", 120) - self.virtio_user.send_expect("set fwd mac", "testpmd> ", 120) - self.virtio_user.send_expect("start", "testpmd> ", 120) + if 'vectorized_path' in self.running_case: + eal_param += " --force-max-simd-bitwidth=512" + param = "{} --rss-ip --nb-cores=1 --txd=1024 --rxd=1024".format(pmd_arg["path"]) + self.virtio_user_pmd.start_testpmd(cores=self.core_list_user, param=param, eal_param=eal_param, \ + no_pci=True, ports=[], prefix="virtio", fixed_prefix=True) + + self.virtio_user_pmd.execute_cmd("set fwd mac", "testpmd> ", 120) + self.virtio_user_pmd.execute_cmd("start", "testpmd> ", 120) def check_port_throughput_after_port_stop(self): """ @@ -109,7 +116,7 @@ class TestLoopbackPortRestart(TestCase): """ loop = 1 while(loop <= 5): - out = self.vhost.send_expect("show port stats 0", "testpmd>", 60) + out = self.vhost_pmd.execute_cmd("show port stats 0", "testpmd>", 60) lines = re.search("Rx-pps:\s*(\d*)", out) result = lines.group(1) if result == "0": @@ -124,7 +131,7 @@ class TestLoopbackPortRestart(TestCase): """ loop = 1 while(loop <= 5): - out = self.vhost.send_expect("show port info all", "testpmd> ", 120) + out = self.vhost_pmd.execute_cmd("show port info all", "testpmd> ", 120) port_status = re.findall("Link\s*status:\s*([a-z]*)", out) if("down" not in port_status): break @@ -134,20 +141,20 @@ class TestLoopbackPortRestart(TestCase): def port_restart(self, restart_times=1): if restart_times == 1: - self.vhost.send_expect("stop", "testpmd> ", 120) - self.vhost.send_expect("port stop 0", "testpmd> ", 120) + self.vhost_pmd.execute_cmd("stop", "testpmd> ", 120) + self.vhost_pmd.execute_cmd("port stop 0", "testpmd> ", 120) self.check_port_throughput_after_port_stop() - self.vhost.send_expect("clear port stats all", "testpmd> ", 120) - self.vhost.send_expect("port start all", "testpmd> ", 120) + self.vhost_pmd.execute_cmd("clear port stats all", "testpmd> ", 120) + self.vhost_pmd.execute_cmd("port start all", "testpmd> ", 120) else: for i in range(restart_times): - self.vhost.send_expect("stop", "testpmd> ", 120) - self.vhost.send_expect("port stop 0", "testpmd> ", 120) - self.vhost.send_expect("clear port stats all", "testpmd> ", 120) - self.vhost.send_expect("port start all", "testpmd> ", 120) + self.vhost_pmd.execute_cmd("stop", "testpmd> ", 120) + self.vhost_pmd.execute_cmd("port stop 0", "testpmd> ", 120) + self.vhost_pmd.execute_cmd("clear port stats all", "testpmd> ", 120) + self.vhost_pmd.execute_cmd("port start all", "testpmd> ", 120) self.check_port_link_status_after_port_restart() - self.vhost.send_expect("set burst 1", "testpmd> ", 120) - self.vhost.send_expect("start tx_first 1", "testpmd> ", 120) + self.vhost_pmd.execute_cmd("set burst 1", "testpmd> ", 120) + self.vhost_pmd.execute_cmd("start tx_first 1", "testpmd> ", 120) def update_table_info(self, case_info, frame_size, Mpps, Cycle): results_row = [frame_size] @@ -161,9 +168,9 @@ class TestLoopbackPortRestart(TestCase): calculate the average throughput """ results = 0.0 - self.vhost.send_expect("show port stats all", "testpmd>", 60) + self.vhost_pmd.execute_cmd("show port stats all", "testpmd>", 60) for i in range(10): - out = self.vhost.send_expect("show port stats all", "testpmd>", 60) + out = self.vhost_pmd.execute_cmd("show port stats all", "testpmd>", 60) time.sleep(1) lines = re.search("Rx-pps:\s*(\d*)", out) result = lines.group(1) @@ -177,8 +184,8 @@ class TestLoopbackPortRestart(TestCase): start to send packets and calculate the average throughput """ # start to send packets - self.vhost.send_expect("set txpkts %s" % frame_size, "testpmd>", 60) - self.vhost.send_expect("start tx_first 32", "testpmd>", 60) + self.vhost_pmd.execute_cmd("set txpkts %s" % frame_size, "testpmd>", 60) + self.vhost_pmd.execute_cmd("start tx_first 32", "testpmd>", 60) Mpps = self.calculate_avg_throughput() self.update_table_info(case_info, frame_size, Mpps, "Before Restart") @@ -190,8 +197,8 @@ class TestLoopbackPortRestart(TestCase): """ close testpmd about vhost-user and virtio-user """ - self.vhost.send_expect("quit", "#", 60) - self.virtio_user.send_expect("quit", "#", 60) + self.vhost_pmd.execute_cmd("quit", "#", 60) + self.virtio_user_pmd.execute_cmd("quit", "#", 60) def close_all_session(self): """ From patchwork Fri Nov 20 12:18:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiang X-Patchwork-Id: 84406 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 14039A04DD; Fri, 20 Nov 2020 05:19:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DF090F90; Fri, 20 Nov 2020 05:19:39 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 51B7B3B5 for ; Fri, 20 Nov 2020 05:19:38 +0100 (CET) IronPort-SDR: s2kIscvPXYlmeTnstRKu4R3IqI+mPXfjVoJsXkecE2OmwH71idpLiW7qUUrUIgux1xA7Py+MrN jxFv0xPsdsqw== X-IronPort-AV: E=McAfee;i="6000,8403,9810"; a="233031462" X-IronPort-AV: E=Sophos;i="5.78,355,1599548400"; d="scan'208";a="233031462" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2020 20:19:36 -0800 IronPort-SDR: 1QE3kUciZ2QbI0Bgw8dTMtDk6lAtSZNtSpE0I5kCWkE8xPWdHsEpTdPVvuK68hERSWBZ8VUs1Z SuQvRJZBtC/w== X-IronPort-AV: E=Sophos;i="5.78,355,1599548400"; d="scan'208";a="311310824" Received: from unknown (HELO localhost.localdomain) ([10.240.183.77]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2020 20:19:34 -0800 From: JiangYuX To: dts@dpdk.org Cc: JiangYu Date: Fri, 20 Nov 2020 12:18:38 +0000 Message-Id: <20201120121839.2063190-1-yux.jiang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dts] [PATCH V1 2/3] tests/loopback_multi_queues: Add param to enable AVX512 for vectorized_path 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: JiangYu 1, Add param to enable AVX512 for vectorized_path only 2, Optimize script: testpmd is called with framework unitified-interface Signed-off-by: JiangYu --- tests/TestSuite_loopback_multi_queues.py | 41 +++++++++++++++++++------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/tests/TestSuite_loopback_multi_queues.py b/tests/TestSuite_loopback_multi_queues.py index 86c2ce9..4700c2d 100644 --- a/tests/TestSuite_loopback_multi_queues.py +++ b/tests/TestSuite_loopback_multi_queues.py @@ -39,6 +39,7 @@ Inorder no-mergeable, Virtio 1.1 mergeable, Virtio 1.1 no-mergeable Path. import utils import time import re +from pmd_output import PmdOutput from test_case import TestCase @@ -75,6 +76,8 @@ class TestLoopbackMultiQueues(TestCase): self.vhost = self.dut.new_session(suite="vhost") self.virtio_user = self.dut.new_session(suite="virtio-user") + self.vhost_pmd = PmdOutput(self.dut, self.vhost) + self.virtio_user_pmd = PmdOutput(self.dut, self.virtio_user) def get_core_mask(self): """ @@ -90,10 +93,10 @@ class TestLoopbackMultiQueues(TestCase): """ start testpmd on vhost """ - eal_param = self.dut.create_eal_parameters(cores=self.core_list_host, prefix='vhost', no_pci=True, vdevs=['net_vhost0,iface=vhost-net,queues=%d' % self.queue_number]) - command_line_client = self.path + eal_param + " -- -i --nb-cores=%d --rxq=%d --txq=%d --txd=1024 --rxd=1024" % (self.nb_cores, self.queue_number, self.queue_number) - self.vhost.send_expect(command_line_client, "testpmd> ", 120) - self.vhost.send_expect("set fwd mac", "testpmd> ", 120) + eal_params = "--vdev 'net_vhost0,iface=vhost-net,queues={}'".format(self.queue_number) + param = "--nb-cores={} --rxq={} --txq={} --txd=1024 --rxd=1024".format(self.nb_cores, self.queue_number, self.queue_number) + self.vhost_pmd.start_testpmd(self.core_list_host, param=param, no_pci=True, ports=[], eal_param=eal_params, prefix='vhost', fixed_prefix=True) + self.vhost_pmd.execute_cmd("set fwd mac", "testpmd> ", 120) @property def check_2M_env(self): @@ -104,22 +107,26 @@ class TestLoopbackMultiQueues(TestCase): """ start testpmd on virtio """ - 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,queues=%d,%s' % (self.queue_number, args["version"])]) + eal_param = "--vdev 'net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues={},{}'".format(self.queue_number, args["version"]) if self.check_2M_env: eal_param += " --single-file-segments" - command_line_user = self.path + eal_param + " -- -i %s --nb-cores=%d --rxq=%d --txq=%d --txd=1024 --rxd=1024" % (args["path"], self.nb_cores, self.queue_number, self.queue_number) - self.virtio_user.send_expect(command_line_user, "testpmd> ", 120) - self.virtio_user.send_expect("set fwd mac", "testpmd> ", 120) - self.virtio_user.send_expect("start", "testpmd> ", 120) + if 'vectorized_path' in self.running_case: + eal_param += " --force-max-simd-bitwidth=512" + param = "{} --nb-cores={} --rxq={} --txq={} --txd=1024 --rxd=1024".format(args["path"], self.nb_cores, self.queue_number, self.queue_number) + self.virtio_user_pmd.start_testpmd(cores=self.core_list_user, param=param, eal_param=eal_param, \ + no_pci=True, ports=[], prefix="virtio", fixed_prefix=True) + + self.virtio_user_pmd.execute_cmd("set fwd mac", "testpmd> ", 120) + self.virtio_user_pmd.execute_cmd("start", "testpmd> ", 120) def calculate_avg_throughput(self): """ calculate the average throughput """ results = 0.0 - self.vhost.send_expect("show port stats all", "testpmd>", 60) + self.vhost_pmd.execute_cmd("show port stats all", "testpmd>", 60) for i in range(10): - out = self.vhost.send_expect("show port stats all", "testpmd>", 60) + out = self.vhost_pmd.execute_cmd("show port stats all", "testpmd>", 60) time.sleep(1) lines = re.search("Rx-pps:\s*(\d*)", out) result = lines.group(1) @@ -143,7 +150,7 @@ class TestLoopbackMultiQueues(TestCase): """ check each queue has receive packets """ - out = self.vhost.send_expect("stop", "testpmd> ", 60) + out = self.vhost_pmd.execute_cmd("stop", "testpmd> ", 60) for queue_index in range(0, self.queue_number): queue = "Queue= %d" % queue_index index = out.find(queue) @@ -157,15 +164,15 @@ class TestLoopbackMultiQueues(TestCase): "frame_size:%d, rx-packets:%d, tx-packets:%d" % (frame_size, rx_packets, tx_packets)) - self.vhost.send_expect("clear port stats all", "testpmd> ", 60) + self.vhost_pmd.execute_cmd("clear port stats all", "testpmd> ", 60) def send_and_verify(self, case_info): """ start to send packets and calculate avg throughput """ for frame_size in self.frame_sizes: - self.vhost.send_expect("set txpkts %d" % frame_size, "testpmd> ", 30) - self.vhost.send_expect("start tx_first 32", "testpmd> ", 30) + self.vhost_pmd.execute_cmd("set txpkts %d" % frame_size, "testpmd> ", 30) + self.vhost_pmd.execute_cmd("start tx_first 32", "testpmd> ", 30) Mpps = self.calculate_avg_throughput() self.update_result_table(frame_size, case_info, Mpps) if self.queue_number > 1: @@ -186,8 +193,8 @@ class TestLoopbackMultiQueues(TestCase): """ close all testpmd of vhost and virtio """ - self.vhost.send_expect("quit", "#", 60) - self.virtio_user.send_expect("quit", "#", 60) + self.vhost_pmd.execute_cmd("quit", "#", 60) + self.virtio_user_pmd.execute_cmd("quit", "#", 60) def close_all_session(self): """ From patchwork Fri Nov 20 12:18:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiang X-Patchwork-Id: 84407 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 342FFA04DD; Fri, 20 Nov 2020 05:19:48 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2A3B4C87E; Fri, 20 Nov 2020 05:19:47 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 4CF6E3B5 for ; Fri, 20 Nov 2020 05:19:45 +0100 (CET) IronPort-SDR: yDdHWuobg8kBAUDKdjPUYjEIdHJzHXv7NnFOsU1f7S1kfKQBfezRALdqYERB3ALJOxNgwDluBF iqf000ub+vsA== X-IronPort-AV: E=McAfee;i="6000,8403,9810"; a="170631148" X-IronPort-AV: E=Sophos;i="5.78,355,1599548400"; d="scan'208";a="170631148" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2020 20:19:43 -0800 IronPort-SDR: 9nC88def4VAynXeqY9p6Ed/qJ5iSTvEmxBDEotQ1EUWTiIRRqOKmOLC70mtG8tjWiLD0dFpsUq I/Jzi12qNRUQ== X-IronPort-AV: E=Sophos;i="5.78,355,1599548400"; d="scan'208";a="311310835" Received: from unknown (HELO localhost.localdomain) ([10.240.183.77]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2020 20:19:41 -0800 From: JiangYuX To: dts@dpdk.org Cc: JiangYu Date: Fri, 20 Nov 2020 12:18:39 +0000 Message-Id: <20201120121839.2063190-2-yux.jiang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201120121839.2063190-1-yux.jiang@intel.com> References: <20201120121839.2063190-1-yux.jiang@intel.com> MIME-Version: 1.0 Subject: [dts] [PATCH V1 3/3] tests/loopback_virtio_user_server_mode: Add param to enable AVX512 for vectorized_path 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: JiangYu 1, Add param to enable AVX512 for vectorized_path only 2, Optimize script: testpmd is called with framework unitified-interface Signed-off-by: JiangYu --- .../TestSuite_loopback_virtio_user_server_mode.py | 61 +++++++++++++--------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/tests/TestSuite_loopback_virtio_user_server_mode.py b/tests/TestSuite_loopback_virtio_user_server_mode.py index cb1dc2b..9801175 100644 --- a/tests/TestSuite_loopback_virtio_user_server_mode.py +++ b/tests/TestSuite_loopback_virtio_user_server_mode.py @@ -38,6 +38,7 @@ Test loopback virtio-user server mode import utils import time import re +from pmd_output import PmdOutput from test_case import TestCase @@ -74,15 +75,17 @@ class TestLoopbackVirtioUserServerMode(TestCase): self.vhost = self.dut.new_session(suite="vhost") self.virtio_user = self.dut.new_session(suite="virtio-user") + self.vhost_pmd = PmdOutput(self.dut, self.vhost) + self.virtio_user_pmd = PmdOutput(self.dut, self.virtio_user) def lanuch_vhost_testpmd(self, queue_number=1, nb_cores=1, extern_params=""): """ start testpmd on vhost """ - eal_param = self.dut.create_eal_parameters(cores=self.core_list_host, prefix='vhost', no_pci=True, vdevs=['net_vhost0,iface=vhost-net,client=1,queues=%d' % queue_number]) - command_line_client = self.path + eal_param + " -- -i --rxq=%d --txq=%d --nb-cores=%d %s" % (queue_number, queue_number, nb_cores, extern_params) - self.vhost.send_expect(command_line_client, "testpmd> ", 120) - self.vhost.send_expect("set fwd mac", "testpmd> ", 120) + eal_params = "--vdev 'net_vhost0,iface=vhost-net,client=1,queues={}'".format(queue_number) + param = "--rxq={} --txq={} --nb-cores={} {}".format(queue_number, queue_number, nb_cores, extern_params) + self.vhost_pmd.start_testpmd(self.core_list_host, param=param, no_pci=True, ports=[], eal_param=eal_params, prefix='vhost', fixed_prefix=True) + self.vhost_pmd.execute_cmd("set fwd mac", "testpmd> ", 120) @property def check_2M_env(self): @@ -93,12 +96,15 @@ class TestLoopbackVirtioUserServerMode(TestCase): """ 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,%s' % args["version"]]) + eal_param = "--vdev 'net_virtio_user0,mac=00:01:02:03:04:05,path=vhost-net,server=1,queues=1,{}'".format(args["version"]) if self.check_2M_env: eal_param += " --single-file-segments" - command_line_user = self.path + 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) + if 'vectorized_path' in self.running_case: + eal_param += " --force-max-simd-bitwidth=512" + param = "--rxq=1 --txq=1 --no-numa" + self.virtio_user_pmd.start_testpmd(cores=self.core_list_user, param=param, eal_param=eal_param, \ + no_pci=True, ports=[], prefix="virtio", fixed_prefix=True) + self.virtio_user_pmd.execute_cmd("set fwd mac", "testpmd> ", 120) def lanuch_vhost_testpmd_with_multi_queue(self, extern_params=""): """ @@ -110,12 +116,15 @@ class TestLoopbackVirtioUserServerMode(TestCase): """ 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=%d,%s' % (self.queue_number, mode)]) + eal_param = "--vdev 'net_virtio_user0,mac=00:01:02:03:04:05,path=vhost-net,server=1,queues={},{}'".format(self.queue_number, mode) if self.check_2M_env: eal_param += " --single-file-segments" - command_line_user = self.path + eal_param + " -- -i %s --nb-cores=%d --rxq=%d --txq=%d" % (extern_params, self.nb_cores, self.queue_number, self.queue_number) - self.virtio_user.send_expect(command_line_user, "testpmd> ", 120) - self.virtio_user.send_expect("set fwd mac", "testpmd> ", 120) + if 'vectorized_path' in self.running_case: + eal_param += " --force-max-simd-bitwidth=512" + param = "{} --nb-cores={} --rxq={} --txq={}".format(extern_params, self.nb_cores, self.queue_number, self.queue_number) + self.virtio_user_pmd.start_testpmd(cores=self.core_list_user, param=param, eal_param=eal_param, \ + no_pci=True, ports=[], prefix="virtio", fixed_prefix=True) + self.virtio_user_pmd.execute_cmd("set fwd mac", "testpmd> ", 120) def start_to_send_packets(self, session_rx, session_tx): """ @@ -131,7 +140,7 @@ class TestLoopbackVirtioUserServerMode(TestCase): """ loop = 1 while(loop <= 5): - out = self.vhost.send_expect("show port stats 0", "testpmd>", 60) + out = self.vhost_pmd.execute_cmd("show port stats 0", "testpmd>", 60) lines = re.search("Rx-pps:\s*(\d*)", out) result = lines.group(1) if result == "0": @@ -146,7 +155,7 @@ class TestLoopbackVirtioUserServerMode(TestCase): """ loop = 1 while(loop <= 5): - out = self.vhost.send_expect("show port info all", "testpmd> ", 120) + out = self.vhost_pmd.execute_cmd("show port info all", "testpmd> ", 120) port_status = re.findall("Link\s*status:\s*([a-z]*)", out) if("down" not in port_status): break @@ -163,21 +172,21 @@ class TestLoopbackVirtioUserServerMode(TestCase): res.group(1)) def port_restart(self): - self.vhost.send_expect("stop", "testpmd> ", 120) - self.vhost.send_expect("port stop 0", "testpmd> ", 120) + self.vhost_pmd.execute_cmd("stop", "testpmd> ", 120) + self.vhost_pmd.execute_cmd("port stop 0", "testpmd> ", 120) self.check_port_throughput_after_port_stop() - self.vhost.send_expect("clear port stats all", "testpmd> ", 120) - self.vhost.send_expect("port start 0", "testpmd> ", 120) + self.vhost_pmd.execute_cmd("clear port stats all", "testpmd> ", 120) + self.vhost_pmd.execute_cmd("port start 0", "testpmd> ", 120) self.check_port_link_status_after_port_restart() - self.vhost.send_expect("start tx_first 32", "testpmd> ", 120) + self.vhost_pmd.execute_cmd("start tx_first 32", "testpmd> ", 120) def relanuch_vhost_testpmd_with_multi_queue(self): - self.vhost.send_expect("quit", "#", 60) + self.vhost_pmd.execute_cmd("quit", "#", 60) self.check_link_status(self.virtio_user, "down") self.lanuch_vhost_testpmd_with_multi_queue() def relanuch_virtio_testpmd_with_multi_queue(self, mode, extern_params=""): - self.virtio_user.send_expect("quit", "#", 60) + self.virtio_user_pmd.execute_cmd("quit", "#", 60) self.check_link_status(self.vhost, "down") self.lanuch_virtio_user_testpmd_with_multi_queue(mode, extern_params) @@ -187,9 +196,9 @@ class TestLoopbackVirtioUserServerMode(TestCase): """ results = 0.0 results_row = [] - self.vhost.send_expect("show port stats all", "testpmd>", 60) + self.vhost_pmd.execute_cmd("show port stats all", "testpmd>", 60) for i in range(10): - out = self.vhost.send_expect("show port stats all", "testpmd>", 60) + out = self.vhost_pmd.execute_cmd("show port stats all", "testpmd>", 60) time.sleep(1) lines = re.search("Rx-pps:\s*(\d*)", out) result = lines.group(1) @@ -208,7 +217,7 @@ class TestLoopbackVirtioUserServerMode(TestCase): """ check all the queue has receive packets """ - out = self.vhost.send_expect("stop", "testpmd> ", 60) + out = self.vhost_pmd.execute_cmd("stop", "testpmd> ", 60) for queue_index in range(0, self.queue_number): queue = "Queue= %d" % queue_index index = out.find(queue) @@ -224,8 +233,8 @@ class TestLoopbackVirtioUserServerMode(TestCase): """ close testpmd about vhost-user and virtio-user """ - self.vhost.send_expect("quit", "#", 60) - self.virtio_user.send_expect("quit", "#", 60) + self.vhost_pmd.execute_cmd("quit", "#", 60) + self.virtio_user_pmd.execute_cmd("quit", "#", 60) def close_all_session(self): """