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 B31CDA2EFC for ; Wed, 18 Sep 2019 08:14:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 065201BFA2; Wed, 18 Sep 2019 08:14:07 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 22B081BF8A for ; Wed, 18 Sep 2019 08:14:05 +0200 (CEST) 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; 17 Sep 2019 23:14:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,519,1559545200"; d="scan'208";a="216832051" Received: from dpdk-moyufen06.sh.intel.com ([10.67.117.220]) by fmsmga002.fm.intel.com with ESMTP; 17 Sep 2019 23:14:04 -0700 From: yufengmx To: dts@dpdk.org, yinan.wang@intel.com, lihongx.ma@intel.com Cc: yufengmx Date: Wed, 18 Sep 2019 14:14:00 +0800 Message-Id: <20190918061400.4397-2-yufengx.mo@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190918061400.4397-1-yufengx.mo@intel.com> References: <20190918061400.4397-1-yufengx.mo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V1 1/1] tests/pvp_vhost_user_built_in_net_driver: support one 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" socket server set socket memsize to support suite deployed on one socket server. Signed-off-by: yufengmx --- ...uite_pvp_vhost_user_built_in_net_driver.py | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/TestSuite_pvp_vhost_user_built_in_net_driver.py b/tests/TestSuite_pvp_vhost_user_built_in_net_driver.py index 52d9df9..1c13665 100644 --- a/tests/TestSuite_pvp_vhost_user_built_in_net_driver.py +++ b/tests/TestSuite_pvp_vhost_user_built_in_net_driver.py @@ -78,6 +78,10 @@ class TestPVPVhostUserBuiltInNetDriver(TestCase): self.tester.send_expect('mkdir -p %s' % self.out_path, '# ') # create an instance to set stream field setting self.pktgen_helper = PacketGeneratorHelper() + + # set memory size + self.verify(self.sockets > 0, 'cpu socket should not be zero') + self.mem_size = ','.join(['2048']*self.sockets) def set_up(self): """ @@ -100,6 +104,13 @@ class TestPVPVhostUserBuiltInNetDriver(TestCase): self.table_header.append("% linerate") self.result_table_create(self.table_header) + @property + def sockets(self): + sockets = [ + cpu.get('socket') for cpu in self.dut.get_all_cores() + if cpu.get('socket')] + return len(set(sockets)) + def prepare_vhost_switch(self): cmd_info = self.dut.send_expect("grep 'define MAX_QUEUES' %s" % "./examples/vhost/main.c", "# ") @@ -158,12 +169,12 @@ class TestPVPVhostUserBuiltInNetDriver(TestCase): """ self.dut.send_expect("rm -rf ./vhost.out", "#") command_line_client = "./examples/vhost/build/app/vhost-switch " + \ - "-c %s -n %d --socket-mem 2048,2048 -- " + \ + "-c %s -n %d --socket-mem %s -- " + \ "-p 0x1 --mergeable 0 --vm2vm 1 " + \ "--builtin-net-driver --socket-file ./vhost-net" + \ "> ./vhost.out &" command_line_client = command_line_client % (self.core_mask_vhost_user, - self.mem_channels) + self.mem_channels, self.mem_size) self.vhost_switch.send_expect(command_line_client, "# ", 120) time.sleep(15) try: @@ -185,11 +196,12 @@ class TestPVPVhostUserBuiltInNetDriver(TestCase): start testpmd on virtio """ command_line_user = "./%s/app/testpmd -n %d -c %s " + \ - "--no-pci --socket-mem 2048,2048 --file-prefix=virtio-user " + \ + "--no-pci --socket-mem %s --file-prefix=virtio-user " + \ "--vdev=net_virtio_user0,mac=%s,path=./vhost-net,queues=1 " + \ "-- -i --rxq=1 --txq=1" command_line_user = command_line_user % (self.target, - self.mem_channels, self.core_mask_virtio_user, self.virtio_mac) + self.mem_channels, self.core_mask_virtio_user, + self.mem_size, self.virtio_mac) 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 tx_first", "testpmd> ", 120) -- 2.21.0