From patchwork Thu Jan 27 02:11:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yingya Han X-Patchwork-Id: 106596 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4E8B0A0032; Thu, 27 Jan 2022 03:33:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1784240685; Thu, 27 Jan 2022 03:33:35 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id C70D54067C for ; Thu, 27 Jan 2022 03:33:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643250813; x=1674786813; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=FuDrYBhZaM/ZaIXz7rIrgNhSupN7p7q1is2ThTXFt1o=; b=A4irC3FOVDe8HObmD/VvdVtlGIecN64+aorlVmbLQkgdtyZoBwm157gD UIxx1sJrNA+KAIYPrPcgY8gOTGGlTJGwNfvdpICcdVsHzBw4Z19liEjfS 6VgMNrtvG3voOvN2waQ+V1TQgrKa0Jpm+uBYraK1VtnWYm3Ag83/lwXEy EPjQGx2ooZfa1sMrVBeHJe3Js0PrfmUCFF5gV0ALajfoTmjkZVfz9l6CC 3+ix+sJ48AaDVGXuQ0pzoZmc5KcyJfHUMF+cGaLUTnqdqVy+E9QUXFNEP VmCuNuDv7T13KN9Jkz0i1GXX2WkzQ1EaWd+py+S0dLkAnILlLgp2ulX4p g==; X-IronPort-AV: E=McAfee;i="6200,9189,10239"; a="246942778" X-IronPort-AV: E=Sophos;i="5.88,319,1635231600"; d="scan'208";a="246942778" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 18:33:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,319,1635231600"; d="scan'208";a="696464613" Received: from dpdk-lijuan-purley2.sh.intel.com ([10.67.119.98]) by orsmga005.jf.intel.com with ESMTP; 26 Jan 2022 18:33:30 -0800 From: hanyingya To: dts@dpdk.org Cc: hanyingya Subject: [dts][PATCH v2]performance_thread: remove perf test suite Date: Thu, 27 Jan 2022 10:11:41 +0800 Message-Id: <20220127021141.194969-1-yingyax.han@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org dpdk has removed the sample of performance_thread. please refer to dpdk commit 1dcbc676d5e0b6d299147. Signed-off-by: hanyingya Reviewed-by: Lijuan Tu --- conf/app_name.cfg | 2 - test_plans/index.rst | 1 - test_plans/performance_thread_test_plan.rst | 227 ----------------- tests/TestSuite_performance_thread.py | 258 -------------------- 4 files changed, 488 deletions(-) delete mode 100644 test_plans/performance_thread_test_plan.rst delete mode 100644 tests/TestSuite_performance_thread.py diff --git a/conf/app_name.cfg b/conf/app_name.cfg index 985ee115..01c4971b 100644 --- a/conf/app_name.cfg +++ b/conf/app_name.cfg @@ -39,7 +39,6 @@ l2fwd-keepalive=target/examples/dpdk-l2fwd-keepalive l3fwd=target/examples/dpdk-l3fwd l3fwd-acl=target/examples/dpdk-l3fwd-acl l3fwd-power=target/examples/dpdk-l3fwd-power -l3fwd-thread=target/examples/dpdk-l3fwd-thread link_status_interrupt=target/examples/dpdk-link_status_interrupt ntb=target/examples/dpdk-ntb packet_ordering=target/examples/dpdk-packet_ordering @@ -104,7 +103,6 @@ l2fwd-keepalive=examples/l2fwd-keepalive/build/app/l2fwd-keepalive l3fwd=examples/l3fwd/build/app/l3fwd l3fwd-acl=examples/l3fwd-acl/build/app/l3fwd-acl l3fwd-power=examples/l3fwd-power/build/app/l3fwd-power -l3fwd-thread=examples/performance-thread/l3fwd-thread/build/app/l3fwd-thread link_status_interrupt=examples/link_status_interrupt/build/app/link_status_interrupt ntb=examples/ntb/build/app/ntb_fwd packet_ordering=examples/packet_ordering/build/app/packet_ordering diff --git a/test_plans/index.rst b/test_plans/index.rst index 68250fca..b25b24f4 100644 --- a/test_plans/index.rst +++ b/test_plans/index.rst @@ -285,7 +285,6 @@ The following are the test plans for the DPDK DTS automated test system. packet_capture_test_plan packet_ordering_test_plan bbdev_test_plan - performance_thread_test_plan fips_cryptodev_test_plan flow_filtering_test_plan diff --git a/test_plans/performance_thread_test_plan.rst b/test_plans/performance_thread_test_plan.rst deleted file mode 100644 index b541bfda..00000000 --- a/test_plans/performance_thread_test_plan.rst +++ /dev/null @@ -1,227 +0,0 @@ -.. Copyright (c) <2011-2019>, 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. The application options to be used in below test cases are listed as well as the -general description.:: - - ./x86_64-native-linuxapp-gcc/examples/dpdk-l3fwd-thread [EAL options] -- \ - -p PORTMASK [-P] - --rx(port,queue,lcore,thread)[,(port,queue,lcore,thread)] - --tx(lcore,thread)[,(lcore,thread)] - [--enable-jumbo] [--max-pkt-len PKTLEN]] - [--no-lthreads] - - For other options please refer to URL memtioned above for detail explanation. - -5. Traffic generator requirements - -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 | - +------+---------+------------+---------------+------------+---------+ - -6. Test results table. - -Frame sizes should be configured from 64,128,256,512,1024,2000, etc - - +------------+---------+------------------+--------------+ - | Frame Size | S/C/T | Throughput(Mpps) | Line Rate(%) | - +============+=========+==================+==============+ - | 64 | | | | - +------------+---------+------------------+--------------+ - | 128 | | | | - +------------+---------+------------------+--------------+ - | 256 | | | | - +------------+---------+------------------+--------------+ - | 512 | | | | - +------------+---------+------------------+--------------+ - | 1024 | | | | - +------------+---------+------------------+--------------+ - | 2000 | | | | - +------------+---------+------------------+--------------+ - - -Test Case: one_lcore_per_pcore performance -========================================== - -1. Launch app with descriptor parameters:: - - ./x86_64-native-linuxapp-gcc/examples/dpdk-l3fwd-thread \ - -c ff -n 4 -- -P -p 3 --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 and verify performance. - -3. Repeat above tests with below command lines respectively - - +-----+---------------------------------------------------------------------------------------------------+ - | # | Command Line | - +=====+===================================================================================================+ - | 1 | ./dpdk-l3fwd-thread -c ff -n 4 -- -P -p 3 --max-pkt-len 2500 \ | - | | --rx="(0,0,0,0)(1,0,1,1) --tx="(2,0)(3,1) \ | - | | --no-lthread | - +-----+---------------------------------------------------------------------------------------------------+ - | 2 | ./dpdk-l3fwd-thread -c ff -n 4 -- -P -p 3 --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 | ./dpdk-l3fwd-thread -c ff -n 4 -- -P -p 3 --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 and full out the above result table. - - -Test Case: n_lcore_per_pcore performance -======================================== - -1. Launch app with descriptor parameters:: - - ./examples/performance-thread/l3fwd-thread/x86_64-native-linuxapp-gcc/l3fwd-thread \ - --lcores="2,(0-1)@0" -- -P -p 3 --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 and verify performance both directional and bi-directional - -3. Repeat above tests with below command lines respectively - - +-----+---------------------------------------------------------------------------------------------------+ - | # | Command Line | - +=====+===================================================================================================+ - | 1 | ./dpdk-l3fwd-thread -n 4 --lcores="(0-3)@0,4" -- -P -p 3 --max-pkt-len 2500 \ | - | | --rx="(0,0,0,0)(1,0,1,1) --tx="(2,0)(3,1) \ | - | | --no-lthread | - +-----+---------------------------------------------------------------------------------------------------+ - | 2 | ./dpdk-l3fwd-thread -n 4 --lcores="(0-7)@0,8" -- -P -p 3-P -p 3 --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 | ./dpdk-l3fwd-thread -n 4 --lcores="(0-15)@0,16" -- -P -p 3 --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 and full out the above result table. - - -Test Case: n_lthread_per_pcore performance -========================================== - -1. Launch app with descriptor parameters:: - - ./x86_64-native-linuxapp-gcc/examples/dpdk-l3fwd-thread \ - -c ff -n 4 -- -P -p 3 --max-pkt-len 2500 \ - ----tx="(0,0)" --tx="(0,0)" - - (Note: option "--stat-lcore" is not enabled in the automation scripts) - -2. Send traffic and verify performance both directional and bi-directional - -3. Repeat above tests with below command lines respectively - - +-----+---------------------------------------------------------------------------------------------------+ - | # | Command Line | - +=====+===================================================================================================+ - | 1 | ./dpdk-l3fwd-thread -c ff -n 4 -- -P -p 3 --max-pkt-len 2500 \ | - | | --rx="(0,0,0,0)(1,0,1,1) --tx="(0,0),(0,1)" | - +-----+---------------------------------------------------------------------------------------------------+ - | 2 | ./dpdk-l3fwd-thread -c ff -n 4 -- -P -p 3 --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 | ./dpdk-l3fwd-thread -c ff -n 4 -- -P -p 3 --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 and full out the above result table. diff --git a/tests/TestSuite_performance_thread.py b/tests/TestSuite_performance_thread.py deleted file mode 100644 index f3c58f05..00000000 --- a/tests/TestSuite_performance_thread.py +++ /dev/null @@ -1,258 +0,0 @@ -# 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 os -import string - -import framework.utils as utils -from framework.pktgen import PacketGeneratorHelper -from framework.settings import HEADER_SIZE -from framework.test_case import TestCase - - -class TestPerformanceThread(TestCase): - - def set_up_all(self): - """ - Run at the start of each test suite. - """ - self.dut_ports = self.dut.get_ports(self.nic) - global valports - valports = [_ for _ in self.dut_ports if self.tester.get_local_port(_) != -1] - - # Verify that enough ports are available - self.verify(len(valports) >= 2, "Insufficent Ports") - - self.port_mask = utils.create_mask(valports) - self.socket = self.dut.get_numa_id(self.dut_ports[0]) - - self.frame_sizes = self.get_suite_cfg()["frame_size"] - self.nb_cores = self.get_suite_cfg()["cores"] - self.headers_size = HEADER_SIZE['eth'] + HEADER_SIZE['ip'] + HEADER_SIZE['tcp'] - - # 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") - - # results table header - self.test_results = {'header': [], 'data': []} - - # get dts output path - if self.logger.log_path.startswith(os.sep): - self.output_path = self.logger.log_path - else: - cur_path = os.path.dirname( - os.path.dirname(os.path.realpath(__file__))) - self.output_path = os.sep.join([cur_path, self.logger.log_path]) - # create an instance to set stream field setting - self.pktgen_helper = PacketGeneratorHelper() - - def set_up(self): - """ - Run before each test case. - """ - pass - - def flows(self): - """ - Return a list of packets that implements the flows described. - """ - return [ - 'IP(src="1.2.3.4",dst="192.18.1.0")', - 'IP(src="1.2.3.4",dst="192.18.1.1")', - 'IP(src="1.2.3.4",dst="192.18.0.0")', - 'IP(src="1.2.3.4",dst="192.18.0.1")', - 'IP(src="1.2.3.4",dst="192.18.3.0")', - 'IP(src="1.2.3.4",dst="192.18.3.1")', - 'IP(src="1.2.3.4",dst="192.18.2.0")', - 'IP(src="1.2.3.4",dst="192.18.2.1")'] - - def create_cores(self, cores): - - core_config = "1S/{}C/1T".format(cores) - core_list = self.dut.get_core_list(core_config, socket=self.socket) - core_mask = utils.create_mask(core_list) - return core_list, core_mask - - def config_rx_tx(self, cores, core_list): - - # config --tx and --tx params for performace thread app - if cores == 2: - rx = "({},{},{},{})".format(valports[0], 0, core_list[0], 0) + "," + "({},{},{},{})".format(valports[1], 0, - core_list[0], 0) - tx = "({},{})".format(core_list[1], 0) - elif cores == 4: - rx = "({},{},{},{})".format(valports[0], 0, core_list[0], 0) + "," + "({},{},{},{})".format(valports[1], 0, - core_list[1], 1) - tx = "({},{})".format(core_list[2], 0) + "," + "({},{})".format(core_list[3], 1) - elif cores == 8: - rx = "({},{},{},{})".format(valports[0], 0, core_list[0], 0) + "," + \ - "({},{},{},{})".format(valports[0], 1, core_list[1], 1) + "," + \ - "({},{},{},{})".format(valports[1], 0, core_list[2], 2) + "," + \ - "({},{},{},{})".format(valports[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: - rx = "({},{},{},{})".format(valports[0], 0, core_list[0], 0) + "," + \ - "({},{},{},{})".format(valports[0], 1, core_list[1], 1) + "," + \ - "({},{},{},{})".format(valports[0], 2, core_list[2], 2) + "," + \ - "({},{},{},{})".format(valports[0], 3, core_list[3], 3) + "," + \ - "({},{},{},{})".format(valports[1], 0, core_list[4], 4) + "," + \ - "({},{},{},{})".format(valports[1], 1, core_list[5], 5) + "," + \ - "({},{},{},{})".format(valports[1], 2, core_list[6], 6) + "," + \ - "({},{},{},{})".format(valports[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) - - lcore_config = "(%s-%s)@%s" % (core_list[0], core_list[-1], core_list[0]) - return lcore_config, rx, tx - - def create_pacap_file(self, frame_size): - """ - Prepare traffic flow - """ - dmac = [self.dut.get_mac_address(self.dut_ports[i]) for i in valports] - smac = ["02:00:00:00:00:0%d" % i for i in valports] - payload_size = frame_size - HEADER_SIZE['ip'] - HEADER_SIZE['eth'] - pcaps = {} - for _port in valports: - index = valports[_port] - cnt = 0 - for layer in self.flows()[_port * 2:(_port + 1) * 2]: - flow = ['Ether(dst="%s", src="%s")/%s/("X"*%d)' % (dmac[index], smac[index], layer, payload_size)] - pcap = os.sep.join([self.output_path, "dst{0}_{1}.pcap".format(index, cnt)]) - self.tester.scapy_append('wrpcap("%s", [%s])' % (pcap, ','.join(flow))) - self.tester.scapy_execute() - if index not in pcaps: - pcaps[index] = [] - pcaps[index].append(pcap) - cnt += 1 - return pcaps - - def prepare_stream(self, pcaps): - """ - create streams for ports,one port one stream - """ - tgen_input = [] - for rxPort in valports: - if rxPort % len(valports) == 0 or len(valports) % rxPort == 2: - txIntf = self.tester.get_local_port(valports[rxPort + 1]) - port_id = valports[rxPort + 1] - else: - txIntf = self.tester.get_local_port(valports[rxPort - 1]) - port_id = valports[rxPort - 1] - rxIntf = self.tester.get_local_port(valports[rxPort]) - for pcap in pcaps[port_id]: - tgen_input.append((txIntf, rxIntf, pcap)) - return tgen_input - - def perf_test(self, params): - - # create result table - header_row = ["Frame size", "S/C/T", "Throughput(Mpps)", "Line Rate(%)"] - self.test_results["header"] = header_row - self.result_table_create(header_row) - self.test_results["data"] = [] - eal_param = "" - for i in valports: - eal_param += " -a %s" % self.dut.ports_info[i]['pci'] - - for cores in self.nb_cores: - core_list, core_mask = self.create_cores(cores) - lcore_config, rx, tx = self.config_rx_tx(cores, core_list) - app_name = self.dut.apps_name['l3fwd-thread'] - if self.running_case is "test_perf_n_lcore_per_pcore": - cmdline = "{} -n 4 {} --lcores='{}' {} --rx='{}' --tx='{}'".format(app_name, eal_param, lcore_config, params, rx, tx) - else: - cmdline = "{} -c {} {} {} --rx='{}' --tx='{}'".format(app_name, core_mask, eal_param, params, rx, tx) - self.dut.send_expect(cmdline, "L3FWD:", 120) - - for frame_size in self.frame_sizes: - pcaps = self.create_pacap_file(frame_size) - # send the traffic and Measure test - tgenInput = self.prepare_stream(pcaps) - - vm_config = self.set_fields() - # clear streams before add new streams - self.tester.pktgen.clear_streams() - # run packet generator - streams = self.pktgen_helper.prepare_stream_from_tginput(tgenInput, 100, vm_config, self.tester.pktgen) - # set traffic option - traffic_opt = {'delay': 15} - _, pps = self.tester.pktgen.measure_throughput(stream_ids=streams, options=traffic_opt) - self.verify(pps > 0, "No traffic detected") - pps /= 1000000.0 - linerate = self.wirespeed(self.nic, frame_size, len(valports)) - percentage = pps * 100 / linerate - data_row = [frame_size, "1S/{}C/1T".format(cores), str(pps), str(percentage)] - self.result_table_add(data_row) - self.test_results["data"].append(data_row) - # stop application - self.dut.send_expect("^C", "# ", 15) - self.result_table_print() - - def test_perf_one_lcore_per_pcore(self): - params = "-n 4 -- -P -p {} --max-pkt-len=2500 --no-lthread" .format(self.port_mask) - self.perf_test(params) - - def test_perf_n_lthreads_per_pcore(self): - params = "-n 4 -- -P -p {} --max-pkt-len=2500" .format(self.port_mask) - self.perf_test(params) - - def test_perf_n_lcore_per_pcore(self): - params = "-- -P -p {} --max-pkt-len 2500 --no-lthread" .format(self.port_mask) - self.perf_test(params) - - def set_fields(self): - """ - set ip protocol field behavior - """ - fields_config = {'ip': {'src': {'action': 'random'}, }, } - return fields_config - - def tear_down(self): - """ - Run after each test case. - """ - self.dut.kill_all() - - def tear_down_all(self): - """ - Run after each test suite. - """ - pass