* [dts] [PATCH V1 1/2] multiple_pthread: Add test plan
@ 2017-06-16 4:58 Lijuan Tu
2017-06-16 4:58 ` [dts] [PATCH V1 2/2] multiple_pthread: Add test script Lijuan Tu
2017-06-23 17:17 ` [dts] [PATCH V1 1/2] multiple_pthread: Add test plan Liu, Yong
0 siblings, 2 replies; 5+ messages in thread
From: Lijuan Tu @ 2017-06-16 4:58 UTC (permalink / raw)
To: dts; +Cc: Lijuan Tu
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=a, Size: 8728 bytes --]
Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
---
test_plans/multiple_pthread_test_plan.rst | 151 ++++++++++++++++++++++++++++++
1 file changed, 151 insertions(+)
create mode 100644 test_plans/multiple_pthread_test_plan.rst
diff --git a/test_plans/multiple_pthread_test_plan.rst b/test_plans/multiple_pthread_test_plan.rst
new file mode 100644
index 0000000..4de4643
--- /dev/null
+++ b/test_plans/multiple_pthread_test_plan.rst
@@ -0,0 +1,151 @@
+.. Copyright (c) < 2017 >, Intel Corporation
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ - Neither the name of Intel Corporation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=====================
+Multiple Pthread Test
+=====================
+
+
+Description
+-----------
+
+This test is a basic multiple pthread test which demonstrates the basics
+of control group. Cgroup is a Linux kernel feature that limits, accounts
+for and isolates the resource usage, like CPU, memory, disk I/O, network,
+etc of a collection of processes. Now, it's focus on the CPU usage.
+
+Prerequisites
+-------------
+Support igb_uio driver, kernel is 3.11+.
+Use "modeprobe uio" "modprobe igb_uio" and then
+use "./tools/dpdk_nic_bind.py --bind=igb_uio device_bus_id" to bind the ports.
+
+Assuming that an Intel� DPDK build has been set up and the testpmd
+applications have been built.
+
+Os required: Linux and FreeBSD
+
+Test Case 1: Basic operation
+----------------------------
+
+To run the application, start the testpmd with the lcoress all running with
+threads and also the unique core assigned, command as follows::
+
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0@8,(4-5)@9' -n 4 -- -i --portmask=0xc
+ EAL: Master lcore 0 is ready (tid=ffd4900;cpuset=[8])
+ EAL: lcore 4 is ready (tid=873e7700;cpuset=[9])
+ EAL: lcore 5 is ready (tid=873e7700;cpuset=[9])
+
+To check the output, we shall make sure the lcore are init on the correct cpu.
+e.g. Duing INIT log we can found below:
+
+The process should start successfully and display a command prompt as follows::
+
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0@8,(4-5)@9' -n 4 -- -i --portmask=0xc
+ Checking link statuses...
+ Port 0 Link Up - speed 10000 Mbps - full-duplex
+ Port 1 Link Up - speed 10000 Mbps - full-duplex
+ Done
+
+Start the packet forwarding as follows::
+
+ testpmd>set fwd mac
+
+Before running the test, make sure the core is a unique one otherwise,
+the throughput will be floating on different cores,
+another thing is to make sure all the logic cores are running, command as follows::
+
+ testpmd>set corelist 4,5
+
+Pay attention that set corelist need to be configured before start,
+otherwise, it will not work::
+
+ testpmd>start
+ testpmd>show config fwd
+
+Using the command to find the threads that's running, as follows::
+
+ ps -C testpmd -L -opid,tid,%cpu,psr,args
+
+Result as follows:
+
+ PID TID %CPU PSR COMMAND
+ 179459 179459 0.2 8 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
+ 179459 179460 0.0 21 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
+ 179461 0.0 21 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
+ 179459 179462 80.4 9 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
+ 179459 179463 0.0 9 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
+
+You will see that there are two threads running on core 9.
+The last 2 threads are running threads, their TID will be assigned to the tasks in the folder thread0.
+
+ cd /sys/fs/cgroup/cpu/dpdk/thread0
+ echo 179462 > tasks
+ echo 179463 > tasks
+
+Assgined the percentage of cpu these two threads occupy as follows:
+
+ echo 10000 > cpu.cfs_quota_us
+
+This means the two threads will totally occupy 10% of the CPU and each 5%.
+
+
+Test Case 2: Positive Test
+--------------------------
+
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0 at 8,(4-5)@(8-11)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='1,2@(0-4,6),(3-4,6)@5,(7,8)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,CONFIG_RTE_MAX_LCORE-1)@(4,5)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,64-66)@(4,5)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2-5,6,7-9' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2, (3-5)@ 3' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,7-4)@(4,5)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+
+Test Case 3: Negative Test
+--------------------------
+
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0-,4-7)@(4,5)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(-1,4-7)@(4,5)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7-9)@(4,5)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,abcd)@(4,5)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(1-,5)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(-1,5)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(4,5-8-9)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(abc,5)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(4,xyz)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)=(8,9)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,3 at 4,(0-1,,4))' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='[0-,4-7]@(4,5)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0-,4-7)@[4,5]' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='3-4 at 3,2 at 5-6' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,,3''2--3' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,,,3''2--3' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
--
2.5.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dts] [PATCH V1 2/2] multiple_pthread: Add test script.
2017-06-16 4:58 [dts] [PATCH V1 1/2] multiple_pthread: Add test plan Lijuan Tu
@ 2017-06-16 4:58 ` Lijuan Tu
2017-06-23 17:17 ` [dts] [PATCH V1 1/2] multiple_pthread: Add test plan Liu, Yong
1 sibling, 0 replies; 5+ messages in thread
From: Lijuan Tu @ 2017-06-16 4:58 UTC (permalink / raw)
To: dts; +Cc: Lijuan Tu
The script only support Linux OS now.
Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
---
tests/TestSuite_multiple_pthread.py | 379 ++++++++++++++++++++++++++++++++++++
1 file changed, 379 insertions(+)
create mode 100644 tests/TestSuite_multiple_pthread.py
diff --git a/tests/TestSuite_multiple_pthread.py b/tests/TestSuite_multiple_pthread.py
new file mode 100644
index 0000000..7ebbd0c
--- /dev/null
+++ b/tests/TestSuite_multiple_pthread.py
@@ -0,0 +1,379 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Intel Corporation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""
+DPDK Test suite.
+
+Test Multiple Pthread Feature
+
+"""
+import utils
+import dts
+import time
+import re
+import os
+import random
+import itertools
+from test_case import TestCase
+from pmd_output import PmdOutput
+
+
+class TestMultiplePthread(TestCase):
+
+ def set_up_all(self):
+ """
+ Run at the start of each test suite.
+ """
+ self.ports = self.dut.get_ports()
+ self.portmask = utils.create_mask(self.dut.get_ports(self.nic))
+ self.verify(len(self.ports) >= 2, "Insufficient number of ports.")
+ self.ports_socket = self.dut.get_numa_id(self.ports[0])
+ self.pmdout = PmdOutput(self.dut)
+
+ def set_up(self):
+ """
+ Run before each test case.
+ """
+ cores = self.dut.get_core_list('all')
+
+ def get_stats(self, portid):
+ """
+ Get packets number from port statistic.
+ """
+ output = PmdOutput(self.dut)
+ stats = output.get_pmd_stats(portid)
+ return stats
+
+ def check_forwarding(self, ports):
+ for i in range(len(ports)):
+ if i % 2 == 0:
+ self.send_packet(ports[i], ports[i + 1])
+ self.send_packet(ports[i + 1], ports[i])
+
+ def send_packet(self, txPort, rxPort):
+ """
+ Send packages according to parameters.
+ """
+ port0_stats = self.get_stats(txPort)
+ gp0tx_bytes = port0_stats['TX-packets']
+ port1_stats = self.get_stats(rxPort)
+ gp1rx_err = port1_stats['RX-errors']
+ gp1rx_bytes = port1_stats['RX-packets']
+ time.sleep(5)
+
+ itf = self.tester.get_interface(self.tester.get_local_port(txPort))
+
+ destMac = self.dut.get_mac_address(txPort)
+ self.tester.scapy_foreground()
+ self.tester.scapy_append(
+ 'sendp([Ether(dst="%s", src="52:00:00:00:00:00")/IP()], iface="%s")'
+ % (destMac, itf))
+ self.tester.scapy_execute()
+ time.sleep(3)
+
+ port0_stats = self.get_stats(txPort)
+ p0tx_bytes = port0_stats['TX-packets']
+ port1_stats = self.get_stats(rxPort)
+ p1rx_err = port1_stats['RX-errors']
+ p1rx_bytes = port1_stats['RX-packets']
+ time.sleep(5)
+
+ p0tx_bytes -= gp0tx_bytes
+ p1rx_bytes -= gp1rx_bytes
+ p1rx_err -= gp1rx_err
+
+ self.verify(p0tx_bytes == p1rx_bytes,
+ "Wrong TX pkts p0_tx=%d, p1_rx=%d"
+ % (p0tx_bytes, p1rx_bytes))
+
+ def positive_test(self, lcores, corelist):
+
+ pmd_cmd = "./%s/app/testpmd --lcores='%s' -n 4 -- -i --portmask=%s" \
+ % (self.target, lcores, self.portmask)
+ out = self.dut.send_expect(pmd_cmd, "testpmd> ", 100)
+ self.dut.send_expect("set fwd mac", "testpmd>")
+ self.dut.send_expect("set corelist %s" % corelist, "testpmd> ")
+ self.dut.send_expect("start", "testpmd> ")
+ out = self.dut.send_expect("show config fwd", "testpmd> ")
+
+ if ',' in corelist:
+ corelist = re.split(",", corelist)
+ self.verify("Logical Core %s " % corelist[0] in out,
+ "set corelist error:" + out)
+ print out
+ self.verify("Logical Core %s " % corelist[1] in out,
+ "set corelist error:" + out)
+ else:
+ self.verify("Logical Core %s " % corelist in out,
+ "set corelist error:" + out)
+ self.check_forwarding(self.ports)
+ cpu = '%cpu'
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%s,psr,args | \
+ tail -n %s" % (cpu, corelist_num), "#")
+ result_scanner = "\d+\s+\d+\s+\w+.\w+\s+\d+\s./%s/app/testpmd" \
+ % self.target
+ scanner = re.compile(result_scanner, re.DOTALL)
+ m = scanner.finditer(out)
+
+ if m:
+ count = 0
+ for i in m:
+ text = i.group()
+ self.dut.alt_session.send_expect(
+ "echo '%s' > /root/temp" % text, "#")
+ out = self.dut.alt_session.send_expect(
+ "cat /root/temp | awk '{print $4}'", "#")
+ if out in cpus:
+ count += 1
+ self.verify(count == corelist_num,
+ "Threads running error:cpu is %s ." % count)
+
+ self.dut.send_expect("quit", "#")
+
+ def get_corelist(self, lcores):
+ global cpus
+ core_list = []
+ cpus = []
+ if lcores:
+ print lcores
+ lcore = re.split(' , ', lcores)
+ for i in lcore:
+ if '@' in i:
+ l_core = re.split('@', i)
+ l_core_0 = l_core[0]
+ l_core_1 = l_core[1]
+
+ if '-' in l_core_0:
+ utils.regexp(i, r'(\d+)')
+ l__core = re.compile(r'(\d+)').findall(l_core_0)
+ l__core = map(int, l__core)
+ if len(l__core) == 2:
+ l__core.append(l__core[0] + 1)
+ random_num = map(str, l__core)
+ for num in random_num:
+ core_list.append(num)
+ elif l_core_0[2] == '-' or l_core_0[3] == '-':
+ l__core.append(l__core[0] + 1)
+ random_num = map(str, l__core)
+ for num in random_num:
+ core_list.append(num)
+ else:
+ if l__core[1] < l__core[2]:
+ l__core.append(l__core[1] + 1)
+ random_num = map(str, l__core)
+ for num in random_num:
+ core_list.append(num)
+ else:
+ l__core.append(l__core[1] - 1)
+ random_num = map(str, l__core)
+ for num in random_num:
+ core_list.append(num)
+ else:
+ l__core = re.compile(r'(\d+)').findall(l_core_0)
+ for num in l__core:
+ core_list.append(num)
+ if '-' in l_core_1:
+ utils.regexp(i, r'(\d+)')
+ l_cpu = re.compile(r'(\d+)').findall(l_core_1)
+ l_cpu = map(int, l_cpu)
+ if len(l_cpu) == 2:
+ l_cpu.append(l_cpu[0] + 1)
+ random_num = map(str, l_cpu)
+ for num in random_num:
+ cpus.append(num)
+ elif l_core_1[2] == '-' or l_core_1[3] == '-':
+ l_cpu.append(l_cpu[0] + 1)
+ random_num = map(str, l_cpu)
+ for num in random_num:
+ cpus.append(num)
+ else:
+ l_cpu.append(l_cpu[1] - 1)
+ random_num = map(str, l_cpu)
+ for num in random_num:
+ cpus.append(num)
+ else:
+ l_cpu = re.compile(r'(\d+)').findall(l_core_1)
+ for num in l_cpu:
+ cpus.append(num)
+ elif '-' in i and '@' not in i:
+ utils.regexp(i, r'(\d+)')
+ lcore_num = re.compile(r'(\d+)').findall(i)
+ lcore_num = map(int, lcore_num)
+ lcore_num.append(lcore_num[0] + 1)
+ random_num = map(str, lcore_num)
+ for num in random_num:
+ core_list.append(num)
+ cpus.append(num)
+ else:
+ utils.regexp(i, r'(\d+)')
+ random_num = re.compile(r'(\d+)').findall(i)
+ for num in random_num:
+ core_list.append(num)
+ cpus.append(num)
+
+ core_list = list(set(core_list))
+ global corelist_num
+ corelist_num = len(core_list)
+
+ i = 0
+ core_list = map(int, core_list)
+ b = min(core_list)
+ while i < len(core_list):
+ if core_list[i] == b:
+ del core_list[i]
+ i -= 1
+ else:
+ i += 1
+
+ corelist = map(str, core_list)
+ print corelist, cpus
+ for i in itertools.combinations(core_list, 2):
+ i = ",".join(map(str, i))
+ corelist.append(i)
+ print corelist
+ for core in corelist:
+ self.positive_test(lcores, core)
+
+ def test_basic_operation(self):
+ """
+ Basic operation
+ """
+ # lcores = '0 @ random_num,(random_num,random_num) @ random_num'
+ cores = self.dut.get_core_list('all')
+ random.shuffle(cores)
+ random_num_0 = random.sample(cores, 2)
+ random_num_0[0] = '0'
+ lcore_0 = "@".join(random_num_0)
+ random_num_1 = tuple(map(int, random.sample(cores, 2)))
+ random_num_2 = random.randint(1, len(cores) - 1)
+ lcore_1 = "@".join(map(str, [random_num_1, random_num_2]))
+ lcores = " , ".join([lcore_0, lcore_1])
+
+ self.get_corelist(lcores)
+
+ def test_positive_test(self):
+ """
+ Positive Test
+ """
+ cores = self.dut.get_core_list('all')
+ random_num_0 = str(random.randint(1, len(cores) - 1)) # %d
+ random_num_1 = tuple(map(int, random.sample(cores, 2))) # (%d,%d)
+ m = random.randint(1, len(cores) - 3)
+ random_num_2 = "-".join(map(str, [m, m + 2])) # (%d-%d)
+ n = random.randint(1, len(cores) - 3)
+ random_num_3 = "-".join(map(str, [n, n + 2])) # (%d-%d)
+ j = random.randint(3, len(cores) - 3)
+ random_num_4 = "-".join(map(str, [j, j - 2])) # (%d-%d)
+ random_num_5 = str(random.randint(1, len(cores) - 1)) # %d
+
+ #lcore_0 = '0 @ %d,(%d-%d)@(%d-%d)'
+ core_0 = "@".join(['(%s)', '(%s)']) % (random_num_2, random_num_3)
+ core_1 = "@".join(['0', random_num_0])
+ lcore_0 = " , ".join([core_1, core_0])
+
+ #lcore_1 = '(0,CONFIG_RTE_MAX_LCORE-1)@(%d,%d)'
+ core_0 = ",".join(['0', cores[-1]])
+ lcore_1 = "@".join(map(str, ['(%s)', random_num_1])) % core_0
+
+ #lcore_2 = '(0,%d-%d)@(%d,%d)'
+ core_0 = ",".join(['0', random_num_2])
+ lcore_2 = "@".join(map(str, ['(%s)', random_num_1])) % core_0
+
+ #lcore_3 = '%d-%d,%d,%d-%d'
+ lcore_3 = " , ".join([random_num_3, random_num_0, random_num_2])
+
+ #lcore_4 = '%d, (%d-%d)@ %d'
+ core_0 = "@".join(['(%s)', random_num_0]) % random_num_2
+ lcore_4 = " , ".join(['2', core_0])
+
+ # lcore_5 = '(0,%d1-%d2)@(%d,%d)' %d1 > %d2
+ core_0 = ",".join(['0', random_num_4])
+ lcore_5 = "@".join(map(str, ['(%s)', random_num_1])) % core_0
+
+ #lcore_6 = '1 , 2@(0-2,6) , (2-4,6)@5 , (7,8)'
+ core__0 = ",".join([random_num_2, random_num_0])
+ core_0 = "@".join(['2', '(%s)']) % core__0
+ core__1 = ",".join([random_num_3, random_num_0])
+ core_1 = "@".join(['(%s)', random_num_5]) % core__1
+ lcore_6 = " , ".join(['1', core_0, core_1])
+
+ lcore_s = [lcore_0, lcore_1, lcore_2,
+ lcore_3, lcore_4, lcore_5, lcore_6]
+ lcore_s = random.sample(lcore_s, 3)
+ print lcore_s
+ for lcores in lcore_s:
+ self.get_corelist(lcores)
+
+ def test_negative_test(self):
+ """
+ Negative Test
+ """
+ cores = map(int, self.dut.get_core_list('all'))
+
+ lcores = [
+ '(0-,%d-%d)@(%d,%d)' % (cores[1], cores[2], cores[-2], cores[-1]),
+ '(-1,%d-%d)@(%d,%d)' % (cores[1], cores[2], cores[-2], cores[-1]),
+ '(0,%d-%d-%d)@(%d,%d)' % (cores[1],
+ cores[2], cores[3], cores[-2], cores[-1]),
+ '(0,abcd)@(%d,%d)' % (cores[1], cores[2]),
+ '(0,%d-%d)@(1-,%d)' % (cores[1], cores[2], cores[-2]),
+ '(0,%d-%d)@(-1,%d)' % (cores[1], cores[2], cores[-2]),
+ '(0,%d-%d)@(%d,%d-%d-%d)' % (cores[1], cores[2],
+ cores[3], cores[-3], cores[-2], cores[-1]),
+ '(0,%d-%d)@(abc,%d)' % (cores[1], cores[2], cores[-2]),
+ '(0,%d-%d)@(%d,xyz)' % (cores[1], cores[2], cores[-2]),
+ '(0,%d-%d)=(%d,%d)' % (cores[1], cores[2], cores[-2], cores[-1]),
+ '%d,%d @ %d,(0-1,,%d))' % (cores[1],
+ cores[2], cores[-2], cores[-1]),
+ '[0-,%d-%d]@(%d,%d)' % (cores[1], cores[2], cores[-2], cores[-1]),
+ '(0-,%d-%d)@[%d,%d]' % (cores[1], cores[2], cores[-2], cores[-1]),
+ '%d-%d @ %d,%d @ %d-%d' % (cores[1], cores[2],
+ cores[2], cores[-3], cores[-2], cores[-1]),
+ '%d,,%d''%d--%d' % (cores[1], cores[2], cores[1], cores[2]),
+ '%d,,,%d''%d--%d' % (cores[1], cores[2], cores[1], cores[2])]
+
+ for lcore in lcores:
+ pmd_cmd = "./%s/app/testpmd --lcores='%s' -n 4 -- -i --portmask=%s" \
+ % (self.target, lcore, self.portmask)
+ self.dut.send_expect(pmd_cmd, "#", 100)
+
+ def tear_down(self):
+ """
+ Run after each test case.
+ """
+ self.dut.kill_all()
+
+ def tear_down_all(self):
+ """
+ Run after each test suite.
+ """
+ pass
--
2.5.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dts] [PATCH V1 1/2] multiple_pthread: Add test plan
2017-06-16 4:58 [dts] [PATCH V1 1/2] multiple_pthread: Add test plan Lijuan Tu
2017-06-16 4:58 ` [dts] [PATCH V1 2/2] multiple_pthread: Add test script Lijuan Tu
@ 2017-06-23 17:17 ` Liu, Yong
2017-06-26 2:00 ` Tu, LijuanX A
1 sibling, 1 reply; 5+ messages in thread
From: Liu, Yong @ 2017-06-23 17:17 UTC (permalink / raw)
To: Tu, LijuanX A, dts; +Cc: Tu, LijuanX A
Lijuan, some comments below.
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Lijuan Tu
> Sent: Thursday, June 15, 2017 9:59 PM
> To: dts@dpdk.org
> Cc: Tu, LijuanX A <lijuanx.a.tu@intel.com>
> Subject: [dts] [PATCH V1 1/2] multiple_pthread: Add test plan
>
> Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
> ---
> test_plans/multiple_pthread_test_plan.rst | 151
> ++++++++++++++++++++++++++++++
> 1 file changed, 151 insertions(+)
> create mode 100644 test_plans/multiple_pthread_test_plan.rst
>
> diff --git a/test_plans/multiple_pthread_test_plan.rst
> b/test_plans/multiple_pthread_test_plan.rst
> new file mode 100644
> index 0000000..4de4643
> --- /dev/null
> +++ b/test_plans/multiple_pthread_test_plan.rst
> @@ -0,0 +1,151 @@
> +.. Copyright (c) < 2017 >, Intel Corporation
> + All rights reserved.
> +
> + Redistribution and use in source and binary forms, with or without
> + modification, are permitted provided that the following conditions
> + are met:
> +
> + - Redistributions of source code must retain the above copyright
> + notice, this list of conditions and the following disclaimer.
> +
> + - Redistributions in binary form must reproduce the above copyright
> + notice, this list of conditions and the following disclaimer in
> + the documentation and/or other materials provided with the
> + distribution.
> +
> + - Neither the name of Intel Corporation nor the names of its
> + contributors may be used to endorse or promote products derived
> + from this software without specific prior written permission.
> +
> + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> + OF THE POSSIBILITY OF SUCH DAMAGE.
> +
> +=====================
> +Multiple Pthread Test
> +=====================
> +
> +
> +Description
> +-----------
> +
> +This test is a basic multiple pthread test which demonstrates the basics
> +of control group. Cgroup is a Linux kernel feature that limits, accounts
> +for and isolates the resource usage, like CPU, memory, disk I/O, network,
> +etc of a collection of processes. Now, it's focus on the CPU usage.
> +
> +Prerequisites
> +-------------
> +Support igb_uio driver, kernel is 3.11+.
> +Use "modeprobe uio" "modprobe igb_uio" and then
> +use "./tools/dpdk_nic_bind.py --bind=igb_uio device_bus_id" to bind the
> ports.
> +
> +Assuming that an Intel� DPDK build has been set up and the testpmd
> +applications have been built.
> +
> +Os required: Linux and FreeBSD
> +
> +Test Case 1: Basic operation
> +----------------------------
> +
> +To run the application, start the testpmd with the lcoress all running
> with
> +threads and also the unique core assigned, command as follows::
> +
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0@8,(4-5)@9' -n 4
> -- -i --portmask=0xc
> + EAL: Master lcore 0 is ready (tid=ffd4900;cpuset=[8])
> + EAL: lcore 4 is ready (tid=873e7700;cpuset=[9])
> + EAL: lcore 5 is ready (tid=873e7700;cpuset=[9])
> +
> +To check the output, we shall make sure the lcore are init on the correct
> cpu.
> +e.g. Duing INIT log we can found below:
> +
> +The process should start successfully and display a command prompt as
> follows::
> +
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0@8,(4-5)@9' -n 4
> -- -i --portmask=0xc
> + Checking link statuses...
> + Port 0 Link Up - speed 10000 Mbps - full-duplex
> + Port 1 Link Up - speed 10000 Mbps - full-duplex
> + Done
> +
> +Start the packet forwarding as follows::
> +
> + testpmd>set fwd mac
> +
> +Before running the test, make sure the core is a unique one otherwise,
> +the throughput will be floating on different cores,
> +another thing is to make sure all the logic cores are running, command as
> follows::
> +
> + testpmd>set corelist 4,5
> +
> +Pay attention that set corelist need to be configured before start,
> +otherwise, it will not work::
> +
> + testpmd>start
> + testpmd>show config fwd
> +
> +Using the command to find the threads that's running, as follows::
> +
> + ps -C testpmd -L -opid,tid,%cpu,psr,args
> +
> +Result as follows:
> +
> + PID TID %CPU PSR COMMAND
> + 179459 179459 0.2 8 ./x86_64-native-linuxapp-gcc/app/testpmd --
> lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
> + 179459 179460 0.0 21 ./x86_64-native-linuxapp-gcc/app/testpmd --
> lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
> + 179461 0.0 21 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0
> at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
> + 179459 179462 80.4 9 ./x86_64-native-linuxapp-gcc/app/testpmd --
> lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
> + 179459 179463 0.0 9 ./x86_64-native-linuxapp-gcc/app/testpmd --
> lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
> +
> +You will see that there are two threads running on core 9.
> +The last 2 threads are running threads, their TID will be assigned to the
> tasks in the folder thread0.
> +
> + cd /sys/fs/cgroup/cpu/dpdk/thread0
> + echo 179462 > tasks
> + echo 179463 > tasks
> +
> +Assgined the percentage of cpu these two threads occupy as follows:
> +
Typo issue here, "assigned" should be "assigned".
> + echo 10000 > cpu.cfs_quota_us
> +
> +This means the two threads will totally occupy 10% of the CPU and each 5%.
> +
> +
> +Test Case 2: Positive Test
> +--------------------------
> +
Please add some description of these settings.
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0 at 8,(4-5)@(8-
> 11)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='1,2@(0-4,6),(3-
> 4,6)@5,(7,8)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --
> txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --
> lcores='(0,CONFIG_RTE_MAX_LCORE-1)@(4,5)' -n 4 -- -i --txfreet=32 --
> rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,64-66)@(4,5)' -
> n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2-5,6,7-9' -n 4 --
> -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2, (3-5)@ 3' -n 4
> -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,7-4)@(4,5)' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> +
> +Test Case 3: Negative Test
> +--------------------------
> +
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0-,4-7)@(4,5)' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(-1,4-7)@(4,5)' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7-9)@(4,5)' -
> n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,abcd)@(4,5)' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(1-,5)' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(-1,5)' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(4,5-8-9)'
> -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(abc,5)' -
> n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(4,xyz)' -
> n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)=(8,9)' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,3 at 4,(0-
> 1,,4))' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='[0-,4-7]@(4,5)' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0-,4-7)@[4,5]' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='3-4 at 3,2 at 5-6'
> -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,,3''2--3' -n 4 -
> - -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,,,3''2--3' -n 4
> -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> --
> 2.5.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dts] [PATCH V1 1/2] multiple_pthread: Add test plan
2017-06-23 17:17 ` [dts] [PATCH V1 1/2] multiple_pthread: Add test plan Liu, Yong
@ 2017-06-26 2:00 ` Tu, LijuanX A
2017-06-27 16:59 ` Liu, Yong
0 siblings, 1 reply; 5+ messages in thread
From: Tu, LijuanX A @ 2017-06-26 2:00 UTC (permalink / raw)
To: Liu, Yong, dts
Hi liuyong,
This is simply random combination test. I will send V2 immediately
The script is fixed selection of several combinations,
I think it's not rigorous , but it 's difficult for us to randomly generated the combined parameters.
-----Original Message-----
From: Liu, Yong
Sent: Saturday, June 24, 2017 1:18 AM
To: Tu, LijuanX A; dts@dpdk.org
Cc: Tu, LijuanX A
Subject: RE: [dts] [PATCH V1 1/2] multiple_pthread: Add test plan
Lijuan, some comments below.
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Lijuan Tu
> Sent: Thursday, June 15, 2017 9:59 PM
> To: dts@dpdk.org
> Cc: Tu, LijuanX A <lijuanx.a.tu@intel.com>
> Subject: [dts] [PATCH V1 1/2] multiple_pthread: Add test plan
>
> Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
> ---
> test_plans/multiple_pthread_test_plan.rst | 151
> ++++++++++++++++++++++++++++++
> 1 file changed, 151 insertions(+)
> create mode 100644 test_plans/multiple_pthread_test_plan.rst
>
> diff --git a/test_plans/multiple_pthread_test_plan.rst
> b/test_plans/multiple_pthread_test_plan.rst
> new file mode 100644
> index 0000000..4de4643
> --- /dev/null
> +++ b/test_plans/multiple_pthread_test_plan.rst
> @@ -0,0 +1,151 @@
> +.. Copyright (c) < 2017 >, Intel Corporation
> + All rights reserved.
> +
> + Redistribution and use in source and binary forms, with or without
> + modification, are permitted provided that the following conditions
> + are met:
> +
> + - Redistributions of source code must retain the above copyright
> + notice, this list of conditions and the following disclaimer.
> +
> + - Redistributions in binary form must reproduce the above copyright
> + notice, this list of conditions and the following disclaimer in
> + the documentation and/or other materials provided with the
> + distribution.
> +
> + - Neither the name of Intel Corporation nor the names of its
> + contributors may be used to endorse or promote products derived
> + from this software without specific prior written permission.
> +
> + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> + OF THE POSSIBILITY OF SUCH DAMAGE.
> +
> +=====================
> +Multiple Pthread Test
> +=====================
> +
> +
> +Description
> +-----------
> +
> +This test is a basic multiple pthread test which demonstrates the
> +basics of control group. Cgroup is a Linux kernel feature that
> +limits, accounts for and isolates the resource usage, like CPU,
> +memory, disk I/O, network, etc of a collection of processes. Now, it's focus on the CPU usage.
> +
> +Prerequisites
> +-------------
> +Support igb_uio driver, kernel is 3.11+.
> +Use "modeprobe uio" "modprobe igb_uio" and then use
> +"./tools/dpdk_nic_bind.py --bind=igb_uio device_bus_id" to bind the
> ports.
> +
> +Assuming that an Intel� DPDK build has been set up and the testpmd
> +applications have been built.
> +
> +Os required: Linux and FreeBSD
> +
> +Test Case 1: Basic operation
> +----------------------------
> +
> +To run the application, start the testpmd with the lcoress all
> +running
> with
> +threads and also the unique core assigned, command as follows::
> +
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0@8,(4-5)@9'
> + -n 4
> -- -i --portmask=0xc
> + EAL: Master lcore 0 is ready (tid=ffd4900;cpuset=[8])
> + EAL: lcore 4 is ready (tid=873e7700;cpuset=[9])
> + EAL: lcore 5 is ready (tid=873e7700;cpuset=[9])
> +
> +To check the output, we shall make sure the lcore are init on the
> +correct
> cpu.
> +e.g. Duing INIT log we can found below:
> +
> +The process should start successfully and display a command prompt as
> follows::
> +
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0@8,(4-5)@9'
> + -n 4
> -- -i --portmask=0xc
> + Checking link statuses...
> + Port 0 Link Up - speed 10000 Mbps - full-duplex
> + Port 1 Link Up - speed 10000 Mbps - full-duplex
> + Done
> +
> +Start the packet forwarding as follows::
> +
> + testpmd>set fwd mac
> +
> +Before running the test, make sure the core is a unique one
> +otherwise, the throughput will be floating on different cores,
> +another thing is to make sure all the logic cores are running,
> +command as
> follows::
> +
> + testpmd>set corelist 4,5
> +
> +Pay attention that set corelist need to be configured before start,
> +otherwise, it will not work::
> +
> + testpmd>start
> + testpmd>show config fwd
> +
> +Using the command to find the threads that's running, as follows::
> +
> + ps -C testpmd -L -opid,tid,%cpu,psr,args
> +
> +Result as follows:
> +
> + PID TID %CPU PSR COMMAND
> + 179459 179459 0.2 8 ./x86_64-native-linuxapp-gcc/app/testpmd --
> lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
> + 179459 179460 0.0 21 ./x86_64-native-linuxapp-gcc/app/testpmd
> + --
> lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
> + 179461 0.0 21 ./x86_64-native-linuxapp-gcc/app/testpmd
> + --lcores=0
> at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
> + 179459 179462 80.4 9 ./x86_64-native-linuxapp-gcc/app/testpmd --
> lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
> + 179459 179463 0.0 9 ./x86_64-native-linuxapp-gcc/app/testpmd --
> lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
> +
> +You will see that there are two threads running on core 9.
> +The last 2 threads are running threads, their TID will be assigned to
> +the
> tasks in the folder thread0.
> +
> + cd /sys/fs/cgroup/cpu/dpdk/thread0
> + echo 179462 > tasks
> + echo 179463 > tasks
> +
> +Assgined the percentage of cpu these two threads occupy as follows:
> +
Typo issue here, "assigned" should be "assigned".
> + echo 10000 > cpu.cfs_quota_us
> +
> +This means the two threads will totally occupy 10% of the CPU and each 5%.
> +
> +
> +Test Case 2: Positive Test
> +--------------------------
> +
Please add some description of these settings.
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0 at
> + 8,(4-5)@(8-
> 11)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd
> + --lcores='1,2@(0-4,6),(3-
> 4,6)@5,(7,8)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --
> txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --
> lcores='(0,CONFIG_RTE_MAX_LCORE-1)@(4,5)' -n 4 -- -i --txfreet=32 --
> rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd
> + --lcores='(0,64-66)@(4,5)' -
> n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2-5,6,7-9' -n
> + 4 --
> -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2, (3-5)@ 3'
> + -n 4
> -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,7-4)@(4,5)'
> + -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> +
> +Test Case 3: Negative Test
> +--------------------------
> +
> + ./x86_64-native-linuxapp-gcc/app/testpmd
> + --lcores='(0-,4-7)@(4,5)' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd
> + --lcores='(-1,4-7)@(4,5)' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd
> + --lcores='(0,4-7-9)@(4,5)' -
> n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd
> + --lcores='(0,abcd)@(4,5)' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd
> + --lcores='(0,4-7)@(1-,5)' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd
> + --lcores='(0,4-7)@(-1,5)' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(4,5-8-9)'
> -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd
> + --lcores='(0,4-7)@(abc,5)' -
> n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd
> + --lcores='(0,4-7)@(4,xyz)' -
> n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)=(8,9)'
> + -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,3 at 4,(0-
> 1,,4))' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01
> --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd
> + --lcores='[0-,4-7]@(4,5)' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd
> + --lcores='(0-,4-7)@[4,5]' -n
> 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='3-4 at 3,2 at 5-6'
> -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,,3''2--3' -n
> + 4 -
> - -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,,,3''2--3'
> + -n 4
> -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> --
> 2.5.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dts] [PATCH V1 1/2] multiple_pthread: Add test plan
2017-06-26 2:00 ` Tu, LijuanX A
@ 2017-06-27 16:59 ` Liu, Yong
0 siblings, 0 replies; 5+ messages in thread
From: Liu, Yong @ 2017-06-27 16:59 UTC (permalink / raw)
To: Tu, LijuanX A, dts
Lijuan,
I've known that this case should cover combinations as more as possible. My ask is just to add some descriptions about what the meaning of these combinations.
Like --lcores='0@8,(4-5)@(8-11)', it will start master lcore on core 8 and lcore4-5 on core 8-11.
For dump command, I think you can use command option replace of args option. With command option, will show that where lcore thread is running.
ps -C testpmd -L -opid,tid,%cpu,psr,comm
[root@dpdk-test38 ~]# ps -C testpmd -L -opid,tid,%cpu,psr,comm
PID TID %CPU PSR COMMAND
40971 40971 1.8 8 testpmd
40971 40974 0.0 8 eal-intr-thread
40971 40975 3.3 9 lcore-slave-4
40971 40976 0.0 9 lcore-slave-5
40971 40977 0.0 8 pdump-thread
Thanks,
Marvin
> -----Original Message-----
> From: Tu, LijuanX A
> Sent: Sunday, June 25, 2017 7:00 PM
> To: Liu, Yong <yong.liu@intel.com>; dts@dpdk.org
> Subject: RE: [dts] [PATCH V1 1/2] multiple_pthread: Add test plan
>
> Hi liuyong,
>
> This is simply random combination test. I will send V2 immediately
> The script is fixed selection of several combinations,
> I think it's not rigorous , but it 's difficult for us to randomly
> generated the combined parameters.
>
>
>
> -----Original Message-----
> From: Liu, Yong
> Sent: Saturday, June 24, 2017 1:18 AM
> To: Tu, LijuanX A; dts@dpdk.org
> Cc: Tu, LijuanX A
> Subject: RE: [dts] [PATCH V1 1/2] multiple_pthread: Add test plan
>
> Lijuan, some comments below.
>
> > -----Original Message-----
> > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Lijuan Tu
> > Sent: Thursday, June 15, 2017 9:59 PM
> > To: dts@dpdk.org
> > Cc: Tu, LijuanX A <lijuanx.a.tu@intel.com>
> > Subject: [dts] [PATCH V1 1/2] multiple_pthread: Add test plan
> >
> > Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
> > ---
> > test_plans/multiple_pthread_test_plan.rst | 151
> > ++++++++++++++++++++++++++++++
> > 1 file changed, 151 insertions(+)
> > create mode 100644 test_plans/multiple_pthread_test_plan.rst
> >
> > diff --git a/test_plans/multiple_pthread_test_plan.rst
> > b/test_plans/multiple_pthread_test_plan.rst
> > new file mode 100644
> > index 0000000..4de4643
> > --- /dev/null
> > +++ b/test_plans/multiple_pthread_test_plan.rst
> > @@ -0,0 +1,151 @@
> > +.. Copyright (c) < 2017 >, Intel Corporation
> > + All rights reserved.
> > +
> > + Redistribution and use in source and binary forms, with or without
> > + modification, are permitted provided that the following conditions
> > + are met:
> > +
> > + - Redistributions of source code must retain the above copyright
> > + notice, this list of conditions and the following disclaimer.
> > +
> > + - Redistributions in binary form must reproduce the above copyright
> > + notice, this list of conditions and the following disclaimer in
> > + the documentation and/or other materials provided with the
> > + distribution.
> > +
> > + - Neither the name of Intel Corporation nor the names of its
> > + contributors may be used to endorse or promote products derived
> > + from this software without specific prior written permission.
> > +
> > + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> > + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> > + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> > + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> > + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
> > + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> > + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> > + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> > + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> > + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> > + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> > + OF THE POSSIBILITY OF SUCH DAMAGE.
> > +
> > +=====================
> > +Multiple Pthread Test
> > +=====================
> > +
> > +
> > +Description
> > +-----------
> > +
> > +This test is a basic multiple pthread test which demonstrates the
> > +basics of control group. Cgroup is a Linux kernel feature that
> > +limits, accounts for and isolates the resource usage, like CPU,
> > +memory, disk I/O, network, etc of a collection of processes. Now, it's
> focus on the CPU usage.
> > +
> > +Prerequisites
> > +-------------
> > +Support igb_uio driver, kernel is 3.11+.
> > +Use "modeprobe uio" "modprobe igb_uio" and then use
> > +"./tools/dpdk_nic_bind.py --bind=igb_uio device_bus_id" to bind the
> > ports.
> > +
> > +Assuming that an Intel� DPDK build has been set up and the testpmd
> > +applications have been built.
> > +
> > +Os required: Linux and FreeBSD
> > +
> > +Test Case 1: Basic operation
> > +----------------------------
> > +
> > +To run the application, start the testpmd with the lcoress all
> > +running
> > with
> > +threads and also the unique core assigned, command as follows::
> > +
> > + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0@8,(4-5)@9'
> > + -n 4
> > -- -i --portmask=0xc
> > + EAL: Master lcore 0 is ready (tid=ffd4900;cpuset=[8])
> > + EAL: lcore 4 is ready (tid=873e7700;cpuset=[9])
> > + EAL: lcore 5 is ready (tid=873e7700;cpuset=[9])
> > +
> > +To check the output, we shall make sure the lcore are init on the
> > +correct
> > cpu.
> > +e.g. Duing INIT log we can found below:
> > +
> > +The process should start successfully and display a command prompt as
> > follows::
> > +
> > + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0@8,(4-5)@9'
> > + -n 4
> > -- -i --portmask=0xc
> > + Checking link statuses...
> > + Port 0 Link Up - speed 10000 Mbps - full-duplex
> > + Port 1 Link Up - speed 10000 Mbps - full-duplex
> > + Done
> > +
> > +Start the packet forwarding as follows::
> > +
> > + testpmd>set fwd mac
> > +
> > +Before running the test, make sure the core is a unique one
> > +otherwise, the throughput will be floating on different cores,
> > +another thing is to make sure all the logic cores are running,
> > +command as
> > follows::
> > +
> > + testpmd>set corelist 4,5
> > +
> > +Pay attention that set corelist need to be configured before start,
> > +otherwise, it will not work::
> > +
> > + testpmd>start
> > + testpmd>show config fwd
> > +
> > +Using the command to find the threads that's running, as follows::
> > +
> > + ps -C testpmd -L -opid,tid,%cpu,psr,args
> > +
> > +Result as follows:
> > +
> > + PID TID %CPU PSR COMMAND
> > + 179459 179459 0.2 8 ./x86_64-native-linuxapp-gcc/app/testpmd --
> > lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
> > + 179459 179460 0.0 21 ./x86_64-native-linuxapp-gcc/app/testpmd
> > + --
> > lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
> > + 179461 0.0 21 ./x86_64-native-linuxapp-gcc/app/testpmd
> > + --lcores=0
> > at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
> > + 179459 179462 80.4 9 ./x86_64-native-linuxapp-gcc/app/testpmd --
> > lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
> > + 179459 179463 0.0 9 ./x86_64-native-linuxapp-gcc/app/testpmd --
> > lcores=0 at 8,(4-5)@9 -n 4 -- -i --portmask=0xc
> > +
> > +You will see that there are two threads running on core 9.
> > +The last 2 threads are running threads, their TID will be assigned to
> > +the
> > tasks in the folder thread0.
> > +
> > + cd /sys/fs/cgroup/cpu/dpdk/thread0
> > + echo 179462 > tasks
> > + echo 179463 > tasks
> > +
> > +Assgined the percentage of cpu these two threads occupy as follows:
> > +
> Typo issue here, "assigned" should be "assigned".
>
> > + echo 10000 > cpu.cfs_quota_us
> > +
> > +This means the two threads will totally occupy 10% of the CPU and each
> 5%.
> > +
> > +
> > +Test Case 2: Positive Test
> > +--------------------------
> > +
> Please add some description of these settings.
>
>
> > + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0 at
> > + 8,(4-5)@(8-
> > 11)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd
> > + --lcores='1,2@(0-4,6),(3-
> > 4,6)@5,(7,8)' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --
> > txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd --
> > lcores='(0,CONFIG_RTE_MAX_LCORE-1)@(4,5)' -n 4 -- -i --txfreet=32 --
> > rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd
> > + --lcores='(0,64-66)@(4,5)' -
> > n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2-5,6,7-9' -n
> > + 4 --
> > -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2, (3-5)@ 3'
> > + -n 4
> > -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,7-4)@(4,5)'
> > + -n
> > 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > +
> > +Test Case 3: Negative Test
> > +--------------------------
> > +
> > + ./x86_64-native-linuxapp-gcc/app/testpmd
> > + --lcores='(0-,4-7)@(4,5)' -n
> > 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd
> > + --lcores='(-1,4-7)@(4,5)' -n
> > 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd
> > + --lcores='(0,4-7-9)@(4,5)' -
> > n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd
> > + --lcores='(0,abcd)@(4,5)' -n
> > 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd
> > + --lcores='(0,4-7)@(1-,5)' -n
> > 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd
> > + --lcores='(0,4-7)@(-1,5)' -n
> > 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)@(4,5-8-
> 9)'
> > -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd
> > + --lcores='(0,4-7)@(abc,5)' -
> > n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd
> > + --lcores='(0,4-7)@(4,xyz)' -
> > n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='(0,4-7)=(8,9)'
> > + -n
> > 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,3 at 4,(0-
> > 1,,4))' -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01
> > --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd
> > + --lcores='[0-,4-7]@(4,5)' -n
> > 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd
> > + --lcores='(0-,4-7)@[4,5]' -n
> > 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='3-4 at 3,2 at 5-
> 6'
> > -n 4 -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,,3''2--3' -n
> > + 4 -
> > - -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='2,,,3''2--3'
> > + -n 4
> > -- -i --txfreet=32 --rxfreet=32 --txqflags=0xf01 --txrst=32
> > --
> > 2.5.0
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-06-27 16:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-16 4:58 [dts] [PATCH V1 1/2] multiple_pthread: Add test plan Lijuan Tu
2017-06-16 4:58 ` [dts] [PATCH V1 2/2] multiple_pthread: Add test script Lijuan Tu
2017-06-23 17:17 ` [dts] [PATCH V1 1/2] multiple_pthread: Add test plan Liu, Yong
2017-06-26 2:00 ` Tu, LijuanX A
2017-06-27 16:59 ` Liu, Yong
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).