* [dts] [PATCH V3 1/3] Add multiple pthread test plan
@ 2015-09-10 3:45 Lijuan Tu
2015-09-10 3:45 ` [dts] [PATCH V3 2/3] Add multiple pthread test suite, Lijuan Tu
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Lijuan Tu @ 2015-09-10 3:45 UTC (permalink / raw)
To: dts
Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
---
test_plans/multiple_pthread_test_plan.rst | 116 ++++++++++++++++++++++++++++++
1 file changed, 116 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..b7b29d4
--- /dev/null
+++ b/test_plans/multiple_pthread_test_plan.rst
@@ -0,0 +1,116 @@
+..f
+ <COPYRIGHT_TAG>
+
+===============================
+Multiple Pthread Test Instructions
+===============================
+
+Cgroup Function 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@8,(4-5)@9 -n 4 -- -i --portmask=0xc
+ 179459 179460 0.0 21 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i --portmask=0xc
+ 179461 0.0 21 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i --portmask=0xc
+ 179459 179462 80.4 9 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i --portmask=0xc
+ 179459 179463 0.0 9 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@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%.
+
+
+Boundary Test
+-------------------------
+
+Test Case 2: Positive Test
+---------------------------------------------
+
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0@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@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@3,2@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
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dts] [PATCH V3 2/3] Add multiple pthread test suite,
2015-09-10 3:45 [dts] [PATCH V3 1/3] Add multiple pthread test plan Lijuan Tu
@ 2015-09-10 3:45 ` Lijuan Tu
2015-09-10 3:45 ` [dts] [PATCH V3 3/3] Add multiple pthread test suite in execution file Lijuan Tu
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Lijuan Tu @ 2015-09-10 3:45 UTC (permalink / raw)
To: dts
There're three cases contained in this suite
1)Basic operation
2)Positive Test
3)Negative Test
Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
---
tests/TestSuite_multiple_pthread.py | 626 ++++++++++++++++++++++++++++++++++++
1 file changed, 626 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..fa089d2
--- /dev/null
+++ b/tests/TestSuite_multiple_pthread.py
@@ -0,0 +1,626 @@
+# 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 dts
+import time
+import re
+import os
+from test_case import TestCase
+from pmd_output import PmdOutput
+
+#
+#
+# Test class.
+#
+
+
+class TestMultiplePthread(TestCase):
+
+ #
+ #
+ #
+ # Test cases.
+ #
+
+ def set_up_all(self):
+ """
+ Run at the start of each test suite.
+ """
+ self.ports = self.dut.get_ports()
+ self.portmask = dts.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 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-bytes']
+ port1_stats = self.get_stats(rxPort)
+ gp1rx_err = port1_stats['RX-errors']
+ gp1rx_bytes = port1_stats['RX-bytes']
+ time.sleep(5)
+
+ itf = self.tester.get_interface(self.tester.get_local_port(rxPort))
+
+ 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")], iface="%s")'
+ % (destMac, itf))
+ self.tester.scapy_execute()
+ time.sleep(3)
+
+ port0_stats = self.get_stats(txPort)
+ p0tx_bytes = port0_stats['TX-bytes']
+ port1_stats = self.get_stats(rxPort)
+ p1rx_err = port1_stats['RX-errors']
+ p1rx_bytes = port1_stats['RX-bytes']
+ 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 set_up(self):
+ """
+ Run before each test case.
+ """
+ pass
+
+ def basic_operation(self, lcores, corelist):
+ """
+ Basic operation
+ """
+ # lcores = '0@8,(4-5)@9'
+ pmd_cmd = "./%s/app/testpmd --lcores='%s' -n 4 -- -i --portmask=%s" \
+ % (self.target, lcores, self.portmask)
+ 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> ")
+ for core in corelist:
+ if core.isdigit() == True:
+ self.verify("Logical Core %s " % core in out,
+ "set corelist error: " + out)
+
+ self.check_forwarding(self.ports)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+ print out
+ result_scanner = "\d+\s+\d+\s+\w+.\w+\s+9\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 $2}'", "#")
+ count += 1
+ self.verify(count == 2, "Threads running error")
+
+ self.dut.send_expect("quit", "#")
+
+ def positive_1_test(self, lcores, corelist):
+ # lcores = '0@8,(4-5)@(8-11)'
+ 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> ")
+ for core in corelist:
+ if core.isdigit() == True:
+ self.verify("Logical Core %s " % core in out,
+ "set corelist error:" + out)
+
+ self.check_forwarding(self.ports)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+ print out
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+ head -n 2 | tail -n 1 | awk '{print $4}'", "#")
+ self.verify(out == '8',
+ "Threads running error:cpu is %s, expect 8 ." % out)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+ tail -n 2", "#")
+ 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 == '8' or out == '9' or out == '10' or out == '11':
+ count += 1
+ self.verify(count == 2,
+ "Threads running error:cpu is %s, expect 2 ." % count)
+
+ self.dut.send_expect("quit", "#")
+
+ def positive_2_test(self, lcores, corelist):
+ # lcores = '1,2@(0-4,6),(3-4,6)@5,(7,8)'
+ 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> ")
+ for core in corelist:
+ if core.isdigit() == True:
+ self.verify("Logical Core %s " % core in out,
+ "set corelist error: " + out)
+
+ self.check_forwarding(self.ports)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+ print out
+
+ # decode lcores work cpus
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+ head -n 2 | tail -n 1 | awk '{print $4}'", "#")
+ self.verify(out == '1',
+ "Threads running error:cpu is %s, expect 1 ." % out)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+ head -n 4 | tail -n 1 | awk '{print $4}'", "#")
+ self.verify(out == '0' or out == '1' or out == '2' or
+ out == '3' or out == '4' or out == '6',
+ "Threads running error")
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+ head -n 7 | tail -n 3", "#")
+ result_scanner = "\d+\s+\d+\s+\w+.\w+\s+5\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 == '5':
+ count += 1
+ self.verify(count == 3,
+ "Threads running error:cpu is %s, expect 3 ." % count)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args | tail -n 2", "#")
+ 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 == '8' or out == '7':
+ count += 1
+ self.verify(count == 2,
+ "Threads running error:cpu is %s, expect 2 ." % count)
+
+ self.dut.send_expect("quit", "#")
+
+ def positive_3_test(self, lcores, corelist):
+ # lcores = '(0,127)@(4,5)'
+ 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> ")
+ self.verify("Logical Core 127 " in out, "set corelist error: " + out)
+
+ self.check_forwarding(self.ports)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+ print out
+
+ 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 == '5' or out == '4':
+ count += 1
+ self.verify(count == 2,
+ "Threads running error:cpu is %s, expect 2 ." % count)
+
+ self.dut.send_expect("quit", "#")
+
+ def positive_4_test(self, lcores, corelist):
+ # lcores = '(0,64-66)@(4,5)'
+ 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> ")
+ self.verify("Logical Core 64 " or "Logical Core 65 " in out,
+ "set corelist error: " + out)
+
+ self.check_forwarding(self.ports)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+ print out
+
+ 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 == '5' or out == '4':
+ count += 1
+ self.verify(count == 4,
+ "Threads running error:cpu is %s, expect 4 ." % count)
+
+ self.dut.send_expect("quit", "#")
+
+ def positive_5_test(self, lcores, corelist):
+ # lcores = '2-5,6,7-9'
+ 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> ")
+ for core in corelist:
+ if core.isdigit() == True:
+ self.verify("Logical Core %s " % core in out,
+ "set corelist error: " + out)
+
+ self.check_forwarding(self.ports)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+ print out
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+ head -n 2 | tail -n 1 | awk '{print $4}'", "#")
+ self.verify(out == '2',
+ "Threads running error:cpu is %s, expect 2 ." % out)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+ head -n 4 | tail -n 1 | awk '{print $4}'", "#")
+ self.verify(out == '3',
+ "Threads running error:cpu is %s, expect 3 ." % out)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+ head -n 5 | tail -n 1 | awk '{print $4}'", "#")
+ self.verify(out == '4',
+ "Threads running error:cpu is %s, expect 4 ." % out)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+ head -n 6 | tail -n 1 | awk '{print $4}'", "#")
+ self.verify(out == '5',
+ "Threads running error:cpu is %s, expect 5 ." % out)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+ head -n 7 | tail -n 1 | awk '{print $4}'", "#")
+ self.verify(out == '6',
+ "Threads running error:cpu is %s, expect 6 ." % out)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+ head -n 8 | tail -n 1 | awk '{print $4}'", "#")
+ self.verify(out == '7',
+ "Threads running error:cpu is %s, expect 7 ." % out)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+ head -n 9 | tail -n 1 | awk '{print $4}'", "#")
+ self.verify(out == '8',
+ "Threads running error:cpu is %s, expect 8 ." % out)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+ head -n 10 | tail -n 1 | awk '{print $4}'", "#")
+ self.verify(out == '9',
+ "Threads running error:cpu is %s, expect 9 ." % out)
+
+ self.dut.send_expect("quit", "#")
+
+ def positive_6_test(self, lcores, corelist):
+ # lcores = '2, (3-5)@ 3'
+ 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> ")
+ for core in corelist:
+ if core.isdigit() == True:
+ self.verify("Logical Core %s " % core in out,
+ "set corelist error: " + out)
+
+ self.check_forwarding(self.ports)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+ print out
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+ head -n 2 | tail -n 1 | awk '{print $4}'", "#")
+ print out
+ self.verify(out == '2',
+ "Threads running error:cpu is %s, expect 2 ." % out)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+ print out
+ 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 == '3':
+ count += 1
+ self.verify(count == 3,
+ "Threads running error:cpu is %s, expect 3 ." % count)
+
+ self.dut.send_expect("quit", "#")
+
+ def positive_7_test(self, lcores, corelist):
+
+ # lcores = '(0,64-66)@(4,5)'
+ 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> ")
+ self.dut.send_expect("show config fwd", "testpmd> ")
+ self.check_forwarding(self.ports)
+
+ out = self.dut.alt_session.send_expect(
+ "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+ print out
+
+ 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)
+ self.dut.alt_session.send_expect(
+ "cd /sys/fs/cgroup/cpu/dpdk/thread0", "#")
+ 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 == '5' or out == '4':
+ count += 1
+ self.verify(count == 5, "Threads running error:cpu is %s, expect 5 ."
+ % count)
+
+ self.dut.send_expect("quit", "#")
+
+ def check_negative(self, lcores):
+ """
+ """
+ pmd_cmd = "./%s/app/testpmd --lcores='%s' -n 4 -- -i --portmask=%s" \
+ % (self.target, lcores, self.portmask)
+ self.dut.send_expect(pmd_cmd, "#", 100)
+
+ def test_basic_operation(self):
+ """
+ Basic operation
+ """
+ lcores = '0@8,(4-5)@9'
+ corelist = ['4', '5', '4,5']
+ for core in corelist:
+ self.basic_operation(lcores, core)
+
+ def test_positive_test(self):
+ """
+ Positive Test
+ """
+
+ # item 1
+ lcores = '0@8,(4-5)@(8-11)'
+ corelist = ['4', '5', '4,5']
+ for core in corelist:
+ self.positive_1_test(lcores, core)
+
+ # item 2
+ lcores = '1,2@(0-4,6),(3-4,6)@5,(7,8)'
+ corelist = ['2', '3', '4', '6', '7', '8',
+ '2,3', '2,4', '2,6', '2,7', '2,8',
+ '3,4', '3,6', '3,7', '3,8',
+ '4,6', '4,7', '4,8',
+ '6,7', '6,8',
+ '7,8']
+ for core in corelist:
+ self.positive_2_test(lcores, core)
+
+ # item 3
+ lcores = '(0,127)@(4,5)'
+ corelist = ['127']
+ for core in corelist:
+ self.positive_3_test(lcores, core)
+
+ # item 4
+ lcores = '(0,64-66)@(4,5)'
+ corelist = ['64', '65', '66', '64,65', '64,66', '65,66']
+ for core in corelist:
+ self.positive_4_test(lcores, core)
+
+ # item 5
+ lcores = '2-5,6,7-9'
+ corelist = ['3', '4', '5', '6', '7', '8', '9',
+ '3,4', '3,5', '3,6', '3,7', '3,8', '3,9',
+ '4,5', '4,6', '4,7', '4,8', '4,9',
+ '5,6', '5,7', '5,8', '5,9',
+ '6,7', '6,8', '6,9',
+ '7,8', '7,9',
+ '8,9']
+ for core in corelist:
+ self.positive_5_test(lcores, core)
+
+ # item 6
+ lcores = '2, (3-5)@ 3'
+ corelist = ['3', '4', '5', '3,4', '3,5', '4,5']
+ for core in corelist:
+ self.positive_6_test(lcores, core)
+
+ # item 7
+ lcores = '(0,7-4)@(4,5)'
+ corelist = ['7', '6', '5', '4',
+ '7,6', '7,5', '7,4', '6,5', '6,4', '5,4']
+ for core in corelist:
+ self.positive_7_test(lcores, core)
+
+ def test_negative_test(self):
+ """
+ Negative Test
+ """
+ lcores = [
+ '(0-,4-7)@(4,5)',
+ '(-1,4-7)@(4,5)',
+ '(0,4-7-9)@(4,5)',
+ '(0,abcd)@(4,5)',
+ '(0,4-7)@(1-,5)',
+ '(0,4-7)@(-1,5)',
+ '(0,4-7)@(4,5-8-9)',
+ '(0,4-7)@(abc,5)',
+ '(0,4-7)@(4,xyz)',
+ '(0,4-7)=(8,9)',
+ '2,3@4,(0-1,,4))',
+ '[0-,4-7]@(4,5)',
+ '(0-,4-7)@[4,5]',
+ '3-4@3,2@5-6',
+ '2,,3''2--3',
+ '2,,,3''2--3']
+ for lcore in lcores:
+ self.check_negative(lcore)
+
+ def tear_down(self):
+ """
+ Run after each test case.
+ """
+ self.dut.kill_all()
+
+ def tear_down_all(self):
+ """
+ Run after each test suite.
+ """
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dts] [PATCH V3 3/3] Add multiple pthread test suite in execution file
2015-09-10 3:45 [dts] [PATCH V3 1/3] Add multiple pthread test plan Lijuan Tu
2015-09-10 3:45 ` [dts] [PATCH V3 2/3] Add multiple pthread test suite, Lijuan Tu
@ 2015-09-10 3:45 ` Lijuan Tu
2015-09-10 5:08 ` [dts] [PATCH V3 1/3] Add multiple pthread test plan Liu, Yong
2015-09-16 6:40 ` Wan, Qun
3 siblings, 0 replies; 5+ messages in thread
From: Lijuan Tu @ 2015-09-10 3:45 UTC (permalink / raw)
To: dts
Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
---
executions/execution.cfg | 3 ++-
executions/execution_FVL.cfg | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/executions/execution.cfg b/executions/execution.cfg
index 6e42b90..0f916a4 100644
--- a/executions/execution.cfg
+++ b/executions/execution.cfg
@@ -25,7 +25,8 @@ test_suites=
scatter,
pmdrssreta,
pmd,
- l2fwd
+ l2fwd,
+ multiple_pthread
targets=
x86_64-native-linuxapp-gcc
parameters=nic_type=cfg:func=true
diff --git a/executions/execution_FVL.cfg b/executions/execution_FVL.cfg
index 9f25802..60af41e 100644
--- a/executions/execution_FVL.cfg
+++ b/executions/execution_FVL.cfg
@@ -26,7 +26,8 @@ test_suites=
scatter,
pmdrssreta,
pmdrss_hash,
- ieee1588
+ ieee1588,
+ multiple_pthread
targets=
x86_64-native-linuxapp-gcc
parameters=nic_type=cfg:func=true
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dts] [PATCH V3 1/3] Add multiple pthread test plan
2015-09-10 3:45 [dts] [PATCH V3 1/3] Add multiple pthread test plan Lijuan Tu
2015-09-10 3:45 ` [dts] [PATCH V3 2/3] Add multiple pthread test suite, Lijuan Tu
2015-09-10 3:45 ` [dts] [PATCH V3 3/3] Add multiple pthread test suite in execution file Lijuan Tu
@ 2015-09-10 5:08 ` Liu, Yong
2015-09-16 6:40 ` Wan, Qun
3 siblings, 0 replies; 5+ messages in thread
From: Liu, Yong @ 2015-09-10 5:08 UTC (permalink / raw)
To: Tu, LijuanX A, dts
Thanks lijuan, some comments about test plan.
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Lijuan Tu
> Sent: Thursday, September 10, 2015 11:46 AM
> To: dts@dpdk.org
> Subject: [dts] [PATCH V3 1/3] Add multiple pthread test plan
>
> Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
> ---
> test_plans/multiple_pthread_test_plan.rst | 116
> ++++++++++++++++++++++++++++++
> 1 file changed, 116 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..b7b29d4
> --- /dev/null
> +++ b/test_plans/multiple_pthread_test_plan.rst
> @@ -0,0 +1,116 @@
> +..f
> + <COPYRIGHT_TAG>
> +
> +===============================
> +Multiple Pthread Test Instructions
> +===============================
> +
> +Cgroup Function 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.
> +
I think this suite require multicores, so please add prerequisite on cpu module.
> +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@8,(4-5)@9 -n 4 -- -i --portmask=0xc
> + 179459 179460 0.0 21 ./x86_64-native-linuxapp-gcc/app/testpmd --
> lcores=0@8,(4-5)@9 -n 4 -- -i --portmask=0xc
> + 179461 0.0 21 ./x86_64-native-linuxapp-gcc/app/testpmd --
> lcores=0@8,(4-5)@9 -n 4 -- -i --portmask=0xc
> + 179459 179462 80.4 9 ./x86_64-native-linuxapp-gcc/app/testpmd --
> lcores=0@8,(4-5)@9 -n 4 -- -i --portmask=0xc
> + 179459 179463 0.0 9 ./x86_64-native-linuxapp-gcc/app/testpmd --
> lcores=0@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%.
> +
> +
How to measure that each cpu only can occupy 5%, should we start performance and measure cpu usage?
> +Boundary Test
> +-------------------------
> +
> +Test Case 2: Positive Test
> +---------------------------------------------
> +
> + ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0@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@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@3,2@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
> --
> 1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dts] [PATCH V3 1/3] Add multiple pthread test plan
2015-09-10 3:45 [dts] [PATCH V3 1/3] Add multiple pthread test plan Lijuan Tu
` (2 preceding siblings ...)
2015-09-10 5:08 ` [dts] [PATCH V3 1/3] Add multiple pthread test plan Liu, Yong
@ 2015-09-16 6:40 ` Wan, Qun
3 siblings, 0 replies; 5+ messages in thread
From: Wan, Qun @ 2015-09-16 6:40 UTC (permalink / raw)
To: Tu, LijuanX A, dts
Hi, Lijuan
Would you pls. add the check for the port and corelist matching?
-----Original Message-----
From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Lijuan Tu
Sent: Thursday, September 10, 2015 11:46 AM
To: dts@dpdk.org
Subject: [dts] [PATCH V3 1/3] Add multiple pthread test plan
Signed-off-by: Lijuan Tu <lijuanx.a.tu@intel.com>
---
test_plans/multiple_pthread_test_plan.rst | 116 ++++++++++++++++++++++++++++++
1 file changed, 116 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..b7b29d4
--- /dev/null
+++ b/test_plans/multiple_pthread_test_plan.rst
@@ -0,0 +1,116 @@
+..f
+ <COPYRIGHT_TAG>
+
+===============================
+Multiple Pthread Test Instructions
+===============================
+
+Cgroup Function 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@8,(4-5)@9 -n 4 -- -i --portmask=0xc
+ 179459 179460 0.0 21 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i --portmask=0xc
+ 179461 0.0 21 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i --portmask=0xc
+ 179459 179462 80.4 9 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@8,(4-5)@9 -n 4 -- -i --portmask=0xc
+ 179459 179463 0.0 9 ./x86_64-native-linuxapp-gcc/app/testpmd --lcores=0@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%.
+
+
+Boundary Test
+-------------------------
+
+Test Case 2: Positive Test
+---------------------------------------------
+
+ ./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0@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@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@3,2@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
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-09-16 6:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-10 3:45 [dts] [PATCH V3 1/3] Add multiple pthread test plan Lijuan Tu
2015-09-10 3:45 ` [dts] [PATCH V3 2/3] Add multiple pthread test suite, Lijuan Tu
2015-09-10 3:45 ` [dts] [PATCH V3 3/3] Add multiple pthread test suite in execution file Lijuan Tu
2015-09-10 5:08 ` [dts] [PATCH V3 1/3] Add multiple pthread test plan Liu, Yong
2015-09-16 6:40 ` Wan, Qun
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).