* [dts] [DTS][PATCH V1 1/2] Add test plan for performance thread suite
@ 2018-08-28 12:43 Wang Fei
2018-08-28 12:43 ` [dts] [DTS][PATCH V1 2/2] add test suite for performance thread perf test Wang Fei
0 siblings, 1 reply; 3+ messages in thread
From: Wang Fei @ 2018-08-28 12:43 UTC (permalink / raw)
To: dts; +Cc: lijuan.tu, Wang Fei
Signed-off-by: Wang Fei <feix.y.wang@intel.com>
---
test_plans/performance_thread_test_plan.rst | 280 ++++++++++++++++++++
1 file changed, 280 insertions(+)
create mode 100644 test_plans/performance_thread_test_plan.rst
diff --git a/test_plans/performance_thread_test_plan.rst b/test_plans/performance_thread_test_plan.rst
new file mode 100644
index 0000000..09d64a3
--- /dev/null
+++ b/test_plans/performance_thread_test_plan.rst
@@ -0,0 +1,280 @@
+.. Copyright (c) <2011-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.
+
+======================================
+Performance-thread performance Tests
+======================================
+
+The Performance-Thread results are produced using ``l3fwd-thread`` application.
+
+For more information about Performance Thread sameple applicaton please refer to
+link: http://doc.dpdk.org/guides/sample_app_ug/performance_thread.html
+
+Prerequisites
+==============
+
+1. Hardware requirements:
+
+ - For each CPU socket, each memory channel should be populated with at least 1x DIMM
+ - Board is populated with 4x 1GbE or 10GbE ports. Special PCIe restrictions may
+ be required for performance. For example, the following requirements should be
+ met for Intel 82599 (Niantic) NICs:
+
+ - NICs are plugged into PCIe Gen2 or Gen3 slots
+ - For PCIe Gen2 slots, the number of lanes should be 8x or higher
+ - A single port from each NIC should be used, so for 4x ports, 4x NICs should
+ be used
+
+ - NIC ports connected to traffic generator. It is assumed that the NIC ports
+ P0, P1 (as identified by the DPDK application) are connected to the
+ traffic generator ports TG0, TG1. The application-side port mask of
+ NIC ports P0, P1 is noted as PORTMASK in this section.
+
+2. BIOS requirements:
+
+ - Intel Hyper-Threading Technology is ENABLED
+ - Hardware Prefetcher is DISABLED
+ - Adjacent Cache Line Prefetch is DISABLED
+ - Direct Cache Access is DISABLED
+
+3. Linux kernel requirements:
+
+ - Linux kernel has the following features enabled: huge page support, UIO, HPET
+ - Appropriate number of huge pages are reserved at kernel boot time
+ - The IDs of the hardware threads (logical cores) per each CPU socket can be
+ determined by parsing the file /proc/cpuinfo. The naming convention for the
+ logical cores is: C{x.y.z} = hyper-thread z of physical core y of CPU socket x,
+ with typical values of x = 0 .. 3, y = 0 .. 7, z = 0 .. 1. Logical cores
+ C{0.0.1} and C{0.0.1} should be avoided while executing the test, as they are
+ used by the Linux kernel for running regular processes.
+
+4. Software application requirements
+
+5. If using vfio the kernel must be >= 3.6+ and VT-d must be enabled in bios.When
+ using vfio, use the following commands to to load the vfio driver and bind it
+ to the device under test::
+
+ modprobe vfio
+ modprobe vfio-pci
+ usertools/dpdk-devbind.py --bind=vfio-pci device_bus_id
+
+6. Build dpdk and performance thread sample app
+ -> make install RTE_SDK=`pwd` T=x86_64-native-linuxapp-gcc
+ -> make -C examples/performance-thread RTE_SDK=`pwd` T=x86_64-native-linuxapp-gcc
+
+7. Bind two ports to igb_uio driver and connect these two ports with two ixia ports
+ -> ./usertools/dpdk-devbind.py --bind=igb_uio 0000:18:00.0 0000:1a:00.0
+
+
+Detail test cases and test steps
+=================================
+
+Test Case: one_lcore_per_pcore performance::
+
+ 1: Launch app:
+ ./examples/performance-thread/l3fwd-thread/x86_64-native-linuxapp-gcc/l3fwd-thread \
+ -c ff -n 2 -- -P -p 3 \
+ --enable-jumbo --max-pkt-len 2500 \
+ --rx="(0,0,0,0)(1,0,0,0)" \
+ --tx="(1,0)" \
+ --no-lthread
+ ( Note: option "--stat-lcore" is not enabled in the automation scripts)
+
+ 2: Send traffic(see traffic config below) and verify performance
+
+ 3: Repeat above tests with below command lines respectively
+
++-----+-----------------------------------------------------------------------------------------------------------+
+| # | Command Line |
++-----+-----------------------------------------------------------------------------------------------------------+
+|1 |./l3fwd-thread -c ff -n 2 -- -P -p 3 --enable-jumbo --max-pkt-len 2500 \ |
+| | --rx="(0,0,0,0)(1,0,1,1) --tx="(2,0)(3,1) \ |
+| | --no-lthread |
++-----+-----------------------------------------------------------------------------------------------------------+
+|2 |./l3fwd-thread -c ff -n 2 -- -P -p 3 --enable-jumbo --max-pkt-len 2500 \ |
+| | --rx="(0,0,0,0)(0,1,1,1)(1,0,2,2)(1,1,3,3)" \ |
+| | --tx="(4,0)(5,1)(6,2)(7,3)" --no-lthread |
++-----+-----------------------------------------------------------------------------------------------------------+
+|3 |./l3fwd-thread -c ff -n 2 -- -P -p 3 --enable-jumbo --max-pkt-len 2500 \ |
+| | --rx="(0,0,0,0)(0,1,1,1)(0,2,2,2)(0,3,3,3)(1,0,4,4)(1,1,5,5)(1,2,6,6)(1,3,7,7)" \ |
+| | --tx="(8,0)(9,1)(10,2)(11,3)(12,4)(13,5)(14,6)(15,7)" \ |
+| | --no-lthread |
++-----+-----------------------------------------------------------------------------------------------------------|
+
+ 4: Check test results output as below table
+
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Cores | Fsize | Unidirectional MPPS | Line Rate(%) | Bidirectional MPPS | Line Rate(%) |
++=======+=======+=====================+==============+====================+==============+
+| Core N| 64 | | | | |
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Core N| 128 | | | | |
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Core N| 256 | | | | |
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Core N| 512 | | | | |
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Core N| 1024 | | | | |
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Core N| 2000 | | | | |
+-----------------------------------------------------------------------------------------+
+
+
+Test Case: n_lcore_per_pcore performance::
+
+ 1: Launch app:
+ ./examples/performance-thread/l3fwd-thread/x86_64-native-linuxapp-gcc/l3fwd-thread \
+ --lcores="2,(0-1)@0" -- -P -p 3 \
+ --enable-jumbo --max-pkt-len 2500 \
+ --rx="(0,0,0,0)(1,0,0,0)" \
+ --tx="(1,0)"
+ ( Note: option "--stat-lcore" is not enabled in the automation scripts)
+
+ 2: Send traffic(see traffic config below) and verify performance both directional and bi-directional
+
+ 3: Repeat above tests with below command lines respectively
+
++-----+-----------------------------------------------------------------------------------------------------------+
+| # | Command Line |
++-----+-----------------------------------------------------------------------------------------------------------+
+|1 |./l3fwd-thread -n 2 --lcores="(0-3)@0,4" -- -P -p 3 \ |
+| | --enable-jumbo --max-pkt-len 2500 \ |
+| | --rx="(0,0,0,0)(1,0,1,1)" \ |
+| | --tx="(2,0)(3,1)" \ |
+| | --no-lthread |
++-----+-----------------------------------------------------------------------------------------------------------+
+|2 |./l3fwd-thread -n 2 --lcores="(0-7)@0,8" -- -P -p 3 \ |
+| | --enable-jumbo --max-pkt-len 2500 \ |
+| | --rx="(0,0,0,0)(0,1,1,1)(1,0,2,2)(1,1,3,3)" \ |
+| | --tx="(4,0)(5,1)(6,2)(7,3)" \ |
+| | --no-lthread |
++-----+-----------------------------------------------------------------------------------------------------------+
+|3 |./l3fwd-thread -n 2 --lcores="(0-15)@0,16" -- -P -p 3 \ |
+| | --enable-jumbo --max-pkt-len 2500 \ |
+| | --rx="(0,0,0,0)(0,1,1,1)(0,2,2,2)(0,3,3,3)(1,0,4,4)(1,1,5,5)(1,2,6,6)(1,3,7,7)" \ |
+| | --tx="(8,0)(9,1)(10,2)(11,3)(12,4)(13,5)(14,6)(15,7)" \ |
+| | --no-lthread |
++-----+-----------------------------------------------------------------------------------------------------------|
+
+ 4: Check test results output as below table:
+
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Cores | Fsize | Unidirectional MPPS | Line Rate(%) | Bidirectional MPPS | Line Rate(%) |
++=======+=======+=====================+==============+====================+==============+
+| Core N| 64 | | | | |
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Core N| 128 | | | | |
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Core N| 256 | | | | |
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Core N| 512 | | | | |
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Core N| 1024 | | | | |
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Core N| 2000 | | | | |
+-----------------------------------------------------------------------------------------+
+
+
+
+
+Test Case: n_lthread_per_pcore performance::
+
+ 1: Launch app:
+ ./examples/performance-thread/l3fwd-thread/x86_64-native-linuxapp-gcc/l3fwd-thread \
+ -c ff -n 2 -- -P -p 3 \
+ --enable-jumbo --max-pkt-len 2500 \
+ ----tx="(0,0)" \
+ --tx="(0,0)"
+ ( Note: option "--stat-lcore" is not enabled in the automation scripts)
+
+ 2: Send traffic(see traffic config below) and verify performance both directional and bi-directional
+
+ 3: Repeat above tests with below command lines respectively
+
++-----+-----------------------------------------------------------------------------------------------------------+
+| # | Command Line |
++-----+-----------------------------------------------------------------------------------------------------------+
+|1 |./l3fwd-thread -c ff -n 2 -- -P -p 3 \ |
+| | --enable-jumbo --max-pkt-len 2500 \ |
+| | --rx="(0,0,0,0)(1,0,0,1)" \ |
+| | --tx="(0,0)(0,1)" \ |
++-----+-----------------------------------------------------------------------------------------------------------+
+|2 |./l3fwd-thread -c ff -n 2 -- -P -p 3 \ |
+| | --enable-jumbo --max-pkt-len 2500 \ |
+| | --rx="(0,0,0,0)(0,1,0,1)(1,0,0,2)(1,1,0,3)" \ |
+| | --tx="(0,0)(0,1)(0,2)(0,3)" \ |
++-----+-----------------------------------------------------------------------------------------------------------+
+|3 |./l3fwd-thread -c ff -n 2 -- -P -p 3 \ |
+| | --enable-jumbo --max-pkt-len 2500 \ |
+| | --rx="(0,0,0,0)(0,1,0,1)(0,2,0,2)(0,3,0,3)(1,0,0,4)(1,1,0,5)(1,2,0,6)(1,3,0,7)" \ |
+| | --tx="(0,0)(0,1)(0,2)(0,3)(0,4)(0,5)(0,6)(0,7)" \ |
++-----+-----------------------------------------------------------------------------------------------------------|
+
+ 4: Check test results output as below table:
+
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Cores | Fsize | Unidirectional MPPS | Line Rate(%) | Bidirectional MPPS | Line Rate(%) |
++=======+=======+=====================+==============+====================+==============+
+| Core N| 64 | | | | |
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Core N| 128 | | | | |
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Core N| 256 | | | | |
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Core N| 512 | | | | |
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Core N| 1024 | | | | |
++-------+-------+---------------------+--------------+--------------------+--------------+
+| Core N| 2000 | | | | |
+-----------------------------------------------------------------------------------------+
+
+
+
+How to configure Traffic generator to send traffic:
+=====================================================
+
+The flows need to be configured and started by the traffic generator:
+
+|
+
++------+---------+------------+---------------+------------+---------+
+| Flow | Traffic | MAC | MAC | IPV4 | IPV4 |
+| | Gen. | Src. | Dst. | Src. | Dest. |
+| | Port | Address | Address | Address | Address |
++------+---------+------------+---------------+------------+---------+
+| 1 | TG0 | Random MAC | DUT Port0 Mac | Random IP | 2.1.1.1 |
++------+---------+------------+---------------+------------+---------+
+| 2 | TG1 | Random Mac | DUT port1 Mac | Random IP | 1.1.1.1 |
++------+---------+------------+---------------+------------+---------+
+
+|
+Frame sizes should be configured from 64,128,256,512,1024,2000, etc
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dts] [DTS][PATCH V1 2/2] add test suite for performance thread perf test
2018-08-28 12:43 [dts] [DTS][PATCH V1 1/2] Add test plan for performance thread suite Wang Fei
@ 2018-08-28 12:43 ` Wang Fei
2018-09-26 5:33 ` Tu, Lijuan
0 siblings, 1 reply; 3+ messages in thread
From: Wang Fei @ 2018-08-28 12:43 UTC (permalink / raw)
To: dts; +Cc: lijuan.tu, Wang Fei
Signed-off-by: Wang Fei <feix.y.wang@intel.com>
---
tests/TestSuite_performance_thread.py | 247 ++++++++++++++++++++++++++
1 file changed, 247 insertions(+)
create mode 100644 tests/TestSuite_performance_thread.py
diff --git a/tests/TestSuite_performance_thread.py b/tests/TestSuite_performance_thread.py
new file mode 100644
index 0000000..e1e5be6
--- /dev/null
+++ b/tests/TestSuite_performance_thread.py
@@ -0,0 +1,247 @@
+# 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.
+Performance-Thread test script.
+"""
+
+import utils
+
+from test_case import TestCase
+from settings import HEADER_SIZE
+from etgen import IxiaPacketGenerator
+import pdb
+
+class TestPerformanceThread(TestCase, IxiaPacketGenerator):
+
+ def set_up_all(self):
+ self.ports = self.dut.get_ports()
+ self.verify(len(self.ports) >= 2, "Insufficent Ports")
+ self.socket = self.dut.get_numa_id(self.ports[0])
+ self.port0_mac = self.dut.get_mac_address(self.ports[0])
+ self.port1_mac = self.dut.get_mac_address(self.ports[1])
+
+ self.tester.extend_external_packet_generator(TestPerformanceThread, self)
+
+ self.frame_sizes = [64, 128, 256, 512, 1024, 2000]
+ self.headers_size = HEADER_SIZE['eth'] + HEADER_SIZE['ip'] + HEADER_SIZE['tcp']
+ self.nb_cores = [2, 4, 8, 16]
+ self.path = "examples/performance-thread/l3fwd-thread/build/l3fwd-thread"
+
+ #results table header
+ self.header = ["Cores", "Fsize", "Unidirectional MPPS", "Line Rate(%)", "Bidirectional MPPS", "Line Rate(%)"]
+
+ # compile performance_thread app
+ out = self.dut.build_dpdk_apps("./examples/performance-thread/l3fwd-thread")
+ self.verify("Error" not in out, "compilation error 1")
+ self.verify("No such file" not in out, "compilation error 2")
+
+ def set_up(self):
+ pass
+
+ def test_perf_one_lcore_per_pcore(self):
+ nb_cores = self.nb_cores
+ params = "-n 2 -- -P -p 3 --enable-jumbo --max-pkt-len=2500 --no-lthread"
+ test_data = {}
+ for cores in nb_cores:
+ _, core_mask = self.create_cores(cores)
+ _,rx, tx = self.config_rx_tx(cores)
+ app_cmdline = "{} -c {} {} --rx='{}' --tx='{}'".format(self.path, core_mask, params, rx, tx)
+ self.dut.send_expect(app_cmdline, "", 15)
+ test_data[cores] = self.start_traffic()
+ self.dut.send_expect("^C", "# ", 15)
+ self.print_result(test_data)
+
+ def test_perf_n_lthreads_per_pcore(self):
+ nb_cores = self.nb_cores
+ params = "-n 2 -- -P -p 3 --enable-jumbo --max-pkt-len=2500"
+ test_data = {}
+ for cores in nb_cores:
+ _, core_mask = self.create_cores(cores)
+ _,rx, tx = self.config_rx_tx(cores)
+ app_cmdline = "{} -c {} {} --rx='{}' --tx='{}'".format(self.path, core_mask, params, rx, tx)
+ self.dut.send_expect(app_cmdline, "", 15)
+ test_data[cores] = self.start_traffic()
+ self.dut.send_expect("^C", "# ", 15)
+ self.print_result(test_data)
+
+ def test_perf_n_lcore_per_pcore(self):
+ nb_cores = self.nb_cores
+ params = "-- -P -p 3 --enable-jumbo --max-pkt-len 2500 --no-lthread"
+ test_data = {}
+ for cores in nb_cores:
+ _, core_mask = self.create_cores(cores)
+ rxtx_config, rx, tx = self.config_rx_tx(cores)
+ #app_cmdline = "{} -c {} -n 2 --lcores='{}' {} --rx='{}' --tx='{}'".format(self.path, core_mask, rxtx_config, params, rx, tx)
+ app_cmdline = "{} -n 2 --lcores='{}' {} --rx='{}' --tx='{}'".format(self.path, rxtx_config, params, rx, tx)
+ self.dut.send_expect(app_cmdline, "", 15)
+ test_data[cores] = self.start_traffic()
+ self.dut.send_expect("^C", "# ", 15)
+ self.print_result(test_data)
+
+ def create_cores(self, nb_cores):
+ if nb_cores == 2:
+ core_config = "1S/2C/1T"
+ elif nb_cores == 4:
+ core_config = "1S/4C/1T"
+ elif nb_cores == 8:
+ core_config = "1S/8C/1T"
+ elif nb_cores == 16:
+ core_config = "1S/16C/1T"
+ core_list = self.dut.get_core_list(core_config, self.socket)
+ core_mask = utils.create_mask(core_list)
+ return core_list, core_mask
+
+ def config_rx_tx(self, cores):
+ socket = self.socket
+ ports = range(len(self.ports))
+ tx_config = ""
+ rx_config = ""
+ core_mask = ""
+ lcore_config = ""
+ assert cores in self.nb_cores
+
+ #config --tx and --tx params for performace thread app
+ if cores == 2:
+ core_list, core_mask = self.create_cores(cores)
+ lcore_config = "(%s-%s)@%s" % (core_list[0],core_list[-1], core_list[0])
+ rx = "({},{},{},{})".format(ports[0], 0, core_list[0], 0) + "," + \
+ "({},{},{},{})".format(ports[1], 0, core_list[0], 0)
+ tx = "({},{})".format(core_list[1], 0)
+ elif cores == 4:
+ core_list, core_mask = self.create_cores(cores)
+ lcore_config = "(%s-%s)@%s" % (core_list[0], core_list[-1], core_list[0])
+ rx = "({},{},{},{})".format(ports[0], 0, core_list[0], 0) + "," + \
+ "({},{},{},{})".format(ports[1], 0, core_list[1], 1)
+ tx = "({},{})".format(core_list[2], 0) + "," + \
+ "({},{})".format(core_list[3], 1)
+ elif cores == 8:
+ core_list, core_mask = self.create_cores(cores)
+ lcore_config = "(%s-%s)@%s" % (core_list[0], core_list[-1], core_list[0])
+ rx = "({},{},{},{})".format(ports[0], 0, core_list[0], 0) + "," + \
+ "({},{},{},{})".format(ports[0], 1, core_list[1], 1) + "," + \
+ "({},{},{},{})".format(ports[1], 0, core_list[2], 2) + "," + \
+ "({},{},{},{})".format(ports[1], 1, core_list[3], 3)
+ tx = "({},{})".format(core_list[4], 0) + "," + "({},{})".format(core_list[5], 1) + "," + \
+ "({},{})".format(core_list[6], 2) + "," + "({},{})".format(core_list[7], 3)
+ elif cores == 16:
+ core_list, core_mask = self.create_cores(cores)
+ lcore_config = "(%s-%s)@%s" % (core_list[0], core_list[-1], core_list[0])
+ rx = "({},{},{},{})".format(ports[0], 0, core_list[0], 0) + "," + \
+ "({},{},{},{})".format(ports[0], 1, core_list[1], 1) + "," + \
+ "({},{},{},{})".format(ports[0], 2, core_list[2], 2) + "," + \
+ "({},{},{},{})".format(ports[0], 3, core_list[3], 3) + "," + \
+ "({},{},{},{})".format(ports[1], 0, core_list[4], 4) + "," + \
+ "({},{},{},{})".format(ports[1], 1, core_list[5], 5) + "," + \
+ "({},{},{},{})".format(ports[1], 2, core_list[6], 6) + "," + \
+ "({},{},{},{})".format(ports[1], 3, core_list[7], 7)
+ tx = "({},{})".format(core_list[8], 0) + "," + "({},{})".format(core_list[9], 1) + "," + \
+ "({},{})".format(core_list[10], 2) + "," + "({},{})".format(core_list[11], 3) + "," + \
+ "({},{})".format(core_list[12], 4) + "," + "({},{})".format(core_list[13], 5) + "," + \
+ "({},{})".format(core_list[14], 6) + "," + "({},{})".format(core_list[15], 7)
+ return lcore_config, rx, tx
+
+ def start_traffic(self):
+ frame_sizes = self.frame_sizes
+ headers_size = self.headers_size
+ ports = self.ports
+ dmac0 = self.port0_mac
+ dmac1 = self.port1_mac
+
+ tgen_input_unidirection = []
+ tgen_input_unidirection.append((self.tester.get_local_port(ports[0]),
+ self.tester.get_local_port(ports[1]),
+ "stream0.pcap"))
+
+ tgen_input_bidirection = []
+ tgen_input_bidirection.append((self.tester.get_local_port(ports[0]),
+ self.tester.get_local_port(ports[1]),
+ "stream0.pcap"))
+ tgen_input_bidirection.append((self.tester.get_local_port(ports[1]),
+ self.tester.get_local_port(ports[0]),
+ "stream1.pcap"))
+
+ result_data = {}
+ for frame_size in frame_sizes:
+ # create pcap file
+ payload_size = frame_size - headers_size
+ self.tester.scapy_append(
+ 'wrpcap("stream0.pcap", [Ether(src="52:00:00:00:00:00",dst="%s")/IP(src="1.2.3.4",dst="2.1.1.1")/TCP()/("X"*%d)])' %
+ (dmac0, payload_size))
+ self.tester.scapy_execute()
+ self.logger.info("Starting Uni-Direction Traffic For Frame Size: %s" % frame_size)
+ _, pps = self.tester.traffic_generator_throughput(tgen_input_unidirection, rate_percent=100, delay=20)
+ mpps = pps / 1000000.0
+ self.verify( mpps != 0, "Traffic Blocked")
+ wirespeed = self.wirespeed(self.nic, frame_size, 1)
+ rate = (mpps / wirespeed) * 100
+ result_data[frame_size] = [mpps, rate]
+
+ self.logger.info("Starting Bi-direction Traffic For Frame Size: %s" % frame_size)
+ self.tester.scapy_append(
+ 'wrpcap("stream1.pcap", [Ether(src="52:00:00:00:00:00",dst="%s")/IP(src="1.2.3.4",dst="1.1.1.1")/TCP()/("X"*%d)])' % (
+ dmac1, payload_size))
+ self.tester.scapy_execute()
+ _, pps = self.tester.traffic_generator_throughput(tgen_input_bidirection, rate_percent=100, delay=20)
+ mpps = pps / 1000000.0
+ self.verify( mpps != 0, "Traffic Blocked")
+ wirespeed = self.wirespeed(self.nic, frame_size, 2)
+ rate = (mpps / wirespeed) * 100
+ result_data[frame_size].extend([mpps, rate])
+
+ return result_data
+
+ def print_result(self, data):
+ '''
+ print test result table
+ '''
+ header = self.header
+ frame_sizes = self.frame_sizes
+ nb_cores = self.nb_cores
+
+ self.result_table_create(header)
+ try:
+ for nb_core in nb_cores:
+ for frame_size in frame_sizes:
+ row = [nb_core, frame_size]
+ row.extend(data[nb_core][frame_size])
+ self.result_table_add(row)
+ self.result_table_print()
+ except:
+ raise
+
+ def tear_down(self):
+ pass
+
+ def tear_down_all(self):
+ pass
+
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dts] [DTS][PATCH V1 2/2] add test suite for performance thread perf test
2018-08-28 12:43 ` [dts] [DTS][PATCH V1 2/2] add test suite for performance thread perf test Wang Fei
@ 2018-09-26 5:33 ` Tu, Lijuan
0 siblings, 0 replies; 3+ messages in thread
From: Tu, Lijuan @ 2018-09-26 5:33 UTC (permalink / raw)
To: Wang, FeiX Y, dts
> -----Original Message-----
> From: Wang, FeiX Y
> Sent: Tuesday, August 28, 2018 8:43 PM
> To: dts@dpdk.org
> Cc: Tu, Lijuan <lijuan.tu@intel.com>; Wang, FeiX Y <feix.y.wang@intel.com>
> Subject: [DTS][PATCH V1 2/2] add test suite for performance thread perf test
>
> Signed-off-by: Wang Fei <feix.y.wang@intel.com>
> ---
> tests/TestSuite_performance_thread.py | 247
> ++++++++++++++++++++++++++
> 1 file changed, 247 insertions(+)
> create mode 100644 tests/TestSuite_performance_thread.py
>
> diff --git a/tests/TestSuite_performance_thread.py
> b/tests/TestSuite_performance_thread.py
> new file mode 100644
> index 0000000..e1e5be6
> --- /dev/null
> +++ b/tests/TestSuite_performance_thread.py
> @@ -0,0 +1,247 @@
> +# 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.
> +Performance-Thread test script.
> +"""
> +
> +import utils
> +
> +from test_case import TestCase
> +from settings import HEADER_SIZE
> +from etgen import IxiaPacketGenerator
> +import pdb
> +
> +class TestPerformanceThread(TestCase, IxiaPacketGenerator):
> +
> + def set_up_all(self):
> + self.ports = self.dut.get_ports()
> + self.verify(len(self.ports) >= 2, "Insufficent Ports")
> + self.socket = self.dut.get_numa_id(self.ports[0])
> + self.port0_mac = self.dut.get_mac_address(self.ports[0])
> + self.port1_mac = self.dut.get_mac_address(self.ports[1])
> +
> +
> + self.tester.extend_external_packet_generator(TestPerformanceThread,
> + self)
> +
> + self.frame_sizes = [64, 128, 256, 512, 1024, 2000]
[Lijuan] It's better to put them in configuration file and users can configure their frame sizes as their condition.
> + self.headers_size = HEADER_SIZE['eth'] + HEADER_SIZE['ip'] +
> HEADER_SIZE['tcp']
> + self.nb_cores = [2, 4, 8, 16]
[Lijuan] I don't think all platform will have more than 16 cores.
> + self.path =
> "examples/performance-thread/l3fwd-thread/build/l3fwd-thread"
> +
> + #results table header
> + self.header = ["Cores", "Fsize", "Unidirectional MPPS", "Line
> + Rate(%)", "Bidirectional MPPS", "Line Rate(%)"]
> +
> + # compile performance_thread app
> + out =
> self.dut.build_dpdk_apps("./examples/performance-thread/l3fwd-thread")
> + self.verify("Error" not in out, "compilation error 1")
> + self.verify("No such file" not in out, "compilation error 2")
> +
> + def set_up(self):
> + pass
> +
> + def test_perf_one_lcore_per_pcore(self):
> + nb_cores = self.nb_cores
> + params = "-n 2 -- -P -p 3 --enable-jumbo --max-pkt-len=2500
> --no-lthread"
> + test_data = {}
> + for cores in nb_cores:
> + _, core_mask = self.create_cores(cores)
> + _,rx, tx = self.config_rx_tx(cores)
> + app_cmdline = "{} -c {} {} --rx='{}' --tx='{}'".format(self.path,
> core_mask, params, rx, tx)
> + self.dut.send_expect(app_cmdline, "", 15)
> + test_data[cores] = self.start_traffic()
> + self.dut.send_expect("^C", "# ", 15)
> + self.print_result(test_data)
> +
> + def test_perf_n_lthreads_per_pcore(self):
> + nb_cores = self.nb_cores
> + params = "-n 2 -- -P -p 3 --enable-jumbo --max-pkt-len=2500"
> + test_data = {}
> + for cores in nb_cores:
> + _, core_mask = self.create_cores(cores)
> + _,rx, tx = self.config_rx_tx(cores)
> + app_cmdline = "{} -c {} {} --rx='{}' --tx='{}'".format(self.path,
> core_mask, params, rx, tx)
> + self.dut.send_expect(app_cmdline, "", 15)
> + test_data[cores] = self.start_traffic()
> + self.dut.send_expect("^C", "# ", 15)
> + self.print_result(test_data)
> +
> + def test_perf_n_lcore_per_pcore(self):
> + nb_cores = self.nb_cores
> + params = "-- -P -p 3 --enable-jumbo --max-pkt-len 2500
> --no-lthread"
> + test_data = {}
> + for cores in nb_cores:
> + _, core_mask = self.create_cores(cores)
> + rxtx_config, rx, tx = self.config_rx_tx(cores)
> + #app_cmdline = "{} -c {} -n 2 --lcores='{}' {} --rx='{}'
> --tx='{}'".format(self.path, core_mask, rxtx_config, params, rx, tx)
> + app_cmdline = "{} -n 2 --lcores='{}' {} --rx='{}'
> --tx='{}'".format(self.path, rxtx_config, params, rx, tx)
> + self.dut.send_expect(app_cmdline, "", 15)
> + test_data[cores] = self.start_traffic()
> + self.dut.send_expect("^C", "# ", 15)
> + self.print_result(test_data)
> +
> + def create_cores(self, nb_cores):
> + if nb_cores == 2:
> + core_config = "1S/2C/1T"
> + elif nb_cores == 4:
> + core_config = "1S/4C/1T"
> + elif nb_cores == 8:
> + core_config = "1S/8C/1T"
> + elif nb_cores == 16:
> + core_config = "1S/16C/1T"
> + core_list = self.dut.get_core_list(core_config, self.socket)
> + core_mask = utils.create_mask(core_list)
> + return core_list, core_mask
> +
> + def config_rx_tx(self, cores):
> + socket = self.socket
> + ports = range(len(self.ports))
> + tx_config = ""
> + rx_config = ""
> + core_mask = ""
> + lcore_config = ""
> + assert cores in self.nb_cores
> +
> + #config --tx and --tx params for performace thread app
> + if cores == 2:
> + core_list, core_mask = self.create_cores(cores)
> + lcore_config = "(%s-%s)@%s" % (core_list[0],core_list[-1],
> core_list[0])
> + rx = "({},{},{},{})".format(ports[0], 0, core_list[0], 0) + "," + \
> + "({},{},{},{})".format(ports[1], 0, core_list[0], 0)
> + tx = "({},{})".format(core_list[1], 0)
> + elif cores == 4:
> + core_list, core_mask = self.create_cores(cores)
> + lcore_config = "(%s-%s)@%s" % (core_list[0], core_list[-1],
> core_list[0])
> + rx = "({},{},{},{})".format(ports[0], 0, core_list[0], 0) + "," + \
> + "({},{},{},{})".format(ports[1], 0, core_list[1], 1)
> + tx = "({},{})".format(core_list[2], 0) + "," + \
> + "({},{})".format(core_list[3], 1)
> + elif cores == 8:
> + core_list, core_mask = self.create_cores(cores)
> + lcore_config = "(%s-%s)@%s" % (core_list[0], core_list[-1],
> core_list[0])
> + rx = "({},{},{},{})".format(ports[0], 0, core_list[0], 0) + "," + \
> + "({},{},{},{})".format(ports[0], 1, core_list[1], 1) + "," +
> \
> + "({},{},{},{})".format(ports[1], 0, core_list[2], 2) + "," +
> \
> + "({},{},{},{})".format(ports[1], 1, core_list[3], 3)
> + tx = "({},{})".format(core_list[4], 0) + "," +
> "({},{})".format(core_list[5], 1) + "," + \
> + "({},{})".format(core_list[6], 2) + "," +
> "({},{})".format(core_list[7], 3)
> + elif cores == 16:
> + core_list, core_mask = self.create_cores(cores)
> + lcore_config = "(%s-%s)@%s" % (core_list[0], core_list[-1],
> core_list[0])
> + rx = "({},{},{},{})".format(ports[0], 0, core_list[0], 0) + "," + \
> + "({},{},{},{})".format(ports[0], 1, core_list[1], 1) + "," +
> \
> + "({},{},{},{})".format(ports[0], 2, core_list[2], 2) + "," +
> \
> + "({},{},{},{})".format(ports[0], 3, core_list[3], 3) + "," +
> \
> + "({},{},{},{})".format(ports[1], 0, core_list[4], 4) + "," +
> \
> + "({},{},{},{})".format(ports[1], 1, core_list[5], 5) + "," +
> \
> + "({},{},{},{})".format(ports[1], 2, core_list[6], 6) + "," +
> \
> + "({},{},{},{})".format(ports[1], 3, core_list[7], 7)
> + tx = "({},{})".format(core_list[8], 0) + "," +
> "({},{})".format(core_list[9], 1) + "," + \
> + "({},{})".format(core_list[10], 2) + "," +
> "({},{})".format(core_list[11], 3) + "," + \
> + "({},{})".format(core_list[12], 4) + "," +
> "({},{})".format(core_list[13], 5) + "," + \
> + "({},{})".format(core_list[14], 6) + "," +
> "({},{})".format(core_list[15], 7)
> + return lcore_config, rx, tx
> +
> + def start_traffic(self):
> + frame_sizes = self.frame_sizes
> + headers_size = self.headers_size
> + ports = self.ports
> + dmac0 = self.port0_mac
> + dmac1 = self.port1_mac
> +
> + tgen_input_unidirection = []
> +
> tgen_input_unidirection.append((self.tester.get_local_port(ports[0]),
> + self.tester.get_local_port(ports[1]),
> + "stream0.pcap"))
> +
> + tgen_input_bidirection = []
> +
> tgen_input_bidirection.append((self.tester.get_local_port(ports[0]),
> +
> self.tester.get_local_port(ports[1]),
> + "stream0.pcap"))
> +
> tgen_input_bidirection.append((self.tester.get_local_port(ports[1]),
> +
> self.tester.get_local_port(ports[0]),
> + "stream1.pcap"))
> +
> + result_data = {}
> + for frame_size in frame_sizes:
> + # create pcap file
> + payload_size = frame_size - headers_size
> + self.tester.scapy_append(
> + 'wrpcap("stream0.pcap",
> [Ether(src="52:00:00:00:00:00",dst="%s")/IP(src="1.2.3.4",dst="2.1.1.1")/TC
> P()/("X"*%d)])' %
> + (dmac0, payload_size))
> + self.tester.scapy_execute()
> + self.logger.info("Starting Uni-Direction Traffic For Frame
> Size: %s" % frame_size)
> + _, pps =
> self.tester.traffic_generator_throughput(tgen_input_unidirection,
> rate_percent=100, delay=20)
> + mpps = pps / 1000000.0
> + self.verify( mpps != 0, "Traffic Blocked")
> + wirespeed = self.wirespeed(self.nic, frame_size, 1)
> + rate = (mpps / wirespeed) * 100
> + result_data[frame_size] = [mpps, rate]
> +
> + self.logger.info("Starting Bi-direction Traffic For Frame
> Size: %s" % frame_size)
> + self.tester.scapy_append(
> + 'wrpcap("stream1.pcap",
> [Ether(src="52:00:00:00:00:00",dst="%s")/IP(src="1.2.3.4",dst="1.1.1.1")/TC
> P()/("X"*%d)])' % (
> + dmac1, payload_size))
> + self.tester.scapy_execute()
> + _, pps =
> self.tester.traffic_generator_throughput(tgen_input_bidirection,
> rate_percent=100, delay=20)
> + mpps = pps / 1000000.0
> + self.verify( mpps != 0, "Traffic Blocked")
> + wirespeed = self.wirespeed(self.nic, frame_size, 2)
> + rate = (mpps / wirespeed) * 100
> + result_data[frame_size].extend([mpps, rate])
> +
> + return result_data
> +
> + def print_result(self, data):
> + '''
> + print test result table
> + '''
> + header = self.header
> + frame_sizes = self.frame_sizes
> + nb_cores = self.nb_cores
> +
> + self.result_table_create(header)
> + try:
> + for nb_core in nb_cores:
> + for frame_size in frame_sizes:
> + row = [nb_core, frame_size]
> + row.extend(data[nb_core][frame_size])
> + self.result_table_add(row)
> + self.result_table_print()
> + except:
> + raise
> +
> + def tear_down(self):
> + pass
> +
> + def tear_down_all(self):
> + pass
> +
> --
> 2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-09-26 5:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-28 12:43 [dts] [DTS][PATCH V1 1/2] Add test plan for performance thread suite Wang Fei
2018-08-28 12:43 ` [dts] [DTS][PATCH V1 2/2] add test suite for performance thread perf test Wang Fei
2018-09-26 5:33 ` Tu, Lijuan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).