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 44F9CA0525; Fri, 21 Feb 2020 02:55:48 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D9690397D; Fri, 21 Feb 2020 02:55:47 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 8F11525B3 for ; Fri, 21 Feb 2020 02:55:46 +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 fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2020 17:55:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,466,1574150400"; d="scan'208";a="269819692" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 20 Feb 2020 17:55:43 -0800 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 20 Feb 2020 17:55:45 -0800 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 20 Feb 2020 17:55:44 -0800 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 20 Feb 2020 17:55:44 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.222]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.98]) with mapi id 14.03.0439.000; Fri, 21 Feb 2020 09:55:43 +0800 From: "Tu, Lijuan" To: "Xiao, QimaiX" , "dts@dpdk.org" CC: "Xiao, QimaiX" Thread-Topic: [dts] [PATCH V2]tests/TestSuite_virtio_user_for_container_networking: add if sentence to verify 2M env Thread-Index: AQHV5wFvNg9UFaTYfUGuebv5q0kouKgk5f+w Date: Fri, 21 Feb 2020 01:55:42 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBCC851@SHSMSX101.ccr.corp.intel.com> References: <1582101794-42625-1-git-send-email-qimaix.xiao@intel.com> In-Reply-To: <1582101794-42625-1-git-send-email-qimaix.xiao@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Xiao Qimai > Sent: Wednesday, February 19, 2020 4:43 PM > To: dts@dpdk.org > Cc: Xiao, QimaiX > Subject: [dts] [PATCH > V2]tests/TestSuite_virtio_user_for_container_networking: add if sentence = to > verify 2M env >=20 > * add param --single-file-segments for 2M env >=20 > Signed-off-by: Xiao Qimai > --- > ...stSuite_virtio_user_for_container_networking.py | 32 ++++++++++++++--= -- > ---- > 1 file changed, 21 insertions(+), 11 deletions(-) >=20 > 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) >=3D (self.nb_cores*2 + 2), > 'There has not enought cores to test this case %s' % > self.running_case) > - core_list_vhost_user =3D core_list[0:self.nb_cores+1] > + self.core_list_vhost_user =3D core_list[0:self.nb_cores+1] > core_list_virtio_user =3D core_list[self.nb_cores+1:self.nb_core= s*2+2] > - self.core_mask_vhost_user =3D utils.create_mask(core_list_vhost_= user) > + self.core_list_virtio_user =3D core_list[self.nb_cores+1:self.nb= _cores*2+2] > self.core_mask_virtio_user =3D utils.create_mask(core_list_virti= o_user) >=20 > def send_and_verify(self): > @@ -133,17 +133,19 @@ class TestVirtioUserForContainer(TestCase): > results_row.append(throughput) > self.result_table_add(results_row) >=20 > + @property > + def check_2M_env(self): > + hugepage_size =3D self.dut.send_expect("cat /proc/meminfo |grep > Hugepagesize|awk '{print($2)}'", "# ") > + return True if hugepage_size =3D=3D '2048' else False > + > def launch_testpmd_as_vhost(self): > """ > start testpmd as vhost > """ > - command_line_client =3D self.dut.target + '/app/testpmd ' + \ > - '-c %s -n %d --socket-mem 1024,1024 --file= -prefix=3Dvhost ' + \ > - '--vdev "net_vhost0,iface=3Dvhost-net,queu= es=3D%d,client=3D0" ' > + \ > - '-- -i --nb-cores=3D%d' > - command_line_client =3D command_line_client % > (self.core_mask_vhost_user, > - self.mem_channels, self.queue_nu= mber, > - self.nb_cores) > + eal_param =3D > self.dut.create_eal_parameters(cores=3Dself.core_list_vhost_user, > prefix=3D'vhost', vdevs=3D["net_vhost0,iface=3Dvhost-net,queues=3D%d,clie= nt=3D0" % > self.queue_number]) > + if self.check_2M_env: > + eal_param +=3D " --single-file-segments" > + command_line_client =3D self.dut.target + '/app/testpmd ' + eal_= param + > ' -- -i --nb-cores=3D%d' % self.nb_cores > self.vhost_user.send_expect(command_line_client, 'testpmd> ', 30= ) > self.vhost_user.send_expect('start', 'testpmd> ', 30) >=20 > @@ -151,10 +153,18 @@ class TestVirtioUserForContainer(TestCase): > """ > start testpmd as virtio > """ > - command_line_user =3D 'docker run -i -t --privileged -v %s/vhost= - > net:/tmp/vhost-net ' + \ > + if self.check_2M_env: > + command_line_user =3D 'docker run -i -t --privileged -v %s/v= host- > 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=3Dcontainer = --single-file- > segments ' + \ > + '-- > vdev=3Dvirtio_user0,mac=3D00:11:22:33:44:10,path=3D/tmp/vhost-net,queues= =3D%d ' > + \ > + '-- -i --rxq=3D%d --txq=3D%d --nb-cores=3D%d= ' > + else: > + command_line_user =3D 'docker run -i -t --privileged -v %s/v= host- > 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=3Dcontainer = ' + \ > + '-m 1024 --no-pci --file-prefix=3Dcontainer = --single-file- > segments ' + \ > '-- > vdev=3Dvirtio_user0,mac=3D00:11:22:33:44:10,path=3D/tmp/vhost-net,queues= =3D%d ' > + \ > '-- -i --rxq=3D%d --txq=3D%d --nb-cores=3D%d= ' > command_line_user =3D command_line_user % (self.container_base_d= ir, > -- > 1.8.3.1