From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D8930440B7; Fri, 31 May 2024 17:21:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BDD7142C24; Fri, 31 May 2024 17:21:00 +0200 (CEST) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by mails.dpdk.org (Postfix) with ESMTP id 5814140265 for ; Fri, 31 May 2024 17:20:59 +0200 (CEST) Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2ea9537a914so717961fa.0 for ; Fri, 31 May 2024 08:20:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1717168859; x=1717773659; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=r5ez3ut/unU4jIqwFYTNMOcatCeYDQdZCmF/phHf7YM=; b=WpC3ITYU1k6FSP8KuzXAkeq8hbKEIlS/f50L53silBgqPMfdDHDRVz3vozYLCUJVcE ITXrW/f4fMJEER3eh/sekAaOYtwhNdsT4qctrHl/LlKlwTplT+WgWiP88mcGG615NG6s rlVMjwgv5E03eEOKdto/b691W2+BL4kYFw6xo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717168859; x=1717773659; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r5ez3ut/unU4jIqwFYTNMOcatCeYDQdZCmF/phHf7YM=; b=tnV+p0ijvuT0yi0ErCVbePA7kfX/6WsRLWAUhXYZ20f+MxvacxGrNGB7VtYHe72WwR 8D3jkoW73bm9CllxwO8MQCvJ2iXrnh91sUEhQ3Oqwt8EprgFrHlTbzlobXMvzmnLVClC bqSlatZ3I++XZthDC1Q9uM7CjDRaXvyE/ivYM4hCSIw2aQnBQFp/L39jS4a+cJu2yOln 217OolZ6fEVCYMViTH27dI7kns7QXqCh/1TgkEuBd5ch/F75T/xiqMyGYRHi6zwonHSY m0Xg3lzHok7BzE2zmHZmo7cKjBM51kYpGcpGSiQV0no5NahvJyktxr0788L0ZLq6XZfU t5jQ== X-Gm-Message-State: AOJu0Yx/whzbocXV/8aefuhp/yU+IkuBj0mEUtyBo43KOcD7L4AZGMGK k2QGXc639Cn+iCZZd6Nz7vXNFKoBxKWkCAMCUIRlewf00gyVtIEkBzz2udeEgHl3vUuu9tk+LnL fegf/pFjCEso7lRO67FYynUpOZrNQLdl5UBHn/w== X-Google-Smtp-Source: AGHT+IGv/wPoGD9KgxzEFW06h+drWG5YP5KH5uNPajOIt81GQxnT/uZrkEXVHvI0/I67eX2p+RwC4BW+MahwGnm+JkE= X-Received: by 2002:a2e:a7d0:0:b0:2da:320a:6739 with SMTP id 38308e7fff4ca-2ea950bef02mr18248991fa.1.1717168858582; Fri, 31 May 2024 08:20:58 -0700 (PDT) MIME-Version: 1.0 References: <20240326190422.577028-1-luca.vizzarro@arm.com> <20240530152505.389167-1-luca.vizzarro@arm.com> <20240530152505.389167-6-luca.vizzarro@arm.com> In-Reply-To: <20240530152505.389167-6-luca.vizzarro@arm.com> From: Nicholas Pratte Date: Fri, 31 May 2024 11:20:47 -0400 Message-ID: Subject: Re: [PATCH v3 5/8] dts: add testpmd shell params To: Luca Vizzarro Cc: dev@dpdk.org, =?UTF-8?Q?Juraj_Linke=C5=A1?= , Jeremy Spewock , Paul Szczepanek Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Tested-by: Nicholas Pratte Reviewed-by: Nicholas Pratte On Thu, May 30, 2024 at 11:25=E2=80=AFAM Luca Vizzarro wrote: > > Implement all the testpmd shell parameters into a data structure. > > Signed-off-by: Luca Vizzarro > Reviewed-by: Paul Szczepanek > --- > dts/framework/params/testpmd.py | 609 ++++++++++++++++++ > dts/framework/remote_session/testpmd_shell.py | 42 +- > dts/tests/TestSuite_pmd_buffer_scatter.py | 5 +- > 3 files changed, 616 insertions(+), 40 deletions(-) > create mode 100644 dts/framework/params/testpmd.py > > diff --git a/dts/framework/params/testpmd.py b/dts/framework/params/testp= md.py > new file mode 100644 > index 0000000000..88d208d683 > --- /dev/null > +++ b/dts/framework/params/testpmd.py > @@ -0,0 +1,609 @@ > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright(c) 2024 Arm Limited > + > +"""Module containing all the TestPmd-related parameter classes.""" > + > +from dataclasses import dataclass, field > +from enum import EnumMeta, Flag, auto, unique > +from pathlib import PurePath > +from typing import Literal, NamedTuple > + > +from framework.params import ( > + Params, > + Switch, > + YesNoSwitch, > + bracketed, > + comma_separated, > + convert_str, > + hex_from_flag_value, > + str_from_flag_value, > +) > +from framework.params.eal import EalParams > +from framework.utils import StrEnum > + > + > +class PortTopology(StrEnum): > + """Enum representing the port topology.""" > + > + #: In paired mode, the forwarding is between pairs of ports, e.g.: (= 0,1), (2,3), (4,5). > + paired =3D auto() > + > + #: In chained mode, the forwarding is to the next available port in = the port mask, e.g.: > + #: (0,1), (1,2), (2,0). > + #: > + #: The ordering of the ports can be changed using the portlist testp= md runtime function. > + chained =3D auto() > + > + #: In loop mode, ingress traffic is simply transmitted back on the s= ame interface. > + loop =3D auto() > + > + > +@convert_str(bracketed, comma_separated) > +class PortNUMAConfig(NamedTuple): > + """DPDK port to NUMA socket association tuple.""" > + > + #: > + port: int > + #: > + socket: int > + > + > +@convert_str(str_from_flag_value) > +@unique > +class FlowDirection(Flag): > + """Flag indicating the direction of the flow. > + > + A bi-directional flow can be specified with the pipe: > + > + >>> TestPmdFlowDirection.RX | TestPmdFlowDirection.TX > + > + """ > + > + #: > + RX =3D 1 << 0 > + #: > + TX =3D 1 << 1 > + > + > +@convert_str(bracketed, comma_separated) > +class RingNUMAConfig(NamedTuple): > + """Tuple associating DPDK port, direction of the flow and NUMA socke= t.""" > + > + #: > + port: int > + #: > + direction: FlowDirection > + #: > + socket: int > + > + > +@convert_str(comma_separated) > +class EthPeer(NamedTuple): > + """Tuple associating a MAC address to the specified DPDK port.""" > + > + #: > + port_no: int > + #: > + mac_address: str > + > + > +@convert_str(comma_separated) > +class TxIPAddrPair(NamedTuple): > + """Tuple specifying the source and destination IPs for the packets."= "" > + > + #: > + source_ip: str > + #: > + dest_ip: str > + > + > +@convert_str(comma_separated) > +class TxUDPPortPair(NamedTuple): > + """Tuple specifying the UDP source and destination ports for the pac= kets. > + > + If leaving ``dest_port`` unspecified, ``source_port`` will be used f= or > + the destination port as well. > + """ > + > + #: > + source_port: int > + #: > + dest_port: int | None =3D None > + > + > +@dataclass > +class DisableRSS(Params): > + """Disables RSS (Receive Side Scaling).""" > + > + _disable_rss: Literal[True] =3D field( > + default=3DTrue, init=3DFalse, metadata=3DParams.long("disable-rs= s") > + ) > + > + > +@dataclass > +class SetRSSIPOnly(Params): > + """Sets RSS (Receive Side Scaling) functions for IPv4/IPv6 only.""" > + > + _rss_ip: Literal[True] =3D field(default=3DTrue, init=3DFalse, metad= ata=3DParams.long("rss-ip")) > + > + > +@dataclass > +class SetRSSUDP(Params): > + """Sets RSS (Receive Side Scaling) functions for IPv4/IPv6 and UDP."= "" > + > + _rss_udp: Literal[True] =3D field(default=3DTrue, init=3DFalse, meta= data=3DParams.long("rss-udp")) > + > + > +class RSSSetting(EnumMeta): > + """Enum representing a RSS setting. Each property is a class that ne= eds to be initialised.""" > + > + #: > + Disabled =3D DisableRSS > + #: > + SetIPOnly =3D SetRSSIPOnly > + #: > + SetUDP =3D SetRSSUDP > + > + > +class SimpleForwardingModes(StrEnum): > + r"""The supported packet forwarding modes for :class:`~TestPmdShell`= \s.""" > + > + #: > + io =3D auto() > + #: > + mac =3D auto() > + #: > + macswap =3D auto() > + #: > + rxonly =3D auto() > + #: > + csum =3D auto() > + #: > + icmpecho =3D auto() > + #: > + ieee1588 =3D auto() > + #: > + fivetswap =3D "5tswap" > + #: > + shared_rxq =3D "shared-rxq" > + #: > + recycle_mbufs =3D auto() > + > + > +@dataclass(kw_only=3DTrue) > +class TXOnlyForwardingMode(Params): > + """Sets a TX-Only forwarding mode. > + > + Attributes: > + multi_flow: Generates multiple flows if set to True. > + segments_length: Sets TX segment sizes or total packet length. > + """ > + > + _forward_mode: Literal["txonly"] =3D field( > + default=3D"txonly", init=3DFalse, metadata=3DParams.long("forwar= d-mode") > + ) > + multi_flow: Switch =3D field(default=3DNone, metadata=3DParams.long(= "txonly-multi-flow")) > + segments_length: list[int] | None =3D field( > + default=3DNone, metadata=3DParams.long("txpkts") | Params.conver= t_value(comma_separated) > + ) > + > + > +@dataclass(kw_only=3DTrue) > +class FlowGenForwardingMode(Params): > + """Sets a flowgen forwarding mode. > + > + Attributes: > + clones: Set the number of each packet clones to be sent. Sending= clones reduces host CPU > + load on creating packets and may help in testing extreme= speeds or maxing out > + Tx packet performance. N should be not zero, but less th= an =E2=80=98burst=E2=80=99 parameter. > + flows: Set the number of flows to be generated, where 1 <=3D N <= =3D INT32_MAX. > + segments_length: Set TX segment sizes or total packet length. > + """ > + > + _forward_mode: Literal["flowgen"] =3D field( > + default=3D"flowgen", init=3DFalse, metadata=3DParams.long("forwa= rd-mode") > + ) > + clones: int | None =3D field(default=3DNone, metadata=3DParams.long(= "flowgen-clones")) > + flows: int | None =3D field(default=3DNone, metadata=3DParams.long("= flowgen-flows")) > + segments_length: list[int] | None =3D field( > + default=3DNone, metadata=3DParams.long("txpkts") | Params.conver= t_value(comma_separated) > + ) > + > + > +@dataclass(kw_only=3DTrue) > +class NoisyForwardingMode(Params): > + """Sets a noisy forwarding mode. > + > + Attributes: > + forward_mode: Set the noisy VNF forwarding mode. > + tx_sw_buffer_size: Set the maximum number of elements of the FIF= O queue to be created for > + buffering packets. > + tx_sw_buffer_flushtime: Set the time before packets in the FIFO = queue are flushed. > + lkup_memory: Set the size of the noisy neighbor simulation memor= y buffer in MB to N. > + lkup_num_reads: Set the size of the noisy neighbor simulation me= mory buffer in MB to N. > + lkup_num_writes: Set the number of writes to be done in noisy ne= ighbor simulation > + memory buffer to N. > + lkup_num_reads_writes: Set the number of r/w accesses to be done= in noisy neighbor > + simulation memory buffer to N. > + """ > + > + _forward_mode: Literal["noisy"] =3D field( > + default=3D"noisy", init=3DFalse, metadata=3DParams.long("forward= -mode") > + ) > + forward_mode: ( > + Literal[ > + SimpleForwardingModes.io, > + SimpleForwardingModes.mac, > + SimpleForwardingModes.macswap, > + SimpleForwardingModes.fivetswap, > + ] > + | None > + ) =3D field(default=3DSimpleForwardingModes.io, metadata=3DParams.lo= ng("noisy-forward-mode")) > + tx_sw_buffer_size: int | None =3D field( > + default=3DNone, metadata=3DParams.long("noisy-tx-sw-buffer-size"= ) > + ) > + tx_sw_buffer_flushtime: int | None =3D field( > + default=3DNone, metadata=3DParams.long("noisy-tx-sw-buffer-flush= time") > + ) > + lkup_memory: int | None =3D field(default=3DNone, metadata=3DParams.= long("noisy-lkup-memory")) > + lkup_num_reads: int | None =3D field(default=3DNone, metadata=3DPara= ms.long("noisy-lkup-num-reads")) > + lkup_num_writes: int | None =3D field(default=3DNone, metadata=3DPar= ams.long("noisy-lkup-num-writes")) > + lkup_num_reads_writes: int | None =3D field( > + default=3DNone, metadata=3DParams.long("noisy-lkup-num-reads-wri= tes") > + ) > + > + > +@convert_str(hex_from_flag_value) > +@unique > +class HairpinMode(Flag): > + """Flag representing the hairpin mode.""" > + > + #: Two hairpin ports loop. > + TWO_PORTS_LOOP =3D 1 << 0 > + #: Two hairpin ports paired. > + TWO_PORTS_PAIRED =3D 1 << 1 > + #: Explicit Tx flow rule. > + EXPLICIT_TX_FLOW =3D 1 << 4 > + #: Force memory settings of hairpin RX queue. > + FORCE_RX_QUEUE_MEM_SETTINGS =3D 1 << 8 > + #: Force memory settings of hairpin TX queue. > + FORCE_TX_QUEUE_MEM_SETTINGS =3D 1 << 9 > + #: Hairpin RX queues will use locked device memory. > + RX_QUEUE_USE_LOCKED_DEVICE_MEMORY =3D 1 << 12 > + #: Hairpin RX queues will use RTE memory. > + RX_QUEUE_USE_RTE_MEMORY =3D 1 << 13 > + #: Hairpin TX queues will use locked device memory. > + TX_QUEUE_USE_LOCKED_DEVICE_MEMORY =3D 1 << 16 > + #: Hairpin TX queues will use RTE memory. > + TX_QUEUE_USE_RTE_MEMORY =3D 1 << 18 > + > + > +@dataclass(kw_only=3DTrue) > +class RXRingParams(Params): > + """Sets the RX ring parameters. > + > + Attributes: > + descriptors: Set the number of descriptors in the RX rings to N,= where N > 0. > + prefetch_threshold: Set the prefetch threshold register of RX ri= ngs to N, where N >=3D 0. > + host_threshold: Set the host threshold register of RX rings to N= , where N >=3D 0. > + write_back_threshold: Set the write-back threshold register of R= X rings to N, where N >=3D 0. > + free_threshold: Set the free threshold of RX descriptors to N, > + where 0 <=3D N < value of ``-=E2=80=93rxd``. > + """ > + > + descriptors: int | None =3D field(default=3DNone, metadata=3DParams.= long("rxd")) > + prefetch_threshold: int | None =3D field(default=3DNone, metadata=3D= Params.long("rxpt")) > + host_threshold: int | None =3D field(default=3DNone, metadata=3DPara= ms.long("rxht")) > + write_back_threshold: int | None =3D field(default=3DNone, metadata= =3DParams.long("rxwt")) > + free_threshold: int | None =3D field(default=3DNone, metadata=3DPara= ms.long("rxfreet")) > + > + > +@convert_str(hex_from_flag_value) > +@unique > +class RXMultiQueueMode(Flag): > + """Flag representing the RX multi-queue mode.""" > + > + #: > + RSS =3D 1 << 0 > + #: > + DCB =3D 1 << 1 > + #: > + VMDQ =3D 1 << 2 > + > + > +@dataclass(kw_only=3DTrue) > +class TXRingParams(Params): > + """Sets the TX ring parameters. > + > + Attributes: > + descriptors: Set the number of descriptors in the TX rings to N,= where N > 0. > + rs_bit_threshold: Set the transmit RS bit threshold of TX rings = to N, > + where 0 <=3D N <=3D value of ``--txd``. > + prefetch_threshold: Set the prefetch threshold register of TX ri= ngs to N, where N >=3D 0. > + host_threshold: Set the host threshold register of TX rings to N= , where N >=3D 0. > + write_back_threshold: Set the write-back threshold register of T= X rings to N, where N >=3D 0. > + free_threshold: Set the transmit free threshold of TX rings to N= , > + where 0 <=3D N <=3D value of ``--txd``. > + """ > + > + descriptors: int | None =3D field(default=3DNone, metadata=3DParams.= long("txd")) > + rs_bit_threshold: int | None =3D field(default=3DNone, metadata=3DPa= rams.long("txrst")) > + prefetch_threshold: int | None =3D field(default=3DNone, metadata=3D= Params.long("txpt")) > + host_threshold: int | None =3D field(default=3DNone, metadata=3DPara= ms.long("txht")) > + write_back_threshold: int | None =3D field(default=3DNone, metadata= =3DParams.long("txwt")) > + free_threshold: int | None =3D field(default=3DNone, metadata=3DPara= ms.long("txfreet")) > + > + > +class Event(StrEnum): > + """Enum representing a testpmd event.""" > + > + #: > + unknown =3D auto() > + #: > + queue_state =3D auto() > + #: > + vf_mbox =3D auto() > + #: > + macsec =3D auto() > + #: > + intr_lsc =3D auto() > + #: > + intr_rmv =3D auto() > + #: > + intr_reset =3D auto() > + #: > + dev_probed =3D auto() > + #: > + dev_released =3D auto() > + #: > + flow_aged =3D auto() > + #: > + err_recovering =3D auto() > + #: > + recovery_success =3D auto() > + #: > + recovery_failed =3D auto() > + #: > + all =3D auto() > + > + > +class SimpleMempoolAllocationMode(StrEnum): > + """Enum representing simple mempool allocation modes.""" > + > + #: Create and populate mempool using native DPDK memory. > + native =3D auto() > + #: Create and populate mempool using externally and anonymously allo= cated area. > + xmem =3D auto() > + #: Create and populate mempool using externally and anonymously allo= cated hugepage area. > + xmemhuge =3D auto() > + > + > +@dataclass(kw_only=3DTrue) > +class AnonMempoolAllocationMode(Params): > + """Create mempool using native DPDK memory, but populate using anony= mous memory. > + > + Attributes: > + no_iova_contig: Enables to create mempool which is not IOVA cont= iguous. > + """ > + > + _mp_alloc: Literal["anon"] =3D field(default=3D"anon", init=3DFalse,= metadata=3DParams.long("mp-alloc")) > + no_iova_contig: Switch =3D None > + > + > +@dataclass(slots=3DTrue, kw_only=3DTrue) > +class TestPmdParams(EalParams): > + """The testpmd shell parameters. > + > + Attributes: > + interactive_mode: Runs testpmd in interactive mode. > + auto_start: Start forwarding on initialization. > + tx_first: Start forwarding, after sending a burst of packets fir= st. > + stats_period: Display statistics every ``PERIOD`` seconds, if in= teractive mode is disabled. > + The default value is 0, which means that the stati= stics will not be displayed. > + > + .. note:: This flag should be used only in non-int= eractive mode. > + display_xstats: Display comma-separated list of extended statist= ics every ``PERIOD`` seconds > + as specified in ``--stats-period`` or when used = with interactive commands > + that show Rx/Tx statistics (i.e. =E2=80=98show p= ort stats=E2=80=99). > + nb_cores: Set the number of forwarding cores, where 1 <=3D N <= =3D =E2=80=9Cnumber of cores=E2=80=9D or > + ``RTE_MAX_LCORE`` from the configuration file. > + coremask: Set the bitmask of the cores running the packet forwar= ding test. The main > + lcore is reserved for command line parsing only and ca= nnot be masked on for packet > + forwarding. > + nb_ports: Set the number of forwarding ports, where 1 <=3D N <= =3D =E2=80=9Cnumber of ports=E2=80=9D on the board > + or ``RTE_MAX_ETHPORTS`` from the configuration file. T= he default value is the > + number of ports on the board. > + port_topology: Set port topology, where mode is paired (the defa= ult), chained or loop. > + portmask: Set the bitmask of the ports used by the packet forwar= ding test. > + portlist: Set the forwarding ports based on the user input used = by the packet forwarding > + test. =E2=80=98-=E2=80=98 denotes a range of ports to = set including the two specified port IDs =E2=80=98,=E2=80=99 > + separates multiple port values. Possible examples like= =E2=80=93portlist=3D0,1 or > + =E2=80=93portlist=3D0-2 or =E2=80=93portlist=3D0,1-2 e= tc. > + numa: Enable/disable NUMA-aware allocation of RX/TX rings and of= RX memory buffers (mbufs). > + socket_num: Set the socket from which all memory is allocated in= NUMA mode, where > + 0 <=3D N < number of sockets on the board. > + port_numa_config: Specify the socket on which the memory pool to= be used by the port will be > + allocated. > + ring_numa_config: Specify the socket on which the TX/RX rings fo= r the port will be > + allocated. Where flag is 1 for RX, 2 for TX, a= nd 3 for RX and TX. > + total_num_mbufs: Set the number of mbufs to be allocated in the = mbuf pools, where N > 1024. > + mbuf_size: Set the data size of the mbufs used to N bytes, where= N < 65536. > + If multiple mbuf-size values are specified the extra = memory pools will be created > + for allocating mbufs to receive packets with buffer s= plitting features. > + mbcache: Set the cache of mbuf memory pools to N, where 0 <=3D N= <=3D 512. > + max_pkt_len: Set the maximum packet size to N bytes, where N >= =3D 64. > + eth_peers_configfile: Use a configuration file containing the Et= hernet addresses of > + the peer ports. > + eth_peer: Set the MAC address XX:XX:XX:XX:XX:XX of the peer port= N, > + where 0 <=3D N < RTE_MAX_ETHPORTS. > + tx_ip: Set the source and destination IP address used when doing= transmit only test. > + The defaults address values are source 198.18.0.1 and des= tination 198.18.0.2. > + These are special purpose addresses reserved for benchmar= king (RFC 5735). > + tx_udp: Set the source and destination UDP port number for trans= mit test only test. > + The default port is the port 9 which is defined for the = discard protocol (RFC 863). > + enable_lro: Enable large receive offload. > + max_lro_pkt_size: Set the maximum LRO aggregated packet size to = N bytes, where N >=3D 64. > + disable_crc_strip: Disable hardware CRC stripping. > + enable_scatter: Enable scatter (multi-segment) RX. > + enable_hw_vlan: Enable hardware VLAN. > + enable_hw_vlan_filter: Enable hardware VLAN filter. > + enable_hw_vlan_strip: Enable hardware VLAN strip. > + enable_hw_vlan_extend: Enable hardware VLAN extend. > + enable_hw_qinq_strip: Enable hardware QINQ strip. > + pkt_drop_enabled: Enable per-queue packet drop for packets with = no descriptors. > + rss: Receive Side Scaling setting. > + forward_mode: Set the forwarding mode. > + hairpin_mode: Set the hairpin port configuration. > + hairpin_queues: Set the number of hairpin queues per port to N, = where 1 <=3D N <=3D 65535. > + burst: Set the number of packets per burst to N, where 1 <=3D N = <=3D 512. > + enable_rx_cksum: Enable hardware RX checksum offload. > + rx_queues: Set the number of RX queues per port to N, where 1 <= =3D N <=3D 65535. > + rx_ring: Set the RX rings parameters. > + no_flush_rx: Don=E2=80=99t flush the RX streams before starting = forwarding. Used mainly with > + the PCAP PMD. > + rx_segments_offsets: Set the offsets of packet segments on recei= ving > + if split feature is engaged. > + rx_segments_length: Set the length of segments to scatter packet= s on receiving > + if split feature is engaged. > + multi_rx_mempool: Enable multiple mbuf pools per Rx queue. > + rx_shared_queue: Create queues in shared Rx queue mode if device= supports. Shared Rx queues > + are grouped per X ports. X defaults to UINT32_M= AX, implies all ports join > + share group 1. Forwarding engine =E2=80=9Cshare= d-rxq=E2=80=9D should be used for shared Rx > + queues. This engine does Rx only and update str= eam statistics accordingly. > + rx_offloads: Set the bitmask of RX queue offloads. > + rx_mq_mode: Set the RX multi queue mode which can be enabled. > + tx_queues: Set the number of TX queues per port to N, where 1 <= =3D N <=3D 65535. > + tx_ring: Set the TX rings params. > + tx_offloads: Set the hexadecimal bitmask of TX queue offloads. > + eth_link_speed: Set a forced link speed to the ethernet port. E.= g. 1000 for 1Gbps. > + disable_link_check: Disable check on link status when starting/s= topping ports. > + disable_device_start: Do not automatically start all ports. This= allows testing > + configuration of rx and tx queues before d= evice is started > + for the first time. > + no_lsc_interrupt: Disable LSC interrupts for all ports, even tho= se supporting it. > + no_rmv_interrupt: Disable RMV interrupts for all ports, even tho= se supporting it. > + bitrate_stats: Set the logical core N to perform bitrate calcula= tion. > + latencystats: Set the logical core N to perform latency and jitt= er calculations. > + print_events: Enable printing the occurrence of the designated e= vents. > + Using :attr:`TestPmdEvent.ALL` will enable all of = them. > + mask_events: Disable printing the occurrence of the designated e= vents. > + Using :attr:`TestPmdEvent.ALL` will disable all of = them. > + flow_isolate_all: Providing this parameter requests flow API iso= lated mode on all ports at > + initialization time. It ensures all traffic is= received through the > + configured flow rules only (see flow command).= Ports that do not support > + this mode are automatically discarded. > + disable_flow_flush: Disable port flow flush when stopping port. > + This allows testing keep flow rules or share= d flow objects across > + restart. > + hot_plug: Enable device event monitor mechanism for hotplug. > + vxlan_gpe_port: Set the UDP port number of tunnel VXLAN-GPE to N= . > + geneve_parsed_port: Set the UDP port number that is used for par= sing the GENEVE protocol > + to N. HW may be configured with another tunn= el Geneve port. > + lock_all_memory: Enable/disable locking all memory. Disabled by = default. > + mempool_allocation_mode: Set mempool allocation mode. > + record_core_cycles: Enable measurement of CPU cycles per packet. > + record_burst_status: Enable display of RX and TX burst stats. > + """ > + > + interactive_mode: Switch =3D field(default=3DTrue, metadata=3DParams= .short("i")) > + auto_start: Switch =3D field(default=3DNone, metadata=3DParams.short= ("a")) > + tx_first: Switch =3D None > + stats_period: int | None =3D None > + display_xstats: list[str] | None =3D field( > + default=3DNone, metadata=3DParams.convert_value(comma_separated) > + ) > + nb_cores: int | None =3D None > + coremask: int | None =3D field(default=3DNone, metadata=3DParams.con= vert_value(hex)) > + nb_ports: int | None =3D None > + port_topology: PortTopology | None =3D PortTopology.paired > + portmask: int | None =3D field(default=3DNone, metadata=3DParams.con= vert_value(hex)) > + portlist: str | None =3D None # TODO: can be ranges 0,1-3 > + > + numa: YesNoSwitch =3D True > + socket_num: int | None =3D None > + port_numa_config: list[PortNUMAConfig] | None =3D field( > + default=3DNone, metadata=3DParams.convert_value(comma_separated) > + ) > + ring_numa_config: list[RingNUMAConfig] | None =3D field( > + default=3DNone, metadata=3DParams.convert_value(comma_separated) > + ) > + total_num_mbufs: int | None =3D None > + mbuf_size: list[int] | None =3D field( > + default=3DNone, metadata=3DParams.convert_value(comma_separated) > + ) > + mbcache: int | None =3D None > + max_pkt_len: int | None =3D None > + eth_peers_configfile: PurePath | None =3D None > + eth_peer: list[EthPeer] | None =3D field(default=3DNone, metadata=3D= Params.multiple()) > + tx_ip: TxIPAddrPair | None =3D TxIPAddrPair(source_ip=3D"198.18.0.1"= , dest_ip=3D"198.18.0.2") > + tx_udp: TxUDPPortPair | None =3D TxUDPPortPair(9) > + enable_lro: Switch =3D None > + max_lro_pkt_size: int | None =3D None > + disable_crc_strip: Switch =3D None > + enable_scatter: Switch =3D None > + enable_hw_vlan: Switch =3D None > + enable_hw_vlan_filter: Switch =3D None > + enable_hw_vlan_strip: Switch =3D None > + enable_hw_vlan_extend: Switch =3D None > + enable_hw_qinq_strip: Switch =3D None > + pkt_drop_enabled: Switch =3D field(default=3DNone, metadata=3DParams= .long("enable-drop-en")) > + rss: RSSSetting | None =3D None > + forward_mode: ( > + SimpleForwardingModes > + | FlowGenForwardingMode > + | TXOnlyForwardingMode > + | NoisyForwardingMode > + | None > + ) =3D SimpleForwardingModes.io > + hairpin_mode: HairpinMode | None =3D HairpinMode(0) > + hairpin_queues: int | None =3D field(default=3DNone, metadata=3DPara= ms.long("hairpinq")) > + burst: int | None =3D None > + enable_rx_cksum: Switch =3D None > + > + rx_queues: int | None =3D field(default=3DNone, metadata=3DParams.lo= ng("rxq")) > + rx_ring: RXRingParams | None =3D None > + no_flush_rx: Switch =3D None > + rx_segments_offsets: list[int] | None =3D field( > + default=3DNone, metadata=3DParams.long("rxoffs") | Params.conver= t_value(comma_separated) > + ) > + rx_segments_length: list[int] | None =3D field( > + default=3DNone, metadata=3DParams.long("rxpkts") | Params.conver= t_value(comma_separated) > + ) > + multi_rx_mempool: Switch =3D None > + rx_shared_queue: Switch | int =3D field(default=3DNone, metadata=3DP= arams.long("rxq-share")) > + rx_offloads: int | None =3D field(default=3DNone, metadata=3DParams.= convert_value(hex)) > + rx_mq_mode: RXMultiQueueMode | None =3D ( > + RXMultiQueueMode.DCB | RXMultiQueueMode.RSS | RXMultiQueueMode.V= MDQ > + ) > + > + tx_queues: int | None =3D field(default=3DNone, metadata=3DParams.lo= ng("txq")) > + tx_ring: TXRingParams | None =3D None > + tx_offloads: int | None =3D field(default=3DNone, metadata=3DParams.= convert_value(hex)) > + > + eth_link_speed: int | None =3D None > + disable_link_check: Switch =3D None > + disable_device_start: Switch =3D None > + no_lsc_interrupt: Switch =3D None > + no_rmv_interrupt: Switch =3D None > + bitrate_stats: int | None =3D None > + latencystats: int | None =3D None > + print_events: list[Event] | None =3D field( > + default=3DNone, metadata=3DParams.multiple() | Params.long("prin= t-event") > + ) > + mask_events: list[Event] | None =3D field( > + default_factory=3Dlambda: [Event.intr_lsc], > + metadata=3DParams.multiple() | Params.long("mask-event"), > + ) > + > + flow_isolate_all: Switch =3D None > + disable_flow_flush: Switch =3D None > + > + hot_plug: Switch =3D None > + vxlan_gpe_port: int | None =3D None > + geneve_parsed_port: int | None =3D None > + lock_all_memory: YesNoSwitch =3D field(default=3DFalse, metadata=3DP= arams.long("mlockall")) > + mempool_allocation_mode: SimpleMempoolAllocationMode | AnonMempoolAl= locationMode | None =3D field( > + default=3DNone, metadata=3DParams.long("mp-alloc") > + ) > + record_core_cycles: Switch =3D None > + record_burst_status: Switch =3D None > diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framewor= k/remote_session/testpmd_shell.py > index 841d456a2f..ef3f23c582 100644 > --- a/dts/framework/remote_session/testpmd_shell.py > +++ b/dts/framework/remote_session/testpmd_shell.py > @@ -1,6 +1,7 @@ > # SPDX-License-Identifier: BSD-3-Clause > # Copyright(c) 2023 University of New Hampshire > # Copyright(c) 2023 PANTHEON.tech s.r.o. > +# Copyright(c) 2024 Arm Limited > > """Testpmd interactive shell. > > @@ -16,14 +17,12 @@ > """ > > import time > -from enum import auto > from pathlib import PurePath > from typing import Callable, ClassVar > > from framework.exception import InteractiveCommandExecutionError > -from framework.params.eal import EalParams > +from framework.params.testpmd import SimpleForwardingModes, TestPmdParam= s > from framework.settings import SETTINGS > -from framework.utils import StrEnum > > from .interactive_shell import InteractiveShell > > @@ -50,37 +49,6 @@ def __str__(self) -> str: > return self.pci_address > > > -class TestPmdForwardingModes(StrEnum): > - r"""The supported packet forwarding modes for :class:`~TestPmdShell`= \s.""" > - > - #: > - io =3D auto() > - #: > - mac =3D auto() > - #: > - macswap =3D auto() > - #: > - flowgen =3D auto() > - #: > - rxonly =3D auto() > - #: > - txonly =3D auto() > - #: > - csum =3D auto() > - #: > - icmpecho =3D auto() > - #: > - ieee1588 =3D auto() > - #: > - noisy =3D auto() > - #: > - fivetswap =3D "5tswap" > - #: > - shared_rxq =3D "shared-rxq" > - #: > - recycle_mbufs =3D auto() > - > - > class TestPmdShell(InteractiveShell): > """Testpmd interactive shell. > > @@ -119,9 +87,7 @@ def _start_application(self, get_privileged_command: C= allable[[str], str] | None > Also find the number of pci addresses which were allowed on the = command line when the app > was started. > """ > - self._app_params +=3D " -i --mask-event intr_lsc" > - > - assert isinstance(self._app_params, EalParams) > + assert isinstance(self._app_params, TestPmdParams) > > self.number_of_ports =3D ( > len(self._app_params.ports) if self._app_params.ports is not= None else 0 > @@ -213,7 +179,7 @@ def wait_link_status_up(self, port_id: int, timeout= =3DSETTINGS.timeout) -> bool: > self._logger.error(f"The link for port {port_id} did not com= e up in the given timeout.") > return "Link status: up" in port_info > > - def set_forward_mode(self, mode: TestPmdForwardingModes, verify: boo= l =3D True): > + def set_forward_mode(self, mode: SimpleForwardingModes, verify: bool= =3D True): > """Set packet forwarding mode. > > Args: > diff --git a/dts/tests/TestSuite_pmd_buffer_scatter.py b/dts/tests/TestSu= ite_pmd_buffer_scatter.py > index c6e93839cb..578b5a4318 100644 > --- a/dts/tests/TestSuite_pmd_buffer_scatter.py > +++ b/dts/tests/TestSuite_pmd_buffer_scatter.py > @@ -23,7 +23,8 @@ > from scapy.utils import hexstr # type: ignore[import-untyped] > > from framework.params import Params > -from framework.remote_session.testpmd_shell import TestPmdForwardingMode= s, TestPmdShell > +from framework.params.testpmd import SimpleForwardingModes > +from framework.remote_session.testpmd_shell import TestPmdShell > from framework.test_suite import TestSuite > > > @@ -113,7 +114,7 @@ def pmd_scatter(self, mbsize: int) -> None: > ), > privileged=3DTrue, > ) > - testpmd.set_forward_mode(TestPmdForwardingModes.mac) > + testpmd.set_forward_mode(SimpleForwardingModes.mac) > testpmd.start() > > for offset in [-1, 0, 1, 4, 5]: > -- > 2.34.1 >