Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/140003/?format=api
http://patches.dpdk.org/api/patches/140003/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240509112057.1167947-6-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": "<20240509112057.1167947-6-luca.vizzarro@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20240509112057.1167947-6-luca.vizzarro@arm.com", "date": "2024-05-09T11:20:54", "name": "[v2,5/8] dts: add testpmd shell params", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "f2bca70fde8814241ab8cb95dcc562583bf97d5c", "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/20240509112057.1167947-6-luca.vizzarro@arm.com/mbox/", "series": [ { "id": 31897, "url": "http://patches.dpdk.org/api/series/31897/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31897", "date": "2024-05-09T11:20:49", "name": "dts: add testpmd params", "version": 2, "mbox": "http://patches.dpdk.org/series/31897/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/140003/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/140003/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 1658143F7C;\n\tThu, 9 May 2024 13:21:50 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9A19640693;\n\tThu, 9 May 2024 13:21:19 +0200 (CEST)", "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id 68A964067D\n for <dev@dpdk.org>; Thu, 9 May 2024 13:21:14 +0200 (CEST)", "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 6C7701474;\n Thu, 9 May 2024 04:21:39 -0700 (PDT)", "from localhost.localdomain (unknown [10.1.194.74])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 400C43F6A8;\n Thu, 9 May 2024 04:21:13 -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 Jeremy Spewock <jspewock@iol.unh.edu>, Luca Vizzarro <luca.vizzarro@arm.com>,\n Paul Szczepanek <paul.szczepanek@arm.com>", "Subject": "[PATCH v2 5/8] dts: add testpmd shell params", "Date": "Thu, 9 May 2024 12:20:54 +0100", "Message-Id": "<20240509112057.1167947-6-luca.vizzarro@arm.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20240509112057.1167947-1-luca.vizzarro@arm.com>", "References": "<20240326190422.577028-1-luca.vizzarro@arm.com>\n <20240509112057.1167947-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: Paul Szczepanek <paul.szczepanek@arm.com>\n---\n dts/framework/params/testpmd.py | 608 ++++++++++++++++++\n dts/framework/remote_session/testpmd_shell.py | 42 +-\n dts/tests/TestSuite_pmd_buffer_scatter.py | 5 +-\n 3 files changed, 615 insertions(+), 40 deletions(-)\n create mode 100644 dts/framework/params/testpmd.py", "diff": "diff --git a/dts/framework/params/testpmd.py b/dts/framework/params/testpmd.py\nnew file mode 100644\nindex 0000000000..f8f70320cf\n--- /dev/null\n+++ b/dts/framework/params/testpmd.py\n@@ -0,0 +1,608 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2024 Arm Limited\n+\n+\"\"\"Module containing all the TestPmd-related parameter classes.\"\"\"\n+\n+from dataclasses import dataclass, field\n+from enum import EnumMeta, Flag, auto, unique\n+from pathlib import PurePath\n+from typing import Literal, NamedTuple\n+\n+from framework.params import (\n+ Params,\n+ Switch,\n+ YesNoSwitch,\n+ bracketed,\n+ comma_separated,\n+ convert_str,\n+ hex_from_flag_value,\n+ str_from_flag_value,\n+)\n+from framework.params.eal import EalParams\n+from framework.utils import StrEnum\n+\n+\n+class PortTopology(StrEnum):\n+ \"\"\"Enum representing the port topology.\"\"\"\n+\n+ paired = auto()\n+ \"\"\"In paired mode, the forwarding is between pairs of ports, e.g.: (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, e.g.:\n+ (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+@convert_str(bracketed, comma_separated)\n+class PortNUMAConfig(NamedTuple):\n+ \"\"\"DPDK port to NUMA socket association tuple.\"\"\"\n+\n+ #:\n+ port: int\n+ #:\n+ socket: int\n+\n+\n+@convert_str(str_from_flag_value)\n+@unique\n+class FlowDirection(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+ #:\n+ RX = 1 << 0\n+ #:\n+ TX = 1 << 1\n+\n+\n+@convert_str(bracketed, comma_separated)\n+class RingNUMAConfig(NamedTuple):\n+ \"\"\"Tuple associating DPDK port, direction of the flow and NUMA socket.\"\"\"\n+\n+ #:\n+ port: int\n+ #:\n+ direction: FlowDirection\n+ #:\n+ socket: int\n+\n+\n+@convert_str(comma_separated)\n+class EthPeer(NamedTuple):\n+ \"\"\"Tuple associating a MAC address to the specified DPDK port.\"\"\"\n+\n+ #:\n+ port_no: int\n+ #:\n+ mac_address: str\n+\n+\n+@convert_str(comma_separated)\n+class TxIPAddrPair(NamedTuple):\n+ \"\"\"Tuple specifying the source and destination IPs for the packets.\"\"\"\n+\n+ #:\n+ source_ip: str\n+ #:\n+ dest_ip: str\n+\n+\n+@convert_str(comma_separated)\n+class TxUDPPortPair(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\n+ the destination port as well.\n+ \"\"\"\n+\n+ #:\n+ source_port: int\n+ #:\n+ dest_port: int | None = None\n+\n+\n+@dataclass\n+class DisableRSS(Params):\n+ \"\"\"Disables RSS (Receive Side Scaling).\"\"\"\n+\n+ _disable_rss: Literal[True] = field(\n+ default=True, init=False, metadata=Params.long(\"disable-rss\")\n+ )\n+\n+\n+@dataclass\n+class SetRSSIPOnly(Params):\n+ \"\"\"Sets RSS (Receive Side Scaling) functions for IPv4/IPv6 only.\"\"\"\n+\n+ _rss_ip: Literal[True] = field(default=True, init=False, metadata=Params.long(\"rss-ip\"))\n+\n+\n+@dataclass\n+class SetRSSUDP(Params):\n+ \"\"\"Sets RSS (Receive Side Scaling) functions for IPv4/IPv6 and UDP.\"\"\"\n+\n+ _rss_udp: Literal[True] = field(default=True, init=False, metadata=Params.long(\"rss-udp\"))\n+\n+\n+class RSSSetting(EnumMeta):\n+ \"\"\"Enum representing a RSS setting. Each property is a class that needs to be initialised.\"\"\"\n+\n+ #:\n+ Disabled = DisableRSS\n+ #:\n+ SetIPOnly = SetRSSIPOnly\n+ #:\n+ SetUDP = SetRSSUDP\n+\n+\n+class SimpleForwardingModes(StrEnum):\n+ r\"\"\"The supported packet forwarding modes for :class:`~TestPmdShell`\\s.\"\"\"\n+\n+ #:\n+ io = auto()\n+ #:\n+ mac = auto()\n+ #:\n+ macswap = auto()\n+ #:\n+ rxonly = auto()\n+ #:\n+ csum = auto()\n+ #:\n+ icmpecho = auto()\n+ #:\n+ ieee1588 = auto()\n+ #:\n+ fivetswap = \"5tswap\"\n+ #:\n+ shared_rxq = \"shared-rxq\"\n+ #:\n+ recycle_mbufs = auto()\n+\n+\n+@dataclass(kw_only=True)\n+class TXOnlyForwardingMode(Params):\n+ \"\"\"Sets a TX-Only forwarding mode.\n+\n+ Attributes:\n+ multi_flow: Generates multiple flows if set to True.\n+ segments_length: Sets TX segment sizes or total packet length.\n+ \"\"\"\n+\n+ _forward_mode: Literal[\"txonly\"] = field(\n+ default=\"txonly\", init=False, metadata=Params.long(\"forward-mode\")\n+ )\n+ multi_flow: Switch = field(default=None, metadata=Params.long(\"txonly-multi-flow\"))\n+ segments_length: list[int] | None = field(\n+ default=None, metadata=Params.long(\"txpkts\") | Params.convert_value(comma_separated)\n+ )\n+\n+\n+@dataclass(kw_only=True)\n+class FlowGenForwardingMode(Params):\n+ \"\"\"Sets a flowgen forwarding mode.\n+\n+ Attributes:\n+ clones: Set the number of each packet clones to be sent. Sending clones reduces host CPU\n+ load on creating packets and may help in testing extreme speeds or maxing out\n+ Tx packet performance. N should be not zero, but less than ‘burst’ parameter.\n+ flows: Set the number of flows to be generated, where 1 <= N <= INT32_MAX.\n+ segments_length: Set TX segment sizes or total packet length.\n+ \"\"\"\n+\n+ _forward_mode: Literal[\"flowgen\"] = field(\n+ default=\"flowgen\", init=False, metadata=Params.long(\"forward-mode\")\n+ )\n+ clones: int | None = field(default=None, metadata=Params.long(\"flowgen-clones\"))\n+ flows: int | None = field(default=None, metadata=Params.long(\"flowgen-flows\"))\n+ segments_length: list[int] | None = field(\n+ default=None, metadata=Params.long(\"txpkts\") | Params.convert_value(comma_separated)\n+ )\n+\n+\n+@dataclass(kw_only=True)\n+class NoisyForwardingMode(Params):\n+ \"\"\"Sets a noisy forwarding mode.\n+\n+ Attributes:\n+ forward_mode: Set the noisy VNF forwarding mode.\n+ tx_sw_buffer_size: Set the maximum number of elements of the FIFO queue to be created for\n+ buffering packets.\n+ tx_sw_buffer_flushtime: Set the time before packets in the FIFO queue are flushed.\n+ lkup_memory: Set the size of the noisy neighbor simulation memory buffer in MB to N.\n+ lkup_num_reads: Set the size of the noisy neighbor simulation memory buffer in MB to N.\n+ lkup_num_writes: Set the number of writes to be done in noisy neighbor simulation\n+ memory buffer to N.\n+ lkup_num_reads_writes: Set the number of r/w accesses to be done in noisy neighbor\n+ simulation memory buffer to N.\n+ \"\"\"\n+\n+ _forward_mode: Literal[\"noisy\"] = field(\n+ default=\"noisy\", init=False, metadata=Params.long(\"forward-mode\")\n+ )\n+ forward_mode: (\n+ Literal[\n+ SimpleForwardingModes.io,\n+ SimpleForwardingModes.mac,\n+ SimpleForwardingModes.macswap,\n+ SimpleForwardingModes.fivetswap,\n+ ]\n+ | None\n+ ) = field(default=SimpleForwardingModes.io, metadata=Params.long(\"noisy-forward-mode\"))\n+ tx_sw_buffer_size: int | None = field(\n+ default=None, metadata=Params.long(\"noisy-tx-sw-buffer-size\")\n+ )\n+ tx_sw_buffer_flushtime: int | None = field(\n+ default=None, metadata=Params.long(\"noisy-tx-sw-buffer-flushtime\")\n+ )\n+ lkup_memory: int | None = field(default=None, metadata=Params.long(\"noisy-lkup-memory\"))\n+ lkup_num_reads: int | None = field(default=None, metadata=Params.long(\"noisy-lkup-num-reads\"))\n+ lkup_num_writes: int | None = field(default=None, metadata=Params.long(\"noisy-lkup-num-writes\"))\n+ lkup_num_reads_writes: int | None = field(\n+ default=None, metadata=Params.long(\"noisy-lkup-num-reads-writes\")\n+ )\n+\n+\n+@convert_str(hex_from_flag_value)\n+@unique\n+class HairpinMode(Flag):\n+ \"\"\"Flag representing the hairpin mode.\"\"\"\n+\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+@dataclass(kw_only=True)\n+class RXRingParams(Params):\n+ \"\"\"Sets the RX ring parameters.\n+\n+ Attributes:\n+ descriptors: Set the number of descriptors in the RX rings to N, where N > 0.\n+ prefetch_threshold: Set the prefetch threshold register of RX rings to N, where N >= 0.\n+ host_threshold: Set the host threshold register of RX rings to N, where N >= 0.\n+ write_back_threshold: Set the write-back threshold register of RX rings to N, where N >= 0.\n+ free_threshold: Set the free threshold of RX descriptors to N,\n+ where 0 <= N < value of ``-–rxd``.\n+ \"\"\"\n+\n+ descriptors: int | None = field(default=None, metadata=Params.long(\"rxd\"))\n+ prefetch_threshold: int | None = field(default=None, metadata=Params.long(\"rxpt\"))\n+ host_threshold: int | None = field(default=None, metadata=Params.long(\"rxht\"))\n+ write_back_threshold: int | None = field(default=None, metadata=Params.long(\"rxwt\"))\n+ free_threshold: int | None = field(default=None, metadata=Params.long(\"rxfreet\"))\n+\n+\n+@convert_str(hex_from_flag_value)\n+@unique\n+class RXMultiQueueMode(Flag):\n+ \"\"\"Flag representing the RX multi-queue mode.\"\"\"\n+\n+ #:\n+ RSS = 1 << 0\n+ #:\n+ DCB = 1 << 1\n+ #:\n+ VMDQ = 1 << 2\n+\n+\n+@dataclass(kw_only=True)\n+class TXRingParams(Params):\n+ \"\"\"Sets the TX ring parameters.\n+\n+ Attributes:\n+ descriptors: Set the number of descriptors in the TX rings to N, where N > 0.\n+ rs_bit_threshold: Set the transmit RS bit threshold of TX rings to N,\n+ where 0 <= N <= value of ``--txd``.\n+ prefetch_threshold: Set the prefetch threshold register of TX rings to N, where N >= 0.\n+ host_threshold: Set the host threshold register of TX rings to N, where N >= 0.\n+ write_back_threshold: Set the write-back threshold register of TX rings to N, where N >= 0.\n+ free_threshold: Set the transmit free threshold of TX rings to N,\n+ where 0 <= N <= value of ``--txd``.\n+ \"\"\"\n+\n+ descriptors: int | None = field(default=None, metadata=Params.long(\"txd\"))\n+ rs_bit_threshold: int | None = field(default=None, metadata=Params.long(\"txrst\"))\n+ prefetch_threshold: int | None = field(default=None, metadata=Params.long(\"txpt\"))\n+ host_threshold: int | None = field(default=None, metadata=Params.long(\"txht\"))\n+ write_back_threshold: int | None = field(default=None, metadata=Params.long(\"txwt\"))\n+ free_threshold: int | None = field(default=None, metadata=Params.long(\"txfreet\"))\n+\n+\n+class Event(StrEnum):\n+ \"\"\"Enum representing a testpmd event.\"\"\"\n+\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 SimpleMempoolAllocationMode(StrEnum):\n+ \"\"\"Enum representing simple mempool allocation modes.\"\"\"\n+\n+ native = auto()\n+ \"\"\"Create and populate mempool using native DPDK 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 AnonMempoolAllocationMode(Params):\n+ \"\"\"Create mempool using native DPDK memory, but populate using anonymous memory.\n+\n+ Attributes:\n+ no_iova_contig: Enables to create mempool which is not IOVA contiguous.\n+ \"\"\"\n+\n+ _mp_alloc: Literal[\"anon\"] = field(default=\"anon\", init=False, metadata=Params.long(\"mp-alloc\"))\n+ no_iova_contig: Switch = None\n+\n+\n+@dataclass(slots=True, kw_only=True)\n+class TestPmdParams(EalParams):\n+ \"\"\"The testpmd shell parameters.\n+\n+ Attributes:\n+ interactive_mode: Runs testpmd in interactive mode.\n+ auto_start: Start forwarding on initialization.\n+ tx_first: Start forwarding, after sending a burst of packets first.\n+ stats_period: 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+ display_xstats: Display comma-separated list of extended statistics every ``PERIOD`` seconds\n+ as specified in ``--stats-period`` or when used with interactive commands\n+ that show Rx/Tx statistics (i.e. ‘show port stats’).\n+ nb_cores: Set the number of forwarding cores, where 1 <= N <= “number of cores” or\n+ ``RTE_MAX_LCORE`` from the configuration file.\n+ coremask: Set the bitmask of the cores running the packet forwarding test. The main\n+ lcore is reserved for command line parsing only and cannot be masked on for packet\n+ forwarding.\n+ nb_ports: Set the number of forwarding ports, where 1 <= N <= “number of ports” on the board\n+ or ``RTE_MAX_ETHPORTS`` from the configuration file. The default value is the\n+ number of ports on the board.\n+ port_topology: Set port topology, where mode is paired (the default), chained or loop.\n+ portmask: Set the bitmask of the ports used by the packet forwarding test.\n+ portlist: Set the forwarding ports based on the user input used by the packet forwarding\n+ test. ‘-‘ denotes a range of ports to set including the two specified port IDs ‘,’\n+ separates multiple port values. Possible examples like –portlist=0,1 or\n+ –portlist=0-2 or –portlist=0,1-2 etc.\n+ numa: Enable/disable NUMA-aware allocation of RX/TX rings and of RX memory buffers (mbufs).\n+ socket_num: Set the socket from which all memory is allocated in NUMA mode, where\n+ 0 <= N < number of sockets on the board.\n+ port_numa_config: Specify the socket on which the memory pool to be used by the port will be\n+ allocated.\n+ ring_numa_config: Specify the socket on which the TX/RX rings for the port will be\n+ allocated. Where flag is 1 for RX, 2 for TX, and 3 for RX and TX.\n+ total_num_mbufs: Set the number of mbufs to be allocated in the mbuf pools, where N > 1024.\n+ mbuf_size: Set the data size of the mbufs used to N bytes, where N < 65536.\n+ If multiple mbuf-size values are specified the extra memory pools will be created\n+ for allocating mbufs to receive packets with buffer splitting features.\n+ mbcache: Set the cache of mbuf memory pools to N, where 0 <= N <= 512.\n+ max_pkt_len: Set the maximum packet size to N bytes, where N >= 64.\n+ eth_peers_configfile: Use a configuration file containing the Ethernet addresses of\n+ the peer ports.\n+ eth_peer: Set the MAC address XX:XX:XX:XX:XX:XX of the peer port N,\n+ where 0 <= N < RTE_MAX_ETHPORTS.\n+ tx_ip: 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+ tx_udp: 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+ enable_lro: Enable large receive offload.\n+ max_lro_pkt_size: Set the maximum LRO aggregated packet size to N bytes, where N >= 64.\n+ disable_crc_strip: Disable hardware CRC stripping.\n+ enable_scatter: Enable scatter (multi-segment) RX.\n+ enable_hw_vlan: Enable hardware VLAN.\n+ enable_hw_vlan_filter: Enable hardware VLAN filter.\n+ enable_hw_vlan_strip: Enable hardware VLAN strip.\n+ enable_hw_vlan_extend: Enable hardware VLAN extend.\n+ enable_hw_qinq_strip: Enable hardware QINQ strip.\n+ pkt_drop_enabled: Enable per-queue packet drop for packets with no descriptors.\n+ rss: Receive Side Scaling setting.\n+ forward_mode: Set the forwarding mode.\n+ hairpin_mode: Set the hairpin port configuration.\n+ hairpin_queues: Set the number of hairpin queues per port to N, where 1 <= N <= 65535.\n+ burst: Set the number of packets per burst to N, where 1 <= N <= 512.\n+ enable_rx_cksum: Enable hardware RX checksum offload.\n+ rx_queues: Set the number of RX queues per port to N, where 1 <= N <= 65535.\n+ rx_ring: Set the RX rings parameters.\n+ no_flush_rx: Don’t flush the RX streams before starting forwarding. Used mainly with\n+ the PCAP PMD.\n+ rx_segments_offsets: Set the offsets of packet segments on receiving\n+ if split feature is engaged.\n+ rx_segments_length: Set the length of segments to scatter packets on receiving\n+ if split feature is engaged.\n+ multi_rx_mempool: Enable multiple mbuf pools per Rx queue.\n+ rx_shared_queue: Create queues in shared Rx queue mode if device supports. Shared Rx queues\n+ are grouped per X ports. X defaults to UINT32_MAX, implies all ports join\n+ share group 1. Forwarding engine “shared-rxq” should be used for shared Rx\n+ queues. This engine does Rx only and update stream statistics accordingly.\n+ rx_offloads: Set the bitmask of RX queue offloads.\n+ rx_mq_mode: Set the RX multi queue mode which can be enabled.\n+ tx_queues: Set the number of TX queues per port to N, where 1 <= N <= 65535.\n+ tx_ring: Set the TX rings params.\n+ tx_offloads: Set the hexadecimal bitmask of TX queue offloads.\n+ eth_link_speed: Set a forced link speed to the ethernet port. E.g. 1000 for 1Gbps.\n+ disable_link_check: Disable check on link status when starting/stopping ports.\n+ disable_device_start: Do not automatically start all ports. This allows testing\n+ configuration of rx and tx queues before device is started\n+ for the first time.\n+ no_lsc_interrupt: Disable LSC interrupts for all ports, even those supporting it.\n+ no_rmv_interrupt: Disable RMV interrupts for all ports, even those supporting it.\n+ bitrate_stats: Set the logical core N to perform bitrate calculation.\n+ latencystats: Set the logical core N to perform latency and jitter calculations.\n+ print_events: Enable printing the occurrence of the designated events.\n+ Using :attr:`TestPmdEvent.ALL` will enable all of them.\n+ mask_events: Disable printing the occurrence of the designated events.\n+ Using :attr:`TestPmdEvent.ALL` will disable all of them.\n+ flow_isolate_all: Providing this parameter requests flow API isolated mode on all ports at\n+ initialization time. It ensures all traffic is received through the\n+ configured flow rules only (see flow command). Ports that do not support\n+ this mode are automatically discarded.\n+ disable_flow_flush: Disable port flow flush when stopping port.\n+ This allows testing keep flow rules or shared flow objects across\n+ restart.\n+ hot_plug: Enable device event monitor mechanism for hotplug.\n+ vxlan_gpe_port: Set the UDP port number of tunnel VXLAN-GPE to N.\n+ geneve_parsed_port: Set the UDP port number that is used for parsing the GENEVE protocol\n+ to N. HW may be configured with another tunnel Geneve port.\n+ lock_all_memory: Enable/disable locking all memory. Disabled by default.\n+ mempool_allocation_mode: Set mempool allocation mode.\n+ record_core_cycles: Enable measurement of CPU cycles per packet.\n+ record_burst_status: Enable display of RX and TX burst stats.\n+ \"\"\"\n+\n+ interactive_mode: Switch = field(default=True, metadata=Params.short(\"i\"))\n+ auto_start: Switch = field(default=None, metadata=Params.short(\"a\"))\n+ tx_first: Switch = None\n+ stats_period: int | None = None\n+ display_xstats: list[str] | None = field(\n+ default=None, metadata=Params.convert_value(comma_separated)\n+ )\n+ nb_cores: int | None = None\n+ coremask: int | None = field(default=None, metadata=Params.convert_value(hex))\n+ nb_ports: int | None = None\n+ port_topology: PortTopology | None = PortTopology.paired\n+ portmask: int | None = field(default=None, metadata=Params.convert_value(hex))\n+ portlist: str | None = None # TODO: can be ranges 0,1-3\n+\n+ numa: YesNoSwitch = True\n+ socket_num: int | None = None\n+ port_numa_config: list[PortNUMAConfig] | None = field(\n+ default=None, metadata=Params.convert_value(comma_separated)\n+ )\n+ ring_numa_config: list[RingNUMAConfig] | None = field(\n+ default=None, metadata=Params.convert_value(comma_separated)\n+ )\n+ total_num_mbufs: int | None = None\n+ mbuf_size: list[int] | None = field(\n+ default=None, metadata=Params.convert_value(comma_separated)\n+ )\n+ mbcache: int | None = None\n+ max_pkt_len: int | None = None\n+ eth_peers_configfile: PurePath | None = None\n+ eth_peer: list[EthPeer] | None = field(default=None, metadata=Params.multiple())\n+ tx_ip: TxIPAddrPair | None = TxIPAddrPair(source_ip=\"198.18.0.1\", dest_ip=\"198.18.0.2\")\n+ tx_udp: TxUDPPortPair | None = TxUDPPortPair(9)\n+ enable_lro: Switch = None\n+ max_lro_pkt_size: int | None = None\n+ disable_crc_strip: Switch = None\n+ enable_scatter: Switch = None\n+ enable_hw_vlan: Switch = None\n+ enable_hw_vlan_filter: Switch = None\n+ enable_hw_vlan_strip: Switch = None\n+ enable_hw_vlan_extend: Switch = None\n+ enable_hw_qinq_strip: Switch = None\n+ pkt_drop_enabled: Switch = field(default=None, metadata=Params.long(\"enable-drop-en\"))\n+ rss: RSSSetting | None = None\n+ forward_mode: (\n+ SimpleForwardingModes\n+ | FlowGenForwardingMode\n+ | TXOnlyForwardingMode\n+ | NoisyForwardingMode\n+ | None\n+ ) = SimpleForwardingModes.io\n+ hairpin_mode: HairpinMode | None = HairpinMode(0)\n+ hairpin_queues: int | None = field(default=None, metadata=Params.long(\"hairpinq\"))\n+ burst: int | None = None\n+ enable_rx_cksum: Switch = None\n+\n+ rx_queues: int | None = field(default=None, metadata=Params.long(\"rxq\"))\n+ rx_ring: RXRingParams | None = None\n+ no_flush_rx: Switch = None\n+ rx_segments_offsets: list[int] | None = field(\n+ default=None, metadata=Params.long(\"rxoffs\") | Params.convert_value(comma_separated)\n+ )\n+ rx_segments_length: list[int] | None = field(\n+ default=None, metadata=Params.long(\"rxpkts\") | Params.convert_value(comma_separated)\n+ )\n+ multi_rx_mempool: Switch = None\n+ rx_shared_queue: Switch | int = field(default=None, metadata=Params.long(\"rxq-share\"))\n+ rx_offloads: int | None = field(default=None, metadata=Params.convert_value(hex))\n+ rx_mq_mode: RXMultiQueueMode | None = (\n+ RXMultiQueueMode.DCB | RXMultiQueueMode.RSS | RXMultiQueueMode.VMDQ\n+ )\n+\n+ tx_queues: int | None = field(default=None, metadata=Params.long(\"txq\"))\n+ tx_ring: TXRingParams | None = None\n+ tx_offloads: int | None = field(default=None, metadata=Params.convert_value(hex))\n+\n+ eth_link_speed: int | None = None\n+ disable_link_check: Switch = None\n+ disable_device_start: Switch = None\n+ no_lsc_interrupt: Switch = None\n+ no_rmv_interrupt: Switch = None\n+ bitrate_stats: int | None = None\n+ latencystats: int | None = None\n+ print_events: list[Event] | None = field(\n+ default=None, metadata=Params.multiple() | Params.long(\"print-event\")\n+ )\n+ mask_events: list[Event] | None = field(\n+ default_factory=lambda: [Event.intr_lsc],\n+ metadata=Params.multiple() | Params.long(\"mask-event\"),\n+ )\n+\n+ flow_isolate_all: Switch = None\n+ disable_flow_flush: Switch = None\n+\n+ hot_plug: Switch = None\n+ vxlan_gpe_port: int | None = None\n+ geneve_parsed_port: int | None = None\n+ lock_all_memory: YesNoSwitch = field(default=False, metadata=Params.long(\"mlockall\"))\n+ mempool_allocation_mode: SimpleMempoolAllocationMode | AnonMempoolAllocationMode | None = field(\n+ default=None, metadata=Params.long(\"mp-alloc\")\n+ )\n+ record_core_cycles: Switch = None\n+ record_burst_status: Switch = None\ndiff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py\nindex 841d456a2f..ef3f23c582 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@@ -16,14 +17,12 @@\n \"\"\"\n \n import time\n-from enum import auto\n from pathlib import PurePath\n from typing import Callable, ClassVar\n \n from framework.exception import InteractiveCommandExecutionError\n-from framework.params.eal import EalParams\n+from framework.params.testpmd import SimpleForwardingModes, TestPmdParams\n from framework.settings import SETTINGS\n-from framework.utils import StrEnum\n \n from .interactive_shell import InteractiveShell\n \n@@ -50,37 +49,6 @@ def __str__(self) -> str:\n return self.pci_address\n \n \n-class TestPmdForwardingModes(StrEnum):\n- r\"\"\"The supported packet forwarding modes for :class:`~TestPmdShell`\\s.\"\"\"\n-\n- #:\n- io = auto()\n- #:\n- mac = auto()\n- #:\n- macswap = auto()\n- #:\n- flowgen = auto()\n- #:\n- rxonly = auto()\n- #:\n- txonly = auto()\n- #:\n- csum = auto()\n- #:\n- icmpecho = auto()\n- #:\n- ieee1588 = auto()\n- #:\n- noisy = auto()\n- #:\n- fivetswap = \"5tswap\"\n- #:\n- shared_rxq = \"shared-rxq\"\n- #:\n- recycle_mbufs = auto()\n-\n-\n class TestPmdShell(InteractiveShell):\n \"\"\"Testpmd interactive shell.\n \n@@ -119,9 +87,7 @@ def _start_application(self, get_privileged_command: Callable[[str], str] | None\n Also find the number of pci addresses which were allowed on the command line when the app\n was started.\n \"\"\"\n- self._app_params += \" -i --mask-event intr_lsc\"\n-\n- assert isinstance(self._app_params, EalParams)\n+ assert isinstance(self._app_params, TestPmdParams)\n \n self.number_of_ports = (\n len(self._app_params.ports) if self._app_params.ports is not None else 0\n@@ -213,7 +179,7 @@ def wait_link_status_up(self, port_id: int, timeout=SETTINGS.timeout) -> bool:\n self._logger.error(f\"The link for port {port_id} did not come up in the given timeout.\")\n return \"Link status: up\" in port_info\n \n- def set_forward_mode(self, mode: TestPmdForwardingModes, verify: bool = True):\n+ def set_forward_mode(self, mode: SimpleForwardingModes, verify: bool = True):\n \"\"\"Set packet forwarding mode.\n \n Args:\ndiff --git a/dts/tests/TestSuite_pmd_buffer_scatter.py b/dts/tests/TestSuite_pmd_buffer_scatter.py\nindex c6e93839cb..578b5a4318 100644\n--- a/dts/tests/TestSuite_pmd_buffer_scatter.py\n+++ b/dts/tests/TestSuite_pmd_buffer_scatter.py\n@@ -23,7 +23,8 @@\n from scapy.utils import hexstr # type: ignore[import-untyped]\n \n from framework.params import Params\n-from framework.remote_session.testpmd_shell import TestPmdForwardingModes, TestPmdShell\n+from framework.params.testpmd import SimpleForwardingModes\n+from framework.remote_session.testpmd_shell import TestPmdShell\n from framework.test_suite import TestSuite\n \n \n@@ -113,7 +114,7 @@ def pmd_scatter(self, mbsize: int) -> None:\n ),\n privileged=True,\n )\n- testpmd.set_forward_mode(TestPmdForwardingModes.mac)\n+ testpmd.set_forward_mode(SimpleForwardingModes.mac)\n testpmd.start()\n \n for offset in [-1, 0, 1, 4, 5]:\n", "prefixes": [ "v2", "5/8" ] }{ "id": 140003, "url": "