From patchwork Mon Dec 26 06:55:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yingya Han X-Patchwork-Id: 121385 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 CA35EA00C5; Mon, 26 Dec 2022 07:55:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C4A7A4021D; Mon, 26 Dec 2022 07:55:31 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 1090540143 for ; Mon, 26 Dec 2022 07:55:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672037730; x=1703573730; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=1Z7HHrfa6uvLZbeOGtAgxTsZkLRFg3uLQwMSSpKMs3c=; b=NoajfGW6M4aJqoOGmiozfjOuh9YFlXTp9XVKiysPhaRmDB4qzuoUeGw7 EKvhA5EomKpKbEE48uudmU/fa3UA+yUQxzdUgMFYfyBjgH5foJdsK8b5t rGEwOVmxdUwIfuKasUIm+RJ7MWTq5480z3rsQZeQvKhlfXIx+vn8T6e7Y XU2kmyQ63x+ToEeg0ZoMc0+cUExGbssQmpO0HW3cgYt/k8Sl3HVWvG5EU ntEoIost4UYOtH31QUfCQFLR9Uza4xoNptv2ScEpd9OhMzXVfNIcj+XVz ZdwoyuKcJocgV25gDSCgBPCVq820Zkrmrod3P/CXjdbdjeT3V7R8bkW8v g==; X-IronPort-AV: E=McAfee;i="6500,9779,10571"; a="320621559" X-IronPort-AV: E=Sophos;i="5.96,274,1665471600"; d="scan'208";a="320621559" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2022 22:55:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10571"; a="826803822" X-IronPort-AV: E=Sophos;i="5.96,274,1665471600"; d="scan'208";a="826803822" Received: from dpdk-lijuan-icelake4.sh.intel.com ([10.67.119.188]) by orsmga005.jf.intel.com with ESMTP; 25 Dec 2022 22:55:27 -0800 From: Yingya Han To: dts@dpdk.org Cc: Yingya Han Subject: [dts][PATCH V1 1/3]test_plans: add ice_header_split_perf test plan Date: Mon, 26 Dec 2022 06:55:14 +0000 Message-Id: <20221226065514.10020-1-yingyax.han@intel.com> X-Mailer: git-send-email 2.34.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 Signed-off-by: Yingya Han --- .../ice_header_split_perf_test_plan.rst | 236 ++++++++++++++++++ test_plans/index.rst | 1 + 2 files changed, 237 insertions(+) create mode 100644 test_plans/ice_header_split_perf_test_plan.rst diff --git a/test_plans/ice_header_split_perf_test_plan.rst b/test_plans/ice_header_split_perf_test_plan.rst new file mode 100644 index 00000000..da07a28b --- /dev/null +++ b/test_plans/ice_header_split_perf_test_plan.rst @@ -0,0 +1,236 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2022 Intel Corporation + +============================================================== +Benchmark the performance of header split forwarding with E810 +============================================================== + +Description +=========== +When Rx queue is configured with RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT offload +and corresponding protocol, packets received will be directly split into +two different mempools. + +Prerequisites +============= + +1. Hardware: + + 1.1) header split perf test for IntelĀ® Ethernet Network Adapter E810-CQDA2: + 1 NIC or 2 NIC cards attached to the same processor and 1 port used of each NIC. + 1.2) header split perf test for IntelĀ® Ethernet Network Adapter E810-XXVDA4: + 1 NIC card attached to the processor and 4 ports used. + +2. Software:: + + dpdk: git clone http://dpdk.org/git/dpdk + trex: git clone http://trex-tgn.cisco.com/trex/release/v2.93.tar.gz + + +Test Case +========= +The test case check the throughput result with ipv4, in the case, +we will send the bi-direction flows with line rate, then we can check the +passthrough rate. + +Common Steps +------------ +1. Bind tested ports to vfio-pci:: + + #./usertools/dpdk-devbind.py -s + 0000:17:00.0 'Device 1592' if=ens5f0 drv=ice unused=vfio-pci + 0000:4b:00.0 'Device 1592' if=ens6f0 drv=ice unused=vfio-pci + #./usertools/dpdk-devbind.py -b vfio-pci + #./usertools/dpdk-devbind.py -b vfio-pci 0000:17:00.0 + #./usertools/dpdk-devbind.py -b vfio-pci 0000:4b:00.0 + +2. Configure traffic generator to send traffic + + Test flow MAC table. + + +------+---------+------------+----------------+ + | Flow | Traffic | MAC | MAC | + | | Gen. | Src. | Dst. | + | | Port | Address | Address | + +======+=========+============+================+ + | 1 | TG0 | Random MAC | 11:22:33:44:55 | + +------+---------+------------+----------------+ + | 2 | TG1 | Random Mac | 11:22:33:44:55 | + +------+---------+------------+----------------+ + | 3 | TG2 | Random Mac | 11:22:33:44:55 | + +------+---------+------------+----------------+ + | 4 | TG3 | Random Mac | 11:22:33:44:55 | + +------+---------+------------+----------------+ + + The Flow IP table. + + +------+---------+------------+---------+ + | Flow | Traffic | IPV4 | IPV4 | + | | Gen. | Src. | Dest. | + | | Port | Address | Address | + +======+=========+============+=========+ + | 1 | TG0 | Any IP | 2.1.1.1 | + +------+---------+------------+---------+ + | 2 | TG1 | Any IP | 1.1.1.1 | + +------+---------+------------+---------+ + | 3 | TG2 | Any IP | 4.1.1.1 | + +------+---------+------------+---------+ + | 4 | TG3 | Any IP | 3.1.1.1 | + +------+---------+------------+---------+ + + Set the packet length : 64 bytes-1518 bytes + The IPV4 Dest Address increase with the num 1024. + +3. Test results table. + + +-----------+------------+-------------+---------+ + | Fwd_core | Frame Size | Throughput | Rate | + +===========+============+=============+=========+ + | 1C/1T | 64 | xxxxx Mpps | xxx % | + +-----------+------------+-------------+---------+ + | 1C/1T | ... | xxxxx Mpps | xxx % | + +-----------+------------+-------------+---------+ + | 2C/2T | 64 | xxxxx Mpps | xxx % | + +-----------+------------+-------------+---------+ + | 2C/2T | ... | xxxxx Mpps | xxx % | + +-----------+------------+-------------+---------+ + | 4C/4T | 64 | xxxxx Mpps | xxx % | + +-----------+------------+-------------+---------+ + | 4C/4T | ... | xxxxx Mpps | xxx % | + +-----------+------------+-------------+---------+ + | 8C/8T | 64 | xxxxx Mpps | xxx % | + +-----------+------------+-------------+---------+ + | 8C/8T | ... | xxxxx Mpps | xxx % | + +-----------+------------+-------------+---------+ + +Test Case 1: test_perf_enable_header_split_rx_on +------------------------------------------------ + +1. Bind PF ports to dpdk driver as common step 1:: + + ./usertools/dpdk-devbind.py -b vfio-pci 17:00.0 4b:00.0 + +2. Start dpdk-testpmd:: + + /app/dpdk-testpmd -l 5,6 -n 8 --force-max-simd-bitwidth=64 \ + -- -i --portmask=0x3 --rxq=1 --txq=1 --txd=1024 --rxd=1024 --forward=rxonly \ + --nb-cores=1 --mbuf-size=2048,2048 + + Note: + -force-max-simd-bitwidth: Set 64, the feature only support 64. + -mbuf-size=2048,2048: config two mempools. + +3. Config mac split:: + + testpmd>port stop all + testpmd>port config 0 rx_offload buffer_split on + testpmd>port config 1 rx_offload buffer_split on + testpmd>set rxhdrs eth + testpmd>port start all + testpmd>start + +4. Configure traffic generator to send traffic as common step 2. + +5. Record Test results as common step 3. + +Test case 2: test_perf_disable_header_split_rx_on +------------------------------------------------- + +1. Bind PF ports to dpdk driver as common step 1:: + + ./usertools/dpdk-devbind.py -b vfio-pci 17:00.0 4b:00.0 + +2. Start dpdk-testpmd:: + + /app/dpdk-testpmd -l 5,6 -n 8 --force-max-simd-bitwidth=64 \ + -- -i --portmask=0x3 --rxq=1 --txq=1 --txd=1024 --rxd=1024 --forward=rxonly \ + --nb-cores=1 + + Note: + -force-max-simd-bitwidth: Set 64, the feature only support 64. + +3. Configure traffic generator to send traffic as common step 2. + +4. Record Test results as common step 3. + +5. Start dpdk-testpmd:: + + /app/dpdk-testpmd -l 5,6 -n 8 --force-max-simd-bitwidth=64 \ + -- -i --portmask=0x3 --rxq=1 --txq=1 --txd=1024 --rxd=1024 --forward=rxonly \ + --nb-cores=1 --mbuf-size=2048,2048 + + Note: + -force-max-simd-bitwidth: Set 64, the feature only support 64. + -mbuf-size=2048,2048: config two mempools. + +6. Configure traffic generator to send traffic as common step 2. + +7. Record Test results as common step 3. + +Test case 3: test_perf_enable_header_split +------------------------------------------ + +1. Bind PF ports to dpdk driver as common step 1:: + + ./usertools/dpdk-devbind.py -b vfio-pci 17:00.0 4b:00.0 + +2. Start dpdk-testpmd:: + + /app/dpdk-testpmd -l 5,6 -n 8 --force-max-simd-bitwidth=64 \ + -- -i --portmask=0x3 --rxq=1 --txq=1 --txd=1024 --rxd=1024 --forward=rxonly \ + --nb-cores=1 --mbuf-size=2048,2048 + + Note: + -force-max-simd-bitwidth: Set 64, the feature only support 64. + -mbuf-size=2048,2048: config two mempools. + +3. Config udp split:: + + testpmd>port stop all + testpmd>port config 0 rx_offload buffer_split on + testpmd>port config 1 rx_offload buffer_split on + testpmd>set rxhdrs inner-ipv4-udp + testpmd>port start all + testpmd>start + +4. Config traffic generator as common step 2. + +5. Record Test results as common step 3. + +6. Config traffic generator with udp flow. + +7. Record Test results as common step 3. + +Test case 4: test_perf_disable_header_split +------------------------------------------- + +1. Bind PF ports to dpdk driver as common step 1:: + + ./usertools/dpdk-devbind.py -b vfio-pci 17:00.0 4b:00.0 + +2. Start dpdk-testpmd:: + + /app/dpdk-testpmd -l 5,6 -n 8 --force-max-simd-bitwidth=64 \ + -- -i --portmask=0x3 --rxq=1 --txq=1 --txd=1024 --rxd=1024 --forward=io \ + --nb-cores=1 + + Note: + -force-max-simd-bitwidth: Set 64, the feature only support 64. + +3. Configure traffic generator to send traffic as common step 2. + +4. Record Test results as common step 3. + +5. Start dpdk-testpmd:: + + /app/dpdk-testpmd -l 5,6 -n 8 --force-max-simd-bitwidth=64 \ + -- -i --portmask=0x3 --rxq=1 --txq=1 --txd=1024 --rxd=1024 --forward=io \ + --nb-cores=1 --mbuf-size=2048,2048 + + Note: + -force-max-simd-bitwidth: Set 64, the feature only support 64. + -mbuf-size=2048,2048: config two mempools. + +6. Configure traffic generator to send traffic as common step 2. + +7. Record Test results as common step 3. diff --git a/test_plans/index.rst b/test_plans/index.rst index 9ca954e2..a4e7c7e8 100644 --- a/test_plans/index.rst +++ b/test_plans/index.rst @@ -35,6 +35,7 @@ The following are the test plans for the DPDK DTS automated test system. ice_dcf_switch_filter_pppoe_test_plan ice_dcf_switch_filter_gtpu_test_plan ice_dcf_flow_priority_test_plan + ice_header_split_perf_test_plan.rst ice_flow_priority_test_plan ice_dcf_qos_test_plan ice_enable_basic_hqos_on_pf_test_plan From patchwork Mon Dec 26 06:55: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: 121386 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 1BA0FA00C5; Mon, 26 Dec 2022 07:55:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1737040146; Mon, 26 Dec 2022 07:55:49 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 6679C40143 for ; Mon, 26 Dec 2022 07:55:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672037747; x=1703573747; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=bR9A5bTobkYvnIIBSOE0vOfOFHiB+MujHfIhrzZR/cM=; b=LWu7OkC6aWEBMLWhi3bWfVKJUrPim7mtqimf10JZcaf1OyJevQWfuhDo RNZGNtVL1vHya5QJz5yLp5U3RUvWd7P+N/3y6Zc2r/Vs/NmhNfLGH+3pG yFJHiiojr8Jg6L8JslXhKumyc4ySsIGSHzp/8qCWFbdSdTpShmJ6KFxdG xL7rq4gSHJNLFsE/1AyCGC03aSxNfxr59DhGDnB1sExsT3KiLKBrUhRQ5 hhxU8Vuv4dX67KCSqwRzlEb7GM8Z+1qRAisMWbkLKvs0hG4y7d+5zsjMo yA1USXXI4X+1RTM6KtIDWN4M87W/JAlC3UgpUuhlcM66rBljNEQruOz4Z w==; X-IronPort-AV: E=McAfee;i="6500,9779,10571"; a="318201020" X-IronPort-AV: E=Sophos;i="5.96,274,1665471600"; d="scan'208";a="318201020" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2022 22:55:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10571"; a="716029016" X-IronPort-AV: E=Sophos;i="5.96,274,1665471600"; d="scan'208";a="716029016" Received: from dpdk-lijuan-icelake4.sh.intel.com ([10.67.119.188]) by fmsmga008.fm.intel.com with ESMTP; 25 Dec 2022 22:55:45 -0800 From: Yingya Han To: dts@dpdk.org Cc: Yingya Han Subject: [dts][PATCH V1 2/3]tests: add ice_header_split_perf test script Date: Mon, 26 Dec 2022 06:55:41 +0000 Message-Id: <20221226065541.10045-1-yingyax.han@intel.com> X-Mailer: git-send-email 2.34.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 Signed-off-by: Yingya Han --- tests/TestSuite_ice_header_split_perf.py | 416 +++++++++++++++++++++++ 1 file changed, 416 insertions(+) create mode 100644 tests/TestSuite_ice_header_split_perf.py diff --git a/tests/TestSuite_ice_header_split_perf.py b/tests/TestSuite_ice_header_split_perf.py new file mode 100644 index 00000000..e7ce11ca --- /dev/null +++ b/tests/TestSuite_ice_header_split_perf.py @@ -0,0 +1,416 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2022 Intel Corporation +# + +""" +DPDK Test suite. +""" + +import os +import re +import time +from copy import deepcopy + +import framework.utils as utils +from framework.exception import VerifyFailure +from framework.packet import Packet +from framework.pktgen import TRANSMIT_CONT +from framework.settings import HEADER_SIZE +from framework.test_case import TestCase +from framework.utils import convert_int2ip, convert_ip2int + + +class TestIceHeaderSplitPerf(TestCase): + # + # Test cases. + # + def set_up_all(self): + """ + Run at the start of each test suite. + """ + self.verify( + self.nic + in ["ICE_100G-E810C_QSFP", "ICE_25G-E810C_SFP", "ICE_25G-E810_XXV_SFP"], + "NIC Unsupported: " + str(self.nic), + ) + self.dut_ports = self.dut.get_ports(self.nic) + self.verify(len(self.dut_ports) >= 1, "At least 1 port is required to test") + # Get socket and cores + self.socket = self.dut.get_numa_id(self.dut_ports[0]) + cores = self.dut.get_core_list("1S/8C/1T", socket=self.socket) + self.verify(cores, "Requested 8 cores failed") + self.core_offset = 3 + self.test_content = self.get_test_content_from_cfg(self.get_suite_cfg()) + + def set_up(self): + """ + Run before each test case. + """ + self.test_result = {"header": [], "data": []} + + def flows(self): + """ + Return a list of packets that implements the flows described. + """ + return [ + "198.18.0.0/24", + "198.18.1.0/24", + "198.18.2.0/24", + "198.18.3.0/24", + "198.18.4.0/24", + "198.18.5.0/24", + "198.18.6.0/24", + "198.18.7.0/24", + ] + + def parse_test_config(self, config): + """ + [n]C/[mT]-[i]Q + n: how many physical core use for polling. + m: how many cpu thread use for polling, if Hyper-threading disabled + in BIOS, m equals n, if enabled, m is 2 times as n. + i: how many queues use per port, so total queues = i x nb_port + """ + pat = "(.*)/(.*)-(.*)" + result = re.findall(pat, config) + if not result: + msg = f"{config} is wrong format, please check" + raise VerifyFailure(msg) + cores, threads, queue = result[0] + _thread_num = int(int(threads[:-1]) // int(cores[:-1])) + + _thread = str(_thread_num) + "T" + _cores = str(self.core_offset + int(cores[:-1])) + "C" + cores_config = "/".join(["1S", _cores, _thread]) + queues_per_port = int(queue[:-1]) + return cores_config, _thread_num, queues_per_port + + def get_test_configs(self, test_parameters): + configs = [] + frame_sizes_grp = [] + for test_item, frame_sizes in sorted(test_parameters.items()): + _frame_sizes = [int(frame_size) for frame_size in frame_sizes] + frame_sizes_grp.extend([int(item) for item in _frame_sizes]) + cores, thread_num, queues = self.parse_test_config(test_item) + corelist = self.dut.get_core_list(cores, self.socket) + core_list = corelist[(self.core_offset - 1) * thread_num :] + if "2T" in cores: + core_list = core_list[1:2] + core_list[0::2] + core_list[1::2][1:] + _core_list = core_list[thread_num - 1 :] + configs.append( + [ + test_item, + _core_list, + [ + " --txd=1024 --rxd=1024" + + " --rxq={0} --txq={0}".format(queues) + + " --nb-cores={}".format(len(core_list) - thread_num) + ], + ] + ) + return configs, sorted(set(frame_sizes_grp)) + + def get_test_content_from_cfg(self, test_content): + test_content["flows"] = self.flows() + configs, frame_sizes = self.get_test_configs(test_content["test_parameters"]) + test_content["configs"] = configs + test_content["frame_sizes"] = frame_sizes + return test_content + + def get_mac_layer(self, port_id): + smac = "02:00:00:00:00:0%d" % port_id + dmac = "52:00:00:00:00:0%d" % port_id + + layer = { + "ether": { + "dst": dmac, + "src": smac, + }, + } + return layer + + def get_ipv4_config(self, config): + netaddr, mask = config.split("/") + ip_range = int("1" * (32 - int(mask)), 2) + start_ip = convert_int2ip(convert_ip2int(netaddr) + 1) + end_ip = convert_int2ip(convert_ip2int(start_ip) + ip_range - 1) + layers = { + "ipv4": { + "src": start_ip, + }, + } + fields_config = { + "ip": { + "src": { + "start": start_ip, + "end": end_ip, + "step": 1, + "action": "random", + }, + }, + } + return layers, fields_config + + def preset_flows_configs(self): + flows = self.test_content.get("flows") + flows_configs = [] + for index, config in enumerate(flows): + if index >= len(self.dut_ports): + break + port_id = self.dut_ports[index] + _layer = self.get_mac_layer(port_id) + _layer2, fields_config = self.get_ipv4_config(config) + _layer.update(_layer2) + flows_configs.append([_layer, fields_config]) + return flows_configs + + def preset_streams(self, pkt_type): + frame_sizes = self.test_content.get("frame_sizes") + test_streams = {} + frame_sizes_new = [] + flows_configs = self.preset_flows_configs() + for frame_size in frame_sizes: + frame_size = 66 if "udp" == pkt_type and frame_size == 64 else frame_size + frame_sizes_new.append(frame_size) + for flow_config in flows_configs: + _layers, fields_config = flow_config + pkt = self.config_stream(_layers, frame_size, pkt_type) + test_streams.setdefault(frame_size, []).append([pkt, fields_config]) + return test_streams, frame_sizes_new + + def config_stream(self, layers, frame_size, pkt_mode): + """ + Prepare traffic flow + """ + if pkt_mode == "udp": + headers_size = sum([HEADER_SIZE[x] for x in ["eth", "ip", "udp"]]) + payload_size = frame_size - headers_size + pkt_config = { + "type": "UDP", + "pkt_layers": {"raw": {"payload": ["58"] * payload_size}}, + } + layers["udp"] = {"src": 53, "dst": 53} + else: + headers_size = sum([HEADER_SIZE[x] for x in ["eth", "ip"]]) + payload_size = frame_size - headers_size + # Set streams for traffic + pkt_config = { + "type": "IP_RAW", + "pkt_layers": {"raw": {"payload": ["58"] * payload_size}}, + } + pkt_config["pkt_layers"].update(layers) + pkt_type = pkt_config.get("type") + pkt_layers = pkt_config.get("pkt_layers") + pkt = Packet(pkt_type=pkt_type) + for layer in list(pkt_layers.keys()): + pkt.config_layer(layer, pkt_layers[layer]) + + return pkt.pktgen.pkt + + def add_stream_to_pktgen(self, streams, option): + def port(index): + p = self.tester.get_local_port(self.dut_ports[index]) + return p + + topos = ( + [ + [port(index), port(index - 1)] + if index % 2 + else [port(index), port(index + 1)] + for index, _ in enumerate(self.dut_ports) + ] + if len(self.dut_ports) > 1 + else [[port(0), port(0)]] + ) + stream_ids = [] + step = int(len(streams) / len(self.dut_ports)) + for cnt, stream in enumerate(streams): + pkt, fields_config = stream + index = cnt // step + txport, rxport = topos[index] + _option = deepcopy(option) + _option["pcap"] = pkt + if fields_config: + _option["fields_config"] = fields_config + stream_id = self.tester.pktgen.add_stream(txport, rxport, pkt) + self.tester.pktgen.config_stream(stream_id, _option) + stream_ids.append(stream_id) + return stream_ids + + def start_testpmd(self, eal_pare, eal): + bin = os.path.join(self.dut.base_dir, self.dut.apps_name["test-pmd"]) + command_line = ( + "{bin} " + "{eal_para}" + " --force-max-simd-bitwidth=64 " + "-- -i " + "--portmask {port_mask} " + "{config} " + "" + ).format( + **{ + "bin": bin, + "eal_para": eal_pare, + "port_mask": utils.create_mask(self.dut_ports), + "config": eal, + } + ) + self.dut.send_expect(command_line, "testpmd>", 60) + + def throughput(self, frame_size, fwd_mode): + streams = self.stream.get(frame_size) + # Set traffic option + duration = self.test_content.get("test_duration") + traffic_stop_wait_time = self.test_content.get("traffic_stop_wait_time", 0) + # Clear streams before adding new streams + self.tester.pktgen.clear_streams() + # Set stream into pktgen + stream_option = { + "stream_config": { + "txmode": {}, + "transmit_mode": TRANSMIT_CONT, + "rate": 100, + } + } + traffic_option = { + "method": "throughput", + "duration": duration, + } + stream_ids = self.add_stream_to_pktgen(streams, stream_option) + # Run packet generator + result = self.tester.pktgen.measure(stream_ids, traffic_option) + time.sleep(traffic_stop_wait_time) + # Statistics result + if fwd_mode == "rxonly": + # Calculate rx throughput + out = self.dut.send_expect("show port stats all", "testpmd> ", 15) + pattern = re.compile(r"(?<=RX-packets: )\d+\.?\d*") + pps = int(pattern.findall(out)[0]) / duration + else: + _, pps = result + self.verify(pps > 0, "No traffic detected") + self.logger.info( + "Throughput of " + + "framesize: {}, is: {} Mpps".format(frame_size, pps / 1000000) + ) + return pps + + def get_port_allowlist(self, port_list=None): + allowlist = [] + if port_list: + for port_id in port_list: + pci = self.dut.ports_info[port_id]["port"].pci + allowlist.append(pci) + return allowlist + + def display_result(self, datas): + # Display result table + header_row = ["Fwd Core", "Frame Size", "Throughput", "Rate"] + self.test_result["header"] = header_row + self.result_table_create(header_row) + self.test_result["data"] = [] + for data in datas: + config, frame_size, pps = data + pps /= 1000000.0 + linerate = self.wirespeed(self.nic, frame_size, len(self.dut_ports)) + percentage = pps * 100 / linerate + data_row = [ + config, + frame_size, + "{:.3f} Mpps".format(pps), + "{:.3f}%".format(percentage), + ] + self.result_table_add(data_row) + self.test_result["data"].append(data_row) + self.result_table_print() + + def config_header_split(self, split_type): + self.dut.send_expect("port stop all", "testpmd> ", 15) + for i in self.dut_ports: + self.dut.send_expect( + "port config {} rx_offload buffer_split on".format(i), "testpmd> ", 15 + ) + if split_type == "eth": + self.dut.send_expect("set rxhdrs eth", "testpmd> ", 15) + elif split_type == "udp": + self.dut.send_expect("set rxhdrs inner-ipv4-udp", "testpmd> ", 15) + self.dut.send_expect("port start all", "testpmd> ", 15) + self.check_port_stats() + + def check_port_stats(self, times=60): + # Check port status up + for i in range(times): + out = self.dut.send_expect("show port info all", "testpmd> ") + pattern = r"(?<=%s)%s" % ("Link status: ", "\S+") + s = re.compile(pattern) + status = s.findall(out) + if "down" not in status: + break + time.sleep(1) + + def perf_test(self, fwd_mode="", mbuf_size="", header_split="", pkt_type=""): + """ + Benchmarking test + """ + self.stream, self.frame_sizes = self.preset_streams(pkt_type) + # Ports allow list + port_allowlist = self.get_port_allowlist(self.dut_ports) + forward = " --forward={}".format(fwd_mode) + results = [] + for config, core_list, eal in self.test_content["configs"]: + self.logger.info( + ("Executing Test Using cores: {0} of config {1}, ").format( + core_list, config + ) + ) + eal_pare = self.dut.create_eal_parameters( + cores=core_list, ports=port_allowlist, socket=self.socket + ) + eal = eal[0] + forward + if "enable" == mbuf_size: + eal += " --mbuf-size=2048,2048" + self.start_testpmd(eal_pare, eal) + self.check_port_stats() + if header_split: + self.config_header_split(header_split) + self.dut.send_expect("start", "testpmd> ", 15) + for frame_size in self.frame_sizes: + self.logger.info("Test running at framesize: {}".format(frame_size)) + self.dut.send_expect("clear port stats all", "testpmd> ", 15) + result = self.throughput(frame_size, fwd_mode) + if result: + results.append([config, frame_size, result]) + self.dut.send_expect("stop", "testpmd> ", 15) + self.dut.send_expect("quit", "# ", 15) + self.display_result(results) + + def test_perf_enable_header_split_rx_on(self): + self.perf_test(fwd_mode="rxonly", mbuf_size="enable", header_split="eth") + + def test_perf_disable_header_split_rx_on(self): + self.perf_test(fwd_mode="rxonly") + self.perf_test(fwd_mode="rxonly", mbuf_size="enable") + + def test_perf_enable_header_split(self): + self.perf_test( + fwd_mode="rxonly", mbuf_size="enable", header_split="udp", pkt_type="ip" + ) + self.perf_test( + fwd_mode="rxonly", mbuf_size="enable", header_split="udp", pkt_type="udp" + ) + + def test_perf_disable_header_split(self): + self.perf_test(fwd_mode="io") + self.perf_test(fwd_mode="io", mbuf_size="enable") + + def tear_down(self): + """ + Run after each test case. + """ + pass + + def tear_down_all(self): + """ + Run after each test suite. + """ + self.dut.kill_all() From patchwork Mon Dec 26 06:55:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yingya Han X-Patchwork-Id: 121387 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 412C6A00C5; Mon, 26 Dec 2022 07:55:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D3794114B; Mon, 26 Dec 2022 07:55:58 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 03F0440143 for ; Mon, 26 Dec 2022 07:55:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672037756; x=1703573756; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=t6rpPnIFl9p2ERpf+HW01YlS0KgTnFFUJVnMQv186/0=; b=RJ6JfXAorxL0rWWIrmEjWMykzHAHyAmNpFz/7ANFM25BvZskc5LBe+mo g84HWkIgbF1AflbsgEYTEd8c8UvplZ1Ri+SIYOwZWFEgSZmlKuyBBkmMO Ct9NCzC+b2Fg+yfrV9W3T3CLkPd8ijONm8pgT9J6NJ4F27XGB4f2FJsGi 8r/eesl9K7h+JwbufQAF2o+p+hkZcpCgYJ7eVF1wYhoqq/VL1pJvrHA88 nGMUgBq5uSsymSz/KmXig7ajk02IoCaCaKXSZyHEGJdgTU84cSXPWujlw aSeSLG6J48w+YIYcMxXHBVLtrHCzk5h9UPCrG6KF/YF1Bc+X0IZNyn3Rd A==; X-IronPort-AV: E=McAfee;i="6500,9779,10571"; a="318201035" X-IronPort-AV: E=Sophos;i="5.96,274,1665471600"; d="scan'208";a="318201035" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2022 22:55:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10571"; a="716029038" X-IronPort-AV: E=Sophos;i="5.96,274,1665471600"; d="scan'208";a="716029038" Received: from dpdk-lijuan-icelake4.sh.intel.com ([10.67.119.188]) by fmsmga008.fm.intel.com with ESMTP; 25 Dec 2022 22:55:54 -0800 From: Yingya Han To: dts@dpdk.org Cc: Yingya Han Subject: [dts][PATCH V1 3/3]conf: add ice_header_split_perf configuration file Date: Mon, 26 Dec 2022 06:55:51 +0000 Message-Id: <20221226065551.10065-1-yingyax.han@intel.com> X-Mailer: git-send-email 2.34.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 Signed-off-by: Yingya Han Acked-by: Haijun Chu Signed-off-by: Yingya Han Acked-by: Lijuan Tu --- conf/ice_header_split_perf.cfg | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 conf/ice_header_split_perf.cfg diff --git a/conf/ice_header_split_perf.cfg b/conf/ice_header_split_perf.cfg new file mode 100644 index 00000000..cd8c0fe4 --- /dev/null +++ b/conf/ice_header_split_perf.cfg @@ -0,0 +1,11 @@ +[suite] +test_duration = 30 +traffic_stop_wait_time = 2 +test_parameters = { + '1C/1T-1Q': ['64', '128', '256', '512', '1024', '1280', '1518',], + '1C/2T-2Q': ['64', '128', '256', '512', '1024', '1280', '1518',], + '2C/2T-2Q': ['64', '128', '256', '512', '1024', '1280', '1518',], + '2C/4T-4Q': ['64', '128', '256', '512', '1024', '1280', '1518',], + '4C/4T-4Q': ['64', '128', '256', '512', '1024', '1280', '1518',], + '4C/8T-8Q': ['64', '128', '256', '512', '1024', '1280', '1518',], + '8C/8T-8Q': ['64', '128', '256', '512', '1024', '1280', '1518',],}