* [dts] [PATCH V1] tests/perf_virtio_user_loopback: Add one new case and Optimize script
@ 2020-11-19 13:19 JiangYuX
2020-11-19 5:21 ` Jiang, YuX
2020-11-19 8:45 ` Tu, Lijuan
0 siblings, 2 replies; 3+ messages in thread
From: JiangYuX @ 2020-11-19 13:19 UTC (permalink / raw)
To: dts; +Cc: JiangYu
From: JiangYu <yux.jiang@intel.com>
1,Automate new case:TC10 perf_loopback_packed_ring_vectorized_path
2,Optimize testpmd function
Signed-off-by: JiangYu <yux.jiang@intel.com>
---
tests/TestSuite_perf_virtio_user_loopback.py | 78 ++++++++++++++++------------
1 file changed, 46 insertions(+), 32 deletions(-)
diff --git a/tests/TestSuite_perf_virtio_user_loopback.py b/tests/TestSuite_perf_virtio_user_loopback.py
index 9f40d36..4408786 100644
--- a/tests/TestSuite_perf_virtio_user_loopback.py
+++ b/tests/TestSuite_perf_virtio_user_loopback.py
@@ -43,6 +43,7 @@ import re
import json
import rst
import os
+from pmd_output import PmdOutput
from copy import deepcopy
from test_case import TestCase
from settings import UPDATE_EXPECTED, load_global_setting
@@ -70,6 +71,8 @@ class TestPerfVirtioUserLoopback(TestCase):
self.vhost = self.dut.new_session(suite="vhost")
self.virtio_user = self.dut.new_session(suite="virtio-user")
+ self.vhost_pmd = PmdOutput(self.dut, self.vhost)
+ self.virtio_user_pmd = PmdOutput(self.dut, self.virtio_user)
self.save_result_flag = True
self.json_obj = dict()
self.path=self.dut.apps_name['test-pmd']
@@ -106,36 +109,31 @@ class TestPerfVirtioUserLoopback(TestCase):
"""
start testpmd on vhost
"""
- eal_params = self.dut.create_eal_parameters(cores=self.core_list_host,
- no_pci=True, prefix='vhost')
- command_line_client = self.path + " %s " + \
- "--socket-mem %s --vdev " + \
- "'net_vhost0,iface=vhost-net,queues=%d' -- -i --nb-cores=%d " + \
- "--rxq=%d --txq=%d --txd=%d --rxd=%d"
- command_line_client = command_line_client % (
- eal_params, self.socket_mem, self.queue_number,
- self.nb_cores, self.queue_number, self.queue_number,
- nb_desc, nb_desc)
- self.vhost.send_expect(command_line_client, "testpmd> ", 120)
- self.vhost.send_expect("set fwd mac", "testpmd> ", 120)
+ vdevs = "'net_vhost0,iface=vhost-net,queues={},client=0'".format(self.queue_number)
+ eal_params = "--socket-mem {} --vdev {}".format(self.socket_mem, vdevs)
+ param = "--nb-cores={} --rxq={} --txq={} --txd={} --rxd={}".format(self.nb_cores, self.queue_number, self.queue_number, nb_desc, nb_desc)
+ self.vhost_pmd.start_testpmd(self.core_list_host, param=param, no_pci=True, ports=[], eal_param=eal_params, prefix='vhost', fixed_prefix=True)
+ self.vhost_pmd.execute_cmd("set fwd mac", "testpmd> ", 120)
def start_virtio_testpmd(self, nb_desc, args):
"""
start testpmd on virtio
"""
- eal_params = self.dut.create_eal_parameters(cores=self.core_list_user,
- no_pci=True, prefix='virtio')
- command_line_user = self.path+ " %s " + \
- " --socket-mem %s " + \
- "--vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues=%d,%s " + \
- "-- -i %s --rss-ip --nb-cores=%d --rxq=%d --txq=%d --txd=%d --rxd=%d"
- command_line_user = command_line_user % (
- eal_params, self.socket_mem,
- self.queue_number, args["version"], args["path"], self.nb_cores,
- self.queue_number, self.queue_number, nb_desc, nb_desc)
- 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", "testpmd> ", 120)
+ eal_param = "--socket-mem {} --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=./vhost-net,queues={},{}".format(self.socket_mem, self.queue_number, args["version"])
+ if self.check_2M_env:
+ eal_param += " --single-file-segments"
+ if 'vectorized_path' in self.running_case:
+ eal_param += " --force-max-simd-bitwidth=512"
+ param = "{} --rss-ip --nb-cores={} --rxq={} --txq={} --txd={} --rxd={}".format(args["path"], self.nb_cores, self.queue_number, self.queue_number, nb_desc, nb_desc)
+ self.virtio_user_pmd.start_testpmd(cores=self.core_list_user, param=param, eal_param=eal_param, \
+ no_pci=True, ports=[], prefix="virtio", fixed_prefix=True)
+ self.virtio_user_pmd.execute_cmd("set fwd mac", "testpmd> ", 120)
+ self.virtio_user_pmd.execute_cmd("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 calculate_avg_throughput(self):
"""
@@ -143,10 +141,10 @@ class TestPerfVirtioUserLoopback(TestCase):
"""
results = 0.0
results_row = []
- out = self.vhost.send_expect("show port stats all", "testpmd>", 60)
+ out = self.vhost_pmd.execute_cmd("show port stats all", "testpmd>", 60)
time.sleep(5)
for i in range(10):
- out = self.vhost.send_expect("show port stats all", "testpmd>", 60)
+ out = self.vhost_pmd.execute_cmd("show port stats all", "testpmd>", 60)
time.sleep(5)
lines = re.search("Rx-pps:\s*(\d*)", out)
result = lines.group(1)
@@ -161,22 +159,22 @@ class TestPerfVirtioUserLoopback(TestCase):
"""
for frame_size in self.frame_sizes:
self.throughput[frame_size] = dict()
- self.vhost.send_expect("set txpkts %d" % frame_size, "testpmd> ", 30)
- self.vhost.send_expect("start tx_first 32", "testpmd> ", 30)
+ self.vhost_pmd.execute_cmd("set txpkts %d" % frame_size, "testpmd> ", 30)
+ self.vhost_pmd.execute_cmd("start tx_first 32", "testpmd> ", 30)
Mpps = self.calculate_avg_throughput()
self.verify(Mpps > 0, "%s can not receive packets of frame size %d" % (self.running_case, frame_size))
self.throughput[frame_size][nb_desc] = Mpps
self.logger.info("Trouthput of " +
"framesize: {}, rxd/txd: {} is :{} Mpps".format(
frame_size, nb_desc, Mpps))
- self.vhost.send_expect("stop", "testpmd> ", 60)
+ self.vhost_pmd.execute_cmd("stop", "testpmd> ", 60)
def close_all_testpmd(self):
"""
close all testpmd of vhost and virtio
"""
- self.vhost.send_expect("quit", "#", 60)
- self.virtio_user.send_expect("quit", "#", 60)
+ self.vhost_pmd.execute_cmd("quit", "#", 60)
+ self.virtio_user_pmd.execute_cmd("quit", "#", 60)
def close_all_session(self):
"""
@@ -422,6 +420,22 @@ class TestPerfVirtioUserLoopback(TestCase):
self.handle_expected()
self.handle_results()
+ def test_perf_loopback_packed_ring_vectorized_path(self):
+ """
+ Test Case 10: loopback test with packed ring vectorized path
+ """
+ self.test_target = "packed_ring_vectorized_path"
+ virtio_pmd_arg = {"version": "packed_vq=1,in_order=1,mrg_rxbuf=0,vectorized=1",
+ "path": "--tx-offloads=0x0"}
+ self.expected_throughput = self.get_suite_cfg()['expected_throughput'][self.test_target]
+ nb_desc = self.test_parameters[64][0]
+ self.start_vhost_testpmd(nb_desc)
+ self.start_virtio_testpmd(nb_desc, virtio_pmd_arg)
+ self.send_and_verify(nb_desc, "virtio_1.1 vectorized")
+ self.close_all_testpmd()
+ self.handle_expected()
+ self.handle_results()
+
def tear_down(self):
"""
Run after each test case.
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dts] [PATCH V1] tests/perf_virtio_user_loopback: Add one new case and Optimize script
2020-11-19 13:19 [dts] [PATCH V1] tests/perf_virtio_user_loopback: Add one new case and Optimize script JiangYuX
@ 2020-11-19 5:21 ` Jiang, YuX
2020-11-19 8:45 ` Tu, Lijuan
1 sibling, 0 replies; 3+ messages in thread
From: Jiang, YuX @ 2020-11-19 5:21 UTC (permalink / raw)
To: Jiang, YuX, dts
[-- Attachment #1: Type: text/plain, Size: 365 bytes --]
Tested-by: JiangYuX <yux.jiang@intel.com>
Best Regards
Jiang yu
> -----Original Message-----
> From: JiangYuX [mailto:yux.jiang@intel.com]
> Sent: Thursday, November 19, 2020 9:19 PM
> To: dts@dpdk.org
> Cc: Jiang, YuX <yux.jiang@intel.com>
> Subject: [dts] [PATCH V1] tests/perf_virtio_user_loopback: Add one new
> case and Optimize script
[-- Attachment #2: perf_virtio_user_loopback.rtf --]
[-- Type: application/rtf, Size: 78243 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dts] [PATCH V1] tests/perf_virtio_user_loopback: Add one new case and Optimize script
2020-11-19 13:19 [dts] [PATCH V1] tests/perf_virtio_user_loopback: Add one new case and Optimize script JiangYuX
2020-11-19 5:21 ` Jiang, YuX
@ 2020-11-19 8:45 ` Tu, Lijuan
1 sibling, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2020-11-19 8:45 UTC (permalink / raw)
To: Jiang, YuX, dts; +Cc: Jiang, YuX
> 1,Automate new case:TC10 perf_loopback_packed_ring_vectorized_path
> 2,Optimize testpmd function
>
> Signed-off-by: JiangYu <yux.jiang@intel.com>
Applied
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-19 8:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 13:19 [dts] [PATCH V1] tests/perf_virtio_user_loopback: Add one new case and Optimize script JiangYuX
2020-11-19 5:21 ` Jiang, YuX
2020-11-19 8:45 ` Tu, Lijuan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).