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 E3FA1A0553; Mon, 17 Feb 2020 13:11:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D86101DAA3; Mon, 17 Feb 2020 13:11:05 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 91E3D1BF9C for ; Mon, 17 Feb 2020 13:11:03 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Feb 2020 04:11:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,452,1574150400"; d="scan'208";a="348488066" Received: from unknown (HELO dpdk-xiaoqimai-dut.sh.intel.com) ([10.240.179.33]) by fmsmga001.fm.intel.com with ESMTP; 17 Feb 2020 04:11:02 -0800 From: Xiao Qimai To: dts@dpdk.org Cc: Xiao Qimai Date: Mon, 17 Feb 2020 20:05:45 +0800 Message-Id: <1581941147-230859-9-git-send-email-qimaix.xiao@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1581941147-230859-1-git-send-email-qimaix.xiao@intel.com> References: <1581941147-230859-1-git-send-email-qimaix.xiao@intel.com> Subject: [dts] [PATCH V1 09/11]tests/TestSuite_pvp_share_lib: optimize testpmd eal parameters 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" Signed-off-by: Xiao Qimai --- tests/TestSuite_pvp_share_lib.py | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/tests/TestSuite_pvp_share_lib.py b/tests/TestSuite_pvp_share_lib.py index 8a6cbf2..3930693 100644 --- a/tests/TestSuite_pvp_share_lib.py +++ b/tests/TestSuite_pvp_share_lib.py @@ -58,8 +58,6 @@ class TestPVPShareLib(TestCase): self.core_list_virtio_user = self.core_list[0:2] self.core_list_vhost_user = self.core_list[2:4] - self.core_mask_virtio_user = utils.create_mask(self.core_list_virtio_user) - self.core_mask_vhost_user = utils.create_mask(self.core_list_vhost_user) self.mem_channels = self.dut.get_memory_channels() self.dst_mac = self.dut.get_mac_address(self.dut_ports[0]) self.prepare_share_lib_env() @@ -129,17 +127,22 @@ class TestPVPShareLib(TestCase): results_row.append(Pct) self.result_table_add(results_row) + @property + def check_2M_env(self): + out = self.dut.send_expect("cat /proc/meminfo |grep Hugepagesize|awk '{print($2)}'", "# ") + return True if out == '2048' else False + def start_testpmd_as_vhost(self, driver): """ start testpmd on vhost """ - command_line_client = "%s/app/testpmd -c %s -n %d " + \ - "--socket-mem 2048,2048 --legacy-mem " + \ - "-d librte_pmd_vhost.so -d librte_pmd_%s.so " + \ - "-d librte_mempool_ring.so --file-prefix=vhost " + \ - "--vdev 'net_vhost0,iface=vhost-net,queues=1' -- -i" - command_line_client = command_line_client % (self.target, - self.core_mask_vhost_user, self.mem_channels, driver) + eal_param = self.dut.create_eal_parameters(socket=self.ports_socket, cores=self.core_list_vhost_user, prefix='vhost', + vdevs=['net_vhost0,iface=vhost-net,queues=1']) + if self.check_2M_env: + eal_param += " --single-file-segments" + eal_param += " -d librte_pmd_vhost.so -d librte_pmd_%s.so -d librte_mempool_ring.so --file-prefix=vhost" % driver + command_line_client = "./%s/app/testpmd " % self.target + eal_param + ' -- -i' + self.vhost_user.send_expect(command_line_client, "testpmd> ", 120) self.vhost_user.send_expect("set fwd mac", "testpmd> ", 120) self.vhost_user.send_expect("start", "testpmd> ", 120) @@ -148,13 +151,13 @@ class TestPVPShareLib(TestCase): """ start testpmd on virtio """ - command_line_user = "./%s/app/testpmd -n %d -c %s " + \ - "--no-pci --socket-mem 2048,2048 --legacy-mem " + \ - "--file-prefix=virtio-user " + \ - "-d librte_pmd_virtio.so -d librte_mempool_ring.so " + \ - "--vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net -- -i" - command_line_user = command_line_user % (self.target, - self.mem_channels, self.core_mask_virtio_user) + eal_param = self.dut.create_eal_parameters(socket=self.ports_socket, cores=self.core_list_virtio_user, prefix='virtio-user', + no_pci=True, vdevs=[ + 'net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net']) + if self.check_2M_env: + eal_param += " --single-file-segments" + eal_param += " -d librte_pmd_virtio.so -d librte_mempool_ring.so" + command_line_user = "./%s/app/testpmd " % self.target + eal_param + " -- -i" self.virtio_user.send_expect(command_line_user, "testpmd> ", 120) self.virtio_user.send_expect("start", "testpmd> ", 120) -- 1.8.3.1