Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/121751/?format=api
http://patches.dpdk.org/api/patches/121751/?format=api", "web_url": "http://patches.dpdk.org/project/dts/patch/20230110145719.18052-3-hongbox.li@intel.com/", "project": { "id": 3, "url": "http://patches.dpdk.org/api/projects/3/?format=api", "name": "DTS", "link_name": "dts", "list_id": "dts.dpdk.org", "list_email": "dts@dpdk.org", "web_url": "", "scm_url": "git://dpdk.org/tools/dts", "webscm_url": "http://git.dpdk.org/tools/dts/", "list_archive_url": "https://inbox.dpdk.org/dts", "list_archive_url_format": "https://inbox.dpdk.org/dts/{}", "commit_url_format": "" }, "msgid": "<20230110145719.18052-3-hongbox.li@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dts/20230110145719.18052-3-hongbox.li@intel.com", "date": "2023-01-10T14:57:13", "name": "[V2,2/8] tests/l2fwd: split performance plan and suite", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "980ec00ea808bd7d9ee94ee057f5213a1eaa3cf1", "submitter": { "id": 2804, "url": "http://patches.dpdk.org/api/people/2804/?format=api", "name": "Li, HongboX", "email": "hongbox.li@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dts/patch/20230110145719.18052-3-hongbox.li@intel.com/mbox/", "series": [ { "id": 26450, "url": "http://patches.dpdk.org/api/series/26450/?format=api", "web_url": "http://patches.dpdk.org/project/dts/list/?series=26450", "date": "2023-01-10T14:57:11", "name": "split performance plan and suite", "version": 2, "mbox": "http://patches.dpdk.org/series/26450/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/121751/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/121751/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dts-bounces@dpdk.org>", "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id E90594239F;\n\tTue, 10 Jan 2023 07:37:51 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E11EF42D1E;\n\tTue, 10 Jan 2023 07:37:51 +0100 (CET)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by mails.dpdk.org (Postfix) with ESMTP id 0140F40689\n for <dts@dpdk.org>; Tue, 10 Jan 2023 07:37:49 +0100 (CET)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Jan 2023 22:37:48 -0800", "from unknown (HELO cvl_100g_103.icx.intel.com) ([10.239.252.93])\n by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Jan 2023 22:37:47 -0800" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1673332670; x=1704868670;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=RrxY6bhMAOUobR+JRMN0zvbj7r1PmtB9vcHlS13vW58=;\n b=ZRE/qF+OLB/UhTj8XyKyz/PczQxcvy40/oOCEtzz9YlFJQl/EdwQ8QDo\n a17MNAEqH0FPAq0rrBqu1IGJo1ex8JITwBcDUgWzYg+kSvCMT7IBzleRB\n CmmC0BR2qC9CPV78M3OwzKDcguLlruZIogIisNwdWkKJEJMSwxI7Usj9C\n d1z5MJQ1GK4kr9wwQkYMez3qSFladdeUFo3vKVat7oovtfK4pgU3+QLhl\n /VOuow9dmlVypSVv5/23wKrS6DIqLA/btfcZ1/35IwyGua+owsbtVHADh\n fonwVULy+ZfE9YXb05wlhyVcfTXj26+we7DOY5U8PpdkcqThhiujXJDgp w==;", "X-IronPort-AV": [ "E=McAfee;i=\"6500,9779,10585\"; a=\"310874979\"", "E=Sophos;i=\"5.96,314,1665471600\"; d=\"scan'208\";a=\"310874979\"", "E=McAfee;i=\"6500,9779,10585\"; a=\"745657665\"", "E=Sophos;i=\"5.96,314,1665471600\"; d=\"scan'208\";a=\"745657665\"" ], "From": "Hongbo Li <hongbox.li@intel.com>", "To": "dts@dpdk.org", "Cc": "Hongbo Li <hongbox.li@intel.com>", "Subject": "[dts][PATCH V2 2/8] tests/l2fwd: split performance plan and suite", "Date": "Tue, 10 Jan 2023 22:57:13 +0800", "Message-Id": "<20230110145719.18052-3-hongbox.li@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20230110145719.18052-1-hongbox.li@intel.com>", "References": "<20230110145719.18052-1-hongbox.li@intel.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dts@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "test suite reviews and discussions <dts.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dts>,\n <mailto:dts-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dts/>", "List-Post": "<mailto:dts@dpdk.org>", "List-Help": "<mailto:dts-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dts>,\n <mailto:dts-request@dpdk.org?subject=subscribe>", "Errors-To": "dts-bounces@dpdk.org" }, "content": "split performance plan and suite\n\nSigned-off-by: Hongbo Li <hongbox.li@intel.com>\n---\n test_plans/l2fwd_test_plan.rst | 36 -----\n test_plans/perf_l2fwd_test_plan.rst | 90 +++++++++++\n tests/TestSuite_l2fwd.py | 106 -------------\n tests/TestSuite_perf_l2fwd.py | 233 ++++++++++++++++++++++++++++\n 4 files changed, 323 insertions(+), 142 deletions(-)\n create mode 100644 test_plans/perf_l2fwd_test_plan.rst\n create mode 100644 tests/TestSuite_perf_l2fwd.py", "diff": "diff --git a/test_plans/l2fwd_test_plan.rst b/test_plans/l2fwd_test_plan.rst\nindex d8803cb5..1bf9ad45 100644\n--- a/test_plans/l2fwd_test_plan.rst\n+++ b/test_plans/l2fwd_test_plan.rst\n@@ -69,39 +69,3 @@ Trigger the packet generator of bursting packets from ``port A``, then check if\n ``port 0`` could receive them and ``port 1`` could forward them back. Stop it\n and then trigger the packet generator of bursting packets from ``port B``, then\n check if ``port 1`` could receive them and ``port 0`` could forward them back.\n-\n-Test Case: ``64/128/256/512/1024/1500`` bytes packet forwarding test\n-====================================================================\n-\n-Set the packet stream to be sent out from packet generator before testing as below.\n-\n-+-------+---------+---------+---------+-----------+\n-| Frame | 1q | 2q | 4q | 8 q |\n-| Size | | | | |\n-+-------+---------+---------+---------+-----------+\n-| 64 | | | | |\n-+-------+---------+---------+---------+-----------+\n-| 65 | | | | |\n-+-------+---------+---------+---------+-----------+\n-| 128 | | | | |\n-+-------+---------+---------+---------+-----------+\n-| 256 | | | | |\n-+-------+---------+---------+---------+-----------+\n-| 512 | | | | |\n-+-------+---------+---------+---------+-----------+\n-| 1024 | | | | |\n-+-------+---------+---------+---------+-----------+\n-| 1280 | | | | |\n-+-------+---------+---------+---------+-----------+\n-| 1518 | | | | |\n-+-------+---------+---------+---------+-----------+\n-\n-Then run the test application as below::\n-\n- $ ./x86_64-native-linuxapp-gcc/examples/dpdk-l2fwd -n 2 -c f -- -q 1 -p 0x3\n-\n-The -n command is used to select the number of memory channels. It should match the number of memory channels on that setup.\n-\n-Trigger the packet generator of bursting packets to the port 0 and 1 on the onboard\n-NIC to be tested. Then measure the forwarding throughput for different packet sizes\n-and different number of queues.\ndiff --git a/test_plans/perf_l2fwd_test_plan.rst b/test_plans/perf_l2fwd_test_plan.rst\nnew file mode 100644\nindex 00000000..e5fbaf30\n--- /dev/null\n+++ b/test_plans/perf_l2fwd_test_plan.rst\n@@ -0,0 +1,90 @@\n+.. SPDX-License-Identifier: BSD-3-Clause\n+ Copyright(c) 2010-2017 Intel Corporation\n+\n+===================\n+L2 Forwarding Tests\n+===================\n+\n+This test application is a basic packet processing application using Intel®\n+DPDK. It is a layer-2 (L2) forwarding application which takes traffic from\n+a single RX port and transmits it with few modification on a single TX port.\n+\n+For a packet received on a RX port (RX_PORT), it would be transmitted from a\n+TX port (TX_PORT=RX_PORT+1) if RX_PORT is even; otherwise from a TX port\n+(TX_PORT=RX_PORT-1) if RX_PORT is odd. Before being transmitted, the source\n+mac address of the packet would be replaced by the mac address of the TX port,\n+while the destination mac address would be replaced by 00:09:c0:00:00:TX_PORT_ID.\n+\n+The test application should be run with the wanted paired ports configured using\n+the coremask parameter via the command line. i.e. port 0 and 1 is a valid pair,\n+while port 1 and 2 isn't. The test is performed by running the test application\n+and using a traffic generator. Tests are run with receiving a variety of size of\n+packets generated by the traffic generator and forwarding back to the traffic\n+generator. The packet loss and the throughput are the right ones need to be\n+measured.\n+\n+The ``l2fwd`` application is run with EAL parameters and parameters for\n+the application itself. For details about the EAL parameters, see the relevant\n+DPDK **Getting Started Guide**. This application supports two parameters for\n+itself.\n+\n+- ``-p PORTMASK``: hexadecimal bitmask of ports to configure\n+- ``-q NQ``: number of queue per lcore (default is 1)\n+\n+Prerequisites\n+=============\n+\n+If using vfio the kernel must be >= 3.6+ and VT-d must be enabled in bios.When\n+using vfio, use the following commands to load the vfio driver and bind it\n+to the device under test::\n+\n+ modprobe vfio\n+ modprobe vfio-pci\n+ usertools/dpdk-devbind.py --bind=vfio-pci device_bus_id\n+\n+Assume port 0 and 1 are connected to the traffic generator, to run the test\n+application in linuxapp environment with 4 lcores, 2 ports and 8 RX queues\n+per lcore::\n+\n+ $ ./x86_64-native-linuxapp-gcc/examples/dpdk-l2fwd -n 1 -c f -- -q 8 -p 0x3\n+\n+Also, if the ports to be tested are different, the port mask should be changed.\n+The lcore used to run the test application and the number of queue used for a\n+lcore could be changed. For benchmarking, the EAL parameters and the parameters\n+for the application itself for different test cases should be the same.\n+\n+Test Case: ``64/128/256/512/1024/1500`` bytes packet forwarding test\n+====================================================================\n+\n+Set the packet stream to be sent out from packet generator before testing as below.\n+\n++-------+---------+---------+---------+-----------+\n+| Frame | 1q | 2q | 4q | 8 q |\n+| Size | | | | |\n++-------+---------+---------+---------+-----------+\n+| 64 | | | | |\n++-------+---------+---------+---------+-----------+\n+| 65 | | | | |\n++-------+---------+---------+---------+-----------+\n+| 128 | | | | |\n++-------+---------+---------+---------+-----------+\n+| 256 | | | | |\n++-------+---------+---------+---------+-----------+\n+| 512 | | | | |\n++-------+---------+---------+---------+-----------+\n+| 1024 | | | | |\n++-------+---------+---------+---------+-----------+\n+| 1280 | | | | |\n++-------+---------+---------+---------+-----------+\n+| 1518 | | | | |\n++-------+---------+---------+---------+-----------+\n+\n+Then run the test application as below::\n+\n+ $ ./x86_64-native-linuxapp-gcc/examples/dpdk-l2fwd -n 2 -c f -- -q 1 -p 0x3\n+\n+The -n command is used to select the number of memory channels. It should match the number of memory channels on that setup.\n+\n+Trigger the packet generator of bursting packets to the port 0 and 1 on the onboard\n+NIC to be tested. Then measure the forwarding throughput for different packet sizes\n+and different number of queues.\ndiff --git a/tests/TestSuite_l2fwd.py b/tests/TestSuite_l2fwd.py\nindex 9e8fd2d5..7594958b 100644\n--- a/tests/TestSuite_l2fwd.py\n+++ b/tests/TestSuite_l2fwd.py\n@@ -150,112 +150,6 @@ class TestL2fwd(TestCase):\n \n self.quit_l2fwd()\n \n- def test_perf_l2fwd_performance(self):\n- \"\"\"\n- Benchmark performance for frame_sizes.\n- \"\"\"\n- ports = []\n- for port in range(self.number_of_ports):\n- ports.append(self.dut_ports[port])\n-\n- port_mask = utils.create_mask(ports)\n- cores = self.dut.get_core_list(self.core_config, socket=self.ports_socket)\n-\n- eal_params = self.dut.create_eal_parameters(cores=cores)\n- eal_param = \"\"\n- for i in ports:\n- eal_param += \" -a %s\" % self.dut.ports_info[i][\"pci\"]\n-\n- for frame_size in self.frame_sizes:\n-\n- payload_size = frame_size - self.headers_size\n-\n- tgen_input = []\n- cnt = 1\n- for port in range(self.number_of_ports):\n- rx_port = self.tester.get_local_port(\n- self.dut_ports[port % self.number_of_ports]\n- )\n- tx_port = self.tester.get_local_port(\n- self.dut_ports[(port + 1) % self.number_of_ports]\n- )\n- destination_mac = self.dut.get_mac_address(\n- self.dut_ports[(port + 1) % self.number_of_ports]\n- )\n- pcap = os.sep.join(\n- [self.output_path, \"l2fwd_{0}_{1}.pcap\".format(port, cnt)]\n- )\n- self.tester.scapy_append(\n- 'wrpcap(\"%s\", [Ether(dst=\"%s\")/IP()/UDP()/(\"X\"*%d)])'\n- % (pcap, destination_mac, payload_size)\n- )\n- tgen_input.append((tx_port, rx_port, pcap))\n- time.sleep(3)\n- self.tester.scapy_execute()\n- cnt += 1\n-\n- for queues in self.test_queues:\n-\n- command_line = \"./%s %s %s -- -q %s -p %s &\" % (\n- self.app_l2fwd_path,\n- eal_params,\n- eal_param,\n- str(queues[\"queues\"]),\n- port_mask,\n- )\n-\n- # self.dut.send_expect(command_line, \"memory mapped\", 60)\n- self.dut.send_expect(command_line, \"L2FWD: entering main loop\", 60)\n- # wait 5 second after l2fwd boot up.\n- # It is aimed to make sure trex detect link up status.\n- if self.tester.is_pktgen:\n- time.sleep(5)\n- info = (\n- \"Executing l2fwd using %s queues, frame size %d and %s setup.\\n\"\n- % (queues[\"queues\"], frame_size, self.core_config)\n- )\n-\n- self.logger.info(info)\n- self.rst_report(info, annex=True)\n- self.rst_report(command_line + \"\\n\\n\", frame=True, annex=True)\n-\n- # clear streams before add new streams\n- self.tester.pktgen.clear_streams()\n- # run packet generator\n- streams = self.pktgen_helper.prepare_stream_from_tginput(\n- tgen_input, 100, None, self.tester.pktgen\n- )\n- _, pps = self.tester.pktgen.measure_throughput(stream_ids=streams)\n-\n- Mpps = pps / 1000000.0\n- queues[\"Mpps\"][frame_size] = Mpps\n- queues[\"pct\"][frame_size] = (\n- Mpps\n- * 100\n- / float(self.wirespeed(self.nic, frame_size, self.number_of_ports))\n- )\n-\n- self.quit_l2fwd()\n-\n- # Look for transmission error in the results\n- for frame_size in self.frame_sizes:\n- for n in range(len(self.test_queues)):\n- self.verify(\n- self.test_queues[n][\"Mpps\"][frame_size] > 0, \"No traffic detected\"\n- )\n-\n- # Prepare the results for table\n- for frame_size in self.frame_sizes:\n- results_row = []\n- results_row.append(frame_size)\n- for queue in self.test_queues:\n- results_row.append(queue[\"Mpps\"][frame_size])\n- results_row.append(queue[\"pct\"][frame_size])\n-\n- self.result_table_add(results_row)\n-\n- self.result_table_print()\n-\n def tear_down(self):\n \"\"\"\n Run after each test case.\ndiff --git a/tests/TestSuite_perf_l2fwd.py b/tests/TestSuite_perf_l2fwd.py\nnew file mode 100644\nindex 00000000..2cbf8899\n--- /dev/null\n+++ b/tests/TestSuite_perf_l2fwd.py\n@@ -0,0 +1,233 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2010-2019 Intel Corporation\n+#\n+\n+\"\"\"\n+DPDK Test suite.\n+Test Layer-2 Forwarding support\n+\"\"\"\n+import os\n+import time\n+\n+import framework.utils as utils\n+from framework.pktgen import PacketGeneratorHelper\n+from framework.settings import HEADER_SIZE\n+from framework.test_case import TestCase\n+\n+\n+class TestL2fwd(TestCase):\n+ def set_up_all(self):\n+ \"\"\"\n+ Run at the start of each test suite.\n+\n+ L2fwd prerequisites.\n+ \"\"\"\n+ self.frame_sizes = [64, 65, 128, 256, 512, 1024, 1280, 1518]\n+\n+ self.test_queues = [\n+ {\"queues\": 1, \"Mpps\": {}, \"pct\": {}},\n+ {\"queues\": 2, \"Mpps\": {}, \"pct\": {}},\n+ {\"queues\": 4, \"Mpps\": {}, \"pct\": {}},\n+ {\"queues\": 8, \"Mpps\": {}, \"pct\": {}},\n+ ]\n+\n+ self.core_config = \"1S/4C/1T\"\n+ self.number_of_ports = 2\n+ self.headers_size = HEADER_SIZE[\"eth\"] + HEADER_SIZE[\"ip\"] + HEADER_SIZE[\"udp\"]\n+\n+ self.dut_ports = self.dut.get_ports_performance(force_different_nic=False)\n+\n+ self.verify(\n+ len(self.dut_ports) >= self.number_of_ports,\n+ \"Not enough ports for \" + self.nic,\n+ )\n+\n+ self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])\n+\n+ # compile\n+ out = self.dut.build_dpdk_apps(\"./examples/l2fwd\")\n+ self.app_l2fwd_path = self.dut.apps_name[\"l2fwd\"]\n+ self.verify(\"Error\" not in out, \"Compilation error\")\n+ self.verify(\"No such\" not in out, \"Compilation error\")\n+\n+ self.table_header = [\"Frame\"]\n+ for queue in self.test_queues:\n+ self.table_header.append(\"%d queues Mpps\" % queue[\"queues\"])\n+ self.table_header.append(\"% linerate\")\n+\n+ self.result_table_create(self.table_header)\n+\n+ # get dts output path\n+ if self.logger.log_path.startswith(os.sep):\n+ self.output_path = self.logger.log_path\n+ else:\n+ cur_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))\n+ self.output_path = os.sep.join([cur_path, self.logger.log_path])\n+ # create an instance to set stream field setting\n+ self.pktgen_helper = PacketGeneratorHelper()\n+\n+ def set_up(self):\n+ \"\"\"\n+ Run before each test case.\n+ \"\"\"\n+ pass\n+\n+ def quit_l2fwd(self):\n+ self.dut.send_expect(\"fg\", \"l2fwd \", 5)\n+ self.dut.send_expect(\"^C\", \"# \", 5)\n+\n+ def notest_port_testing(self):\n+ \"\"\"\n+ Check port forwarding.\n+ \"\"\"\n+ # the cases use the first two ports\n+ port_mask = utils.create_mask([self.dut_ports[0], self.dut_ports[1]])\n+ eal_params = self.dut.create_eal_parameters()\n+\n+ self.dut.send_expect(\n+ \"./%s %s -- -q 8 -p %s &\" % (self.app_l2fwd_path, eal_params, port_mask),\n+ \"L2FWD: entering main loop\",\n+ 60,\n+ )\n+\n+ for i in [0, 1]:\n+ tx_port = self.tester.get_local_port(self.dut_ports[i])\n+ rx_port = self.tester.get_local_port(self.dut_ports[1 - i])\n+\n+ tx_interface = self.tester.get_interface(tx_port)\n+ rx_interface = self.tester.get_interface(rx_port)\n+\n+ self.tester.scapy_background()\n+ self.tester.scapy_append('p = sniff(iface=\"%s\", count=1)' % rx_interface)\n+ self.tester.scapy_append(\"number_packets=len(p)\")\n+ self.tester.scapy_append(\"RESULT = str(number_packets)\")\n+\n+ self.tester.scapy_foreground()\n+ self.tester.scapy_append(\n+ 'sendp([Ether()/IP()/UDP()/(\"X\"*46)], iface=\"%s\")' % tx_interface\n+ )\n+\n+ self.tester.scapy_execute()\n+ number_packets = self.tester.scapy_get_result()\n+ self.verify(number_packets == \"1\", \"Failed to switch L2 frame\")\n+\n+ self.quit_l2fwd()\n+\n+ def test_perf_l2fwd_performance(self):\n+ \"\"\"\n+ Benchmark performance for frame_sizes.\n+ \"\"\"\n+ ports = []\n+ for port in range(self.number_of_ports):\n+ ports.append(self.dut_ports[port])\n+\n+ port_mask = utils.create_mask(ports)\n+ cores = self.dut.get_core_list(self.core_config, socket=self.ports_socket)\n+\n+ eal_params = self.dut.create_eal_parameters(cores=cores)\n+ eal_param = \"\"\n+ for i in ports:\n+ eal_param += \" -a %s\" % self.dut.ports_info[i][\"pci\"]\n+\n+ for frame_size in self.frame_sizes:\n+\n+ payload_size = frame_size - self.headers_size\n+\n+ tgen_input = []\n+ cnt = 1\n+ for port in range(self.number_of_ports):\n+ rx_port = self.tester.get_local_port(\n+ self.dut_ports[port % self.number_of_ports]\n+ )\n+ tx_port = self.tester.get_local_port(\n+ self.dut_ports[(port + 1) % self.number_of_ports]\n+ )\n+ destination_mac = self.dut.get_mac_address(\n+ self.dut_ports[(port + 1) % self.number_of_ports]\n+ )\n+ pcap = os.sep.join(\n+ [self.output_path, \"l2fwd_{0}_{1}.pcap\".format(port, cnt)]\n+ )\n+ self.tester.scapy_append(\n+ 'wrpcap(\"%s\", [Ether(dst=\"%s\")/IP()/UDP()/(\"X\"*%d)])'\n+ % (pcap, destination_mac, payload_size)\n+ )\n+ tgen_input.append((tx_port, rx_port, pcap))\n+ time.sleep(3)\n+ self.tester.scapy_execute()\n+ cnt += 1\n+\n+ for queues in self.test_queues:\n+\n+ command_line = \"./%s %s %s -- -q %s -p %s &\" % (\n+ self.app_l2fwd_path,\n+ eal_params,\n+ eal_param,\n+ str(queues[\"queues\"]),\n+ port_mask,\n+ )\n+\n+ # self.dut.send_expect(command_line, \"memory mapped\", 60)\n+ self.dut.send_expect(command_line, \"L2FWD: entering main loop\", 60)\n+ # wait 5 second after l2fwd boot up.\n+ # It is aimed to make sure trex detect link up status.\n+ if self.tester.is_pktgen:\n+ time.sleep(5)\n+ info = (\n+ \"Executing l2fwd using %s queues, frame size %d and %s setup.\\n\"\n+ % (queues[\"queues\"], frame_size, self.core_config)\n+ )\n+\n+ self.logger.info(info)\n+ self.rst_report(info, annex=True)\n+ self.rst_report(command_line + \"\\n\\n\", frame=True, annex=True)\n+\n+ # clear streams before add new streams\n+ self.tester.pktgen.clear_streams()\n+ # run packet generator\n+ streams = self.pktgen_helper.prepare_stream_from_tginput(\n+ tgen_input, 100, None, self.tester.pktgen\n+ )\n+ _, pps = self.tester.pktgen.measure_throughput(stream_ids=streams)\n+\n+ Mpps = pps / 1000000.0\n+ queues[\"Mpps\"][frame_size] = Mpps\n+ queues[\"pct\"][frame_size] = (\n+ Mpps\n+ * 100\n+ / float(self.wirespeed(self.nic, frame_size, self.number_of_ports))\n+ )\n+\n+ self.quit_l2fwd()\n+\n+ # Look for transmission error in the results\n+ for frame_size in self.frame_sizes:\n+ for n in range(len(self.test_queues)):\n+ self.verify(\n+ self.test_queues[n][\"Mpps\"][frame_size] > 0, \"No traffic detected\"\n+ )\n+\n+ # Prepare the results for table\n+ for frame_size in self.frame_sizes:\n+ results_row = []\n+ results_row.append(frame_size)\n+ for queue in self.test_queues:\n+ results_row.append(queue[\"Mpps\"][frame_size])\n+ results_row.append(queue[\"pct\"][frame_size])\n+\n+ self.result_table_add(results_row)\n+\n+ self.result_table_print()\n+\n+ def tear_down(self):\n+ \"\"\"\n+ Run after each test case.\n+ \"\"\"\n+ self.dut.send_expect(\"fg\", \"l2fwd|# \", 5)\n+ self.dut.send_expect(\"^C\", \"# \", 5)\n+\n+ def tear_down_all(self):\n+ \"\"\"\n+ Run after each test suite.\n+ \"\"\"\n+ pass\n", "prefixes": [ "V2", "2/8" ] }{ "id": 121751, "url": "