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 CF053A054F; Tue, 18 Feb 2020 11:17:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8DAF31D5A6; Tue, 18 Feb 2020 11:17:22 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 17F701D5A5 for ; Tue, 18 Feb 2020 11:17:20 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Feb 2020 02:17:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,456,1574150400"; d="scan'208";a="268704068" Received: from unknown (HELO dpdk-xiaoqimai-dut.sh.intel.com) ([10.240.179.33]) by fmsmga002.fm.intel.com with ESMTP; 18 Feb 2020 02:17:18 -0800 From: Xiao Qimai To: dts@dpdk.org Cc: Xiao Qimai Date: Tue, 18 Feb 2020 18:12:10 +0800 Message-Id: <1582020730-323282-1-git-send-email-qimaix.xiao@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH V1]tests/TestSuite_virtio_user_for_container_networking: add if sentence to verify 2M env 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" * optimize testpmd eal parameters Signed-off-by: Xiao Qimai --- ...stSuite_virtio_user_for_container_networking.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/TestSuite_virtio_user_for_container_networking.py b/tests/TestSuite_virtio_user_for_container_networking.py index 034587e..cdcae01 100644 --- a/tests/TestSuite_virtio_user_for_container_networking.py +++ b/tests/TestSuite_virtio_user_for_container_networking.py @@ -96,10 +96,8 @@ class TestVirtioUserForContainer(TestCase): self.verify(len(core_list) >= (self.nb_cores*2 + 2), 'There has not enought cores to test this case %s' % self.running_case) - core_list_vhost_user = core_list[0:self.nb_cores+1] - core_list_virtio_user = core_list[self.nb_cores+1:self.nb_cores*2+2] - self.core_mask_vhost_user = utils.create_mask(core_list_vhost_user) - self.core_mask_virtio_user = utils.create_mask(core_list_virtio_user) + self.core_list_vhost_user = core_list[0:self.nb_cores+1] + self.core_list_virtio_user = core_list[self.nb_cores+1:self.nb_cores*2+2] def send_and_verify(self): """ @@ -133,17 +131,19 @@ class TestVirtioUserForContainer(TestCase): results_row.append(throughput) self.result_table_add(results_row) + @property + def check_2M_env(self): + hugepage_size = self.dut.send_expect("cat /proc/meminfo |grep Hugepagesize|awk '{print($2)}'", "# ") + return True if hugepage_size == '2048' else False + def launch_testpmd_as_vhost(self): """ start testpmd as vhost """ - command_line_client = self.dut.target + '/app/testpmd ' + \ - '-c %s -n %d --socket-mem 1024,1024 --file-prefix=vhost ' + \ - '--vdev "net_vhost0,iface=vhost-net,queues=%d,client=0" ' + \ - '-- -i --nb-cores=%d' - command_line_client = command_line_client % (self.core_mask_vhost_user, - self.mem_channels, self.queue_number, - self.nb_cores) + eal_param = self.dut.create_eal_parameters(cores=self.core_list_vhost_user, prefix='vhost', vdevs=["net_vhost0,iface=vhost-net,queues=%d,client=0" % self.queue_number]) + if self.check_2M_env: + eal_param += " --single-file-segments" + command_line_client = self.dut.target + '/app/testpmd ' + eal_param + ' -- -i --nb-cores=%d' % self.nb_cores self.vhost_user.send_expect(command_line_client, 'testpmd> ', 30) self.vhost_user.send_expect('start', 'testpmd> ', 30) -- 1.8.3.1