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 5A25945482; Mon, 17 Jun 2024 17:24:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B1A740A77; Mon, 17 Jun 2024 17:24:22 +0200 (CEST) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by mails.dpdk.org (Postfix) with ESMTP id 5E3CF40A77 for ; Mon, 17 Jun 2024 17:24:20 +0200 (CEST) Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2ebc724e1fdso4411091fa.1 for ; Mon, 17 Jun 2024 08:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1718637860; x=1719242660; 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=bPcySwz36jLBCMWpqus5/J+MTpDDTuLS09j0L0v+Lgk=; b=f/NTojD6d/9dURGDDxqw0GF49WktZoybwt9O6aEsZVvdAmPAVV8vY+bfuI45zTM1Zt 7/IoKWGPF93XofkZ/kyqKG0ojUXBcHAmBVNDNPHT/3R2T+rTQMzBKnnuHbTpk/7vGgFP Ak907o/ohjL/t1y8OmIJ+JuPwGsMQoVxip1M4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718637860; x=1719242660; 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=bPcySwz36jLBCMWpqus5/J+MTpDDTuLS09j0L0v+Lgk=; b=OxV2IYZZ85EcyyoMBiD469cFVF2LNaFNVnJxJWj9iGiYgSiSod1VUmC6ewOmxZBXcM QTGvdy+rLIqRi6T0qLzQMllTWekti93eTOuMHR0Hyrm0JVjQzCYsNlVMqYMX2SM2Ocek n9X5Ch6hNDsKmW7YMAciq4WT9zcXSvADGVQ3+7msQa2852q9qt9ohs3eYOl9GE2ilqOm otKehndFWhz6HnXDQynQMAE9VdmRbq0gFNJZU1zFGi3qsOXzophj90h8A8OkmFobD4+A 3sKchx501+FptrMnyNZk6a33jMxguGqQqZI2OymkaB1Youn3I7w/YShglxpn/9cJTfnx aTXg== X-Gm-Message-State: AOJu0Yx8sDOxBiTQkNeRJukNo4JOmhwCCaXcrZ9bQT75l8NEXGcVI0Xh BTHKi3QWSWXk1lN3boiKRR+pvoeeNbuw1n6krkPicy4mJr8pbH4s0DUCEvSlp9YGiiuIcdBJXiO zUTJeOqmM2xk0XVs5o+dG8/cYK2RkdoWBryKdXg== X-Google-Smtp-Source: AGHT+IE9fqHffaz+Qtv1gmkXtqwro1ih/gu3nCTXFVep9z1fGI32GKvbPYZjOkVl9fV757SYyv6cjyrEjkST03FRWXs= X-Received: by 2002:a05:651c:2108:b0:2eb:da20:7b3f with SMTP id 38308e7fff4ca-2ec0e463c43mr68714741fa.1.1718637859568; Mon, 17 Jun 2024 08:24:19 -0700 (PDT) MIME-Version: 1.0 References: <20240326190422.577028-1-luca.vizzarro@arm.com> <20240617145409.67407-1-luca.vizzarro@arm.com> <20240617145409.67407-6-luca.vizzarro@arm.com> In-Reply-To: <20240617145409.67407-6-luca.vizzarro@arm.com> From: Nicholas Pratte Date: Mon, 17 Jun 2024 11:24:08 -0400 Message-ID: Subject: Re: [PATCH v5 5/8] dts: add testpmd shell params To: Luca Vizzarro Cc: dev@dpdk.org, Jeremy Spewock , =?UTF-8?Q?Juraj_Linke=C5=A1?= , 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 Mon, Jun 17, 2024 at 10:54=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 > Reviewed-by: Juraj Linke=C5=A1 > Reviewed-by: Jeremy Spewock > Reviewed-by: Nicholas Pratte > --- > dts/framework/params/testpmd.py | 607 ++++++++++++++++++ > dts/framework/remote_session/testpmd_shell.py | 39 +- > dts/tests/TestSuite_pmd_buffer_scatter.py | 5 +- > 3 files changed, 613 insertions(+), 38 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..1913bd0fa2 > --- /dev/null > +++ b/dts/framework/params/testpmd.py > @@ -0,0 +1,607 @@ > +# 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, > + hex_from_flag_value, > + modify_str, > + 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() > + > + > +@modify_str(comma_separated, bracketed) > +class PortNUMAConfig(NamedTuple): > + """DPDK port to NUMA socket association tuple.""" > + > + #: > + port: int > + #: > + socket: int > + > + > +@modify_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 > + > + > +@modify_str(comma_separated, bracketed) > +class RingNUMAConfig(NamedTuple): > + """Tuple associating DPDK port, direction of the flow and NUMA socke= t.""" > + > + #: > + port: int > + #: > + direction: FlowDirection > + #: > + socket: int > + > + > +@modify_str(comma_separated) > +class EthPeer(NamedTuple): > + """Tuple associating a MAC address to the specified DPDK port.""" > + > + #: > + port_no: int > + #: > + mac_address: str > + > + > +@modify_str(comma_separated) > +class TxIPAddrPair(NamedTuple): > + """Tuple specifying the source and destination IPs for the packets."= "" > + > + #: > + source_ip: str > + #: > + dest_ip: str > + > + > +@modify_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") > + ) > + > + > +@modify_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")) > + > + > +@modify_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: Run 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 None > + 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 None > + tx_udp: TxUDPPortPair | None =3D None > + 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 None > + hairpin_mode: HairpinMode | None =3D None > + 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 None > + > + 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=3DNone, metadata=3DPa= rams.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 2b9ef9418d..82701a9839 100644 > --- a/dts/framework/remote_session/testpmd_shell.py > +++ b/dts/framework/remote_session/testpmd_shell.py > @@ -26,7 +26,7 @@ > from typing_extensions import Self > > from framework.exception import InteractiveCommandExecutionError > -from framework.params.eal import EalParams > +from framework.params.testpmd import SimpleForwardingModes, TestPmdParam= s > from framework.parser import ParserFn, TextParser > from framework.settings import SETTINGS > from framework.utils import StrEnum > @@ -56,37 +56,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 VLANOffloadFlag(Flag): > """Flag representing the VLAN offload settings of a NIC port.""" > > @@ -646,9 +615,7 @@ def _start_application(self, get_privileged_command: = Callable[[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 > @@ -740,7 +707,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 >