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 80AA4A04B0; Fri, 14 Aug 2020 11:33:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 363851C0CD; Fri, 14 Aug 2020 11:33:18 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id DA8CE1C0C5 for ; Fri, 14 Aug 2020 11:33:15 +0200 (CEST) IronPort-SDR: vMESFuq/Ukgs6T6BVFoid57tGNvGCXA4WZCXc466MAzdhhZNuFtkUf0ZspUCWUUE9XCpiZSLE5 Ax26s+OYZp3g== X-IronPort-AV: E=McAfee;i="6000,8403,9712"; a="172429344" X-IronPort-AV: E=Sophos;i="5.76,311,1592895600"; d="scan'208";a="172429344" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2020 02:33:14 -0700 IronPort-SDR: 5IB4kmulGxqEJVjHfThV7HmI4/GCbnOiuoLhtCY/dITvt8P76bhDZoHH1xGeKiZ3t6DIOjv7/P SY/YnpRJ6LHQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,311,1592895600"; d="scan'208";a="309334448" Received: from unknown (HELO localhost.localdomain) ([10.240.183.52]) by orsmga002.jf.intel.com with ESMTP; 14 Aug 2020 02:33:12 -0700 From: Xiao Qimai To: dts@dpdk.org Cc: Xiao Qimai Date: Fri, 14 Aug 2020 09:15:19 +0000 Message-Id: <20200814091520.62326-1-qimaix.xiao@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V1] update virtio func cases to support 2M hugepage 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 eal parameter single-file-segments for 2M env test Signed-off-by: Xiao Qimai --- tests/TestSuite_loopback_multi_paths_port_restart.py | 7 +++++++ tests/TestSuite_loopback_multi_queues.py | 7 +++++++ tests/TestSuite_loopback_virtio_user_server_mode.py | 9 +++++++++ ...estSuite_pvp_virtio_user_multi_queues_port_restart.py | 7 +++++++ tests/TestSuite_vhost_1024_ethports.py | 9 +++++++++ tests/TestSuite_vhost_enqueue_interrupt.py | 7 +++++++ tests/TestSuite_vhost_event_idx_interrupt.py | 7 +++++++ tests/TestSuite_vhost_virtio_user_interrupt.py | 7 +++++++ tests/TestSuite_vm2vm_virtio_pmd.py | 9 +++++++++ tests/TestSuite_vm2vm_virtio_user.py | 9 +++++++++ 10 files changed, 78 insertions(+) diff --git a/tests/TestSuite_loopback_multi_paths_port_restart.py b/tests/TestSuite_loopback_multi_paths_port_restart.py index 3f44232..1e91af4 100644 --- a/tests/TestSuite_loopback_multi_paths_port_restart.py +++ b/tests/TestSuite_loopback_multi_paths_port_restart.py @@ -84,11 +84,18 @@ class TestLoopbackPortRestart(TestCase): self.vhost.send_expect(command_line_client, "testpmd> ", 120) self.vhost.send_expect("set fwd mac", "testpmd> ", 120) + @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_virtio_user_testpmd(self, pmd_arg): """ start testpmd of vhost user """ eal_param = self.dut.create_eal_parameters(cores=self.core_list_user, prefix='virtio', no_pci=True, vdevs=['net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,%s' % pmd_arg["version"]]) + if self.check_2M_env: + eal_param += " --single-file-segments" command_line_user = self.dut.target + "/app/testpmd " + eal_param + " -- -i %s --rss-ip --nb-cores=1 --txd=1024 --rxd=1024" % pmd_arg["path"] self.virtio_user.send_expect(command_line_user, "testpmd> ", 120) self.virtio_user.send_expect("set fwd mac", "testpmd> ", 120) diff --git a/tests/TestSuite_loopback_multi_queues.py b/tests/TestSuite_loopback_multi_queues.py index 10abb72..8300dfc 100644 --- a/tests/TestSuite_loopback_multi_queues.py +++ b/tests/TestSuite_loopback_multi_queues.py @@ -93,11 +93,18 @@ class TestLoopbackMultiQueues(TestCase): self.vhost.send_expect(command_line_client, "testpmd> ", 120) self.vhost.send_expect("set fwd mac", "testpmd> ", 120) + @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_virtio_testpmd(self, args): """ start testpmd on virtio """ eal_param = self.dut.create_eal_parameters(cores=self.core_list_user, prefix='virtio', no_pci=True, vdevs=['net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=%d,%s' % (self.queue_number, args["version"])]) + if self.check_2M_env: + eal_param += " --single-file-segments" command_line_user = self.dut.target + "/app/testpmd " + eal_param + " -- -i %s --nb-cores=%d --rxq=%d --txq=%d --txd=1024 --rxd=1024" % (args["path"], self.nb_cores, self.queue_number, self.queue_number) self.virtio_user.send_expect(command_line_user, "testpmd> ", 120) self.virtio_user.send_expect("set fwd mac", "testpmd> ", 120) diff --git a/tests/TestSuite_loopback_virtio_user_server_mode.py b/tests/TestSuite_loopback_virtio_user_server_mode.py index 742aa09..d329d46 100644 --- a/tests/TestSuite_loopback_virtio_user_server_mode.py +++ b/tests/TestSuite_loopback_virtio_user_server_mode.py @@ -82,11 +82,18 @@ class TestLoopbackVirtioUserServerMode(TestCase): self.vhost.send_expect(command_line_client, "testpmd> ", 120) self.vhost.send_expect("set fwd mac", "testpmd> ", 120) + @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 lanuch_virtio_user_testpmd(self, args): """ start testpmd of vhost user """ eal_param = self.dut.create_eal_parameters(cores=self.core_list_user, prefix='virtio', no_pci=True, vdevs=['net_virtio_user0,mac=00:01:02:03:04:05,path=vhost-net,server=1,queues=1,%s' % args["version"]]) + if self.check_2M_env: + eal_param += " --single-file-segments" command_line_user = self.dut.target + "/app/testpmd " + eal_param + " -- -i --rxq=1 --txq=1 --no-numa" self.virtio_user.send_expect(command_line_user, "testpmd> ", 120) self.virtio_user.send_expect("set fwd mac", "testpmd> ", 120) @@ -102,6 +109,8 @@ class TestLoopbackVirtioUserServerMode(TestCase): start testpmd of vhost user """ eal_param = self.dut.create_eal_parameters(cores=self.core_list_user, prefix='virtio', no_pci=True, vdevs=['net_virtio_user0,mac=00:01:02:03:04:05,path=vhost-net,server=1,queues=%d,%s' % (self.queue_number, mode)]) + if self.check_2M_env: + eal_param += " --single-file-segments" command_line_user = self.dut.target + "/app/testpmd " + eal_param + " -- -i %s --nb-cores=%d --rxq=%d --txq=%d" % (extern_params, self.nb_cores, self.queue_number, self.queue_number) self.virtio_user.send_expect(command_line_user, "testpmd> ", 120) self.virtio_user.send_expect("set fwd mac", "testpmd> ", 120) diff --git a/tests/TestSuite_pvp_virtio_user_multi_queues_port_restart.py b/tests/TestSuite_pvp_virtio_user_multi_queues_port_restart.py index 0cd6fb2..c35f79d 100644 --- a/tests/TestSuite_pvp_virtio_user_multi_queues_port_restart.py +++ b/tests/TestSuite_pvp_virtio_user_multi_queues_port_restart.py @@ -99,6 +99,11 @@ class TestPVPVirtioUserMultiQueuesPortRestart(TestCase): self.vhost.send_expect("set fwd mac", "testpmd> ", 120) self.vhost.send_expect("start", "testpmd> ", 120) + @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_virtio_user_testpmd(self, vdevs, vector_flag=False): """ start testpmd in vm depend on different path @@ -106,6 +111,8 @@ class TestPVPVirtioUserMultiQueuesPortRestart(TestCase): testcmd = self.dut.target + "/app/testpmd " eal_params = self.dut.create_eal_parameters(cores=self.core_list[5:8], prefix='virtio', no_pci=True, vdevs=[vdevs]) + if self.check_2M_env: + eal_params += " --single-file-segments" if vector_flag: para = " -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip --nb-cores=2 --rxq=%s --txq=%s --rss-ip" % ( self.queue_number, self.queue_number) diff --git a/tests/TestSuite_vhost_1024_ethports.py b/tests/TestSuite_vhost_1024_ethports.py index 6e02c83..b764936 100644 --- a/tests/TestSuite_vhost_1024_ethports.py +++ b/tests/TestSuite_vhost_1024_ethports.py @@ -71,10 +71,19 @@ class TestVhost1024Ethports(TestCase): "sed -i 's/CONFIG_RTE_MAX_ETHPORTS=1024$/CONFIG_RTE_MAX_ETHPORTS=32/' config/common_base", '#', 30) self.dut.build_install_dpdk(self.target) + @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 test_launch_vhost_with_1024_ethports(self): """ Test function of launch vhost with 1024 ethports """ + if self.check_2M_env: + hugepages = int(self.dut.get_total_huge_pages()) + if hugepages< 20480: + self.dut.send_expect('echo 20480 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages', expected='# ', timeout=30) command_line_vdev = '' for ethport in range(self.max_ethport): command_line_vdev += '--vdev "eth_vhost%d,iface=vhost-net%d,queues=%d" ' %(ethport, ethport, self.queue) diff --git a/tests/TestSuite_vhost_enqueue_interrupt.py b/tests/TestSuite_vhost_enqueue_interrupt.py index 9d3f5bc..5520782 100644 --- a/tests/TestSuite_vhost_enqueue_interrupt.py +++ b/tests/TestSuite_vhost_enqueue_interrupt.py @@ -89,11 +89,18 @@ class TestVhostEnqueueInterrupt(TestCase): """ vdev = "net_virtio_user0,mac=%s,path=./vhost-net,server=1,queues=%d" % (self.vmac, self.queues) if not packed else "net_virtio_user0,mac=%s,path=./vhost-net,server=1,queues=%d,packed_vq=1" % (self.vmac, self.queues) eal_params = self.dut.create_eal_parameters(cores=self.core_list_virtio, prefix='virtio', no_pci=True, ports=[self.pci_info], vdevs=[vdev]) + if self.check_2M_env: + eal_params += " --single-file-segments" para = " -- -i --rxq=%d --txq=%d --rss-ip" % (self.queues, self.queues) command_line_client = self.dut.target + "/app/testpmd " + eal_params + para self.virtio_user.send_expect(command_line_client, "testpmd> ", 120) self.virtio_user.send_expect("set fwd txonly", "testpmd> ", 20) + @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 lanuch_l3fwd_power(self): """ launch l3fwd-power with a virtual vhost device diff --git a/tests/TestSuite_vhost_event_idx_interrupt.py b/tests/TestSuite_vhost_event_idx_interrupt.py index 4bb40c7..e82bd46 100644 --- a/tests/TestSuite_vhost_event_idx_interrupt.py +++ b/tests/TestSuite_vhost_event_idx_interrupt.py @@ -82,6 +82,11 @@ class TestVhostEventIdxInterrupt(TestCase): out = self.dut.send_expect("make -C examples/l3fwd-power", "#") self.verify("Error" not in out, "compilation l3fwd-power error") + @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 lanuch_l3fwd_power(self): """ launch l3fwd-power with a virtual vhost device @@ -109,6 +114,8 @@ class TestVhostEventIdxInterrupt(TestCase): example_para = "./examples/l3fwd-power/build/l3fwd-power " para = " --log-level=9 %s -- -p %s --parse-ptype 1 --config '%s' --interrupt-only" % (vdev_info, port_info, config_info) eal_params = self.dut.create_eal_parameters(cores=self.core_list_l3fwd, no_pci=True) + if self.check_2M_env: + eal_params += " --single-file-segments " command_line_client = example_para + eal_params + para self.vhost.get_session_before(timeout=2) self.vhost.send_expect(command_line_client, "POWER", 40) diff --git a/tests/TestSuite_vhost_virtio_user_interrupt.py b/tests/TestSuite_vhost_virtio_user_interrupt.py index 2f430d8..e882c3a 100644 --- a/tests/TestSuite_vhost_virtio_user_interrupt.py +++ b/tests/TestSuite_vhost_virtio_user_interrupt.py @@ -89,11 +89,18 @@ class TestVirtioUserInterrupt(TestCase): out = self.dut.build_dpdk_apps("./examples/l3fwd-power") self.verify("Error" not in out, "compilation l3fwd-power error") + @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 launch_l3fwd(self, path, packed=False): self.core_interrupt = self.core_list_l3fwd[0] example_para = "./examples/l3fwd-power/build/l3fwd-power " vdev = "virtio_user0,path=%s,cq=1" % path if not packed else "virtio_user0,path=%s,cq=1,packed_vq=1" % path eal_params = self.dut.create_eal_parameters(cores=self.core_list_l3fwd, prefix='l3fwd-pwd', no_pci=True, ports=[self.pci_info], vdevs=[vdev]) + if self.check_2M_env: + eal_params += " --single-file-segments" para = " --config='(0,0,%s)' --parse-ptype --interrupt-only" % self.core_interrupt cmd_l3fwd = example_para + eal_params + " --log-level='user1,7' -- -p 1 " + para self.l3fwd.get_session_before(timeout=2) diff --git a/tests/TestSuite_vm2vm_virtio_pmd.py b/tests/TestSuite_vm2vm_virtio_pmd.py index 7fea5bf..c26a084 100644 --- a/tests/TestSuite_vm2vm_virtio_pmd.py +++ b/tests/TestSuite_vm2vm_virtio_pmd.py @@ -112,6 +112,11 @@ class TestVM2VMVirtioPMD(TestCase): self.vhost_user.send_expect("set fwd mac", "testpmd> ", 30) self.vhost_user.send_expect("start", "testpmd> ", 30) + @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_virtio_testpmd_with_vhost_net1(self, path_mode, extern_param): """ launch the testpmd as virtio with vhost_net1 @@ -121,6 +126,8 @@ class TestVM2VMVirtioPMD(TestCase): testcmd = self.dut.target + "/app/testpmd " vdev = "--vdev=net_virtio_user1,mac=00:01:02:03:04:05,path=./vhost-net1,queues=1,%s " % path_mode eal_params = self.dut.create_eal_parameters(cores=virtio_mask, no_pci=True, prefix='virtio', ports=[self.pci_info]) + if self.check_2M_env: + eal_params += " --single-file-segments" para = " -- -i --nb-cores=1 --txd=1024 --rxd=1024 %s" % extern_param command_line = testcmd + eal_params + vdev + para self.virtio_user1.send_expect(command_line, 'testpmd> ', 30) @@ -136,6 +143,8 @@ class TestVM2VMVirtioPMD(TestCase): testcmd = self.dut.target + "/app/testpmd " vdev = "--vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net0,queues=1,%s " % path_mode eal_params = self.dut.create_eal_parameters(cores=virtio_mask, no_pci=True, prefix='virtio0', ports=[self.pci_info]) + if self.check_2M_env: + eal_params += " --single-file-segments " para = " -- -i --nb-cores=1 --txd=1024 --rxd=1024 %s" % extern_param command_line = testcmd + eal_params + vdev + para self.virtio_user0.send_expect(command_line, 'testpmd> ', 30) diff --git a/tests/TestSuite_vm2vm_virtio_user.py b/tests/TestSuite_vm2vm_virtio_user.py index 343e2d2..e743e61 100644 --- a/tests/TestSuite_vm2vm_virtio_user.py +++ b/tests/TestSuite_vm2vm_virtio_user.py @@ -125,12 +125,19 @@ class TestVM2VMVirtioUser(TestCase): self.pmd_vhost.execute_cmd(self.command_line, timeout=30) self.pmd_vhost.execute_cmd('set fwd %s' % fwd_mode) + @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_virtio_testpmd_with_vhost_net1(self, path_mode, extern_params, ringsize): """ launch the testpmd as virtio with vhost_net1 """ eal_params = self.dut.create_eal_parameters(cores=self.core_list_virtio1, no_pci=True, prefix=self.virtio_prefix, fixed_prefix=True) + if self.check_2M_env: + eal_params += " --single-file-segments " vdev_params = '--vdev=net_virtio_user1,mac=00:01:02:03:04:05,path=./vhost-net1,queues=1,%s,queue_size=%d ' % (path_mode, ringsize) command_line = self.dut.target + "/app/testpmd %s " + \ "--socket-mem %s %s -- -i --nb-cores=1 --txd=%d --rxd=%d %s" @@ -147,6 +154,8 @@ class TestVM2VMVirtioUser(TestCase): """ eal_params = self.dut.create_eal_parameters(cores=self.core_list_virtio0, no_pci=True, prefix='virtio0') + if self.check_2M_env: + eal_params += " --single-file-segments " vdev_params = '--vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net0,queues=1,%s,queue_size=%d ' % (path_mode, ringsize) command_line = self.dut.target + '/app/testpmd %s ' + \ '--socket-mem %s %s -- -i --nb-cores=1 --txd=%d --rxd=%d %s' -- 2.25.1