get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 138829,
    "url": "http://patches.dpdk.org/api/patches/138829/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240326190422.577028-4-luca.vizzarro@arm.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20240326190422.577028-4-luca.vizzarro@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240326190422.577028-4-luca.vizzarro@arm.com",
    "date": "2024-03-26T19:04:19",
    "name": "[3/6] dts: add testpmd shell params",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "93102ed6596b62805498817f76b0efb7913e0f98",
    "submitter": {
        "id": 3197,
        "url": "http://patches.dpdk.org/api/people/3197/?format=api",
        "name": "Luca Vizzarro",
        "email": "luca.vizzarro@arm.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240326190422.577028-4-luca.vizzarro@arm.com/mbox/",
    "series": [
        {
            "id": 31622,
            "url": "http://patches.dpdk.org/api/series/31622/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31622",
            "date": "2024-03-26T19:04:16",
            "name": "dts: add testpmd params and statefulness",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/31622/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/138829/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/138829/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-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 1732643D5B;\n\tTue, 26 Mar 2024 20:04:59 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B7C3741156;\n\tTue, 26 Mar 2024 20:04:37 +0100 (CET)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id 73CBF410E6\n for <dev@dpdk.org>; Tue, 26 Mar 2024 20:04:35 +0100 (CET)",
            "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A802F339;\n Tue, 26 Mar 2024 12:05:08 -0700 (PDT)",
            "from localhost.localdomain (unknown [10.57.16.115])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1FEA13F64C;\n Tue, 26 Mar 2024 12:04:33 -0700 (PDT)"
        ],
        "From": "Luca Vizzarro <luca.vizzarro@arm.com>",
        "To": "dev@dpdk.org",
        "Cc": "=?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>,\n Luca Vizzarro <luca.vizzarro@arm.com>,\n Jack Bond-Preston <jack.bond-preston@arm.com>,\n Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>",
        "Subject": "[PATCH 3/6] dts: add testpmd shell params",
        "Date": "Tue, 26 Mar 2024 19:04:19 +0000",
        "Message-Id": "<20240326190422.577028-4-luca.vizzarro@arm.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20240326190422.577028-1-luca.vizzarro@arm.com>",
        "References": "<20240326190422.577028-1-luca.vizzarro@arm.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Implement all the testpmd shell parameters into a data structure.\n\nSigned-off-by: Luca Vizzarro <luca.vizzarro@arm.com>\nReviewed-by: Jack Bond-Preston <jack.bond-preston@arm.com>\nReviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\n---\n dts/framework/remote_session/testpmd_shell.py | 633 +++++++++++++++++-\n 1 file changed, 615 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py\nindex db3abb7600..a823dc53be 100644\n--- a/dts/framework/remote_session/testpmd_shell.py\n+++ b/dts/framework/remote_session/testpmd_shell.py\n@@ -1,6 +1,7 @@\n # SPDX-License-Identifier: BSD-3-Clause\n # Copyright(c) 2023 University of New Hampshire\n # Copyright(c) 2023 PANTHEON.tech s.r.o.\n+# Copyright(c) 2024 Arm Limited\n \n \"\"\"Testpmd interactive shell.\n \n@@ -15,10 +16,25 @@\n     testpmd_shell.close()\n \"\"\"\n \n+from dataclasses import dataclass, field\n+from enum import auto, Enum, Flag, unique\n import time\n-from enum import auto\n from pathlib import PurePath\n-from typing import Callable, ClassVar\n+from typing import Callable, ClassVar, Literal, NamedTuple\n+from framework.params import (\n+    BooleanOption,\n+    Params,\n+    bracketed,\n+    comma_separated,\n+    Option,\n+    field_mixins,\n+    hex_from_flag_value,\n+    multiple,\n+    long,\n+    short,\n+    str_from_flag_value,\n+    str_mixins,\n+)\n \n from framework.exception import InteractiveCommandExecutionError\n from framework.params import StrParams\n@@ -28,26 +44,79 @@\n from .interactive_shell import InteractiveShell\n \n \n-class TestPmdDevice(object):\n-    \"\"\"The data of a device that testpmd can recognize.\n+@str_mixins(bracketed, comma_separated)\n+class TestPmdPortNUMAConfig(NamedTuple):\n+    \"\"\"DPDK port to NUMA socket association tuple.\"\"\"\n \n-    Attributes:\n-        pci_address: The PCI address of the device.\n+    port: int\n+    socket: int\n+\n+\n+@str_mixins(str_from_flag_value)\n+@unique\n+class TestPmdFlowDirection(Flag):\n+    \"\"\"Flag indicating the direction of the flow.\n+\n+    A bi-directional flow can be specified with the pipe:\n+\n+    >>> TestPmdFlowDirection.RX | TestPmdFlowDirection.TX\n+    <TestPmdFlowDirection.TX|RX: 3>\n     \"\"\"\n \n-    pci_address: str\n+    #:\n+    RX = 1 << 0\n+    #:\n+    TX = 1 << 1\n \n-    def __init__(self, pci_address_line: str):\n-        \"\"\"Initialize the device from the testpmd output line string.\n \n-        Args:\n-            pci_address_line: A line of testpmd output that contains a device.\n-        \"\"\"\n-        self.pci_address = pci_address_line.strip().split(\": \")[1].strip()\n+@str_mixins(bracketed, comma_separated)\n+class TestPmdRingNUMAConfig(NamedTuple):\n+    \"\"\"Tuple associating DPDK port, direction of the flow and NUMA socket.\"\"\"\n+\n+    port: int\n+    direction: TestPmdFlowDirection\n+    socket: int\n+\n+\n+@str_mixins(comma_separated)\n+class TestPmdEthPeer(NamedTuple):\n+    \"\"\"Tuple associating a MAC address to the specified DPDK port.\"\"\"\n+\n+    port_no: int\n+    mac_address: str\n+\n+\n+@str_mixins(comma_separated)\n+class TestPmdTxIPAddrPair(NamedTuple):\n+    \"\"\"Tuple specifying the source and destination IPs for the packets.\"\"\"\n+\n+    source_ip: str\n+    dest_ip: str\n \n-    def __str__(self) -> str:\n-        \"\"\"The PCI address captures what the device is.\"\"\"\n-        return self.pci_address\n+\n+@str_mixins(comma_separated)\n+class TestPmdTxUDPPortPair(NamedTuple):\n+    \"\"\"Tuple specifying the UDP source and destination ports for the packets.\n+\n+    If leaving ``dest_port`` unspecified, ``source_port`` will be used for the destination port as well.\n+    \"\"\"\n+\n+    source_port: int\n+    dest_port: int | None = None\n+\n+\n+class TestPmdPortTopology(StrEnum):\n+    paired = auto()\n+    \"\"\"In paired mode, the forwarding is between pairs of ports,\n+    for example: (0,1), (2,3), (4,5).\"\"\"\n+    chained = auto()\n+    \"\"\"In chained mode, the forwarding is to the next available port in the port mask,\n+    for example: (0,1), (1,2), (2,0).\n+\n+    The ordering of the ports can be changed using the portlist testpmd runtime function.\n+    \"\"\"\n+    loop = auto()\n+    \"\"\"In loop mode, ingress traffic is simply transmitted back on the same interface.\"\"\"\n \n \n class TestPmdForwardingModes(StrEnum):\n@@ -81,6 +150,534 @@ class TestPmdForwardingModes(StrEnum):\n     recycle_mbufs = auto()\n \n \n+@str_mixins(comma_separated)\n+class XYPair(NamedTuple):\n+    #:\n+    X: int\n+    #:\n+    Y: int | None = None\n+\n+\n+@str_mixins(hex_from_flag_value)\n+@unique\n+class TestPmdRXMultiQueueMode(Flag):\n+    #:\n+    RSS = 1 << 0\n+    #:\n+    DCB = 1 << 1\n+    #:\n+    VMDQ = 1 << 2\n+\n+\n+@str_mixins(hex_from_flag_value)\n+@unique\n+class TestPmdHairpinMode(Flag):\n+    TWO_PORTS_LOOP = 1 << 0\n+    \"\"\"Two hairpin ports loop.\"\"\"\n+    TWO_PORTS_PAIRED = 1 << 1\n+    \"\"\"Two hairpin ports paired.\"\"\"\n+    EXPLICIT_TX_FLOW = 1 << 4\n+    \"\"\"Explicit Tx flow rule.\"\"\"\n+    FORCE_RX_QUEUE_MEM_SETTINGS = 1 << 8\n+    \"\"\"Force memory settings of hairpin RX queue.\"\"\"\n+    FORCE_TX_QUEUE_MEM_SETTINGS = 1 << 9\n+    \"\"\"Force memory settings of hairpin TX queue.\"\"\"\n+    RX_QUEUE_USE_LOCKED_DEVICE_MEMORY = 1 << 12\n+    \"\"\"Hairpin RX queues will use locked device memory.\"\"\"\n+    RX_QUEUE_USE_RTE_MEMORY = 1 << 13\n+    \"\"\"Hairpin RX queues will use RTE memory.\"\"\"\n+    TX_QUEUE_USE_LOCKED_DEVICE_MEMORY = 1 << 16\n+    \"\"\"Hairpin TX queues will use locked device memory.\"\"\"\n+    TX_QUEUE_USE_RTE_MEMORY = 1 << 18\n+    \"\"\"Hairpin TX queues will use RTE memory.\"\"\"\n+\n+\n+class TestPmdEvent(StrEnum):\n+    #:\n+    unknown = auto()\n+    #:\n+    queue_state = auto()\n+    #:\n+    vf_mbox = auto()\n+    #:\n+    macsec = auto()\n+    #:\n+    intr_lsc = auto()\n+    #:\n+    intr_rmv = auto()\n+    #:\n+    intr_reset = auto()\n+    #:\n+    dev_probed = auto()\n+    #:\n+    dev_released = auto()\n+    #:\n+    flow_aged = auto()\n+    #:\n+    err_recovering = auto()\n+    #:\n+    recovery_success = auto()\n+    #:\n+    recovery_failed = auto()\n+    #:\n+    all = auto()\n+\n+\n+class TestPmdMempoolAllocationMode(StrEnum):\n+    native = auto()\n+    \"\"\"Create and populate mempool using native DPDK memory.\"\"\"\n+    anon = auto()\n+    \"\"\"Create mempool using native DPDK memory, but populate using anonymous memory.\"\"\"\n+    xmem = auto()\n+    \"\"\"Create and populate mempool using externally and anonymously allocated area.\"\"\"\n+    xmemhuge = auto()\n+    \"\"\"Create and populate mempool using externally and anonymously allocated hugepage area.\"\"\"\n+\n+\n+@dataclass(kw_only=True)\n+class TestPmdTXOnlyForwardingMode(Params):\n+    __forward_mode: Literal[TestPmdForwardingModes.txonly] = field(\n+        default=TestPmdForwardingModes.txonly, init=False, metadata=long(\"forward-mode\")\n+    )\n+    multi_flow: Option = field(default=None, metadata=long(\"txonly-multi-flow\"))\n+    \"\"\"Generate multiple flows.\"\"\"\n+    segments_length: XYPair | None = field(default=None, metadata=long(\"txpkts\"))\n+    \"\"\"Set TX segment sizes or total packet length.\"\"\"\n+\n+\n+@dataclass(kw_only=True)\n+class TestPmdFlowGenForwardingMode(Params):\n+    __forward_mode: Literal[TestPmdForwardingModes.flowgen] = field(\n+        default=TestPmdForwardingModes.flowgen, init=False, metadata=long(\"forward-mode\")\n+    )\n+    clones: int | None = field(default=None, metadata=long(\"flowgen-clones\"))\n+    \"\"\"Set the number of each packet clones to be sent. Sending clones reduces host CPU load on\n+    creating packets and may help in testing extreme speeds or maxing out Tx packet performance.\n+    N should be not zero, but less than ‘burst’ parameter.\n+    \"\"\"\n+    flows: int | None = field(default=None, metadata=long(\"flowgen-flows\"))\n+    \"\"\"Set the number of flows to be generated, where 1 <= N <= INT32_MAX.\"\"\"\n+    segments_length: XYPair | None = field(default=None, metadata=long(\"txpkts\"))\n+    \"\"\"Set TX segment sizes or total packet length.\"\"\"\n+\n+\n+@dataclass(kw_only=True)\n+class TestPmdNoisyForwardingMode(Params):\n+    __forward_mode: Literal[TestPmdForwardingModes.noisy] = field(\n+        default=TestPmdForwardingModes.noisy, init=False, metadata=long(\"forward-mode\")\n+    )\n+    forward_mode: (\n+        Literal[\n+            TestPmdForwardingModes.io,\n+            TestPmdForwardingModes.mac,\n+            TestPmdForwardingModes.macswap,\n+            TestPmdForwardingModes.fivetswap,\n+        ]\n+        | None\n+    ) = field(default=TestPmdForwardingModes.io, metadata=long(\"noisy-forward-mode\"))\n+    \"\"\"Set the noisy vnf forwarding mode.\"\"\"\n+    tx_sw_buffer_size: int | None = field(default=None, metadata=long(\"noisy-tx-sw-buffer-size\"))\n+    \"\"\"Set the maximum number of elements of the FIFO queue to be created for buffering packets.\n+    The default value is 0.\n+    \"\"\"\n+    tx_sw_buffer_flushtime: int | None = field(\n+        default=None, metadata=long(\"noisy-tx-sw-buffer-flushtime\")\n+    )\n+    \"\"\"Set the time before packets in the FIFO queue are flushed. The default value is 0.\"\"\"\n+    lkup_memory: int | None = field(default=None, metadata=long(\"noisy-lkup-memory\"))\n+    \"\"\"Set the size of the noisy neighbor simulation memory buffer in MB to N. The default value is 0.\"\"\"\n+    lkup_num_reads: int | None = field(default=None, metadata=long(\"noisy-lkup-num-reads\"))\n+    \"\"\"Set the number of reads to be done in noisy neighbor simulation memory buffer to N.\n+    The default value is 0.\n+    \"\"\"\n+    lkup_num_writes: int | None = field(default=None, metadata=long(\"noisy-lkup-num-writes\"))\n+    \"\"\"Set the number of writes to be done in noisy neighbor simulation memory buffer to N.\n+    The default value is 0.\n+    \"\"\"\n+    lkup_num_reads_writes: int | None = field(\n+        default=None, metadata=long(\"noisy-lkup-num-reads-writes\")\n+    )\n+    \"\"\"Set the number of r/w accesses to be done in noisy neighbor simulation memory buffer to N.\n+    The default value is 0.\n+    \"\"\"\n+\n+\n+@dataclass(kw_only=True)\n+class TestPmdAnonMempoolAllocationMode(Params):\n+    __mp_alloc: Literal[TestPmdMempoolAllocationMode.anon] = field(\n+        default=TestPmdMempoolAllocationMode.anon, init=False, metadata=long(\"mp-alloc\")\n+    )\n+    no_iova_contig: Option = None\n+    \"\"\"Enable to create mempool which is not IOVA contiguous.\"\"\"\n+\n+\n+@dataclass(kw_only=True)\n+class TestPmdRXRingParams(Params):\n+    descriptors: int | None = field(default=None, metadata=long(\"rxd\"))\n+    \"\"\"Set the number of descriptors in the RX rings to N, where N > 0. The default value is 128.\"\"\"\n+    prefetch_threshold: int | None = field(default=None, metadata=long(\"rxpt\"))\n+    \"\"\"Set the prefetch threshold register of RX rings to N, where N >= 0. The default value is 8.\"\"\"\n+    host_threshold: int | None = field(default=None, metadata=long(\"rxht\"))\n+    \"\"\"Set the host threshold register of RX rings to N, where N >= 0. The default value is 8.\"\"\"\n+    write_back_threshold: int | None = field(default=None, metadata=long(\"rxwt\"))\n+    \"\"\"Set the write-back threshold register of RX rings to N, where N >= 0. The default value is 4.\"\"\"\n+    free_threshold: int | None = field(default=None, metadata=long(\"rxfreet\"))\n+    \"\"\"Set the free threshold of RX descriptors to N, where 0 <= N < value of ``-–rxd``.\n+    The default value is 0.\n+    \"\"\"\n+\n+\n+@dataclass\n+class TestPmdDisableRSS(Params):\n+    \"\"\"Disable RSS (Receive Side Scaling).\"\"\"\n+\n+    __disable_rss: Literal[True] = field(default=True, init=False, metadata=long(\"disable-rss\"))\n+\n+\n+@dataclass\n+class TestPmdSetRSSIPOnly(Params):\n+    \"\"\"Set RSS functions for IPv4/IPv6 only.\"\"\"\n+\n+    __rss_ip: Literal[True] = field(default=True, init=False, metadata=long(\"rss-ip\"))\n+\n+\n+@dataclass\n+class TestPmdSetRSSUDP(Params):\n+    \"\"\"Set RSS functions for IPv4/IPv6 and UDP.\"\"\"\n+\n+    __rss_udp: Literal[True] = field(default=True, init=False, metadata=long(\"rss-udp\"))\n+\n+\n+@dataclass(kw_only=True)\n+class TestPmdTXRingParams(Params):\n+    descriptors: int | None = field(default=None, metadata=long(\"txd\"))\n+    \"\"\"Set the number of descriptors in the TX rings to N, where N > 0. The default value is 512.\"\"\"\n+    rs_bit_threshold: int | None = field(default=None, metadata=long(\"txrst\"))\n+    \"\"\"Set the transmit RS bit threshold of TX rings to N, where 0 <= N <= value of ``--txd``.\n+    The default value is 0.\n+    \"\"\"\n+    prefetch_threshold: int | None = field(default=None, metadata=long(\"txpt\"))\n+    \"\"\"Set the prefetch threshold register of TX rings to N, where N >= 0. The default value is 36.\"\"\"\n+    host_threshold: int | None = field(default=None, metadata=long(\"txht\"))\n+    \"\"\"Set the host threshold register of TX rings to N, where N >= 0. The default value is 0.\"\"\"\n+    write_back_threshold: int | None = field(default=None, metadata=long(\"txwt\"))\n+    \"\"\"Set the write-back threshold register of TX rings to N, where N >= 0. The default value is 0.\"\"\"\n+    free_threshold: int | None = field(default=None, metadata=long(\"txfreet\"))\n+    \"\"\"Set the transmit free threshold of TX rings to N, where 0 <= N <= value of ``--txd``.\n+    The default value is 0.\n+    \"\"\"\n+\n+\n+@dataclass(slots=True, kw_only=True)\n+class TestPmdParameters(Params):\n+    \"\"\"The testpmd shell parameters.\n+\n+    The string representation can be created by converting the instance to a string.\n+    \"\"\"\n+\n+    interactive_mode: Option = field(default=True, metadata=short(\"i\"))\n+    \"\"\"Runs testpmd in interactive mode.\"\"\"\n+    auto_start: Option = field(default=None, metadata=short(\"a\"))\n+    \"\"\"Start forwarding on initialization.\"\"\"\n+    tx_first: Option = None\n+    \"\"\"Start forwarding, after sending a burst of packets first.\"\"\"\n+\n+    stats_period: int | None = None\n+    \"\"\"Display statistics every ``PERIOD`` seconds, if interactive mode is disabled.\n+    The default value is 0, which means that the statistics will not be displayed.\n+\n+    .. note:: This flag should be used only in non-interactive mode.\n+    \"\"\"\n+\n+    display_xstats: list[str] | None = field(default=None, metadata=field_mixins(comma_separated))\n+    \"\"\"Display comma-separated list of extended statistics every ``PERIOD`` seconds as specified in\n+    ``--stats-period`` or when used with interactive commands that show Rx/Tx statistics\n+    (i.e. ‘show port stats’).\n+    \"\"\"\n+\n+    nb_cores: int | None = 1\n+    \"\"\"Set the number of forwarding cores, where 1 <= N <= “number of cores” or ``RTE_MAX_LCORE``\n+    from the configuration file. The default value is 1.\n+    \"\"\"\n+    coremask: int | None = field(default=None, metadata=field_mixins(hex))\n+    \"\"\"Set the hexadecimal bitmask of the cores running the packet forwarding test. The main lcore\n+    is reserved for command line parsing only and cannot be masked on for packet forwarding.\n+    \"\"\"\n+\n+    nb_ports: int | None = None\n+    \"\"\"Set the number of forwarding ports, where 1 <= N <= “number of ports” on the board or\n+    ``RTE_MAX_ETHPORTS`` from the configuration file. The default value is the number of ports\n+    on the board.\n+    \"\"\"\n+    port_topology: TestPmdPortTopology | None = TestPmdPortTopology.paired\n+    \"\"\"Set port topology, where mode is paired (the default), chained or loop.\"\"\"\n+    portmask: int | None = field(default=None, metadata=field_mixins(hex))\n+    \"\"\"Set the hexadecimal bitmask of the ports used by the packet forwarding test.\"\"\"\n+    portlist: str | None = None  # TODO: can be ranges 0,1-3\n+    \"\"\"Set the forwarding ports based on the user input used by the packet forwarding test.\n+    ‘-‘ denotes a range of ports to set including the two specified port IDs ‘,’ separates\n+    multiple port values. Possible examples like –portlist=0,1 or –portlist=0-2 or –portlist=0,1-2 etc\n+    \"\"\"\n+\n+    numa: BooleanOption = True\n+    \"\"\"Enable/disable NUMA-aware allocation of RX/TX rings and of RX memory buffers (mbufs). Enabled by default.\"\"\"\n+    socket_num: int | None = None\n+    \"\"\"Set the socket from which all memory is allocated in NUMA mode, where 0 <= N < number of sockets on the board.\"\"\"\n+    port_numa_config: list[TestPmdPortNUMAConfig] | None = field(\n+        default=None, metadata=field_mixins(comma_separated)\n+    )\n+    \"\"\"Specify the socket on which the memory pool to be used by the port will be allocated.\"\"\"\n+    ring_numa_config: list[TestPmdRingNUMAConfig] | None = field(\n+        default=None, metadata=field_mixins(comma_separated)\n+    )\n+    \"\"\"Specify the socket on which the TX/RX rings for the port will be allocated.\n+    Where flag is 1 for RX, 2 for TX, and 3 for RX and TX.\n+    \"\"\"\n+\n+    # Mbufs\n+    total_num_mbufs: int | None = None\n+    \"\"\"Set the number of mbufs to be allocated in the mbuf pools, where N > 1024.\"\"\"\n+    mbuf_size: list[int] | None = field(default=None, metadata=field_mixins(comma_separated))\n+    \"\"\"Set the data size of the mbufs used to N bytes, where N < 65536. The default value is 2048.\n+    If multiple mbuf-size values are specified the extra memory pools will be created for\n+    allocating mbufs to receive packets with buffer splitting features.\n+    \"\"\"\n+    mbcache: int | None = None\n+    \"\"\"Set the cache of mbuf memory pools to N, where 0 <= N <= 512. The default value is 16.\"\"\"\n+\n+    max_pkt_len: int | None = None\n+    \"\"\"Set the maximum packet size to N bytes, where N >= 64. The default value is 1518.\"\"\"\n+\n+    eth_peers_configfile: PurePath | None = None\n+    \"\"\"Use a configuration file containing the Ethernet addresses of the peer ports.\"\"\"\n+    eth_peer: list[TestPmdEthPeer] | None = field(default=None, metadata=multiple())\n+    \"\"\"Set the MAC address XX:XX:XX:XX:XX:XX of the peer port N, where 0 <= N < RTE_MAX_ETHPORTS.\"\"\"\n+\n+    tx_ip: TestPmdTxIPAddrPair | None = TestPmdTxIPAddrPair(\n+        source_ip=\"198.18.0.1\", dest_ip=\"198.18.0.2\"\n+    )\n+    \"\"\"Set the source and destination IP address used when doing transmit only test.\n+    The defaults address values are source 198.18.0.1 and destination 198.18.0.2.\n+    These are special purpose addresses reserved for benchmarking (RFC 5735).\n+    \"\"\"\n+    tx_udp: TestPmdTxUDPPortPair | None = TestPmdTxUDPPortPair(9)\n+    \"\"\"Set the source and destination UDP port number for transmit test only test.\n+    The default port is the port 9 which is defined for the discard protocol (RFC 863).\"\"\"\n+\n+    enable_lro: Option = None\n+    \"\"\"Enable large receive offload.\"\"\"\n+    max_lro_pkt_size: int | None = None\n+    \"\"\"Set the maximum LRO aggregated packet size to N bytes, where N >= 64.\"\"\"\n+\n+    disable_crc_strip: Option = None\n+    \"\"\"Disable hardware CRC stripping.\"\"\"\n+    enable_scatter: Option = None\n+    \"\"\"Enable scatter (multi-segment) RX.\"\"\"\n+    enable_hw_vlan: Option = None\n+    \"\"\"Enable hardware VLAN.\"\"\"\n+    enable_hw_vlan_filter: Option = None\n+    \"\"\"Enable hardware VLAN filter.\"\"\"\n+    enable_hw_vlan_strip: Option = None\n+    \"\"\"Enable hardware VLAN strip.\"\"\"\n+    enable_hw_vlan_extend: Option = None\n+    \"\"\"Enable hardware VLAN extend.\"\"\"\n+    enable_hw_qinq_strip: Option = None\n+    \"\"\"Enable hardware QINQ strip.\"\"\"\n+    pkt_drop_enabled: Option = field(default=None, metadata=long(\"enable-drop-en\"))\n+    \"\"\"Enable per-queue packet drop for packets with no descriptors.\"\"\"\n+\n+    rss: TestPmdDisableRSS | TestPmdSetRSSIPOnly | TestPmdSetRSSUDP | None = None\n+    \"\"\"RSS option setting.\n+\n+    The value can be one of:\n+    * :class:`TestPmdDisableRSS`, to disable RSS\n+    * :class:`TestPmdSetRSSIPOnly`, to set RSS for IPv4/IPv6 only\n+    * :class:`TestPmdSetRSSUDP`, to set RSS for IPv4/IPv6 and UDP\n+    \"\"\"\n+\n+    forward_mode: (\n+        Literal[\n+            TestPmdForwardingModes.io,\n+            TestPmdForwardingModes.mac,\n+            TestPmdForwardingModes.macswap,\n+            TestPmdForwardingModes.rxonly,\n+            TestPmdForwardingModes.csum,\n+            TestPmdForwardingModes.icmpecho,\n+            TestPmdForwardingModes.ieee1588,\n+            TestPmdForwardingModes.fivetswap,\n+            TestPmdForwardingModes.shared_rxq,\n+            TestPmdForwardingModes.recycle_mbufs,\n+        ]\n+        | TestPmdFlowGenForwardingMode\n+        | TestPmdTXOnlyForwardingMode\n+        | TestPmdNoisyForwardingMode\n+        | None\n+    ) = TestPmdForwardingModes.io\n+    \"\"\"Set the forwarding mode.\n+\n+    The value can be one of:\n+    * :attr:`TestPmdForwardingModes.io` (default)\n+    * :attr:`TestPmdForwardingModes.mac`\n+    * :attr:`TestPmdForwardingModes.rxonly`\n+    * :attr:`TestPmdForwardingModes.csum`\n+    * :attr:`TestPmdForwardingModes.icmpecho`\n+    * :attr:`TestPmdForwardingModes.ieee1588`\n+    * :attr:`TestPmdForwardingModes.fivetswap`\n+    * :attr:`TestPmdForwardingModes.shared_rxq`\n+    * :attr:`TestPmdForwardingModes.recycle_mbufs`\n+    * :class:`FlowGenForwardingMode`\n+    * :class:`TXOnlyForwardingMode`\n+    * :class:`NoisyForwardingMode`\n+    \"\"\"\n+\n+    hairpin_mode: TestPmdHairpinMode | None = TestPmdHairpinMode(0)\n+    \"\"\"Set the hairpin port configuration.\"\"\"\n+    hairpin_queues: int | None = field(default=None, metadata=long(\"hairpinq\"))\n+    \"\"\"Set the number of hairpin queues per port to N, where 1 <= N <= 65535. The default value is 0.\"\"\"\n+\n+    burst: int | None = None\n+    \"\"\"Set the number of packets per burst to N, where 1 <= N <= 512. The default value is 32.\n+    If set to 0, driver default is used if defined.\n+    Else, if driver default is not defined, default of 32 is used.\n+    \"\"\"\n+\n+    # RX data parameters\n+    enable_rx_cksum: Option = None\n+    \"\"\"Enable hardware RX checksum offload.\"\"\"\n+    rx_queues: int | None = field(default=None, metadata=long(\"rxq\"))\n+    \"\"\"Set the number of RX queues per port to N, where 1 <= N <= 65535. The default value is 1.\"\"\"\n+    rx_ring: TestPmdRXRingParams | None = None\n+    \"\"\"Set the RX rings parameters.\"\"\"\n+    no_flush_rx: Option = None\n+    \"\"\"Don’t flush the RX streams before starting forwarding. Used mainly with the PCAP PMD.\"\"\"\n+    rx_segments_offsets: XYPair | None = field(default=None, metadata=long(\"rxoffs\"))\n+    \"\"\"Set the offsets of packet segments on receiving if split feature is engaged.\n+    Affects only the queues configured with split offloads (currently BUFFER_SPLIT is supported only).\n+    \"\"\"\n+    rx_segments_length: XYPair | None = field(default=None, metadata=long(\"rxpkts\"))\n+    \"\"\"Set the length of segments to scatter packets on receiving if split feature is engaged.\n+    Affects only the queues configured with split offloads (currently BUFFER_SPLIT is supported only).\n+    Optionally the multiple memory pools can be specified with –mbuf-size command line parameter and\n+    the mbufs to receive will be allocated sequentially from these extra memory pools.\n+    \"\"\"\n+    multi_rx_mempool: Option = None\n+    \"\"\"Enable multiple mbuf pools per Rx queue.\"\"\"\n+    rx_shared_queue: Option | int = field(default=None, metadata=long(\"rxq-share\"))\n+    \"\"\"Create queues in shared Rx queue mode if device supports. Shared Rx queues are grouped per X ports.\n+    X defaults to UINT32_MAX, implies all ports join share group 1.\n+    Forwarding engine “shared-rxq” should be used for shared Rx queues.\n+    This engine does Rx only and update stream statistics accordingly.\n+    \"\"\"\n+    rx_offloads: int | None = field(default=0, metadata=field_mixins(hex))\n+    \"\"\"Set the hexadecimal bitmask of RX queue offloads. The default value is 0.\"\"\"\n+    rx_mq_mode: TestPmdRXMultiQueueMode | None = (\n+        TestPmdRXMultiQueueMode.DCB | TestPmdRXMultiQueueMode.RSS | TestPmdRXMultiQueueMode.VMDQ\n+    )\n+    \"\"\"Set the hexadecimal bitmask of RX multi queue mode which can be enabled.\"\"\"\n+\n+    # TX data parameters\n+    tx_queues: int | None = field(default=None, metadata=long(\"txq\"))\n+    \"\"\"Set the number of TX queues per port to N, where 1 <= N <= 65535. The default value is 1.\"\"\"\n+    tx_ring: TestPmdTXRingParams | None = None\n+    \"\"\"Set the TX rings params.\"\"\"\n+    tx_offloads: int | None = field(default=0, metadata=field_mixins(hex))\n+    \"\"\"Set the hexadecimal bitmask of TX queue offloads. The default value is 0.\"\"\"\n+\n+    eth_link_speed: int | None = None\n+    \"\"\"Set a forced link speed to the ethernet port. E.g. 1000 for 1Gbps.\"\"\"\n+    disable_link_check: Option = None\n+    \"\"\"Disable check on link status when starting/stopping ports.\"\"\"\n+    disable_device_start: Option = None\n+    \"\"\"Do not automatically start all ports.\n+    This allows testing configuration of rx and tx queues before device is started for the first time.\n+    \"\"\"\n+    no_lsc_interrupt: Option = None\n+    \"\"\"Disable LSC interrupts for all ports, even those supporting it.\"\"\"\n+    no_rmv_interrupt: Option = None\n+    \"\"\"Disable RMV interrupts for all ports, even those supporting it.\"\"\"\n+    bitrate_stats: int | None = None\n+    \"\"\"Set the logical core N to perform bitrate calculation.\"\"\"\n+    latencystats: int | None = None\n+    \"\"\"Set the logical core N to perform latency and jitter calculations.\"\"\"\n+    print_events: list[TestPmdEvent] | None = field(\n+        default=None, metadata=multiple(long(\"print-event\"))\n+    )\n+    \"\"\"Enable printing the occurrence of the designated events.\n+    Using :attr:`TestPmdEvent.ALL` will enable all of them.\n+    \"\"\"\n+    mask_events: list[TestPmdEvent] | None = field(\n+        default_factory=lambda: [TestPmdEvent.intr_lsc], metadata=multiple(long(\"mask-event\"))\n+    )\n+    \"\"\"Disable printing the occurrence of the designated events.\n+    Using :attr:`TestPmdEvent.ALL` will disable all of them.\n+    \"\"\"\n+\n+    flow_isolate_all: Option = None\n+    \"\"\"Providing this parameter requests flow API isolated mode on all ports at initialization time.\n+    It ensures all traffic is received through the configured flow rules only (see flow command).\n+\n+    Ports that do not support this mode are automatically discarded.\n+    \"\"\"\n+    disable_flow_flush: Option = None\n+    \"\"\"Disable port flow flush when stopping port.\n+    This allows testing keep flow rules or shared flow objects across restart.\n+    \"\"\"\n+\n+    hot_plug: Option = None\n+    \"\"\"Enable device event monitor mechanism for hotplug.\"\"\"\n+    vxlan_gpe_port: int | None = None\n+    \"\"\"Set the UDP port number of tunnel VXLAN-GPE to N. The default value is 4790.\"\"\"\n+    geneve_parsed_port: int | None = None\n+    \"\"\"Set the UDP port number that is used for parsing the GENEVE protocol to N.\n+    HW may be configured with another tunnel Geneve port. The default value is 6081.\n+    \"\"\"\n+    lock_all_memory: BooleanOption = field(default=False, metadata=long(\"mlockall\"))\n+    \"\"\"Enable/disable locking all memory. Disabled by default.\"\"\"\n+    mempool_allocation_mode: (\n+        Literal[\n+            TestPmdMempoolAllocationMode.native,\n+            TestPmdMempoolAllocationMode.xmem,\n+            TestPmdMempoolAllocationMode.xmemhuge,\n+        ]\n+        | TestPmdAnonMempoolAllocationMode\n+        | None\n+    ) = field(default=None, metadata=long(\"mp-alloc\"))\n+    \"\"\"Select mempool allocation mode.\n+\n+    The value can be one of:\n+    * :attr:`TestPmdMempoolAllocationMode.native`\n+    * :class:`TestPmdAnonMempoolAllocationMode`\n+    * :attr:`TestPmdMempoolAllocationMode.xmem`\n+    * :attr:`TestPmdMempoolAllocationMode.xmemhuge`\n+    \"\"\"\n+    record_core_cycles: Option = None\n+    \"\"\"Enable measurement of CPU cycles per packet.\"\"\"\n+    record_burst_status: Option = None\n+    \"\"\"Enable display of RX and TX burst stats.\"\"\"\n+\n+\n+class TestPmdDevice(object):\n+    \"\"\"The data of a device that testpmd can recognize.\n+\n+    Attributes:\n+        pci_address: The PCI address of the device.\n+    \"\"\"\n+\n+    pci_address: str\n+\n+    def __init__(self, pci_address_line: str):\n+        \"\"\"Initialize the device from the testpmd output line string.\n+\n+        Args:\n+            pci_address_line: A line of testpmd output that contains a device.\n+        \"\"\"\n+        self.pci_address = pci_address_line.strip().split(\": \")[1].strip()\n+\n+    def __str__(self) -> str:\n+        \"\"\"The PCI address captures what the device is.\"\"\"\n+        return self.pci_address\n+\n+\n class TestPmdShell(InteractiveShell):\n     \"\"\"Testpmd interactive shell.\n \n@@ -123,8 +720,8 @@ def _start_application(self, get_privileged_command: Callable[[str], str] | None\n \n         assert isinstance(self._app_args, EalParameters)\n \n-        if isinstance(self._app_args.app_params, StrParams):\n-            self._app_args.app_params.value += \" -i --mask-event intr_lsc\"\n+        if self._app_args.app_params is None:\n+            self._app_args.app_params = TestPmdParameters()\n \n         self.number_of_ports = len(self._app_args.ports) if self._app_args.ports is not None else 0\n \n",
    "prefixes": [
        "3/6"
    ]
}