get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/124685/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 124685,
    "url": "http://patchwork.dpdk.org/api/patches/124685/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dts/patch/20230302093349.1044243-1-weix.ling@intel.com/",
    "project": {
        "id": 3,
        "url": "http://patchwork.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": "<20230302093349.1044243-1-weix.ling@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dts/20230302093349.1044243-1-weix.ling@intel.com",
    "date": "2023-03-02T09:33:49",
    "name": "[V1] dsa: add new dsa test_plans and testsuite",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "c9e21ff8a87aa25bf5d33ba624178e0cf701cab8",
    "submitter": {
        "id": 1828,
        "url": "http://patchwork.dpdk.org/api/people/1828/?format=api",
        "name": "Ling, WeiX",
        "email": "weix.ling@intel.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.dpdk.org/project/dts/patch/20230302093349.1044243-1-weix.ling@intel.com/mbox/",
    "series": [
        {
            "id": 27223,
            "url": "http://patchwork.dpdk.org/api/series/27223/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dts/list/?series=27223",
            "date": "2023-03-02T09:33:49",
            "name": "[V1] dsa: add new dsa test_plans and testsuite",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/27223/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/124685/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/124685/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 8E8CA41D3D;\n\tThu,  2 Mar 2023 10:45:20 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8A88740E2D;\n\tThu,  2 Mar 2023 10:45:20 +0100 (CET)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id 651DD40DFB\n for <dts@dpdk.org>; Thu,  2 Mar 2023 10:45:18 +0100 (CET)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 02 Mar 2023 01:45:05 -0800",
            "from unknown (HELO localhost.localdomain) ([10.239.252.222])\n by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 02 Mar 2023 01:45:03 -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=1677750318; x=1709286318;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=+AxRRT0uibxQqkiwSJa2Bs+2e8I09PJM3zImyYdnL0E=;\n b=A/M+dVQ1zZ6YPfadE7uGYKZ7H76iEHx200/MRq40adumdGC64VLxZz3h\n APHWOq7Y+m24EzuNJkVoxPybuyrZcV7aXJ5xfcgJNbEWJ9ZZeGawoMxg7\n iQRJV46JR6fecDZBrBdh3dLD+o3tjHVdICtZ6ZO7SVKatm/kKOr4uHyJU\n OBPyox/z8wwX5PhWbixz0KTmWk49vu4zEDxNHfLebV/84AZxZfA6uM8vs\n fYBXKcUerlZNJeoOpwsX/38FrwXBGa6KQDDZo9zuHQ+FGKQiuEnno69sF\n fn7epXPBquo9stUBlUhfd2O71qJ5h2vh8dEu/4IRXIZCD/Z5x1D0zmrcW A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10636\"; a=\"333403089\"",
            "E=Sophos;i=\"5.98,227,1673942400\"; d=\"scan'208\";a=\"333403089\"",
            "E=McAfee;i=\"6500,9779,10636\"; a=\"920606998\"",
            "E=Sophos;i=\"5.98,227,1673942400\"; d=\"scan'208\";a=\"920606998\""
        ],
        "From": "Wei Ling <weix.ling@intel.com>",
        "To": "dts@dpdk.org",
        "Cc": "Wei Ling <weix.ling@intel.com>",
        "Subject": "[dts][PATCH V1] dsa: add new dsa test_plans and testsuite",
        "Date": "Thu,  2 Mar 2023 17:33:49 +0800",
        "Message-Id": "<20230302093349.1044243-1-weix.ling@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "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": "Add new dsa test_plans and testsuite to test dpdk-dma application\nand example of how to use the DMAdev API to make a packet copy\napplication use DSA channel with DPDK driver and Kernel driver.\n\nSigned-off-by: Wei Ling <weix.ling@intel.com>\n---\n test_plans/dsa_test_plan.rst | 353 +++++++++++++++++++++++++\n test_plans/index.rst         |   1 +\n tests/TestSuite_dsa.py       | 485 +++++++++++++++++++++++++++++++++++\n 3 files changed, 839 insertions(+)\n create mode 100644 test_plans/dsa_test_plan.rst\n create mode 100644 tests/TestSuite_dsa.py",
    "diff": "diff --git a/test_plans/dsa_test_plan.rst b/test_plans/dsa_test_plan.rst\nnew file mode 100644\nindex 00000000..9e5eb6c7\n--- /dev/null\n+++ b/test_plans/dsa_test_plan.rst\n@@ -0,0 +1,353 @@\n+.. SPDX-License-Identifier: BSD-3-Clause\n+   Copyright(c) 2023 Intel Corporation\n+\n+=============\n+DSA test plan\n+=============\n+\n+Description\n+===========\n+\n+This sample is intended as a demonstration of the basic components of a DPDK\n+forwarding application and example of how to use the DMAdev API to make a packet\n+copy application.\n+\n+Also while forwarding, the MAC addresses are affected as follows:\n+\n+*   The source MAC address is replaced by the TX port MAC address\n+\n+*   The destination MAC address is replaced by  02:00:00:00:00:TX_PORT_ID\n+\n+This application can be used to compare performance of using software packet\n+copy with copy done using a DMA device for different sizes of packets.\n+The example will print out statistics each second. The stats shows\n+received/send packets and packets dropped or failed to copy.\n+\n+In order to run the hardware copy application, the copying device\n+needs to be bound to user-space IO driver.\n+\n+Refer to the \"DMAdev library\" chapter in the \"Programmers guide\" for information\n+on using the library.\n+\n+The application requires a number of command line options:\n+\n+.. code-block:: console\n+\n+    ./<build_dir>/examples/dpdk-dma [EAL options] -- [-p MASK] [-q NQ] [-s RS] [-c <sw|hw>]\n+        [--[no-]mac-updating] [-b BS] [-f FS] [-i SI]\n+\n+where,\n+\n+*   p MASK: A hexadecimal bitmask of the ports to configure (default is all)\n+\n+*   q NQ: Number of Rx queues used per port equivalent to DMA channels\n+    per port (default is 1)\n+\n+*   c CT: Performed packet copy type: software (sw) or hardware using\n+    DMA (hw) (default is hw)\n+\n+*   s RS: Size of dmadev descriptor ring for hardware copy mode or rte_ring for\n+    software copy mode (default is 2048)\n+\n+*   --[no-]mac-updating: Whether MAC address of packets should be changed\n+    or not (default is mac-updating)\n+\n+*   b BS: set the DMA batch size\n+\n+*   f FS: set the max frame size\n+\n+*   i SI: set the interval, in second, between statistics prints (default is 1)\n+\n+The application can be launched in various configurations depending on\n+provided parameters. The app can use up to 2 lcores: one of them receives\n+incoming traffic and makes a copy of each packet. The second lcore then\n+updates MAC address and sends the copy. If one lcore per port is used,\n+both operations are done sequentially. For each configuration an additional\n+lcore is needed since the main lcore does not handle traffic but is\n+responsible for configuration, statistics printing and safe shutdown of\n+all ports and devices.\n+\n+The application can use a maximum of 8 ports.\n+\n+To run the application in a Linux environment with 3 lcores (the main lcore,\n+plus two forwarding cores), a single port (port 0), software copying and MAC\n+updating issue the command:\n+\n+    $ ./<build_dir>/examples/dpdk-dma -l 0-2 -n 2 -- -p 0x1 --mac-updating -c sw\n+\n+To run the application in a Linux environment with 2 lcores (the main lcore,\n+plus one forwarding core), 2 ports (ports 0 and 1), hardware copying and no MAC\n+updating issue the command:\n+\n+    $ ./<build_dir>/examples/dpdk-dma -l 0-1 -n 1 -- -p 0x3 --no-mac-updating -c hw\n+\n+Prerequisites\n+=============\n+\n+Test flow\n+---------\n+    \n+NIC RX -> copy packet -> free original -> update mac addresses -> NIC TX\n+\n+General set up\n+--------------\n+1. Compile DPDK::\n+\n+    # CC=gcc meson --werror -Denable_kmods=True -Dlibdir=lib -Dexamples=all --default-library=static <dpdk build dir>\n+    # ninja -C <dpdk build dir> -j 110\n+    For example:\n+    CC=gcc meson --werror -Denable_kmods=True -Dlibdir=lib -Dexamples=all --default-library=static x86_64-native-linuxapp-gcc\n+    ninja -C x86_64-native-linuxapp-gcc -j 110\n+\n+Test case\n+=========\n+\n+Test Case 1: DMA basic test with differnet size packets using DSA dpdk driver\n+-----------------------------------------------------------------------------\n+\n+1.Bind 1 DSA port and 1 NIC port to vfio-pci driver.\n+\n+2.Launch dma app::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-1 -n 2 -a 0000:29:00.0 -a 0000:6a:01.0,max_queues=1 -- -p 0x1 -q 1 --mac-updating -c hw\n+\n+3.Send different size packets (64B, 256B, 512B, 1024B, IMIX) from TG to NIC.\n+\n+4.Check performance from “Total packets Tx” and check log includes \"Worker Threads = 1, Copy Mode = hw\".\n+\n+Test Case 2: DMA test with multi-threads using DSA dpdk driver\n+--------------------------------------------------------------\n+\n+1.Bind 1 DSA port and 1 NIC port to vfio-pci driver.\n+\n+2.Launch dma app with three cores::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-2 -n 2 -a 0000:29:00.0 -a 0000:6a:01.0,max_queues=1 -- -p 0x1 -q 1 --mac-updating -c hw\n+\n+3. Send different size packets from TG to NIC.\n+\n+4.Check performance from “Total packets Tx” and check log includes \"Worker Threads = 2, Copy Mode = hw\".\n+\n+Test Case 3: DMA test with multi NIC ports using DSA dpdk driver\n+----------------------------------------------------------------\n+\n+1.Bind 1 DSA port and 2 NIC ports to vfio-pci driver.\n+\n+2.Launch dma app with multi-ports::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-4 -n 2 -a 0000:29:00.0 -a 0000:29:00.1 -a 0000:6a:01.0,max_queues=2 -- -p 0x3 -q 1 --mac-updating -c hw\n+\n+3.Send different size packets (64B, 256B, 512B, 1024B, IMIX) from TG to two NIC ports.\n+\n+4.Check stats of two ports, each port's performance shows in “Total packets Tx” and each port's log includes \"Worker Threads = 2, Copy Mode = hw\".\n+\n+Test Case 4: DMA test with multi-queues using DSA dpdk driver\n+-------------------------------------------------------------\n+\n+1.Bind 1 DSA port and 1 NIC port to vfio-pci driver.\n+\n+2.Launch dma app with multi-queues::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-2 -n 2 -a 0000:29:00.0 -a 0000:6a:01.0,max_queues=2 -- -p 0x1 -q 1 --mac-updating -c hw\n+\n+3. Send random ip packets (64B, 256B, 512B, 1024B, IMIX) from TG to NIC port.\n+\n+4. Check stats of dma app, \"Worker Threads = 2, Copy Mode = hw, Rx Queues = 2\" and each dma channel can enqueue packets.\n+\n+5. Repeat step2 to step4 with queue number 4 and qemu number 8, at the same time, set max_queues equal to queue number.\n+Check performance gains status when queue numbers added.\n+\n+Test Case 5: DMA performance comparison between mac-updating and no-mac-updating using DSA dpdk driver\n+------------------------------------------------------------------------------------------------------\n+\n+1.Bind 1 DSA port and 1 NIC port to vfio-pci driver.\n+\n+2.Launch dma app::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-1 -n 2 -a 0000:29:00.0 -a 0000:6a:01.0,max_queues=2 -- -p 0x1 -q 2 --no-mac-updating -c hw\n+\n+3. Send random ip packets (64B, 256B, 512B, 1024B, IMIX) from TG to NIC port.\n+\n+4. Check performance from dma app::\n+\n+    Total packets Tx:                   xxx [pps]\n+\n+5.Launch dma app::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-1 -n 2 -a 0000:29:00.0 -a 0000:6a:01.0,max_queues=2 -- -p 0x1 -q 2 --mac-updating -c hw\n+\n+6. Send random ip packets (64B, 256B, 512B, 1024B, IMIX) from TG to NIC port.\n+\n+7. Check performance from dma app::\n+\n+    Total packets Tx:                   xxx [pps]\n+  \n+Test Case 6: DMA performance comparison between SW copies and HW copies using DSA dpdk driver  \n+---------------------------------------------------------------------------------------------\n+\n+1.Bind 1 DSA port and 1 NIC port to vfio-pci driver.\n+\n+2.Launch dma app with SW mode::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-2 -n 2 -a 0000:29:00.0 -a 0000:6a:01.0,max_queues=4 -- -p 0x1 -q 4 --mac-updating  -c sw\n+\n+3. Send random ip packets with different packet size,includes [64, 128, 256, 512, 1024, 1518] from TG.\n+\n+4. Check performance from dma app::\n+\n+    Total packets Tx:                   xxx [pps]\n+\n+5.Launch dma app with HW mode::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-2 -n 2 -a 0000:29:00.0 -a 0000:6a:01.0,max_queues=4 -- -p 0x1 -q 4 --mac-updating -c hw\n+\n+6. Send random ip packets with different packet size,includes [64, 128, 256, 512, 1024, 1518] from TG.\n+\n+7. Check performance from dma app and compare with hw copy test::\n+\n+    Total packets Tx:                   xxx [pps]\n+\n+Test Case 7: DMA basic test with differnet size packets using DSA kernel driver\n+-------------------------------------------------------------------------------\n+\n+1.Bind 1 DSA port to idxd driver and 1 NIC port to vfio-pci driver::\n+\n+   <dpdk dir># ./usertools/dpdk-devbind.py -b vfio-pci 29:00.0\n+\n+   ls /dev/dsa #check wq configure, reset if exist\n+   <dpdk dir># ./usertools/dpdk-devbind.py -u 6a:01.0\n+   <dpdk dir># ./usertools/dpdk-devbind.py -b idxd 6a:01.0\n+   ./drivers/dma/idxd/dpdk_idxd_cfg.py -q 1 0\n+   ls /dev/dsa #check wq configure success\n+\n+2.Launch dma app::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-1 -n 2 -a 0000:29:00.0 -a wq0.0 -- -p 0x1 -q 1 --mac-updating -c hw\n+\n+3.Send different size packets (64B, 256B, 512B, 1024B, IMIX) from TG to NIC.\n+\n+4.Check performance from “Total packets Tx” and check log includes \"Worker Threads = 1, Copy Mode = hw\".\n+\n+Test Case 8: DMA test with multi-threads using DSA kernel driver\n+----------------------------------------------------------------\n+\n+1.Bind 1 DSA port to idxd driver and 1 NIC port to vfio-pci driver.\n+\n+2.Launch dma app with three cores::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-2 -n 2 -a 0000:29:00.0 -a wq0.0 -- -p 0x1 -q 1 --mac-updating -c hw\n+\n+3. Send different size packets from TG to NIC.\n+\n+4.Check performance from “Total packets Tx” and check log includes \"Worker Threads = 2, Copy Mode = hw\".\n+\n+Test Case 9: DMA test with multi NIC ports using DSA kernel driver\n+------------------------------------------------------------------\n+\n+1.Bind 1 DSA port to idxd driver and two NIC ports to vfio-pci driver::\n+\n+   <dpdk dir># ./usertools/dpdk-devbind.py -b vfio-pci 29:00.0\n+\n+   ls /dev/dsa #check wq configure, reset if exist\n+   <dpdk dir># ./usertools/dpdk-devbind.py -u 6a:01.0\n+   <dpdk dir># ./usertools/dpdk-devbind.py -b idxd 6a:01.0\n+   ./drivers/dma/idxd/dpdk_idxd_cfg.py -q 2 0\n+   ls /dev/dsa #check wq configure success\n+\n+2.Launch dma app with multi-ports::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-4 -n 2 -a 0000:29:00.0 -a 0000:29:00.1 -a wq0.0 -a wq0.1 -- -p 0x3 -q 1 --mac-updating -c hw\n+\n+3.Send different size packets (64B, 256B, 512B, 1024B, IMIX) from TG to two NIC ports.\n+\n+4.Check stats of two ports, each port's performance shows in “Total packets Tx” and each port's log includes \"Worker Threads = 2, Copy Mode = hw\".\n+\n+Test Case 10: DMA test with multi-queues using DSA kernel driver\n+----------------------------------------------------------------\n+\n+1.Bind 1 DSA port to idxd driver and 1 NIC port to vfio-pci driver::\n+\n+   <dpdk dir># ./usertools/dpdk-devbind.py -b vfio-pci 29:00.0\n+\n+   ls /dev/dsa #check wq configure, reset if exist\n+   <dpdk dir># ./usertools/dpdk-devbind.py -u 6a:01.0\n+   <dpdk dir># ./usertools/dpdk-devbind.py -b idxd 6a:01.0\n+   ./drivers/dma/idxd/dpdk_idxd_cfg.py -q 2 0\n+   ls /dev/dsa #check wq configure success\n+\n+2.Launch dma app with multi-queues::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-2 -n 2 -a 0000:29:00.0 -a wq0.0 -a wq0.1 -- -p 0x1 -q 2 --mac-updating -c hw\n+\n+3. Send random ip packets (64B, 256B, 512B, 1024B, IMIX) from TG to NIC port.\n+\n+4. Check stats of dma app, \"Worker Threads = 2, Copy Mode = hw, Rx Queues = 2\" and each dma channel can enqueue packets.\n+\n+5. Repeat step2 to step4 with queue number 4 and qemu number 8, at the same time, reset and create WQ with the same number of queue numbers.\n+Check performance gains status when queue numbers added.\n+\n+Test Case 11: DMA performance comparison between mac-updating and no-mac-updating using DSA kernel driver\n+---------------------------------------------------------------------------------------------------------\n+\n+1.Bind 1 DSA port to idxd driver and 1 NIC port to vfio-pci driver::\n+\n+   <dpdk dir># ./usertools/dpdk-devbind.py -b vfio-pci 29:00.0\n+\n+   ls /dev/dsa #check wq configure, reset if exist\n+   <dpdk dir># ./usertools/dpdk-devbind.py -u 6a:01.0\n+   <dpdk dir># ./usertools/dpdk-devbind.py -b idxd 6a:01.0\n+   ./drivers/dma/idxd/dpdk_idxd_cfg.py -q 2 0\n+   ls /dev/dsa #check wq configure success\n+\n+2.Launch dma app::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-1 -n 2 -a 0000:29:00.0 -a wq0.0 -a wq0.1 -- -p 0x1 -q 2 --no-mac-updating -c hw\n+\n+3. Send random ip 64B packets from TG.\n+\n+4. Check performance from dma app::\n+\n+    Total packets Tx:                   xxx [pps]\n+\n+5.Launch dma app::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-1 -n 2 -a 0000:29:00.0 -a wq0.0 -a wq0.1 -- -p 0x1 -q 2 --mac-updating -c hw\n+\n+6. Send random ip 64B packets from TG.\n+\n+7. Check performance from dma app::\n+\n+    Total packets Tx:                   xxx [pps]\n+\n+Test Case 12: DMA performance comparison between SW copies and HW copies using DSA kernel driver  \n+------------------------------------------------------------------------------------------------\n+\n+1.Bind 1 DSA port to idxd driver and 1 NIC port to vfio-pci driver::\n+\n+   <dpdk dir># ./usertools/dpdk-devbind.py -b vfio-pci 29:00.0\n+\n+   ls /dev/dsa #check wq configure, reset if exist\n+   <dpdk dir># ./usertools/dpdk-devbind.py -u 6a:01.0\n+   <dpdk dir># ./usertools/dpdk-devbind.py -b idxd 6a:01.0\n+   ./drivers/dma/idxd/dpdk_idxd_cfg.py -q 4 0\n+   ls /dev/dsa #check wq configure success\n+\n+2.Launch dma app with SW mode::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-2 -n 2 -a 0000:29:00.0 -a wq0.0 -a wq0.1 -a wq0.2 -a wq0.3 -- -p 0x1 -q 4 --mac-updating  -c sw\n+\n+3. Send random ip packets with different packet size,includes [64, 128, 256, 512, 1024, 1518] from TG.\n+\n+4. Check performance from dma app::\n+\n+    Total packets Tx:                   xxx [pps]\n+\n+5.Launch dma app with HW mode::\n+\n+   ./x86_64-native-linuxapp-gcc/examples/dpdk-dma -l 0-2 -n 2 -a 0000:29:00.0 -a wq0.0 -a wq0.1 -a wq0.2 -a wq0.3 -- -p 0x1 -q 4 --mac-updating -c hw\n+\n+6. Send random ip packets with different packet size,includes [64, 128, 256, 512, 1024, 1518] from TG.\n+\n+7. Check performance from dma app and compare with hw copy test::\n+\n+    Total packets Tx:                   xxx [pps]\ndiff --git a/test_plans/index.rst b/test_plans/index.rst\nindex ea13fc8e..eeb3e719 100644\n--- a/test_plans/index.rst\n+++ b/test_plans/index.rst\n@@ -284,6 +284,7 @@ The following are the test plans for the DPDK DTS automated test system.\n     flow_filtering_test_plan\n     af_xdp_test_plan\n     cbdma_test_plan\n+    dsa_test_plan\n     flexible_rxd_test_plan\n     ipsec_gw_and_library_test_plan\n     port_control_test_plan\ndiff --git a/tests/TestSuite_dsa.py b/tests/TestSuite_dsa.py\nnew file mode 100644\nindex 00000000..1291dc68\n--- /dev/null\n+++ b/tests/TestSuite_dsa.py\n@@ -0,0 +1,485 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2023 Intel Corporation\n+#\n+\n+import re\n+import time\n+\n+from framework.packet import Packet\n+from framework.pktgen import TRANSMIT_CONT\n+from framework.test_case import TestCase\n+\n+from .virtio_common import dsa_common as DC\n+\n+\n+class TestDSA(TestCase):\n+    def set_up_all(self):\n+        \"\"\"\n+        Run at the start of each test suite.\n+        \"\"\"\n+        self.frame_sizes = [64, 256, 512, 1024, 1518]\n+        self.dut_ports = self.dut.get_ports()\n+        self.verify(len(self.dut_ports) >= 1, \"Insufficient ports for testing\")\n+        self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])\n+        out = self.dut.build_dpdk_apps(\"./examples/dma\")\n+        self.verify(\"Error\" not in out, \"compilation dma error\")\n+        self.dma_path = self.dut.apps_name[\"dma\"]\n+        self.dma_name = self.dma_path.split(\"/\")[-1]\n+        self.core_num = 1\n+        self.DC = DC(self)\n+\n+    def set_up(self):\n+        \"\"\"\n+        Run before each test case.\n+        \"\"\"\n+        # Prepare the result table\n+        self.table_header = [\"Frame\"]\n+        self.table_header.append(\"Mpps\")\n+        self.table_header.append(\"Worker Threads\")\n+        self.table_header.append(\"Copy Mode\")\n+        self.table_header.append(\"Updating MAC\")\n+        self.table_header.append(\"Rx Queues\")\n+        self.table_header.append(\"% linerate\")\n+        self.result_table_create(self.table_header)\n+        self.dut.send_expect(\"killall -I %s\" % self.dma_name, \"#\", 20)\n+        self.DC.reset_all_work_queue()\n+        self.DC.bind_all_dsa_to_kernel()\n+\n+    def get_core_list(self):\n+        \"\"\"\n+        get cores list depend on self.work_thread\n+        \"\"\"\n+        core_config = \"1S/%dC/1T\" % self.core_num\n+        core_list = self.dut.get_core_list(core_config, socket=self.ports_socket)\n+        return core_list\n+\n+    def launch_dma_app(self, eal_params):\n+        \"\"\"\n+        launch dma with different params\n+        \"\"\"\n+        port_info = 0\n+        for i in range(self.nic_port_num):\n+            port_info |= 1 << i\n+        updating_mac = (\n+            \"--mac-updating\" if self.updating_mac == \"enabled\" else \"--no-mac-updating\"\n+        )\n+        rx_queues = self.rx_queues / self.nic_port_num\n+        cmd = \"%s %s -- -p %s -q %d %s -c %s\" % (\n+            self.dma_path,\n+            eal_params,\n+            hex(port_info),\n+            rx_queues,\n+            updating_mac,\n+            self.copy_mode,\n+        )\n+        expected = self.dma_path.split(\"/\")[-1].strip()\n+        self.dut.send_expect(cmd, expected)\n+        time.sleep(3)\n+        out = self.dut.get_session_output(timeout=1)\n+        self.logger.info(\"out before: {}\".format(out))\n+        \"\"\"\n+        when start DSA app, default cores num is 2, it will only one thread\n+        when the cores num > 2, there will have 2 thread, and the max value of thread\n+        num is 2.\n+        \"\"\"\n+        self.work_thread = 2 if self.core_num > 2 else 1\n+        work_thread_info = \"Worker Threads = %d\" % self.work_thread\n+        copy_mode_info = \"Copy Mode = %s\" % self.copy_mode\n+        update_mac_info = \"Updating MAC = %s\" % self.updating_mac\n+        rx_queues_info = \"Rx Queues = %d\" % rx_queues\n+        self.verify(\n+            work_thread_info in out\n+            and copy_mode_info in out\n+            and update_mac_info in out\n+            and rx_queues_info in out,\n+            \"The output info not match setting for the cmd, please check\",\n+        )\n+\n+    def config_stream(self, frame_size):\n+        stream_ids = []\n+        for port in range(self.nic_port_num):\n+            tx_port = self.tester.get_local_port(self.dut_ports[port])\n+            rx_port = tx_port\n+            if self.nic_port_num > 1:\n+                if port % self.nic_port_num == 0:\n+                    rx_port = self.tester.get_local_port(self.dut_ports[port + 1])\n+                else:\n+                    rx_port = self.tester.get_local_port(self.dut_ports[port - 1])\n+            dst_mac = self.dut.get_mac_address(self.dut_ports[port])\n+            # pkt config\n+            pkt = Packet(pkt_type=\"UDP\", pkt_len=frame_size)\n+            # pkt.config_layer(\"ether\", {\"dst\": \"%s\" % dst_mac})\n+            pkt.config_layer(\"udp\", {\"src\": 1111, \"dst\": 1112})\n+            pkt.save_pcapfile(\n+                self.tester, \"%s/dsa_%d.pcap\" % (self.tester.tmp_file, port)\n+            )\n+            stream_option = {\n+                \"pcap\": \"%s/dsa_%d.pcap\" % (self.tester.tmp_file, port),\n+                \"fields_config\": {\n+                    \"ether\": {\n+                        \"dst\": {\n+                            \"action\": \"random\",\n+                        }\n+                    },\n+                    \"ip\": {\n+                        \"src\": {\n+                            \"action\": \"random\",\n+                            \"start\": \"16.0.0.1\",\n+                            \"step\": 1,\n+                            \"end\": \"16.0.0.64\",\n+                        }\n+                    },\n+                },\n+                \"stream_config\": {\n+                    \"rate\": 100,\n+                    \"transmit_mode\": TRANSMIT_CONT,\n+                },\n+            }\n+            stream_id = self.tester.pktgen.add_stream(\n+                tx_port, tx_port, \"%s/dsa_%d.pcap\" % (self.tester.tmp_file, port)\n+            )\n+            self.tester.pktgen.config_stream(stream_id, stream_option)\n+            stream_ids.append(stream_id)\n+        return stream_ids\n+\n+    def send_and_verify(self, check_each_queue=True):\n+        \"\"\"\n+        Send packet with packet generator and verify\n+        \"\"\"\n+        for frame_size in self.frame_sizes:\n+            self.tester.pktgen.clear_streams()\n+            stream_ids = self.config_stream(frame_size)\n+            traffic_opt = {\"method\": \"throughput\", \"rate\": 100, \"duration\": 20}\n+            self.logger.info(\n+                \"start to send %d frame size packets from pktgen\" % frame_size\n+            )\n+            _, pps = self.tester.pktgen.measure(stream_ids, traffic_opt)\n+            self.verify(\n+                pps > 0,\n+                \"%s can not receive packets of frame size %d\"\n+                % (self.running_case, frame_size),\n+            )\n+            self.update_result_tables(frame_size, pps)\n+            if check_each_queue:\n+                self.check_enqueue_packets_of_each_channel()\n+\n+    def check_enqueue_packets_of_each_channel(self):\n+        \"\"\"\n+        Check stats of dma app, each dma channel can enqueue packets\n+        \"\"\"\n+        out = self.dut.get_session_output(timeout=2)\n+        index = out.rfind(\"Statistics for port 0\")\n+        out = out[index:]\n+        data_info = re.findall(\"Total completed ops:\\s*(\\d*)\", out)\n+        self.verify(\n+            (len(data_info) - 1) == self.rx_queues,\n+            \"There miss some queue, the run queue is \"\n+            \"%d, and expect queue num is %d\" % ((len(data_info) - 1), self.rx_queues),\n+        )\n+        for index in range(self.rx_queues):\n+            self.verify(\n+                data_info[index] != 0, \"the queue %d can not enqueues data\" % index\n+            )\n+\n+    def update_result_tables(self, frame_size, pps):\n+        Mpps = pps / 1000000.0\n+        linerate = (\n+            Mpps * 100 / float(self.wirespeed(self.nic, frame_size, self.nic_port_num))\n+        )\n+        self.work_thread = 2 if self.core_num > 2 else 1\n+        results_row = [frame_size]\n+        results_row.append(Mpps)\n+        results_row.append(self.work_thread)\n+        results_row.append(self.copy_mode)\n+        results_row.append(self.updating_mac)\n+        results_row.append(self.rx_queues / self.nic_port_num)\n+        results_row.append(linerate)\n+        self.result_table_add(results_row)\n+\n+    def test_perf_dsa_basic_test_using_dpdk_driver(self):\n+        \"\"\"\n+        Test Case 1: DMA basic test with differnet size packets using DSA dpdk driver\n+        \"\"\"\n+        self.used_dsa = self.DC.bind_dsa_to_dpdk(\n+            dsa_number=1, driver_name=\"vfio-pci\", socket=self.ports_socket\n+        )\n+        self.core_num = 2\n+        self.rx_queues = 1\n+        self.nic_port_num = 1\n+        self.updating_mac = \"enabled\"\n+        self.copy_mode = \"hw\"\n+        ports = self.used_dsa\n+        for i in range(self.nic_port_num):\n+            ports.append(self.dut.ports_info[i][\"pci\"])\n+        port_options = {self.used_dsa[0]: \"max_queues=%s\" % self.rx_queues}\n+        eal_params = self.dut.create_eal_parameters(\n+            cores=self.get_core_list(), ports=ports, port_options=port_options\n+        )\n+        self.launch_dma_app(eal_params=eal_params)\n+        self.send_and_verify(check_each_queue=True)\n+        self.result_table_print()\n+\n+    def test_perf_dsa_with_multi_threads_using_dpdk_driver(self):\n+        \"\"\"\n+        Test Case 2: DMA test with multi-threads using DSA dpdk driver\n+        \"\"\"\n+        self.used_dsa = self.DC.bind_dsa_to_dpdk(\n+            dsa_number=1, driver_name=\"vfio-pci\", socket=self.ports_socket\n+        )\n+        self.core_num = 3\n+        self.rx_queues = 1\n+        self.nic_port_num = 1\n+        self.updating_mac = \"enabled\"\n+        self.copy_mode = \"hw\"\n+        ports = self.used_dsa\n+        for i in range(self.nic_port_num):\n+            ports.append(self.dut.ports_info[i][\"pci\"])\n+        port_options = {self.used_dsa[0]: \"max_queues=%s\" % self.rx_queues}\n+        eal_params = self.dut.create_eal_parameters(\n+            cores=self.get_core_list(), ports=ports, port_options=port_options\n+        )\n+        self.launch_dma_app(eal_params=eal_params)\n+        self.send_and_verify(check_each_queue=True)\n+        self.result_table_print()\n+\n+    def test_perf_dsa_with_multi_nic_ports_using_dpdk_driver(self):\n+        \"\"\"\n+        Test Case 3: DMA test with multi nic ports using DSA dpdk driver\n+        \"\"\"\n+        self.verify(len(self.dut_ports) >= 2, \"Insufficient ports for testing\")\n+        self.used_dsa = self.DC.bind_dsa_to_dpdk(\n+            dsa_number=1, driver_name=\"vfio-pci\", socket=self.ports_socket\n+        )\n+        self.core_num = 5\n+        self.rx_queues = 2\n+        self.nic_port_num = 2\n+        self.updating_mac = \"enabled\"\n+        self.copy_mode = \"hw\"\n+        ports = self.used_dsa\n+        for i in range(self.nic_port_num):\n+            ports.append(self.dut.ports_info[i][\"pci\"])\n+        port_options = {self.used_dsa[0]: \"max_queues=%s\" % self.rx_queues}\n+        eal_params = self.dut.create_eal_parameters(\n+            cores=self.get_core_list(), ports=ports, port_options=port_options\n+        )\n+        self.launch_dma_app(eal_params=eal_params)\n+        self.send_and_verify(check_each_queue=True)\n+        self.result_table_print()\n+\n+    def test_perf_dsa_with_multi_queues_using_dpdk_driver(self):\n+        \"\"\"\n+        Test Case 4: DMA test with multi-queues using DSA dpdk driver\n+        \"\"\"\n+        self.used_dsa = self.DC.bind_dsa_to_dpdk(\n+            dsa_number=1, driver_name=\"vfio-pci\", socket=self.ports_socket\n+        )\n+        self.core_num = 3\n+        self.nic_port_num = 1\n+        self.updating_mac = \"enabled\"\n+        self.copy_mode = \"hw\"\n+        queue_list = [2, 4, 8]\n+        ports = self.used_dsa\n+        for i in range(self.nic_port_num):\n+            ports.append(self.dut.ports_info[i][\"pci\"])\n+        for self.rx_queues in queue_list:\n+            port_options = {self.used_dsa[0]: \"max_queues=%s\" % self.rx_queues}\n+            eal_params = self.dut.create_eal_parameters(\n+                cores=self.get_core_list(), ports=ports, port_options=port_options\n+            )\n+            self.launch_dma_app(eal_params=eal_params)\n+            self.send_and_verify(check_each_queue=True)\n+            self.dut.send_expect(\"^c\", \"# \")\n+        self.result_table_print()\n+\n+    def test_perf_dsa_with_diff_update_mac_using_dpdk_driver(self):\n+        \"\"\"\n+        Test Case 5: DMA performance comparison between mac-updating and no-mac-updating using DSA dpdk driver\n+        \"\"\"\n+        self.used_dsa = self.DC.bind_dsa_to_dpdk(\n+            dsa_number=1, driver_name=\"vfio-pci\", socket=self.ports_socket\n+        )\n+        self.core_num = 2\n+        self.rx_queues = 2\n+        self.nic_port_num = 1\n+        self.updating_mac = \"disabled\"\n+        self.copy_mode = \"hw\"\n+        ports = self.used_dsa\n+        for i in range(self.nic_port_num):\n+            ports.append(self.dut.ports_info[i][\"pci\"])\n+        port_options = {self.used_dsa[0]: \"max_queues=%s\" % self.rx_queues}\n+        eal_params = self.dut.create_eal_parameters(\n+            cores=self.get_core_list(), ports=ports, port_options=port_options\n+        )\n+        self.launch_dma_app(eal_params=eal_params)\n+        self.send_and_verify(check_each_queue=True)\n+\n+        self.dut.send_expect(\"^c\", \"# \")\n+        self.updating_mac = \"enabled\"\n+        self.launch_dma_app(eal_params=eal_params)\n+        self.send_and_verify(check_each_queue=True)\n+        self.result_table_print()\n+\n+    def test_perf_dsa_with_diff_copy_mode_using_dpdk_driver(self):\n+        \"\"\"\n+        Test Case 6: DMA performance comparison between SW copies and HW copies using DSA dpdk driver\n+        \"\"\"\n+        self.used_dsa = self.DC.bind_dsa_to_dpdk(\n+            dsa_number=1, driver_name=\"vfio-pci\", socket=self.ports_socket\n+        )\n+        self.core_num = 3\n+        self.rx_queues = 4\n+        self.nic_port_num = 1\n+        self.updating_mac = \"enabled\"\n+        self.copy_mode = \"sw\"\n+        ports = self.used_dsa\n+        for i in range(self.nic_port_num):\n+            ports.append(self.dut.ports_info[i][\"pci\"])\n+        port_options = {self.used_dsa[0]: \"max_queues=%s\" % self.rx_queues}\n+        eal_params = self.dut.create_eal_parameters(\n+            cores=self.get_core_list(), ports=ports, port_options=port_options\n+        )\n+        self.launch_dma_app(eal_params=eal_params)\n+        self.send_and_verify(check_each_queue=False)\n+\n+        self.dut.send_expect(\"^c\", \"# \")\n+        self.copy_mode = \"hw\"\n+        self.launch_dma_app(eal_params=eal_params)\n+        self.send_and_verify(check_each_queue=True)\n+        self.result_table_print()\n+\n+    def test_perf_dsa_basic_test_using_kernel_driver(self):\n+        \"\"\"\n+        Test Case 7: DMA basic test with differnet size packets using DSA kernel driver\n+        \"\"\"\n+        self.DC.create_work_queue(work_queue_number=1, dsa_index=0)\n+        self.core_num = 2\n+        self.rx_queues = 1\n+        self.nic_port_num = 1\n+        self.updating_mac = \"enabled\"\n+        self.copy_mode = \"hw\"\n+        ports = [self.dut.ports_info[0][\"pci\"]]\n+        eal_params = self.dut.create_eal_parameters(\n+            cores=self.get_core_list(), ports=ports\n+        )\n+        self.launch_dma_app(eal_params=eal_params)\n+        self.send_and_verify(check_each_queue=True)\n+        self.result_table_print()\n+\n+    def test_perf_dsa_with_multi_thread_using_kernel_driver(self):\n+        \"\"\"\n+        Test Case 8: DMA test with multi-threads using DSA kernel driver\n+        \"\"\"\n+        self.DC.create_work_queue(work_queue_number=1, dsa_index=0)\n+        self.core_num = 3\n+        self.rx_queues = 1\n+        self.nic_port_num = 1\n+        self.updating_mac = \"enabled\"\n+        self.copy_mode = \"hw\"\n+        ports = [self.dut.ports_info[0][\"pci\"]]\n+        eal_params = self.dut.create_eal_parameters(\n+            cores=self.get_core_list(), ports=ports\n+        )\n+        self.launch_dma_app(eal_params=eal_params)\n+        self.send_and_verify(check_each_queue=True)\n+        self.result_table_print()\n+\n+    def test_perf_dsa_with_multi_nic_ports_using_kernle_driver(self):\n+        \"\"\"\n+        Test Case 9: DMA test with multi nic ports using DSA kernel driver\n+        \"\"\"\n+        self.verify(len(self.dut_ports) >= 2, \"Insufficient ports for testing\")\n+        self.DC.create_work_queue(work_queue_number=2, dsa_index=0)\n+        self.core_num = 5\n+        self.rx_queues = 2\n+        self.nic_port_num = 2\n+        self.updating_mac = \"enabled\"\n+        self.copy_mode = \"hw\"\n+        ports = [self.dut.ports_info[0][\"pci\"], self.dut.ports_info[1][\"pci\"]]\n+        eal_params = self.dut.create_eal_parameters(\n+            cores=self.get_core_list(), ports=ports\n+        )\n+        self.launch_dma_app(eal_params=eal_params)\n+        self.send_and_verify(check_each_queue=True)\n+        self.result_table_print()\n+\n+    def test_perf_dsa_with_multi_queues_using_kernel_driver(self):\n+        \"\"\"\n+        Test Case 10: DMA test with multi-queues using DSA kernel driver\n+        \"\"\"\n+        self.DC.create_work_queue(work_queue_number=8, dsa_index=0)\n+        self.core_num = 3\n+        self.nic_port_num = 1\n+        self.updating_mac = \"enabled\"\n+        self.copy_mode = \"hw\"\n+        queue_list = [2, 4, 8]\n+        for self.rx_queues in queue_list:\n+            ports = [self.dut.ports_info[0][\"pci\"]]\n+            eal_params = self.dut.create_eal_parameters(\n+                cores=self.get_core_list(), ports=ports\n+            )\n+            self.launch_dma_app(eal_params=eal_params)\n+            self.send_and_verify(check_each_queue=True)\n+            self.dut.send_expect(\"^c\", \"# \")\n+        self.result_table_print()\n+\n+    def test_perf_dsa_with_diff_update_mac_using_kernel_driver(self):\n+        \"\"\"\n+        Test Case 11: DMA performance comparison between mac-updating and no-mac-updating using DSA kernel driver\n+        \"\"\"\n+        self.DC.create_work_queue(work_queue_number=2, dsa_index=0)\n+        self.core_num = 2\n+        self.rx_queues = 2\n+        self.nic_port_num = 1\n+        self.updating_mac = \"disabled\"\n+        self.copy_mode = \"hw\"\n+        ports = [self.dut.ports_info[0][\"pci\"]]\n+        eal_params = self.dut.create_eal_parameters(\n+            cores=self.get_core_list(), ports=ports\n+        )\n+        self.launch_dma_app(eal_params=eal_params)\n+        self.send_and_verify(check_each_queue=True)\n+\n+        self.dut.send_expect(\"^c\", \"# \")\n+        self.updating_mac = \"enabled\"\n+        self.launch_dma_app(eal_params=eal_params)\n+        self.send_and_verify(check_each_queue=True)\n+        self.result_table_print()\n+\n+    def test_perf_dsa_with_diff_copy_mode_using_kernel_driver(self):\n+        \"\"\"\n+        Test Case 12: DMA performance comparison between SW copies and HW copies using DSA kernel driver\n+        \"\"\"\n+        self.DC.create_work_queue(work_queue_number=4, dsa_index=0)\n+        self.core_num = 3\n+        self.rx_queues = 4\n+        self.nic_port_num = 1\n+        self.updating_mac = \"enabled\"\n+        self.copy_mode = \"sw\"\n+        ports = [self.dut.ports_info[0][\"pci\"]]\n+        eal_params = self.dut.create_eal_parameters(\n+            cores=self.get_core_list(), ports=ports\n+        )\n+        self.launch_dma_app(eal_params=eal_params)\n+        self.send_and_verify(check_each_queue=False)\n+\n+        self.dut.send_expect(\"^c\", \"# \")\n+        self.copy_mode = \"hw\"\n+        self.launch_dma_app(eal_params=eal_params)\n+        self.send_and_verify(check_each_queue=True)\n+        self.result_table_print()\n+\n+    def tear_down(self):\n+        \"\"\"\n+        Run after each test case.\n+        \"\"\"\n+        self.dut.send_expect(\"^c\", \"# \")\n+        self.dut.send_expect(\"killall -I %s\" % self.dma_name, \"#\", 20)\n+        self.dut.kill_all()\n+        self.DC.reset_all_work_queue()\n+        self.DC.bind_all_dsa_to_kernel()\n+\n+    def tear_down_all(self):\n+        \"\"\"\n+        Run after each test suite.\n+        \"\"\"\n+        pass\n",
    "prefixes": [
        "V1"
    ]
}