From patchwork Fri Apr 21 18:29:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yingya Han X-Patchwork-Id: 126385 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 108EF429AC; Fri, 21 Apr 2023 12:32:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C5B841156; Fri, 21 Apr 2023 12:32:39 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id BAF3D410F3 for ; Fri, 21 Apr 2023 12:32:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682073156; x=1713609156; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vr6b+NiJOAoXHvNDpg5Ue0KsSXVei6gPcbEI1bhT5Js=; b=FcC3LLv0+YmAwp9qxMZSbGrK11rW7vdV2heP86DlJcX9mM+Tv1ahiVto gCPtJarmbXWAzV9/HD0OFcrFTaFhfJBryHa4SOchyFsXz6flIRnhEArgP W844n3wBJPCwszttfsf1nYh+MueCrU8wDOW85DKTAWKm1duHA3dF6wX9x 9Yy+fVsSp+YZ01DrKSUf882jHTHCXrpCFoY4v7j3LFRToMMtht02nwC7h SYPUgmvFxZ30kURrnZ+z7CUF7b/LFsDCgsShlJxK2b7ppt+ShrdoNRi9g TidmMp5aQJkM7yakey6zEYei+dgHhcXiqw40HtD3+XmezfEE0kpB3SEp4 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="325563772" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="325563772" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2023 03:32:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="669688069" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="669688069" Received: from dpdk-lijuan-icelake4.sh.intel.com ([10.67.119.152]) by orsmga006.jf.intel.com with ESMTP; 21 Apr 2023 03:32:34 -0700 From: Yingya Han To: dts@dpdk.org Cc: Yingya Han Subject: [dts][PATCH V2 1/3]test_plans: add ice_iavf_checksum_perf test plan Date: Fri, 21 Apr 2023 18:29:21 +0000 Message-Id: <20230421182923.179866-2-yingyax.han@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230421182923.179866-1-yingyax.han@intel.com> References: <20230421182923.179866-1-yingyax.han@intel.com> 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_iavf_checksum_perf_test_plan.rst | 224 ++++++++++++++++++ test_plans/index.rst | 1 + 2 files changed, 225 insertions(+) create mode 100644 test_plans/ice_iavf_checksum_perf_test_plan.rst diff --git a/test_plans/ice_iavf_checksum_perf_test_plan.rst b/test_plans/ice_iavf_checksum_perf_test_plan.rst new file mode 100644 index 00000000..891a6536 --- /dev/null +++ b/test_plans/ice_iavf_checksum_perf_test_plan.rst @@ -0,0 +1,224 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2023 Intel Corporation + +=============================================================== +Benchmark the performance of iavf checksum forwarding with E810 +=============================================================== + +Description +=========== + +Prerequisites +============= + +1. Hardware: + + 1.1) vf checksum 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) vf checksum 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 PF ports to kernel driver(ice), then create 1 VF from each PF, + take E810-CQDA2 for example:: + + echo 1 > /sys/bus/pci/devices/0000\:17\:00.0/sriov_numvfs + echo 1 > /sys/bus/pci/devices/0000\:4b\:00.0/sriov_numvfs + +2. Ip link set VF trust on and spoofchk off on DUT:: + + ip link set $PF_INTF vf 0 trust on + ip link set $PF_INTF vf 0 spoofchk off + +3. Set vf mac address:: + + ip link set ens5f0 vf 0 mac 00:12:34:56:78:01 + ip link set ens6f0 vf 0 mac 00:12:34:56:78:02 + +4. 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:01.0 + #./usertools/dpdk-devbind.py -b vfio-pci 0000:4b:01.0 + +5. Configure traffic generator to send traffic + + Test flow MAC table. + + +------+---------+------------+----------------+ + | Flow | Traffic | MAC | MAC | + | | Gen. | Src. | Dst. | + | | Port | Address | Address | + +======+=========+============+================+ + | 1 | TG0 | Random MAC | 00:12:34:56:01 | + +------+---------+------------+----------------+ + | 2 | TG1 | Random Mac | 00:12:34:56:02 | + +------+---------+------------+----------------+ + + The Flow IP table. + + +------+---------+------------+------------+ + | Flow | Traffic | IPV4 | IPV4 | + | | Gen. | Src. | Dest. | + | | Port | Address | Address | + +======+=========+============+============+ + | 1 | TG0 | Any IP | 198.18.1.0 | + +------+---------+------------+------------+ + | 2 | TG1 | Any IP | 198.18.0.0 | + +------+---------+------------+------------+ + + Set the packet length : 128 bytes-1518 bytes + The IPV4 Dest Address increase with the num 1024. + +6. Test results table. + + +-----------+------------+-------------+---------+ + | Fwd_core | Frame Size | Throughput | Rate | + +===========+============+=============+=========+ + | 1C/1T | 128 | xxxxx Mpps | xxx % | + +-----------+------------+-------------+---------+ + | 1C/1T | ... | xxxxx Mpps | xxx % | + +-----------+------------+-------------+---------+ + +Test Case 1: test_perf_enable_SW_checksum_offload +------------------------------------------------- +test steps +~~~~~~~~~~ +1. Bind VF ports to dpdk driver as common step 4:: + + ./usertools/dpdk-devbind.py -b vfio-pci 17:01.0 4b:01.0 + +2. Start dpdk-testpmd:: + + /app/dpdk-testpmd -l 5,6 -n 8 --force-max-simd-bitwidth=512 \ + -- -i --portmask=0x3 --rxq=1 --txq=1 --txd=1024 --rxd=1024 --forward=io \ + --nb-cores=1 --enable-rx-cksum + + Note: + -force-max-simd-bitwidth: set 512 + -enable-rx-cksum: enable rx checksum + +3. Configure traffic generator to send traffic as common step 5. + +4. Record Test results as common step 6. + +5. Config SW checksum offload:: + + testpmd>stop + testpmd>set fwd csum + testpmd>port stop all + testpmd>csum set ip sw 0 + testpmd>csum set ip sw 1 + testpmd>port start all + testpmd>start + +6. Configure traffic generator to send traffic as common step 5. + + Set the incorrect ipv4 checksum. + +7. Record Test results as common step 6. + +8. Set the traffic flow as below: + + Ether / IPv4 / UDP / VXLAN / Ether / IPv4 / UDP / payload + + Set the packet length : 128 bytes-1518 bytes. + + Set the inner and outer incorrect ipv4 checksum and udp checksum. + +9. Record Test results as common step 6. + + +Test Case 2: test_perf_enable_HW_checksum_offload +------------------------------------------------- +test steps +~~~~~~~~~~ + +1. Bind VF ports to dpdk driver as common step 4:: + + ./usertools/dpdk-devbind.py -b vfio-pci 17:01.0 4b:01.0 + +2. Start dpdk-testpmd:: + + /app/dpdk-testpmd -l 5,6 -n 8 --force-max-simd-bitwidth=512 \ + -- -i --portmask=0x3 --rxq=1 --txq=1 --txd=1024 --rxd=1024 --forward=io \ + --nb-cores=1 --enable-rx-cksum + + Note: + -force-max-simd-bitwidth: set 512 + -enable-rx-cksum: enable rx checksum + +3. Config HW checksum offload:: + + testpmd>stop + testpmd>set fwd csum + testpmd>port stop all + testpmd>csum set ip hw 0 + testpmd>csum set ip hw 1 + testpmd>port start all + testpmd>set promisc all on + testpmd>start + +4. Configure traffic generator to send traffic as common step 5. + + Set the incorrect ipv4 checksum. + +5. Record Test results as common step 6. + +6. Set the traffic flow as below: + + Ether / IPv4 / UDP / VXLAN / Ether / IPv4 / UDP / payload + + Set the packet length : 128 bytes-1518 bytes. + + Set the inner and outer incorrect ipv4 checksum and udp checksum. + +7. Record Test results as common step 6. + +8. Set HW inner and outer checksum offload:: + + testpmd>stop + testpmd>port stop all + testpmd>csum set udp hw 0 + testpmd>csum set udp hw 1 + testpmd>csum set outer-ip hw 0 + testpmd>csum set outer-ip hw 1 + testpmd>csum set outer-udp hw 0 + testpmd>csum set outer-udp hw 1 + testpmd>csum parse-tunnel on 0 + testpmd>csum parse-tunnel on 1 + testpmd>port start all + testpmd>set promisc all on + testpmd>start + +9. Configure traffic generator to send traffic as common step 5. + + Set the incorrect ipv4 checksum. + +10. Record Test results as common step 6. + +11. Set the traffic flow as below: + + Ether / IPv4 / UDP / VXLAN / Ether / IPv4 / UDP / payload + + Set the packet length : 128 bytes-1518 bytes. + + Set the inner and outer incorrect ipv4 checksum and udp checksum. + +12. Record Test results as common step 6. diff --git a/test_plans/index.rst b/test_plans/index.rst index 2008f50b..3a91799e 100644 --- a/test_plans/index.rst +++ b/test_plans/index.rst @@ -43,6 +43,7 @@ The following are the test plans for the DPDK DTS automated test system. ice_fdir_test_plan ice_rx_timestamp_test_plan ice_ip_fragment_rte_flow_test_plan + ice_iavf_checksum_perf_test_plan ice_iavf_flow_subscribe_test_plan ice_iavf_ip_fragment_rte_flow_test_plan ice_iavf_packet_pacing_test_plan From patchwork Fri Apr 21 18:29:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yingya Han X-Patchwork-Id: 126386 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 3745E429AC; Fri, 21 Apr 2023 12:32:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3168C410FB; Fri, 21 Apr 2023 12:32:41 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id E4BD5410F3 for ; Fri, 21 Apr 2023 12:32:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682073159; x=1713609159; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kxW34lkEhtPlE5m5+2/jk5Lr7n6bO663S0wSbEd0aik=; b=YydLz8zJ3GfloifRhTZM60/piDmC31mNePZlOVcE6/STCF2yDpsPFknT kT1scUXlMzqupSmfahs44TT+Yb5RHKEPNcvKPaFacc7Iur8xeVLaCp8Fr 5ZzXC8lQWy9Q/1VcPtyS41LATFjGteh6kntF98/f0h54YxoCDvttxrFK0 l/v1dMN6UVYFC7c/zzlG0GLZfUqSOmFBU0paYwJFSM9rKfu4J1PVoK2mC y1pEZevCDzW9GtSTwe54+BtgubZckend+wLdIgjcx2qlOHyuw+0PKYcTK 4oFg6RQSK7+SBTF5VZiwlXAJU9hxGLJb19fhcXTwBFc0oOzQLJ3aUBL+0 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="325563779" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="325563779" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2023 03:32:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="669688079" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="669688079" Received: from dpdk-lijuan-icelake4.sh.intel.com ([10.67.119.152]) by orsmga006.jf.intel.com with ESMTP; 21 Apr 2023 03:32:36 -0700 From: Yingya Han To: dts@dpdk.org Cc: Yingya Han Subject: [dts][PATCH V2 2/3]tests: add ice_iavf_checksum_perf test script Date: Fri, 21 Apr 2023 18:29:22 +0000 Message-Id: <20230421182923.179866-3-yingyax.han@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230421182923.179866-1-yingyax.han@intel.com> References: <20230421182923.179866-1-yingyax.han@intel.com> 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_iavf_checksum_perf.py | 378 ++++++++++++++++++++++ 1 file changed, 378 insertions(+) create mode 100644 tests/TestSuite_ice_iavf_checksum_perf.py diff --git a/tests/TestSuite_ice_iavf_checksum_perf.py b/tests/TestSuite_ice_iavf_checksum_perf.py new file mode 100644 index 00000000..d49c7095 --- /dev/null +++ b/tests/TestSuite_ice_iavf_checksum_perf.py @@ -0,0 +1,378 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2023 Intel Corporation +# + +""" +DPDK Test suite. +""" + +import os +import re +import time + +from framework.exception import VerifyFailure +from framework.pktgen import PacketGeneratorHelper +from framework.pmd_output import PmdOutput +from framework.settings import HEADER_SIZE +from framework.test_case import TestCase + + +class TestIceIavfChecksumPerf(TestCase): + def set_up_all(self): + """ + Run at the start of each test suite. + PMD prerequisites. + """ + 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") + self.socket = self.dut.get_numa_id(self.dut_ports[0]) + + self.core_offset = 3 + self.test_content = self.get_test_content_from_cfg(self.get_suite_cfg()) + # 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]) + self.vfs_mac = ["00:12:34:56:78:0%d" % (i + 1) for i in self.dut_ports] + self.pmdout = PmdOutput(self.dut) + # Create an instance to set stream field setting + self.pktgen_helper = PacketGeneratorHelper() + + def set_up(self): + """ + Run before each test case. + It's more convenient to load suite configuration here than + set_up_all in debug mode. + """ + self.test_result = {"header": [], "date": []} + self.vf_port_info = {} + + 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) + + " --enable-rx-cksum" + ], + ] + ) + return configs, sorted(set(frame_sizes_grp)) + + def get_test_content_from_cfg(self, test_content): + 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 vf_create(self): + """ + Require enough PF ports, create 1 VF from each PF. + """ + # Get vf assign method + vf_driver = self.test_content.get("vf_driver") + if vf_driver is None: + vf_driver = self.drivername + for port_id in self.dut_ports: + pf_driver = self.dut.ports_info[port_id]["port"].default_driver + self.dut.generate_sriov_vfs_by_port(port_id, 1, driver=pf_driver) + pf_pci = self.dut.ports_info[port_id]["port"].pci + sriov_vfs_port = self.dut.ports_info[port_id].get("vfs_port") + if not sriov_vfs_port: + msg = f"failed to create vf on dut port {pf_pci}" + self.logger.error(msg) + continue + self.vf_port_info[port_id] = { + "pf_pci": pf_pci, + "vf_pci": self.dut.ports_info[port_id]["port"].get_sriov_vfs_pci(), + } + pf_intf = self.dut.ports_info[port_id]["intf"] + # Set vf mac + self.dut.send_expect( + "ip link set %s vf 0 mac %s" % (pf_intf, self.vfs_mac[port_id]), "#" + ) + self.dut.send_expect("ip link set %s vf 0 trust on" % pf_intf, "#") + self.dut.send_expect("ip link set %s vf 0 spoofchk off" % pf_intf, "#") + # Bind vf to dpdk + try: + for port in sriov_vfs_port: + port.bind_driver(driver=vf_driver) + except Exception as e: + self.vf_destroy() + raise Exception(e) + + def vf_destroy(self): + """ + Destroy the setup VFs + """ + if not self.vf_port_info: + return + for port_id, _ in self.vf_port_info.items(): + self.dut.destroy_sriov_vfs_by_port(port_id) + self.dut.ports_info[port_id]["port"].bind_driver(self.drivername) + self.vf_port_info = None + + def checksum_enable(self, csum, csum_config): + self.dut.send_expect("stop", "testpmd> ", 15) + self.dut.send_expect("set fwd csum", "testpmd> ", 15) + self.dut.send_expect("port stop all", "testpmd> ", 15) + for port_id in self.dut_ports: + self.dut.send_expect("csum set ip %s %d" % (csum, port_id), "testpmd> ", 15) + if csum_config: + self.dut.send_expect( + "csum set udp %s %d" % (csum, port_id), "testpmd> ", 15 + ) + self.dut.send_expect( + "csum set outer-ip %s %d" % (csum, port_id), "testpmd> ", 15 + ) + self.dut.send_expect( + "csum set outer-udp %s %d" % (csum, port_id), "testpmd> ", 15 + ) + self.dut.send_expect( + "csum set parse-tunnel on %d" % (port_id), "testpmd> ", 15 + ) + self.dut.send_expect("port start all", "testpmd> ", 15) + if csum == "hw": + self.dut.send_expect("set promisc all on", "testpmd> ", 15) + + def start_testpmd(self, core_list, pci_para, eal, csum, csum_config): + self.pmdout.start_testpmd(core_list, eal, pci_para, socket=self.socket) + if csum: + self.checksum_enable(csum, csum_config) + self.dut.send_expect("start", "testpmd> ", 15) + + def create_pcaps_file(self, frame_size, pkt_type): + """ + Prepare traffic flow + """ + if pkt_type == "vxlan": + headers_size = sum( + [ + HEADER_SIZE[x] + for x in ["eth", "ip", "udp", "vxlan", "eth", "ip", "udp"] + ] + ) + else: + headers_size = sum([HEADER_SIZE[x] for x in ["eth", "ip"]]) + payload_size = frame_size - headers_size + pcaps = {} + # Modify the incorrect checksum of IP and UDP for inner and outer. + for _port in self.dut_ports: + if 1 == len(self.dut_ports): + if pkt_type == "vxlan": + flow = [ + 'Ether(dst="%s")/IP(dst="192.18.1.%d",chksum=1)/UDP(chksum=1)/VXLAN(vni=0x1)/Ether()/IP(dst="192.18.%d.0,chksum=1)/UDP(chksum=1)/("X"*%d)' + % (self.vfs_mac[_port], _port, _port, payload_size) + ] + else: + flow = [ + 'Ether(dst="%s")/IP(dst="192.18.1.%d",chksum=1)/("X"*%d)' + % (self.vfs_mac[_port], _port, payload_size) + ] + pcap = os.sep.join([self.output_path, "dst{0}.pcap".format(_port)]) + self.tester.scapy_append('wrpcap("%s", [%s])' % (pcap, ",".join(flow))) + self.tester.scapy_execute() + pcaps[_port] = [] + pcaps[_port].append(pcap) + else: + cnt = 0 + for i in range(len(self.dut_ports) ** 2)[_port * 2 : (_port + 1) * 2]: + if pkt_type == "vxlan": + flow = [ + 'Ether(dst="%s")/IP(dst="192.18.%d.%d",chksum=1)/UDP(chksum=1)/VXLAN(vni=0x1)/Ether()/IP(dst="192.18.%d.0",chksum=1)/UDP(chksum=1)/("X"*%d)' + % (self.vfs_mac[_port], i, _port, i + 1, payload_size) + ] + else: + flow = [ + 'Ether(dst="%s")/IP(dst="192.18.%d.%d",chksum=1)/("X"*%d)' + % (self.vfs_mac[_port], i, _port, payload_size) + ] + pcap = os.sep.join( + [self.output_path, "dst{0}_{1}.pcap".format(_port, cnt)] + ) + self.tester.scapy_append( + 'wrpcap("%s", [%s])' % (pcap, ",".join(flow)) + ) + self.tester.scapy_execute() + if _port not in pcaps: + pcaps[_port] = [] + pcaps[_port].append(pcap) + cnt += 1 + return pcaps + + def prepare_stream(self, pcaps): + """ + Create streams for ports, one port one stream + """ + tgen_input = [] + port_num = len(self.dut_ports) + if 1 == port_num: + txIntf = self.tester.get_local_port(self.dut_ports[0]) + rxIntf = txIntf + for pcap in pcaps[0]: + tgen_input.append((txIntf, rxIntf, pcap)) + else: + for rxPort in self.dut_ports: + if rxPort % port_num == 0 or rxPort ** 2 == port_num: + txIntf = self.tester.get_local_port(self.dut_ports[rxPort + 1]) + port_id = self.dut_ports[rxPort + 1] + else: + txIntf = self.tester.get_local_port(self.dut_ports[rxPort - 1]) + port_id = self.dut_ports[rxPort - 1] + rxIntf = self.tester.get_local_port(self.dut_ports[rxPort]) + for pcap in pcaps[port_id]: + tgen_input.append((txIntf, rxIntf, pcap)) + return tgen_input + + def throughput(self, frame_size, pkt_type): + pcaps = self.create_pcaps_file(frame_size, pkt_type) + tgenInput = self.prepare_stream(pcaps) + # Get traffic option + duration = self.test_content.get("test_duration") + traffic_stop_wait_time = self.test_content.get("traffic_stop_wait_time", 0) + vm_config = self.set_fields() + # Clear streams before add new streams + self.tester.pktgen.clear_streams() + streams = self.pktgen_helper.prepare_stream_from_tginput( + tgenInput, 100, vm_config, self.tester.pktgen + ) + # Set traffic option + traffic_option = { + "method": "throughput", + "duration": duration, + } + # Run packet generator + result = self.tester.pktgen.measure(streams, traffic_option) + time.sleep(traffic_stop_wait_time) + # Statistics result + _, pps = result + self.verify(pps > 0, "No traffic detected") + pps /= 1000000 + self.logger.info( + "Throughput of " + "framesize: {}, is: {} Mpps".format(frame_size, pps) + ) + return pps + + 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 + 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 perf_test(self, csum="", csum_config="", pkt_type="ipv4"): + """ + Performance Benchmarking test + """ + pci_para = "" + for port_id in self.dut_ports: + pci_para += " -a " + self.vf_port_info[port_id]["vf_pci"][0] + 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 + ) + ) + self.start_testpmd(core_list, pci_para, eal[0], csum, csum_config) + for frame_size in self.test_content["frame_sizes"]: + self.logger.info("Test running at framesize: {}".format(frame_size)) + result = self.throughput(frame_size, pkt_type) + 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_sw_checksum_offload(self): + self.vf_create() + self.perf_test() + self.perf_test(csum="sw", pkt_type="ipv4") + self.perf_test(csum="sw", pkt_type="vxlan") + + def test_perf_enable_hw_checksum_offload(self): + self.vf_create() + self.perf_test(csum="hw", pkt_type="ipv4") + self.perf_test(csum="hw", pkt_type="vxlan") + self.perf_test(csum="hw", csum_config="all", pkt_type="ipv4") + self.perf_test(csum="hw", csum_config="all", pkt_type="vxlan") + + 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.vf_destroy() + + def tear_down_all(self): + """ + Run after each test suite. + """ + self.dut.kill_all() From patchwork Fri Apr 21 18:29:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yingya Han X-Patchwork-Id: 126387 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 576AE429AC; Fri, 21 Apr 2023 12:32:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5306542C4D; Fri, 21 Apr 2023 12:32:42 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 20ABE410F3 for ; Fri, 21 Apr 2023 12:32:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682073160; x=1713609160; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=d6ntxSQDmoIBEt/GAITJ0KrnSyiB+SErkQMJbEu93fQ=; b=nYobRU0pdpCFOSGuT9+vm6mwoZHawHDGqthYoClsUh9aRjaFzEX4EnxJ lP83nbiR0azTqoLZe5VKMo47ysubKSFB2F6+IaAFj4JXY0VFvmBh9U5Fd eGbRPhnduJn+R29KEvsmkZeEOnlm6IbJNjg/5GfOVKpkjc95qktMQABL0 IVUhH1WTVy6JeNpPKnb1cty9Jc8iify8J6wMwxSl21C87JJSU2E9plPEs In/oAg1L4BqXLHO41215ugLfhFb9mTehKXj71dCEnzDS5EHVzwM10Yj7/ d/Qgeiz0R+dWEEDtQfkxDBGspJtvIkDyNh6DeMvaE2Y+CajLGUzCAAsYo Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="325563784" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="325563784" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2023 03:32:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="669688088" X-IronPort-AV: E=Sophos;i="5.99,214,1677571200"; d="scan'208";a="669688088" Received: from dpdk-lijuan-icelake4.sh.intel.com ([10.67.119.152]) by orsmga006.jf.intel.com with ESMTP; 21 Apr 2023 03:32:38 -0700 From: Yingya Han To: dts@dpdk.org Cc: Yingya Han Subject: [dts][PATCH V2 3/3]conf: add ice_iavf_checksum_perf configuration file Date: Fri, 21 Apr 2023 18:29:23 +0000 Message-Id: <20230421182923.179866-4-yingyax.han@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230421182923.179866-1-yingyax.han@intel.com> References: <20230421182923.179866-1-yingyax.han@intel.com> 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 --- conf/ice_iavf_checksum_perf.cfg | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 conf/ice_iavf_checksum_perf.cfg diff --git a/conf/ice_iavf_checksum_perf.cfg b/conf/ice_iavf_checksum_perf.cfg new file mode 100644 index 00000000..19dcb5ee --- /dev/null +++ b/conf/ice_iavf_checksum_perf.cfg @@ -0,0 +1,6 @@ +[suite] +test_duration = 30 +traffic_stop_wait_time = 2 +test_parameters = { + '1C/1T-1Q': ['128', '256', '512', '1024', '1280', '1518',], + '1C/2T-2Q': ['128', '256', '512', '1024', '1280', '1518',],}