Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/116624/?format=api
http://patches.dpdk.org/api/patches/116624/?format=api", "web_url": "http://patches.dpdk.org/project/dts/patch/20220922142950.398902-7-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": "<20220922142950.398902-7-hongbox.li@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dts/20220922142950.398902-7-hongbox.li@intel.com", "date": "2022-09-22T14:29:50", "name": "[V1,7/7] tests/multiprocess:Separated performance cases", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "d33e7bc5228e1c482d699e179cf96feb35da7046", "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/20220922142950.398902-7-hongbox.li@intel.com/mbox/", "series": [ { "id": 24769, "url": "http://patches.dpdk.org/api/series/24769/?format=api", "web_url": "http://patches.dpdk.org/project/dts/list/?series=24769", "date": "2022-09-22T14:29:44", "name": "[V1,1/7] tests/efd:Separated performance cases", "version": 1, "mbox": "http://patches.dpdk.org/series/24769/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/116624/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/116624/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 0148AA0540;\n\tThu, 22 Sep 2022 08:26:39 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E716740697;\n\tThu, 22 Sep 2022 08:26:39 +0200 (CEST)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id DC78E40156\n for <dts@dpdk.org>; Thu, 22 Sep 2022 08:26:37 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Sep 2022 23:26:37 -0700", "from unknown (HELO localhost.localdomain) ([10.239.252.92])\n by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Sep 2022 23:26:31 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1663827998; x=1695363998;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=pgti0tOxTwG3XPebD8guWNJ6Jnwoq3AFkqOPBrskPnU=;\n b=PpIckU6OwHBtO+xbcbKEnTH2C23MNLYWSOEr2GJmfDoXq1IAWvngpldp\n RyDKMuWvgwXiJUR1ys/ZxtgwlUMHnUjMX/3A6xoLONJEGFH5CpG01mcPM\n TxOBn5kZUHmOScqEya30dw4CFFsze1Y/AcYb91LM3KnuJo9wsj7bbdiVv\n D7ufh52a3Iv3RyMq9yrN/ZYz0MuVn77GNcqnZSJXzSbA/odbqA/pCsnSu\n 5zW+tc155j93iuaQVFUo/jUB28fxFoPUS/94CZaP+PFbPlAiyK0xKH9Iz\n i4cLHLaZSS71TcqufR02p/RhlQrXWAN0TIcAlxDeEcQXG2M+0a51225A7 w==;", "X-IronPort-AV": [ "E=McAfee;i=\"6500,9779,10477\"; a=\"297812191\"", "E=Sophos;i=\"5.93,335,1654585200\"; d=\"scan'208\";a=\"297812191\"", "E=Sophos;i=\"5.93,335,1654585200\"; d=\"scan'208\";a=\"948467906\"" ], "From": "Hongbo Li <hongbox.li@intel.com>", "To": "dts@dpdk.org", "Cc": "Hongbo Li <hongbox.li@intel.com>", "Subject": "[PATCH V1 7/7] tests/multiprocess:Separated performance cases", "Date": "Thu, 22 Sep 2022 14:29:50 +0000", "Message-Id": "<20220922142950.398902-7-hongbox.li@intel.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220922142950.398902-1-hongbox.li@intel.com>", "References": "<20220922142950.398902-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": "Separated performance cases\n\nSigned-off-by: Hongbo Li <hongbox.li@intel.com>\n---\n test_plans/index.rst | 7 +\n test_plans/multiprocess_test_plan.rst | 48 ---\n test_plans/perf_multiprocess_test_plan.rst | 194 ++++++++++++\n tests/TestSuite_multiprocess.py | 210 -------------\n tests/TestSuite_perf_multiprocess.py | 333 +++++++++++++++++++++\n 5 files changed, 534 insertions(+), 258 deletions(-)\n create mode 100644 test_plans/perf_multiprocess_test_plan.rst\n create mode 100644 tests/TestSuite_perf_multiprocess.py", "diff": "diff --git a/test_plans/index.rst b/test_plans/index.rst\nindex 8e2634bd..a834d767 100644\n--- a/test_plans/index.rst\n+++ b/test_plans/index.rst\n@@ -108,6 +108,13 @@ The following are the test plans for the DPDK DTS automated test system.\n ntb_test_plan\n nvgre_test_plan\n perf_virtio_user_loopback_test_plan\n+ perf_efd_test_plan\n+ perf_ipfrag_test_plan\n+ perf_kni_test_plan\n+ perf_l2fwd_test_plan\n+ perf_multiprocess_test_plan\n+ perf_tso_test_plan\n+ perf_vxlan_test_plan\n pf_smoke_test_plan\n pipeline_test_plan\n pvp_virtio_user_multi_queues_port_restart_test_plan\ndiff --git a/test_plans/multiprocess_test_plan.rst b/test_plans/multiprocess_test_plan.rst\nindex bfef1ca9..699938ed 100644\n--- a/test_plans/multiprocess_test_plan.rst\n+++ b/test_plans/multiprocess_test_plan.rst\n@@ -196,26 +196,6 @@ run should remain the same, except for the ``num-procs`` value, which should be\n adjusted appropriately.\n \n \n-Test Case: Performance Tests\n-----------------------------\n-\n-Run the multiprocess application using standard IP traffic - varying source\n-and destination address information to allow RSS to evenly distribute packets\n-among RX queues. Record traffic throughput results as below.\n-\n-+-------------------+-----+-----+-----+-----+-----+-----+\n-| Num-procs | 1 | 2 | 2 | 4 | 4 | 8 |\n-+-------------------+-----+-----+-----+-----+-----+-----+\n-| Cores/Threads | 1/1 | 1/2 | 2/1 | 2/2 | 4/1 | 4/2 |\n-+-------------------+-----+-----+-----+-----+-----+-----+\n-| Num Ports | 2 | 2 | 2 | 2 | 2 | 2 |\n-+-------------------+-----+-----+-----+-----+-----+-----+\n-| Packet Size | 64 | 64 | 64 | 64 | 64 | 64 |\n-+-------------------+-----+-----+-----+-----+-----+-----+\n-| %-age Line Rate | X | X | X | X | X | X |\n-+-------------------+-----+-----+-----+-----+-----+-----+\n-| Packet Rate(mpps) | X | X | X | X | X | X |\n-+-------------------+-----+-----+-----+-----+-----+-----+\n \n Test Case: Function Tests\n -------------------------\n@@ -294,34 +274,6 @@ An example commands to run 8 client processes is as follows::\n root@host:mp_client# ./x86_64-native-linuxapp-gcc/examples/dpdk-mp_client -c 40000 --proc-type=secondary -- -n 6 &\n root@host:mp_client# ./x86_64-native-linuxapp-gcc/examples/dpdk-mp_client -c 100000 --proc-type=secondary -- -n 7 &\n \n-Test Case: Performance Measurement\n-----------------------------------\n-\n-- On the traffic generator set up a traffic flow in both directions specifying\n- IP traffic.\n-- Run the server and client applications as above.\n-- Start the traffic and record the throughput for transmitted and received packets.\n-\n-An example set of results is shown below.\n-\n-+----------------------+-----+-----+-----+-----+-----+-----+\n-| Server threads | 1 | 1 | 1 | 1 | 1 | 1 |\n-+----------------------+-----+-----+-----+-----+-----+-----+\n-| Server Cores/Threads | 1/1 | 1/1 | 1/1 | 1/1 | 1/1 | 1/1 |\n-+----------------------+-----+-----+-----+-----+-----+-----+\n-| Num-clients | 1 | 2 | 2 | 4 | 4 | 8 |\n-+----------------------+-----+-----+-----+-----+-----+-----+\n-| Client Cores/Threads | 1/1 | 1/2 | 2/1 | 2/2 | 4/1 | 4/2 |\n-+----------------------+-----+-----+-----+-----+-----+-----+\n-| Num Ports | 2 | 2 | 2 | 2 | 2 | 2 |\n-+----------------------+-----+-----+-----+-----+-----+-----+\n-| Packet Size | 64 | 64 | 64 | 64 | 64 | 64 |\n-+----------------------+-----+-----+-----+-----+-----+-----+\n-| %-age Line Rate | X | X | X | X | X | X |\n-+----------------------+-----+-----+-----+-----+-----+-----+\n-| Packet Rate(mpps) | X | X | X | X | X | X |\n-+----------------------+-----+-----+-----+-----+-----+-----+\n-\n Test Case: Function Tests\n -------------------------\n start server process and 2 client process, send some packets, the number of packets is a random value between 20 and 256.\ndiff --git a/test_plans/perf_multiprocess_test_plan.rst b/test_plans/perf_multiprocess_test_plan.rst\nnew file mode 100644\nindex 00000000..4cca63de\n--- /dev/null\n+++ b/test_plans/perf_multiprocess_test_plan.rst\n@@ -0,0 +1,194 @@\n+.. SPDX-License-Identifier: BSD-3-Clause\n+ Copyright(c) 2010-2017 Intel Corporation\n+\n+=======================================\n+Sample Application Tests: Multi-Process\n+=======================================\n+\n+Simple MP Application Test\n+==========================\n+\n+Description\n+-----------\n+\n+This test is a basic multi-process test which demonstrates the basics of sharing\n+information between DPDK processes. The same application binary is run\n+twice - once as a primary instance, and once as a secondary instance. Messages\n+are sent from primary to secondary and vice versa, demonstrating the processes\n+are sharing memory and can communicate using rte_ring structures.\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+Assuming that a DPDK build has been set up and the multi-process sample\n+applications have been built.\n+\n+Symmetric MP Application Test\n+=============================\n+\n+Description\n+-----------\n+\n+This test is a multi-process test which demonstrates how multiple processes can\n+work together to perform packet I/O and packet processing in parallel, much as\n+other example application work by using multiple threads. In this example, each\n+process reads packets from all network ports being used - though from a different\n+RX queue in each case. Those packets are then forwarded by each process which\n+sends them out by writing them directly to a suitable TX queue.\n+\n+Prerequisites\n+-------------\n+\n+Assuming that an Intel� DPDK build has been set up and the multi-process sample\n+applications have been built. It is also assumed that a traffic generator has\n+been configured and plugged in to the NIC ports 0 and 1.\n+\n+Test Methodology\n+----------------\n+\n+As with the simple_mp example, the first instance of the symmetric_mp process\n+must be run as the primary instance, though with a number of other application\n+specific parameters also provided after the EAL arguments. These additional\n+parameters are:\n+\n+* -p <portmask>, where portmask is a hexadecimal bitmask of what ports on the\n+ system are to be used. For example: -p 3 to use ports 0 and 1 only.\n+* --num-procs <N>, where N is the total number of symmetric_mp instances that\n+ will be run side-by-side to perform packet processing. This parameter is used to\n+ configure the appropriate number of receive queues on each network port.\n+* --proc-id <n>, where n is a numeric value in the range 0 <= n < N (number of\n+ processes, specified above). This identifies which symmetric_mp instance is being\n+ run, so that each process can read a unique receive queue on each network port.\n+\n+The secondary symmetric_mp instances must also have these parameters specified,\n+and the first two must be the same as those passed to the primary instance, or errors\n+result.\n+\n+For example, to run a set of four symmetric_mp instances, running on lcores 1-4, all\n+performing level-2 forwarding of packets between ports 0 and 1, the following\n+commands can be used (assuming run as root)::\n+\n+ ./x86_64-native-linuxapp-gcc/examples/dpdk-symmetric_mp -c 2 --proc-type=auto -- -p 3 --num-procs=4 --proc-id=0\n+ ./x86_64-native-linuxapp-gcc/examples/dpdk-symmetric_mp -c 4 --proc-type=auto -- -p 3 --num-procs=4 --proc-id=1\n+ ./x86_64-native-linuxapp-gcc/examples/dpdk-symmetric_mp -c 8 --proc-type=auto -- -p 3 --num-procs=4 --proc-id=2\n+ ./x86_64-native-linuxapp-gcc/examples/dpdk-symmetric_mp -c 10 --proc-type=auto -- -p 3 --num-procs=4 --proc-id=3\n+\n+To run only 1 or 2 instances, the above parameters to the 1 or 2 instances being\n+run should remain the same, except for the ``num-procs`` value, which should be\n+adjusted appropriately.\n+\n+\n+Test Case: Performance Tests\n+----------------------------\n+\n+Run the multiprocess application using standard IP traffic - varying source\n+and destination address information to allow RSS to evenly distribute packets\n+among RX queues. Record traffic throughput results as below.\n+\n++-------------------+-----+-----+-----+-----+-----+-----+\n+| Num-procs | 1 | 2 | 2 | 4 | 4 | 8 |\n++-------------------+-----+-----+-----+-----+-----+-----+\n+| Cores/Threads | 1/1 | 1/2 | 2/1 | 2/2 | 4/1 | 4/2 |\n++-------------------+-----+-----+-----+-----+-----+-----+\n+| Num Ports | 2 | 2 | 2 | 2 | 2 | 2 |\n++-------------------+-----+-----+-----+-----+-----+-----+\n+| Packet Size | 64 | 64 | 64 | 64 | 64 | 64 |\n++-------------------+-----+-----+-----+-----+-----+-----+\n+| %-age Line Rate | X | X | X | X | X | X |\n++-------------------+-----+-----+-----+-----+-----+-----+\n+| Packet Rate(mpps) | X | X | X | X | X | X |\n++-------------------+-----+-----+-----+-----+-----+-----+\n+\n+Client Server Multiprocess Tests\n+================================\n+\n+Description\n+-----------\n+\n+The client-server sample application demonstrates the ability of Intel� DPDK\n+to use multiple processes in which a server process performs packet I/O and one\n+or multiple client processes perform packet processing. The server process\n+controls load balancing on the traffic received from a number of input ports to\n+a user-specified number of clients. The client processes forward the received\n+traffic, outputting the packets directly by writing them to the TX rings of the\n+outgoing ports.\n+\n+Prerequisites\n+-------------\n+\n+Assuming that an Intel� DPDK build has been set up and the multi-process\n+sample application has been built.\n+Also assuming a traffic generator is connected to the ports \"0\" and \"1\".\n+\n+It is important to run the server application before the client application,\n+as the server application manages both the NIC ports with packet transmission\n+and reception, as well as shared memory areas and client queues.\n+\n+Run the Server Application:\n+\n+- Provide the core mask on which the server process is to run using -c, e.g. -c 3 (bitmask number).\n+- Set the number of ports to be engaged using -p, e.g. -p 3 refers to ports 0 & 1.\n+- Define the maximum number of clients using -n, e.g. -n 8.\n+\n+The command line below is an example on how to start the server process on\n+logical core 2 to handle a maximum of 8 client processes configured to\n+run on socket 0 to handle traffic from NIC ports 0 and 1::\n+\n+ root@host:mp_server# ./x86_64-native-linuxapp-gcc/examples/dpdk-mp_server -c 2 -- -p 3 -n 8\n+\n+NOTE: If an additional second core is given in the coremask to the server process\n+that second core will be used to print statistics. When benchmarking, only a\n+single lcore is needed for the server process\n+\n+Run the Client application:\n+\n+- In another terminal run the client application.\n+- Give each client a distinct core mask with -c.\n+- Give each client a unique client-id with -n.\n+\n+An example commands to run 8 client processes is as follows::\n+\n+ root@host:mp_client# ./x86_64-native-linuxapp-gcc/examples/dpdk-mp_client -c 40 --proc-type=secondary -- -n 0 &\n+ root@host:mp_client# ./x86_64-native-linuxapp-gcc/examples/dpdk-mp_client -c 100 --proc-type=secondary -- -n 1 &\n+ root@host:mp_client# ./x86_64-native-linuxapp-gcc/examples/dpdk-mp_client -c 400 --proc-type=secondary -- -n 2 &\n+ root@host:mp_client# ./x86_64-native-linuxapp-gcc/examples/dpdk-mp_client -c 1000 --proc-type=secondary -- -n 3 &\n+ root@host:mp_client# ./x86_64-native-linuxapp-gcc/examples/dpdk-mp_client -c 4000 --proc-type=secondary -- -n 4 &\n+ root@host:mp_client# ./x86_64-native-linuxapp-gcc/examples/dpdk-mp_client -c 10000 --proc-type=secondary -- -n 5 &\n+ root@host:mp_client# ./x86_64-native-linuxapp-gcc/examples/dpdk-mp_client -c 40000 --proc-type=secondary -- -n 6 &\n+ root@host:mp_client# ./x86_64-native-linuxapp-gcc/examples/dpdk-mp_client -c 100000 --proc-type=secondary -- -n 7 &\n+\n+Test Case: Performance Measurement\n+----------------------------------\n+\n+- On the traffic generator set up a traffic flow in both directions specifying\n+ IP traffic.\n+- Run the server and client applications as above.\n+- Start the traffic and record the throughput for transmitted and received packets.\n+\n+An example set of results is shown below.\n+\n++----------------------+-----+-----+-----+-----+-----+-----+\n+| Server threads | 1 | 1 | 1 | 1 | 1 | 1 |\n++----------------------+-----+-----+-----+-----+-----+-----+\n+| Server Cores/Threads | 1/1 | 1/1 | 1/1 | 1/1 | 1/1 | 1/1 |\n++----------------------+-----+-----+-----+-----+-----+-----+\n+| Num-clients | 1 | 2 | 2 | 4 | 4 | 8 |\n++----------------------+-----+-----+-----+-----+-----+-----+\n+| Client Cores/Threads | 1/1 | 1/2 | 2/1 | 2/2 | 4/1 | 4/2 |\n++----------------------+-----+-----+-----+-----+-----+-----+\n+| Num Ports | 2 | 2 | 2 | 2 | 2 | 2 |\n++----------------------+-----+-----+-----+-----+-----+-----+\n+| Packet Size | 64 | 64 | 64 | 64 | 64 | 64 |\n++----------------------+-----+-----+-----+-----+-----+-----+\n+| %-age Line Rate | X | X | X | X | X | X |\n++----------------------+-----+-----+-----+-----+-----+-----+\n+| Packet Rate(mpps) | X | X | X | X | X | X |\n++----------------------+-----+-----+-----+-----+-----+-----+\ndiff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py\nindex da382a41..ed0933b6 100644\n--- a/tests/TestSuite_multiprocess.py\n+++ b/tests/TestSuite_multiprocess.py\n@@ -1689,216 +1689,6 @@ class TestMultiprocess(TestCase):\n }\n self.rte_flow(mac_ipv4_symmetric, self.multiprocess_rss_data, **pmd_param)\n \n- def test_perf_multiprocess_performance(self):\n- \"\"\"\n- Benchmark Multiprocess performance.\n- #\"\"\"\n- packet_count = 16\n- self.dut.send_expect(\"fg\", \"# \")\n- txPort = self.tester.get_local_port(self.dut_ports[0])\n- rxPort = self.tester.get_local_port(self.dut_ports[1])\n- mac = self.tester.get_mac(txPort)\n- dmac = self.dut.get_mac_address(self.dut_ports[0])\n- tgenInput = []\n-\n- # create mutative src_ip+dst_ip package\n- for i in range(packet_count):\n- package = (\n- r'flows = [Ether(src=\"%s\", dst=\"%s\")/IP(src=\"192.168.1.%d\", dst=\"192.168.1.%d\")/(\"X\"*26)]'\n- % (mac, dmac, i + 1, i + 2)\n- )\n- self.tester.scapy_append(package)\n- pcap = os.sep.join([self.output_path, \"test_%d.pcap\" % i])\n- self.tester.scapy_append('wrpcap(\"%s\", flows)' % pcap)\n- tgenInput.append([txPort, rxPort, pcap])\n- self.tester.scapy_execute()\n-\n- # run multiple symmetric_mp process\n- validExecutions = []\n- for execution in executions:\n- if len(self.dut.get_core_list(execution[\"cores\"])) == execution[\"nprocs\"]:\n- validExecutions.append(execution)\n-\n- portMask = utils.create_mask(self.dut_ports)\n-\n- for n in range(len(validExecutions)):\n- execution = validExecutions[n]\n- # get coreList form execution['cores']\n- coreList = self.dut.get_core_list(execution[\"cores\"], socket=self.socket)\n- # to run a set of symmetric_mp instances, like test plan\n- dutSessionList = []\n- for index in range(len(coreList)):\n- dut_new_session = self.dut.new_session()\n- dutSessionList.append(dut_new_session)\n- # add -a option when tester and dut in same server\n- dut_new_session.send_expect(\n- self.app_symmetric_mp\n- + \" -c %s --proc-type=auto %s -- -p %s --num-procs=%d --proc-id=%d\"\n- % (\n- utils.create_mask([coreList[index]]),\n- self.eal_param,\n- portMask,\n- execution[\"nprocs\"],\n- index,\n- ),\n- \"Finished Process Init\",\n- )\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- tgenInput, 100, None, self.tester.pktgen\n- )\n- _, pps = self.tester.pktgen.measure_throughput(stream_ids=streams)\n-\n- execution[\"pps\"] = pps\n-\n- # close all symmetric_mp process\n- self.dut.send_expect(\"killall symmetric_mp\", \"# \")\n- # close all dut sessions\n- for dut_session in dutSessionList:\n- self.dut.close_session(dut_session)\n-\n- # get rate and mpps data\n- for n in range(len(executions)):\n- self.verify(executions[n][\"pps\"] is not 0, \"No traffic detected\")\n- self.result_table_create(\n- [\n- \"Num-procs\",\n- \"Sockets/Cores/Threads\",\n- \"Num Ports\",\n- \"Frame Size\",\n- \"%-age Line Rate\",\n- \"Packet Rate(mpps)\",\n- ]\n- )\n-\n- for execution in validExecutions:\n- self.result_table_add(\n- [\n- execution[\"nprocs\"],\n- execution[\"cores\"],\n- 2,\n- 64,\n- execution[\"pps\"] / float(100000000 / (8 * 84)),\n- execution[\"pps\"] / float(1000000),\n- ]\n- )\n-\n- self.result_table_print()\n-\n- def test_perf_multiprocess_client_serverperformance(self):\n- \"\"\"\n- Benchmark Multiprocess client-server performance.\n- \"\"\"\n- self.dut.kill_all()\n- self.dut.send_expect(\"fg\", \"# \")\n- txPort = self.tester.get_local_port(self.dut_ports[0])\n- rxPort = self.tester.get_local_port(self.dut_ports[1])\n- mac = self.tester.get_mac(txPort)\n-\n- self.tester.scapy_append(\n- 'dmac=\"%s\"' % self.dut.get_mac_address(self.dut_ports[0])\n- )\n- self.tester.scapy_append('smac=\"%s\"' % mac)\n- self.tester.scapy_append(\n- 'flows = [Ether(src=smac, dst=dmac)/IP(src=\"192.168.1.1\", dst=\"192.168.1.1\")/(\"X\"*26)]'\n- )\n-\n- pcap = os.sep.join([self.output_path, \"test.pcap\"])\n- self.tester.scapy_append('wrpcap(\"%s\", flows)' % pcap)\n- self.tester.scapy_execute()\n-\n- validExecutions = []\n- for execution in executions:\n- if len(self.dut.get_core_list(execution[\"cores\"])) == execution[\"nprocs\"]:\n- validExecutions.append(execution)\n-\n- for execution in validExecutions:\n- coreList = self.dut.get_core_list(execution[\"cores\"], socket=self.socket)\n- # get core with socket parameter to specified which core dut used when tester and dut in same server\n- coreMask = utils.create_mask(\n- self.dut.get_core_list(\"1S/1C/1T\", socket=self.socket)\n- )\n- portMask = utils.create_mask(self.dut_ports)\n- # specified mp_server core and add -a option when tester and dut in same server\n- self.dut.send_expect(\n- self.app_mp_server\n- + \" -n %d -c %s %s -- -p %s -n %d\"\n- % (\n- self.dut.get_memory_channels(),\n- coreMask,\n- self.eal_param,\n- portMask,\n- execution[\"nprocs\"],\n- ),\n- \"Finished Process Init\",\n- 20,\n- )\n- self.dut.send_expect(\"^Z\", \"\\r\\n\")\n- self.dut.send_expect(\"bg\", \"# \")\n-\n- for n in range(execution[\"nprocs\"]):\n- time.sleep(5)\n- # use next core as mp_client core, different from mp_server\n- coreMask = utils.create_mask([str(int(coreList[n]) + 1)])\n- self.dut.send_expect(\n- self.app_mp_client\n- + \" -n %d -c %s --proc-type=secondary %s -- -n %d\"\n- % (self.dut.get_memory_channels(), coreMask, self.eal_param, n),\n- \"Finished Process Init\",\n- )\n- self.dut.send_expect(\"^Z\", \"\\r\\n\")\n- self.dut.send_expect(\"bg\", \"# \")\n-\n- tgenInput = []\n- tgenInput.append([txPort, rxPort, pcap])\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- tgenInput, 100, None, self.tester.pktgen\n- )\n- _, pps = self.tester.pktgen.measure_throughput(stream_ids=streams)\n-\n- execution[\"pps\"] = pps\n- self.dut.kill_all()\n- time.sleep(5)\n-\n- for n in range(len(executions)):\n- self.verify(executions[n][\"pps\"] is not 0, \"No traffic detected\")\n-\n- self.result_table_create(\n- [\n- \"Server threads\",\n- \"Server Cores/Threads\",\n- \"Num-procs\",\n- \"Sockets/Cores/Threads\",\n- \"Num Ports\",\n- \"Frame Size\",\n- \"%-age Line Rate\",\n- \"Packet Rate(mpps)\",\n- ]\n- )\n-\n- for execution in validExecutions:\n- self.result_table_add(\n- [\n- 1,\n- \"1S/1C/1T\",\n- execution[\"nprocs\"],\n- execution[\"cores\"],\n- 2,\n- 64,\n- execution[\"pps\"] / float(100000000 / (8 * 84)),\n- execution[\"pps\"] / float(1000000),\n- ]\n- )\n-\n- self.result_table_print()\n-\n def set_fields(self):\n \"\"\"set ip protocol field behavior\"\"\"\n fields_config = {\ndiff --git a/tests/TestSuite_perf_multiprocess.py b/tests/TestSuite_perf_multiprocess.py\nnew file mode 100644\nindex 00000000..d03bb2f6\n--- /dev/null\n+++ b/tests/TestSuite_perf_multiprocess.py\n@@ -0,0 +1,333 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2010-2014 Intel Corporation\n+#\n+\n+\"\"\"\n+DPDK Test suite.\n+Multi-process Test.\n+\"\"\"\n+\n+import copy\n+import os\n+import random\n+import re\n+import time\n+import traceback\n+from collections import OrderedDict\n+\n+import framework.utils as utils\n+from framework.exception import VerifyFailure\n+from framework.packet import Packet\n+from framework.pktgen import PacketGeneratorHelper\n+from framework.pmd_output import PmdOutput\n+from framework.test_case import TestCase, check_supported_nic\n+from framework.utils import GREEN, RED\n+\n+from .rte_flow_common import FdirProcessing as fdirprocess\n+from .rte_flow_common import RssProcessing as rssprocess\n+\n+executions = []\n+\n+\n+class TestMultiprocess(TestCase):\n+\n+ support_nic = [\"ICE_100G-E810C_QSFP\", \"ICE_25G-E810C_SFP\", \"ICE_25G-E810_XXV_SFP\"]\n+\n+ def set_up_all(self):\n+ \"\"\"\n+ Run at the start of each test suite.\n+\n+ Multiprocess prerequisites.\n+ Requirements:\n+ OS is not freeBSD\n+ DUT core number >= 4\n+ multi_process build pass\n+ \"\"\"\n+ # self.verify('bsdapp' not in self.target, \"Multiprocess not support freebsd\")\n+\n+ self.verify(len(self.dut.get_all_cores()) >= 4, \"Not enough Cores\")\n+ self.pkt = Packet()\n+ self.dut_ports = self.dut.get_ports()\n+ self.socket = self.dut.get_numa_id(self.dut_ports[0])\n+ extra_option = \"-Dexamples='multi_process/client_server_mp/mp_server,multi_process/client_server_mp/mp_client,multi_process/simple_mp,multi_process/symmetric_mp'\"\n+ self.dut.build_install_dpdk(target=self.target, extra_options=extra_option)\n+ self.app_mp_client = self.dut.apps_name[\"mp_client\"]\n+ self.app_mp_server = self.dut.apps_name[\"mp_server\"]\n+ self.app_simple_mp = self.dut.apps_name[\"simple_mp\"]\n+ self.app_symmetric_mp = self.dut.apps_name[\"symmetric_mp\"]\n+\n+ executions.append({\"nprocs\": 1, \"cores\": \"1S/1C/1T\", \"pps\": 0})\n+ executions.append({\"nprocs\": 2, \"cores\": \"1S/1C/2T\", \"pps\": 0})\n+ executions.append({\"nprocs\": 2, \"cores\": \"1S/2C/1T\", \"pps\": 0})\n+ executions.append({\"nprocs\": 4, \"cores\": \"1S/2C/2T\", \"pps\": 0})\n+ executions.append({\"nprocs\": 4, \"cores\": \"1S/4C/1T\", \"pps\": 0})\n+ executions.append({\"nprocs\": 8, \"cores\": \"1S/4C/2T\", \"pps\": 0})\n+\n+ self.eal_param = \"\"\n+ for i in self.dut_ports:\n+ self.eal_param += \" -a %s\" % self.dut.ports_info[i][\"pci\"]\n+\n+ self.eal_para = self.dut.create_eal_parameters(cores=\"1S/2C/1T\")\n+ # start new session to run secondary\n+ self.session_secondary = self.dut.new_session()\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+ self.dport_info0 = self.dut.ports_info[self.dut_ports[0]]\n+ self.pci0 = self.dport_info0[\"pci\"]\n+ self.tester_ifaces = [\n+ self.tester.get_interface(self.dut.ports_map[port])\n+ for port in self.dut_ports\n+ ]\n+ rxq = 1\n+ self.session_list = []\n+ self.logfmt = \"*\" * 20\n+\n+ def set_up(self):\n+ \"\"\"\n+ Run before each test case.\n+ \"\"\"\n+ pass\n+\n+ def test_perf_multiprocess_performance(self):\n+ \"\"\"\n+ Benchmark Multiprocess performance.\n+ #\"\"\"\n+ packet_count = 16\n+ self.dut.send_expect(\"fg\", \"# \")\n+ txPort = self.tester.get_local_port(self.dut_ports[0])\n+ rxPort = self.tester.get_local_port(self.dut_ports[1])\n+ mac = self.tester.get_mac(txPort)\n+ dmac = self.dut.get_mac_address(self.dut_ports[0])\n+ tgenInput = []\n+\n+ # create mutative src_ip+dst_ip package\n+ for i in range(packet_count):\n+ package = (\n+ r'flows = [Ether(src=\"%s\", dst=\"%s\")/IP(src=\"192.168.1.%d\", dst=\"192.168.1.%d\")/(\"X\"*26)]'\n+ % (mac, dmac, i + 1, i + 2)\n+ )\n+ self.tester.scapy_append(package)\n+ pcap = os.sep.join([self.output_path, \"test_%d.pcap\" % i])\n+ self.tester.scapy_append('wrpcap(\"%s\", flows)' % pcap)\n+ tgenInput.append([txPort, rxPort, pcap])\n+ self.tester.scapy_execute()\n+\n+ # run multiple symmetric_mp process\n+ validExecutions = []\n+ for execution in executions:\n+ if len(self.dut.get_core_list(execution[\"cores\"])) == execution[\"nprocs\"]:\n+ validExecutions.append(execution)\n+\n+ portMask = utils.create_mask(self.dut_ports)\n+\n+ for n in range(len(validExecutions)):\n+ execution = validExecutions[n]\n+ # get coreList form execution['cores']\n+ coreList = self.dut.get_core_list(execution[\"cores\"], socket=self.socket)\n+ # to run a set of symmetric_mp instances, like test plan\n+ dutSessionList = []\n+ for index in range(len(coreList)):\n+ dut_new_session = self.dut.new_session()\n+ dutSessionList.append(dut_new_session)\n+ # add -a option when tester and dut in same server\n+ dut_new_session.send_expect(\n+ self.app_symmetric_mp\n+ + \" -c %s --proc-type=auto %s -- -p %s --num-procs=%d --proc-id=%d\"\n+ % (\n+ utils.create_mask([coreList[index]]),\n+ self.eal_param,\n+ portMask,\n+ execution[\"nprocs\"],\n+ index,\n+ ),\n+ \"Finished Process Init\",\n+ )\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+ tgenInput, 100, None, self.tester.pktgen\n+ )\n+ _, pps = self.tester.pktgen.measure_throughput(stream_ids=streams)\n+\n+ execution[\"pps\"] = pps\n+\n+ # close all symmetric_mp process\n+ self.dut.send_expect(\"killall symmetric_mp\", \"# \")\n+ # close all dut sessions\n+ for dut_session in dutSessionList:\n+ self.dut.close_session(dut_session)\n+\n+ # get rate and mpps data\n+ for n in range(len(executions)):\n+ self.verify(executions[n][\"pps\"] is not 0, \"No traffic detected\")\n+ self.result_table_create(\n+ [\n+ \"Num-procs\",\n+ \"Sockets/Cores/Threads\",\n+ \"Num Ports\",\n+ \"Frame Size\",\n+ \"%-age Line Rate\",\n+ \"Packet Rate(mpps)\",\n+ ]\n+ )\n+\n+ for execution in validExecutions:\n+ self.result_table_add(\n+ [\n+ execution[\"nprocs\"],\n+ execution[\"cores\"],\n+ 2,\n+ 64,\n+ execution[\"pps\"] / float(100000000 / (8 * 84)),\n+ execution[\"pps\"] / float(1000000),\n+ ]\n+ )\n+\n+ self.result_table_print()\n+\n+ def test_perf_multiprocess_client_serverperformance(self):\n+ \"\"\"\n+ Benchmark Multiprocess client-server performance.\n+ \"\"\"\n+ self.dut.kill_all()\n+ self.dut.send_expect(\"fg\", \"# \")\n+ txPort = self.tester.get_local_port(self.dut_ports[0])\n+ rxPort = self.tester.get_local_port(self.dut_ports[1])\n+ mac = self.tester.get_mac(txPort)\n+\n+ self.tester.scapy_append(\n+ 'dmac=\"%s\"' % self.dut.get_mac_address(self.dut_ports[0])\n+ )\n+ self.tester.scapy_append('smac=\"%s\"' % mac)\n+ self.tester.scapy_append(\n+ 'flows = [Ether(src=smac, dst=dmac)/IP(src=\"192.168.1.1\", dst=\"192.168.1.1\")/(\"X\"*26)]'\n+ )\n+\n+ pcap = os.sep.join([self.output_path, \"test.pcap\"])\n+ self.tester.scapy_append('wrpcap(\"%s\", flows)' % pcap)\n+ self.tester.scapy_execute()\n+\n+ validExecutions = []\n+ for execution in executions:\n+ if len(self.dut.get_core_list(execution[\"cores\"])) == execution[\"nprocs\"]:\n+ validExecutions.append(execution)\n+\n+ for execution in validExecutions:\n+ coreList = self.dut.get_core_list(execution[\"cores\"], socket=self.socket)\n+ # get core with socket parameter to specified which core dut used when tester and dut in same server\n+ coreMask = utils.create_mask(\n+ self.dut.get_core_list(\"1S/1C/1T\", socket=self.socket)\n+ )\n+ portMask = utils.create_mask(self.dut_ports)\n+ # specified mp_server core and add -a option when tester and dut in same server\n+ self.dut.send_expect(\n+ self.app_mp_server\n+ + \" -n %d -c %s %s -- -p %s -n %d\"\n+ % (\n+ self.dut.get_memory_channels(),\n+ coreMask,\n+ self.eal_param,\n+ portMask,\n+ execution[\"nprocs\"],\n+ ),\n+ \"Finished Process Init\",\n+ 20,\n+ )\n+ self.dut.send_expect(\"^Z\", \"\\r\\n\")\n+ self.dut.send_expect(\"bg\", \"# \")\n+\n+ for n in range(execution[\"nprocs\"]):\n+ time.sleep(5)\n+ # use next core as mp_client core, different from mp_server\n+ coreMask = utils.create_mask([str(int(coreList[n]) + 1)])\n+ self.dut.send_expect(\n+ self.app_mp_client\n+ + \" -n %d -c %s --proc-type=secondary %s -- -n %d\"\n+ % (self.dut.get_memory_channels(), coreMask, self.eal_param, n),\n+ \"Finished Process Init\",\n+ )\n+ self.dut.send_expect(\"^Z\", \"\\r\\n\")\n+ self.dut.send_expect(\"bg\", \"# \")\n+\n+ tgenInput = []\n+ tgenInput.append([txPort, rxPort, pcap])\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+ tgenInput, 100, None, self.tester.pktgen\n+ )\n+ _, pps = self.tester.pktgen.measure_throughput(stream_ids=streams)\n+\n+ execution[\"pps\"] = pps\n+ self.dut.kill_all()\n+ time.sleep(5)\n+\n+ for n in range(len(executions)):\n+ self.verify(executions[n][\"pps\"] is not 0, \"No traffic detected\")\n+\n+ self.result_table_create(\n+ [\n+ \"Server threads\",\n+ \"Server Cores/Threads\",\n+ \"Num-procs\",\n+ \"Sockets/Cores/Threads\",\n+ \"Num Ports\",\n+ \"Frame Size\",\n+ \"%-age Line Rate\",\n+ \"Packet Rate(mpps)\",\n+ ]\n+ )\n+\n+ for execution in validExecutions:\n+ self.result_table_add(\n+ [\n+ 1,\n+ \"1S/1C/1T\",\n+ execution[\"nprocs\"],\n+ execution[\"cores\"],\n+ 2,\n+ 64,\n+ execution[\"pps\"] / float(100000000 / (8 * 84)),\n+ execution[\"pps\"] / float(1000000),\n+ ]\n+ )\n+\n+ self.result_table_print()\n+\n+ def set_fields(self):\n+ \"\"\"set ip protocol field behavior\"\"\"\n+ fields_config = {\n+ \"ip\": {\n+ \"src\": {\"range\": 64, \"action\": \"inc\"},\n+ \"dst\": {\"range\": 64, \"action\": \"inc\"},\n+ },\n+ }\n+\n+ return fields_config\n+\n+ def tear_down(self):\n+ \"\"\"\n+ Run after each test case.\n+ \"\"\"\n+ if self.session_list:\n+ for sess in self.session_list:\n+ self.dut.close_session(sess)\n+ self.dut.kill_all()\n+\n+ def tear_down_all(self):\n+ \"\"\"\n+ Run after each test suite.\n+ \"\"\"\n+ self.dut.kill_all()\n+ pass\n", "prefixes": [ "V1", "7/7" ] }{ "id": 116624, "url": "