From: hanyingya <yingyax.han@intel.com>
To: dts@dpdk.org
Cc: hanyingya <yingyax.han@intel.com>
Subject: [dts] [PATCH V1]: add dut ports pci when app starts
Date: Fri, 5 Jun 2020 13:44:25 +0800 [thread overview]
Message-ID: <20200605054425.68357-1-yingyax.han@intel.com> (raw)
Fix the problem that the dut ports are not clear when starting trex.
Signed-off-by: hanyingya <yingyax.han@intel.com>
---
tests/TestSuite_ipfrag.py | 7 +++--
tests/TestSuite_l2fwd.py | 7 +++--
tests/TestSuite_multiprocess.py | 39 ++++++++++++++-------------
tests/TestSuite_performance_thread.py | 7 +++--
tests/TestSuite_tso.py | 12 +++++----
tests/TestSuite_vf_l3fwd.py | 2 +-
tests/TestSuite_vmdq.py | 7 +++--
tests/TestSuite_vmdq_dcb.py | 7 +++--
8 files changed, 54 insertions(+), 34 deletions(-)
diff --git a/tests/TestSuite_ipfrag.py b/tests/TestSuite_ipfrag.py
index 52e2cb0..cbcd5fe 100644
--- a/tests/TestSuite_ipfrag.py
+++ b/tests/TestSuite_ipfrag.py
@@ -302,10 +302,13 @@ l3fwd_ipv4_route_array[] = {\\\n"
core_mask = utils.create_mask(self.dut.get_core_list(lcore))
portmask = utils.create_mask([P0, P1])
+ eal_param = ""
+ for i in [P0, P1]:
+ eal_param += " -w %s" % self.dut.ports_info[i]['pci']
self.dut.send_expect("^c", "# ", 120)
- self.dut.send_expect("examples/ip_fragmentation/build/ip_fragmentation -c %s -n %d -- -p %s -q %s" % (
- core_mask, self.dut.get_memory_channels(), portmask, num_pthreads), "IP_FRAG:", 120)
+ self.dut.send_expect("examples/ip_fragmentation/build/ip_fragmentation -c %s -n %d %s -- -p %s -q %s" % (
+ core_mask, self.dut.get_memory_channels(), eal_param, portmask, num_pthreads), "IP_FRAG:", 120)
result = [2, lcore, num_pthreads]
for size in size_list:
diff --git a/tests/TestSuite_l2fwd.py b/tests/TestSuite_l2fwd.py
index 4a47c02..f8c0d72 100644
--- a/tests/TestSuite_l2fwd.py
+++ b/tests/TestSuite_l2fwd.py
@@ -172,6 +172,9 @@ class TestL2fwd(TestCase):
cores = self.dut.get_core_list(self.core_config, socket=self.ports_socket)
eal_params = self.dut.create_eal_parameters(cores=cores)
+ eal_param = ""
+ for i in ports:
+ eal_param += " -w %s" % self.dut.ports_info[i]['pci']
for frame_size in self.frame_sizes:
@@ -193,8 +196,8 @@ class TestL2fwd(TestCase):
for queues in self.test_queues:
- command_line = "./examples/l2fwd/build/l2fwd %s -- -q %s -p %s &" % \
- (eal_params, str(queues['queues']), port_mask)
+ command_line = "./examples/l2fwd/build/l2fwd %s %s -- -q %s -p %s &" % \
+ (eal_params, eal_param, str(queues['queues']), port_mask)
# self.dut.send_expect(command_line, "memory mapped", 60)
self.dut.send_expect(command_line, "L2FWD: entering main loop", 60)
diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py
index a6af875..0ede8bf 100644
--- a/tests/TestSuite_multiprocess.py
+++ b/tests/TestSuite_multiprocess.py
@@ -71,6 +71,9 @@ class TestMultiprocess(TestCase):
executions.append({'nprocs': 4, 'cores': '1S/4C/1T', 'pps': 0})
executions.append({'nprocs': 8, 'cores': '1S/4C/2T', 'pps': 0})
+ self.eal_param = ""
+ for i in self.dut_ports:
+ self.eal_param += " -w %s" % self.dut.ports_info[i]['pci']
# start new session to run secondary
self.session_secondary = self.dut.new_session()
@@ -97,12 +100,12 @@ class TestMultiprocess(TestCase):
# Send message from secondary to primary
cores = self.dut.get_core_list('1S/2C/1T', socket=self.socket)
coremask = utils.create_mask(cores)
- self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=primary" % (self.target, coremask),
+ self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=primary" % (self.target, coremask, self.eal_param),
"Finished Process Init", 100)
time.sleep(20)
coremask = hex(int(coremask, 16) * 0x10).rstrip("L")
self.session_secondary.send_expect(
- "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=secondary" % (self.target, coremask), "Finished Process Init",
+ "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=secondary" % (self.target, coremask, self.eal_param), "Finished Process Init",
100)
self.session_secondary.send_expect("send hello_primary", ">")
@@ -114,10 +117,10 @@ class TestMultiprocess(TestCase):
cores = self.dut.get_core_list('1S/2C/1T', socket=self.socket)
coremask = utils.create_mask(cores)
self.session_secondary.send_expect(
- "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=primary " % (self.target, coremask), "Finished Process Init", 100)
+ "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=primary " % (self.target, coremask, self.eal_param), "Finished Process Init", 100)
time.sleep(20)
coremask = hex(int(coremask, 16) * 0x10).rstrip("L")
- self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=secondary" % (self.target, coremask),
+ self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=secondary" % (self.target, coremask, self.eal_param),
"Finished Process Init", 100)
self.session_secondary.send_expect("send hello_secondary", ">")
out = self.dut.get_session_output()
@@ -134,11 +137,11 @@ class TestMultiprocess(TestCase):
cores = self.dut.get_core_list('1S/2C/1T', socket=self.socket)
coremask = utils.create_mask(cores)
- self.session_secondary.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=primary" % (self.target, coremask),
+ self.session_secondary.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=primary" % (self.target, coremask, self.eal_param),
"Finished Process Init", 100)
time.sleep(20)
coremask = hex(int(coremask, 16) * 0x10).rstrip("L")
- self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=secondary" % (self.target, coremask),
+ self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=secondary" % (self.target, coremask, self.eal_param),
"Finished Process Init", 100)
stringsSent = 0
for line in open('/usr/share/dict/words', 'r').readlines():
@@ -160,13 +163,13 @@ class TestMultiprocess(TestCase):
# Send message from secondary to primary (auto process type)
cores = self.dut.get_core_list('1S/2C/1T', socket=self.socket)
coremask = utils.create_mask(cores)
- out = self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=auto " % (self.target, coremask),
+ out = self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=auto " % (self.target, coremask, self.eal_param),
"Finished Process Init", 100)
self.verify("EAL: Auto-detected process type: PRIMARY" in out, "The type of process (PRIMARY) was not detected properly")
time.sleep(20)
coremask = hex(int(coremask, 16) * 0x10).rstrip("L")
out = self.session_secondary.send_expect(
- "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=auto" % (self.target, coremask), "Finished Process Init", 100)
+ "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=auto" % (self.target, coremask, self.eal_param), "Finished Process Init", 100)
self.verify("EAL: Auto-detected process type: SECONDARY" in out,
"The type of process (SECONDARY) was not detected properly")
@@ -180,11 +183,11 @@ class TestMultiprocess(TestCase):
cores = self.dut.get_core_list('1S/2C/1T', socket=self.socket)
coremask = utils.create_mask(cores)
out = self.session_secondary.send_expect(
- "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=auto" % (self.target, coremask), "Finished Process Init", 100)
+ "./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=auto" % (self.target, coremask, self.eal_param), "Finished Process Init", 100)
self.verify("EAL: Auto-detected process type: PRIMARY" in out, "The type of process (PRIMARY) was not detected properly")
time.sleep(20)
coremask = hex(int(coremask, 16) * 0x10).rstrip("L")
- out = self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s --proc-type=auto" % (self.target, coremask),
+ out = self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s --proc-type=auto" % (self.target, coremask, self.eal_param),
"Finished Process Init", 100)
self.verify("EAL: Auto-detected process type: SECONDARY" in out, "The type of process (SECONDARY) was not detected properly")
self.session_secondary.send_expect("send hello_secondary", ">", 100)
@@ -202,10 +205,10 @@ class TestMultiprocess(TestCase):
cores = self.dut.get_core_list('1S/2C/1T', socket=self.socket)
coremask = utils.create_mask(cores)
- self.session_secondary.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s -m 64" % (self.target, coremask),
+ self.session_secondary.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s -m 64" % (self.target, coremask, self.eal_param),
"Finished Process Init", 100)
coremask = hex(int(coremask, 16) * 0x10).rstrip("L")
- out = self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s" % (self.target, coremask), "# ", 100)
+ out = self.dut.send_expect("./examples/multi_process/simple_mp/%s/simple_mp -n 1 -c %s %s" % (self.target, coremask, self.eal_param), "# ", 100)
self.verify("Is another primary process running" in out,
"No other primary process detected")
@@ -245,8 +248,8 @@ class TestMultiprocess(TestCase):
execution = validExecutions[n]
coreMask = utils.create_mask(self.dut.get_core_list(execution['cores'], socket=self.socket))
self.session_secondary.send_expect(
- "./examples/multi_process/symmetric_mp/%s/symmetric_mp -c %s --proc-type=auto -- -p %s --num-procs=%d --proc-id=%d" % (
- self.target, coreMask, portMask, execution['nprocs'], n), "Finished Process Init")
+ "./examples/multi_process/symmetric_mp/%s/symmetric_mp -c %s %s --proc-type=auto -- -p %s --num-procs=%d --proc-id=%d" % (
+ self.target, coreMask, self.eal_param, portMask, execution['nprocs'], n), "Finished Process Init")
# clear streams before add new streams
self.tester.pktgen.clear_streams()
@@ -298,16 +301,16 @@ class TestMultiprocess(TestCase):
coreMask = utils.create_mask(self.dut.get_core_list('1S/1C/1T'))
portMask = utils.create_mask(self.dut_ports)
- self.dut.send_expect("./examples/multi_process/client_server_mp/mp_server/%s/mp_server -n %d -c %s -- -p %s -n %d" % (
- self.target, self.dut.get_memory_channels(), "0xA0", portMask, execution['nprocs']), "Finished Process Init", 20)
+ self.dut.send_expect("./examples/multi_process/client_server_mp/mp_server/%s/mp_server -n %d -c %s %s -- -p %s -n %d" % (
+ self.target, self.dut.get_memory_channels(), "0xA0", self.eal_param, portMask, execution['nprocs']), "Finished Process Init", 20)
self.dut.send_expect("^Z", "\r\n")
self.dut.send_expect("bg", "# ")
for n in range(execution['nprocs']):
time.sleep(5)
coreMask = utils.create_mask([coreList[n]])
- self.dut.send_expect("./examples/multi_process/client_server_mp/mp_client/%s/mp_client -n %d -c %s --proc-type=secondary -- -n %d" % (
- self.target, self.dut.get_memory_channels(), coreMask, n), "Finished Process Init")
+ self.dut.send_expect("./examples/multi_process/client_server_mp/mp_client/%s/mp_client -n %d -c %s %s --proc-type=secondary -- -n %d" % (
+ self.target, self.dut.get_memory_channels(), coreMask, self.eal_param, n), "Finished Process Init")
self.dut.send_expect("^Z", "\r\n")
self.dut.send_expect("bg", "# ")
diff --git a/tests/TestSuite_performance_thread.py b/tests/TestSuite_performance_thread.py
index 5e6b74b..2ede5b5 100644
--- a/tests/TestSuite_performance_thread.py
+++ b/tests/TestSuite_performance_thread.py
@@ -189,14 +189,17 @@ class TestPerformanceThread(TestCase):
self.test_results["header"] = header_row
self.result_table_create(header_row)
self.test_results["data"] = []
+ eal_param = ""
+ for i in valports:
+ eal_param += " -w %s" % self.dut.ports_info[i]['pci']
for cores in self.nb_cores:
core_list, core_mask = self.create_cores(cores)
lcore_config, rx, tx = self.config_rx_tx(cores, core_list)
if self.running_case is "test_perf_n_lcore_per_pcore":
- cmdline = "{} -n 4 --lcores='{}' {} --rx='{}' --tx='{}'".format(self.path, lcore_config, params, rx, tx)
+ cmdline = "{} -n 4 {} --lcores='{}' {} --rx='{}' --tx='{}'".format(self.path, eal_param, lcore_config, params, rx, tx)
else:
- cmdline = "{} -c {} {} --rx='{}' --tx='{}'".format(self.path, core_mask, params, rx, tx)
+ cmdline = "{} -c {} {} {} --rx='{}' --tx='{}'".format(self.path, core_mask, eal_param, params, rx, tx)
self.dut.send_expect(cmdline, "L3FWD:", 120)
for frame_size in self.frame_sizes:
diff --git a/tests/TestSuite_tso.py b/tests/TestSuite_tso.py
index eaafd9a..db98110 100644
--- a/tests/TestSuite_tso.py
+++ b/tests/TestSuite_tso.py
@@ -77,7 +77,9 @@ class TestTSO(TestCase):
self.table_header.append("%s Mpps" % test_cycle['cores'])
self.table_header.append("% linerate")
- self.blacklist = ""
+ self.eal_param = ""
+ for i in self.dut_ports:
+ self.eal_param += " -w %s" % self.dut.ports_info[i]['pci']
self.headers_size = HEADER_SIZE['eth'] + HEADER_SIZE[
'ip'] + HEADER_SIZE['tcp']
@@ -208,9 +210,9 @@ class TestTSO(TestCase):
self.tester.send_expect("ip l set %s up" % tx_interface, "# ")
if (self.nic in ["cavium_a063","cavium_a064"]):
- cmd = "./%s/app/testpmd -c %s -n %d %s -- -i --rxd=512 --txd=512 --burst=32 --rxfreet=64 --mbcache=128 --portmask=%s --max-pkt-len=%s --txpt=36 --txht=0 --txwt=0 --txfreet=32 --txrst=32 --tx-offloads=0x8000" % (self.target, self.coreMask, self.dut.get_memory_channels(), self.blacklist, self.portMask, TSO_MTU)
+ cmd = "./%s/app/testpmd -c %s -n %d %s -- -i --rxd=512 --txd=512 --burst=32 --rxfreet=64 --mbcache=128 --portmask=%s --max-pkt-len=%s --txpt=36 --txht=0 --txwt=0 --txfreet=32 --txrst=32 --tx-offloads=0x8000" % (self.target, self.coreMask, self.dut.get_memory_channels(), self.eal_param, self.portMask, TSO_MTU)
else:
- cmd = "./%s/app/testpmd -c %s -n %d %s -- -i --rxd=512 --txd=512 --burst=32 --rxfreet=64 --mbcache=128 --portmask=%s --max-pkt-len=%s --txpt=36 --txht=0 --txwt=0 --txfreet=32 --txrst=32 " % (self.target, self.coreMask, self.dut.get_memory_channels(), self.blacklist, self.portMask, TSO_MTU)
+ cmd = "./%s/app/testpmd -c %s -n %d %s -- -i --rxd=512 --txd=512 --burst=32 --rxfreet=64 --mbcache=128 --portmask=%s --max-pkt-len=%s --txpt=36 --txht=0 --txwt=0 --txfreet=32 --txrst=32 " % (self.target, self.coreMask, self.dut.get_memory_channels(), self.eal_param, self.portMask, TSO_MTU)
self.dut.send_expect(cmd, "testpmd> ", 120)
self.dut.send_expect("set verbose 1", "testpmd> ", 120)
@@ -305,7 +307,7 @@ class TestTSO(TestCase):
self.tester.send_expect("ethtool -K %s rx off tx off tso off gso off gro off lro off" % tx_interface, "# ")
self.tester.send_expect("ip l set %s up" % tx_interface, "# ")
- cmd = "./%s/app/testpmd -c %s -n %d %s -- -i --rxd=512 --txd=512 --burst=32 --rxfreet=64 --mbcache=128 --portmask=%s --max-pkt-len=%s --txpt=36 --txht=0 --txwt=0 --txfreet=32 --txrst=32 " % (self.target, self.coreMask, self.dut.get_memory_channels(), self.blacklist, self.portMask, TSO_MTU)
+ cmd = "./%s/app/testpmd -c %s -n %d %s -- -i --rxd=512 --txd=512 --burst=32 --rxfreet=64 --mbcache=128 --portmask=%s --max-pkt-len=%s --txpt=36 --txht=0 --txwt=0 --txfreet=32 --txrst=32 " % (self.target, self.coreMask, self.dut.get_memory_channels(), self.eal_param, self.portMask, TSO_MTU)
self.dut.send_expect(cmd, "testpmd> ", 120)
self.dut.send_expect("set verbose 1", "testpmd> ", 120)
self.dut.send_expect("port stop all", "testpmd> ", 120)
@@ -407,7 +409,7 @@ class TestTSO(TestCase):
else:
queues = 1
- command_line = "./%s/app/testpmd -c %s -n %d %s -- -i --rxd=512 --txd=512 --burst=32 --rxfreet=64 --mbcache=128 --portmask=%s --max-pkt-len=%s --txpt=36 --txht=0 --txwt=0 --txfreet=32 --txrst=32 " % (self.target, self.coreMask, self.dut.get_memory_channels(), self.blacklist, self.portMask, TSO_MTU)
+ command_line = "./%s/app/testpmd -c %s -n %d %s -- -i --rxd=512 --txd=512 --burst=32 --rxfreet=64 --mbcache=128 --portmask=%s --max-pkt-len=%s --txpt=36 --txht=0 --txwt=0 --txfreet=32 --txrst=32 " % (self.target, self.coreMask, self.dut.get_memory_channels(), self.eal_param, self.portMask, TSO_MTU)
info = "Executing PMD using %s\n" % test_cycle['cores']
self.logger.info(info)
self.rst_report(info, annex=True)
diff --git a/tests/TestSuite_vf_l3fwd.py b/tests/TestSuite_vf_l3fwd.py
index 2416a40..471fe61 100644
--- a/tests/TestSuite_vf_l3fwd.py
+++ b/tests/TestSuite_vf_l3fwd.py
@@ -136,7 +136,7 @@ class TestVfL3fwd(TestCase):
self.host_testpmd = PmdOutput(self.dut)
eal_param = '--socket-mem=1024,1024 --file-prefix=pf'
for i in valports:
- eal_param += ' -b %s' % self.sriov_vfs_port[i][0].pci
+ eal_param += ' -w %s' % self.dut.ports_info[i]['pci']
core_config = self.cores[:len(valports)]
self.host_testpmd.start_testpmd(core_config, "", eal_param=eal_param)
for i in valports:
diff --git a/tests/TestSuite_vmdq.py b/tests/TestSuite_vmdq.py
index cb6bdf0..e5dcd82 100644
--- a/tests/TestSuite_vmdq.py
+++ b/tests/TestSuite_vmdq.py
@@ -82,9 +82,12 @@ class TestVmdq(TestCase):
self.verify(core_list is not None, "Requested cores failed")
core_mask = utils.create_mask(core_list)
port_mask = utils.create_mask(self.dut_ports)
+ eal_param = ""
+ for i in self.dut_ports:
+ eal_param += " -w %s" % self.dut.ports_info[i]['pci']
# Run the application
- self.dut.send_expect("./examples/vmdq/build/vmdq_app -c %s -n 4 -- -p %s --nb-pools %s --enable-rss" %
- (core_mask, port_mask, str(npools)), "reading queues", 120)
+ self.dut.send_expect("./examples/vmdq/build/vmdq_app -c %s -n 4 %s -- -p %s --nb-pools %s --enable-rss" %
+ (core_mask, eal_param, port_mask, str(npools)), "reading queues", 120)
def get_tgen_input(self, prios):
"""
diff --git a/tests/TestSuite_vmdq_dcb.py b/tests/TestSuite_vmdq_dcb.py
index 44abffc..6c71365 100644
--- a/tests/TestSuite_vmdq_dcb.py
+++ b/tests/TestSuite_vmdq_dcb.py
@@ -110,9 +110,12 @@ class TestVmdqDcb(TestCase):
self.verify(core_list is not None, "Requested %d cores failed" % ntcs)
core_mask = utils.create_mask(core_list)
port_mask = utils.create_mask(self.dut_ports)
+ eal_param = ""
+ for i in self.dut_ports:
+ eal_param += " -w %s" % self.dut.ports_info[i]['pci']
# Run the application
- self.dut.send_expect("./examples/vmdq_dcb/build/vmdq_dcb_app -c %s -n 4 -- -p %s --nb-pools %s --nb-tcs %s "
- "--enable-rss" % (core_mask, port_mask, str(npools), str(ntcs)), "reading queues", 120)
+ self.dut.send_expect("./examples/vmdq_dcb/build/vmdq_dcb_app -c %s -n 4 %s -- -p %s --nb-pools %s --nb-tcs %s "
+ "--enable-rss" % (core_mask, eal_param, port_mask, str(npools), str(ntcs)), "reading queues", 120)
def create_pcaps(self, prios):
"""
--
2.17.1
next reply other threads:[~2020-06-05 5:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-05 5:44 hanyingya [this message]
2020-06-19 3:23 ` 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=20200605054425.68357-1-yingyax.han@intel.com \
--to=yingyax.han@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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).