test suite reviews and discussions
 help / color / mirror / Atom feed
From: Ling Wei <weix.ling@intel.com>
To: dts@dpdk.org
Cc: Ling Wei <weix.ling@intel.com>
Subject: [dts] [PATCH V3] tests/pvp_multi_paths_performance:modify dts code sync with testplan and optimize code
Date: Wed,  3 Mar 2021 16:55:41 +0800
Message-ID: <20210303085541.223382-1-weix.ling@intel.com> (raw)

Remove test case 9 vectorized=1 with testplan, default is vectorized=0
and use pmd.start_testpmd() to replace session.send_expect() to start
testpmd.

Signed-off-by: Ling Wei <weix.ling@intel.com>
---
v1:
Remove test case 9 vectorized=1 with testplan, default is vectorized=0.

v2:
Use pmd.start_testpmd() to replace session.send_expect() to start
testpmd.

v3:
Use pmd.start_testpmd() to replace session.send_expect() to quit
testpmd.

 .../TestSuite_pvp_multi_paths_performance.py  | 46 +++++++++----------
 1 file changed, 21 insertions(+), 25 deletions(-)

diff --git a/tests/TestSuite_pvp_multi_paths_performance.py b/tests/TestSuite_pvp_multi_paths_performance.py
index e2fa5ec9..11db11ee 100644
--- a/tests/TestSuite_pvp_multi_paths_performance.py
+++ b/tests/TestSuite_pvp_multi_paths_performance.py
@@ -42,6 +42,7 @@ from packet import Packet
 from pktgen import PacketGeneratorHelper
 from settings import UPDATE_EXPECTED, load_global_setting
 from copy import deepcopy
+from pmd_output import PmdOutput
 
 
 class TestPVPMultiPathPerformance(TestCase):
@@ -67,8 +68,10 @@ class TestPVPMultiPathPerformance(TestCase):
             self.tester.send_expect('mkdir -p %s' % self.out_path, '# ')
         # create an instance to set stream field setting
         self.pktgen_helper = PacketGeneratorHelper()
-        self.vhost_user = self.dut.new_session(suite="user")
-        self.vhost = self.dut.new_session(suite="vhost")
+        self.vhost_user = self.dut.new_session(suite="vhost-user")
+        self.virtio_user0 = self.dut.new_session(suite="virtio-user0")
+        self.vhost_user_pmd = PmdOutput(self.dut, self.vhost_user)
+        self.virtio_user0_pmd = PmdOutput(self.dut, self.virtio_user0)
         self.save_result_flag = True
         self.json_obj = {}
 
@@ -161,34 +164,27 @@ class TestPVPMultiPathPerformance(TestCase):
         self.dut.send_expect("rm -rf ./vhost-net*", "#")
         self.dut.send_expect("killall -s INT %s" % self.testpmd_name , "#")
         self.dut.send_expect("killall -s INT qemu-system-x86_64", "#")
-        eal_param = self.dut.create_eal_parameters(cores=self.core_list_host, prefix='vhost',
-                                                   ports=[self.dut.ports_info[self.dut_ports[0]]['pci']],
-                                                   vdevs=['net_vhost0,iface=vhost-net,queues=1,client=0'])
-        command_line_client = self.path + eal_param + \
-                              " -- -i --nb-cores=1 --txd=%d --rxd=%d" % (self.nb_desc, self.nb_desc)
-        self.vhost.send_expect(command_line_client, "testpmd> ", 120)
-        self.vhost.send_expect("set fwd mac", "testpmd> ", 120)
-        self.vhost.send_expect("start", "testpmd> ", 120)
+        vdevs = ['net_vhost0,iface=vhost-net,queues=1,client=0']
+        ports = [self.dut.ports_info[self.dut_ports[0]]['pci']]
+        param = "--nb-cores=1 --txd=%d --rxd=%d" % (self.nb_desc, self.nb_desc)
+        self.vhost_user_pmd.start_testpmd(cores=self.core_list_host,param=param, vdevs=vdevs, ports=ports, prefix="vhost")
+        self.vhost_user_pmd.execute_cmd("set fwd mac")
+        self.vhost_user_pmd.execute_cmd("start")
 
     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,%s' %
-                                                          args["version"]])
+        eal_param = ""
         if self.check_2M_env:
             eal_param += " --single-file-segments"
         if 'virtio11_vectorized' in self.running_case:
             eal_param += " --force-max-simd-bitwidth=512"
-        command_line_user = self.path + eal_param + \
-                            " -- -i %s --rss-ip --nb-cores=1 --txd=%d --rxd=%d" % \
-                            (args["path"], self.nb_desc, self.nb_desc)
-        self.vhost_user = self.dut.new_session(suite="user")
-        self.vhost_user.send_expect(command_line_user, "testpmd> ", 120)
-        self.vhost_user.send_expect("set fwd mac", "testpmd> ", 120)
-        self.vhost_user.send_expect("start", "testpmd> ", 120)
+        vdevs = ['net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,%s' % args["version"]]
+        param = "%s --rss-ip --nb-cores=1 --txd=%d --rxd=%d" % (args["path"], self.nb_desc, self.nb_desc)
+        self.virtio_user0_pmd.start_testpmd(cores=self.core_list_user, eal_param=eal_param, param=param, vdevs=vdevs, no_pci=True, prefix='virtio')
+        self.virtio_user0_pmd.execute_cmd("set fwd mac")
+        self.virtio_user0_pmd.execute_cmd("start")
 
     def handle_expected(self):
         """
@@ -289,15 +285,15 @@ class TestPVPMultiPathPerformance(TestCase):
         """
         close all testpmd of vhost and virtio
         """
-        self.vhost.send_expect("quit", "#", 60)
-        self.vhost_user.send_expect("quit", "#", 60)
+        self.vhost_user_pmd.execute_cmd("quit", "# ")
+        self.virtio_user0_pmd.execute_cmd("quit", "# ")
 
     def close_all_session(self):
         """
         close all session of vhost an virtio
         """
         self.dut.close_session(self.vhost_user)
-        self.dut.close_session(self.vhost)
+        self.dut.close_session(self.virtio_user0)
 
     def test_perf_pvp_virtio11_mergeable(self):
         """
@@ -356,7 +352,7 @@ class TestPVPMultiPathPerformance(TestCase):
         """
         self.test_target = self.running_case
         self.expected_throughput = self.get_suite_cfg()['expected_throughput'][self.test_target]
-        virtio_pmd_arg = {"version": "in_order=1,packed_vq=1,mrg_rxbuf=0,vectorized=1",
+        virtio_pmd_arg = {"version": "in_order=1,packed_vq=1,mrg_rxbuf=0",
                           "path": "--rx-offloads=0x10 --enable-hw-vlan-strip"}
         self.start_vhost_testpmd()
         self.start_virtio_testpmd(virtio_pmd_arg)
-- 
2.25.1


             reply	other threads:[~2021-03-03  8:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03  8:55 Ling Wei [this message]
2021-03-03  8:57 ` Ling, WeiX
2021-03-10  5:44 ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210303085541.223382-1-weix.ling@intel.com \
    --to=weix.ling@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ https://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git