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 5B36FA0555; Wed, 19 Feb 2020 09:48:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 14BDA1BF81; Wed, 19 Feb 2020 09:48:34 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 6B96CB62 for ; Wed, 19 Feb 2020 09:48:32 +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; 19 Feb 2020 00:48:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,459,1574150400"; d="scan'208";a="269097758" Received: from unknown (HELO dpdk-xiaoqimai-dut.sh.intel.com) ([10.240.179.33]) by fmsmga002.fm.intel.com with ESMTP; 19 Feb 2020 00:48:29 -0800 From: Xiao Qimai To: dts@dpdk.org Cc: Xiao Qimai Date: Wed, 19 Feb 2020 16:43:14 +0800 Message-Id: <1582101794-42625-1-git-send-email-qimaix.xiao@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH V2]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" * add param --single-file-segments for 2M env Signed-off-by: Xiao Qimai --- ...stSuite_virtio_user_for_container_networking.py | 32 ++++++++++++++-------- 1 file changed, 21 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..ba303b7 100644 --- a/tests/TestSuite_virtio_user_for_container_networking.py +++ b/tests/TestSuite_virtio_user_for_container_networking.py @@ -96,9 +96,9 @@ 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] + self.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_list_virtio_user = core_list[self.nb_cores+1:self.nb_cores*2+2] self.core_mask_virtio_user = utils.create_mask(core_list_virtio_user) def send_and_verify(self): @@ -133,17 +133,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) @@ -151,10 +153,18 @@ class TestVirtioUserForContainer(TestCase): """ start testpmd as virtio """ - command_line_user = 'docker run -i -t --privileged -v %s/vhost-net:/tmp/vhost-net ' + \ + if self.check_2M_env: + command_line_user = 'docker run -i -t --privileged -v %s/vhost-net:/tmp/vhost-net ' + \ + '-v /mnt/huge:/dev/hugepages ' + \ + '-v %s:%s %s .%s/%s/app/testpmd -c %s -n %d ' + \ + '-m 1024 --no-pci --file-prefix=container --single-file-segments ' + \ + '--vdev=virtio_user0,mac=00:11:22:33:44:10,path=/tmp/vhost-net,queues=%d ' + \ + '-- -i --rxq=%d --txq=%d --nb-cores=%d' + else: + command_line_user = 'docker run -i -t --privileged -v %s/vhost-net:/tmp/vhost-net ' + \ '-v /mnt/huge:/dev/hugepages ' + \ '-v %s:%s %s .%s/%s/app/testpmd -c %s -n %d ' + \ - '-m 1024 --no-pci --file-prefix=container ' + \ + '-m 1024 --no-pci --file-prefix=container --single-file-segments ' + \ '--vdev=virtio_user0,mac=00:11:22:33:44:10,path=/tmp/vhost-net,queues=%d ' + \ '-- -i --rxq=%d --txq=%d --nb-cores=%d' command_line_user = command_line_user % (self.container_base_dir, -- 1.8.3.1