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 6423F46DDD; Tue, 26 Aug 2025 04:31:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 541AF4021E; Tue, 26 Aug 2025 04:31:06 +0200 (CEST) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id 9C5284021E for ; Tue, 26 Aug 2025 04:31:04 +0200 (CEST) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-3252e4b0f51so2528745a91.0 for ; Mon, 25 Aug 2025 19:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1756175464; x=1756780264; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=VXCZ5oTQfgQEixBMRvbWta7f3WQXJtHm+aTFD6HSjg0=; b=SHmk5Ydhu59KGRDdpH14v9sdLf6GSFBN7RKGOKMz8Eok/3hx6RJFdPMRbxzNnNTU5s +Gh539bUkos9jO8HscoLT+LgCwvnyyOSQF99Cy+ODReIdJNO9u6e4ZYHarcqAmPQo47Y cyoP/6E68Q+YXav/E87Or0P0rfjuBWIZyXZns= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756175464; x=1756780264; h=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=VXCZ5oTQfgQEixBMRvbWta7f3WQXJtHm+aTFD6HSjg0=; b=bpHs7EDM9RNcM1d8W8B63QfB/U3GBn/NDHmRZd9VpYI73JyoQupOnlTvakSypgiG8x xJP3+kkJMYDIWl0+ggrJxEKjaYfAWiGv4cAsVwm/nEzBW8x1JJP7VFKupcsUAOYhYngW /wbDktX5rnUbJlnrVagDXcGIbncrFdM44rV7rUFPZuEpXhEY5N/bYShd9OQaqB5v2kM9 LvhvQ+8LodO6+LJf4ZOLaotpmn+NbzKraWdh8nGxsufgrnupBHishPGgONiNiXyXKmLH SA245IPuCzAbVhobP/gcsfqgAyPaQTd0lnECsf4unrzNGUbCP6e5hTIXWuRSmkaNFCUQ NjPw== X-Gm-Message-State: AOJu0YzAJ/Be/4qAJWXBdu5GKEEAUj7xb0mDYWt1syS7yrzfXk6nXUXo +euEQpDppZMlti9QsPOgTojSwCv+P57yw764ITRVExC9LqcM0n2j8iwhSKBlqIG6j75q8GXeOrE oq7GjLnB6oGqGq54Cmu4qSxVqUriPxOc4E9sy/RNKgsmoYQO4XBqW X-Gm-Gg: ASbGncuWIjWztLbn3Lxi0luZvLLqpiusLqjqCOI8Tsvhd/jsa2yKxfxMtbUPLlNpbgN fSIicSg834o1xEXwX9c9weRHgxmGrQRnyZ8nOLinOQ5C0uauRDsRKJa5I1/SE62gcNJTN84f+C/ 9wReuq97BgBnqWCmEJHPUyP9Mwgtv8KdVp68H3wTXq98tod02Z2mAKM/TV8mxG/IpKsma07xCzn EXuS6/pqhBQcnzV9sV8zOKi7gMXEAHws4hzwkg= X-Google-Smtp-Source: AGHT+IFUT9kz+y5Ek4Z+tkx1il8E1fOhlhMS4EAABEegWd1eCVJe/Q1uXLCMFtxxJnr4Ld/apE/9JRf9xut7eU0yWuc= X-Received: by 2002:a17:90b:4fca:b0:325:6598:30e0 with SMTP id 98e67ed59e1d1-3256598350fmr10819021a91.18.1756175463651; Mon, 25 Aug 2025 19:31:03 -0700 (PDT) MIME-Version: 1.0 References: <20250718150404.200096-1-thomas.wilks@arm.com> <20250730125859.159185-1-thomas.wilks@arm.com> <20250730125859.159185-2-thomas.wilks@arm.com> In-Reply-To: <20250730125859.159185-2-thomas.wilks@arm.com> From: Patrick Robb Date: Mon, 25 Aug 2025 22:24:26 -0400 X-Gm-Features: Ac12FXyH-EriC9xEYQPqcbCYwb62VZjAR8FIpP1JQUf2ftuBoUO-keopFF4u4o4 Message-ID: Subject: Re: [PATCH v4 1/2] dts: add RSS functions to testpmd To: Thomas Wilks Cc: dev@dpdk.org, Paul Szczepanek , Luca Vizzarro , Ivan Malov , Dean Marx , Alex Chapman Content-Type: multipart/alternative; boundary="000000000000acaf9f063d3b76d5" 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 --000000000000acaf9f063d3b76d5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I think this patch looks good. Thanks Thomas and thanks Ivan for your insights. Reviewed-by: Patrick Robb On Wed, Jul 30, 2025 at 8:59=E2=80=AFAM Thomas Wilks = wrote: > From: Alex Chapman > > This patch adds the required functionality for the RSS key_update, > RETA, and hash test suites. This includes: > The setting of custom RETA values for routing packets to specific > queues. > The setting of the RSS mode on all ports, to specify how to hash > the packets. > The updating of the RSS hash key used during the hashing process. > > Alongside this, there is the addition of a __str__ method to the > RSSOffloadTypesFlags class, so that when flag names are cast to > a string they will use '-' as separators, instead of '_'. > This allows them to be directly used within testpmd RSS commands > without any further changes. > > Signed-off-by: Alex Chapman > Signed-off-by: Thomas Wilks > > Reviewed-by: Paul Szczepanek > Reviewed-by: Patrick Robb > Tested-by: Patrick Robb > --- > dts/framework/remote_session/testpmd_shell.py | 104 ++++++++++++++++-- > 1 file changed, 97 insertions(+), 7 deletions(-) > > diff --git a/dts/framework/remote_session/testpmd_shell.py > b/dts/framework/remote_session/testpmd_shell.py > index ad8cb273dc..473333f8fb 100644 > --- a/dts/framework/remote_session/testpmd_shell.py > +++ b/dts/framework/remote_session/testpmd_shell.py > @@ -343,6 +343,12 @@ def make_parser(cls) -> ParserFn: > RSSOffloadTypesFlag.from_list_string, > ) > > + def __str__(self): > + """Replaces underscores with hyphens to produce valid testpmd > value.""" > + if self.name is None: > + return "" > + return self.name.replace("_", "-") > + > > class DeviceCapabilitiesFlag(Flag): > """Flag representing the device capabilities.""" > @@ -644,11 +650,13 @@ class TestPmdPort(TextParser): > ) > #: Maximum number of VFs > max_vfs_num: int | None =3D field( > - default=3DNone, metadata=3DTextParser.find_int(r"Maximum number = of > VFs: (\d+)") > + default=3DNone, > + metadata=3DTextParser.find_int(r"Maximum number of VFs: (\d+)"), > ) > #: Maximum number of VMDq pools > max_vmdq_pools_num: int | None =3D field( > - default=3DNone, metadata=3DTextParser.find_int(r"Maximum number = of > VMDq pools: (\d+)") > + default=3DNone, > + metadata=3DTextParser.find_int(r"Maximum number of VMDq pools: > (\d+)"), > ) > > #: > @@ -1734,6 +1742,82 @@ def close_all_ports(self, verify: bool =3D True) -= > > None: > if not all(f"Port {p_id} is closed" in port_close_output for > p_id in range(num_ports)): > raise InteractiveCommandExecutionError("Ports were not > closed successfully.") > > + def port_config_rss_reta( > + self, port_id: int, hash_index: int, queue_id: int, verify: bool > =3D True > + ) -> None: > + """Configure a port's RSS redirection table. > + > + Args: > + port_id: The port where the redirection table will be > configured. > + hash_index: The index into the redirection table associated > with the destination queue. > + queue_id: The destination queue of the packet. > + verify: If :data:`True`, verifies if a port's redirection > table > + was correctly configured. > + > + Raises: > + InteractiveCommandExecutionError: If `verify` is :data:`True= ` > + Testpmd failed to config RSS reta. > + """ > + out =3D self.send_command(f"port config {port_id} rss reta > ({hash_index},{queue_id})") > + if verify: > + if f"The reta size of port {port_id} is" not in out: > + self._logger.debug(f"Failed to config RSS reta: \n{out}"= ) > + raise InteractiveCommandExecutionError("Testpmd failed t= o > config RSS reta.") > + > + def port_config_all_rss_offload_type( > + self, flag: RSSOffloadTypesFlag, verify: bool =3D True > + ) -> None: > + """Set the RSS mode on all ports. > + > + Args: > + flag: The RSS iptype all ports will be configured to. > + verify: If :data:`True`, it verifies if all ports RSS offloa= d > type > + was correctly configured. > + > + Raises: > + InteractiveCommandExecutionError: If `verify` is :data:`True= ` > + Testpmd failed to config the RSS mode on all ports. > + """ > + out =3D self.send_command(f"port config all rss {flag.name}") > + if verify: > + if "error" in out: > + self._logger.debug(f"Failed to config the RSS mode on al= l > ports: \n{out}") > + raise InteractiveCommandExecutionError( > + f"Testpmd failed to change RSS mode to {flag.name}" > + ) > + > + def port_config_rss_hash_key( > + self, > + port_id: int, > + offload_type: RSSOffloadTypesFlag, > + hex_str: str, > + verify: bool =3D True, > + ) -> str: > + """Sets the RSS hash key for the specified port. > + > + Args: > + port_id: The port that will have the hash key applied to. > + offload_type: The offload type the hash key will be applied > to. > + hex_str: The hash key to set. > + verify: If :data:`True`, verify that RSS has the key. > + > + Raises: > + InteractiveCommandExecutionError: If `verify` is :data:`True= ` > + Testpmd failed to set the RSS hash key. > + """ > + output =3D self.send_command( > + f"port config {port_id} rss-hash-key {offload_type} > {hex_str}", > + skip_first_line=3DTrue, > + ) > + > + if verify: > + if output.strip(): > + self._logger.debug(f"Failed to set rss hash key: > \n{output}") > + raise InteractiveCommandExecutionError( > + f"Testpmd failed to set {hex_str} on {port_id} with = a > flag of {offload_type}." > + ) > + return output > + > def show_port_info_all(self) -> list[TestPmdPort]: > """Returns the information of all the ports. > > @@ -1952,22 +2036,28 @@ def csum_set_hw( > > {port_id}:\n{csum_output}""" > ) > > - def flow_create(self, flow_rule: FlowRule, port_id: int) -> int: > + def flow_create(self, flow_rule: FlowRule, port_id: int, verify: boo= l > =3D True) -> int: > """Creates a flow rule in the testpmd session. > > - This command is implicitly verified as needed to return the > created flow rule id. > - > Args: > flow_rule: :class:`FlowRule` object used for creating testpm= d > flow rule. > port_id: Integer representing the port to use. > + verify: If :data:`True`, the output of the command is scanne= d > + to ensure the flow rule was created successfully. > > Raises: > InteractiveCommandExecutionError: If flow rule is invalid. > > Returns: > - Id of created flow rule. > + Id of created flow rule as an integer. > """ > flow_output =3D self.send_command(f"flow create {port_id} > {flow_rule}") > + if verify: > + if "created" not in flow_output: > + self._logger.debug(f"Failed to create flow > rule:\n{flow_output}") > + raise InteractiveCommandExecutionError( > + f"Failed to create flow rule:\n{flow_output}" > + ) > match =3D re.search(r"#(\d+)", flow_output) > if match is not None: > match_str =3D match.group(1) > @@ -1996,7 +2086,7 @@ def flow_delete(self, flow_id: int, port_id: int, > verify: bool =3D True) -> None: > """Deletes the specified flow rule from the testpmd session. > > Args: > - flow_id: ID of the flow to remove. > + flow_id: :class:`FlowRule` id used for deleting testpmd flow > rule. > port_id: Integer representing the port to use. > verify: If :data:`True`, the output of the command is scanne= d > to ensure the flow rule was deleted successfully. > -- > 2.43.0 > > --000000000000acaf9f063d3b76d5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think this patch looks good. Thanks Thomas and than= ks Ivan for your insights.

Reviewed-by: Patrick Robb &l= t;probb@iol.unh.edu<= /a>>

From: Al= ex Chapman <al= ex.chapman@arm.com>

This patch adds the required functionality for the RSS key_update,
RETA, and hash test suites. This includes:
The setting of custom RETA values for routing packets to specific
queues.
The setting of the RSS mode on all ports, to specify how to hash
the packets.
The updating of the RSS hash key used during the hashing process.

Alongside this, there is the addition of a __str__ method to the
RSSOffloadTypesFlags class, so that when flag names are cast to
a string they will use '-' as separators, instead of '_'. This allows them to be directly used within testpmd RSS commands
without any further changes.

Signed-off-by: Alex Chapman <alex.chapman@arm.com>
Signed-off-by: Thomas Wilks <thomas.wilks@arm.com>

Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
Reviewed-by: Patrick Robb <probb@iol.unh.edu>
Tested-by: Patrick Robb <probb@iol.unh.edu>
---
=C2=A0dts/framework/remote_session/testpmd_shell.py | 104 ++++++++++++++++-= -
=C2=A01 file changed, 97 insertions(+), 7 deletions(-)

diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/= remote_session/testpmd_shell.py
index ad8cb273dc..473333f8fb 100644
--- a/dts/framework/remote_session/testpmd_shell.py
+++ b/dts/framework/remote_session/testpmd_shell.py
@@ -343,6 +343,12 @@ def make_parser(cls) -> ParserFn:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0RSSOffloadTypesFlag.from_li= st_string,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0)

+=C2=A0 =C2=A0 def __str__(self):
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Replaces underscores with hy= phens to produce valid testpmd value."""
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if self.name is None:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return ""
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 return self.name.replace("_", "= -")
+

=C2=A0class DeviceCapabilitiesFlag(Flag):
=C2=A0 =C2=A0 =C2=A0"""Flag representing the device capabili= ties."""
@@ -644,11 +650,13 @@ class TestPmdPort(TextParser):
=C2=A0 =C2=A0 =C2=A0)
=C2=A0 =C2=A0 =C2=A0#: Maximum number of VFs
=C2=A0 =C2=A0 =C2=A0max_vfs_num: int | None =3D field(
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 default=3DNone, metadata=3DTextParser.find_int= (r"Maximum number of VFs: (\d+)")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 default=3DNone,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 metadata=3DTextParser.find_int(r"Maximum = number of VFs: (\d+)"),
=C2=A0 =C2=A0 =C2=A0)
=C2=A0 =C2=A0 =C2=A0#: Maximum number of VMDq pools
=C2=A0 =C2=A0 =C2=A0max_vmdq_pools_num: int | None =3D field(
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 default=3DNone, metadata=3DTextParser.find_int= (r"Maximum number of VMDq pools: (\d+)")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 default=3DNone,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 metadata=3DTextParser.find_int(r"Maximum = number of VMDq pools: (\d+)"),
=C2=A0 =C2=A0 =C2=A0)

=C2=A0 =C2=A0 =C2=A0#:
@@ -1734,6 +1742,82 @@ def close_all_ports(self, verify: bool =3D True) -&g= t; None:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if not all(f"Port {p_i= d} is closed" in port_close_output for p_id in range(num_ports)):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0raise Interac= tiveCommandExecutionError("Ports were not closed successfully.")<= br>
+=C2=A0 =C2=A0 def port_config_rss_reta(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 self, port_id: int, hash_index: int, queue_id:= int, verify: bool =3D True
+=C2=A0 =C2=A0 ) -> None:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Configure a port's RSS r= edirection table.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Args:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 port_id: The port where the redi= rection table will be configured.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 hash_index: The index into the r= edirection table associated with the destination queue.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 queue_id: The destination queue = of the packet.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 verify: If :data:`True`, verifie= s if a port's redirection table
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 was correctly conf= igured.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Raises:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 InteractiveCommandExecutionError= : If `verify` is :data:`True`
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Testpmd failed to = config RSS reta.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 out =3D self.send_command(f"port config {= port_id} rss reta ({hash_index},{queue_id})")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if verify:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if f"The reta size of port = {port_id} is" not in out:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self._logger.debug= (f"Failed to config RSS reta: \n{out}")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 raise InteractiveC= ommandExecutionError("Testpmd failed to config RSS reta.")
+
+=C2=A0 =C2=A0 def port_config_all_rss_offload_type(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 self, flag: RSSOffloadTypesFlag, verify: bool = =3D True
+=C2=A0 =C2=A0 ) -> None:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Set the RSS mode on all port= s.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Args:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 flag: The RSS iptype all ports w= ill be configured to.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 verify: If :data:`True`, it veri= fies if all ports RSS offload type
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 was correctly conf= igured.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Raises:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 InteractiveCommandExecutionError= : If `verify` is :data:`True`
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Testpmd failed to = config the RSS mode on all ports.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 out =3D self.send_command(f"port config a= ll rss {f= lag.name}")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if verify:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if "error" in out:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self._logger.debug= (f"Failed to config the RSS mode on all ports: \n{out}")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 raise InteractiveC= ommandExecutionError(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f&qu= ot;Testpmd failed to change RSS mode to {flag.name}"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )
+
+=C2=A0 =C2=A0 def port_config_rss_hash_key(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 self,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 port_id: int,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 offload_type: RSSOffloadTypesFlag,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 hex_str: str,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 verify: bool =3D True,
+=C2=A0 =C2=A0 ) -> str:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """Sets the RSS hash key for th= e specified port.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Args:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 port_id: The port that will have= the hash key applied to.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 offload_type: The offload type t= he hash key will be applied to.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 hex_str: The hash key to set. +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 verify: If :data:`True`, verify = that RSS has the key.
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Raises:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 InteractiveCommandExecutionError= : If `verify` is :data:`True`
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Testpmd failed to = set the RSS hash key.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 """
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 output =3D self.send_command(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f"port config {port_id} rss= -hash-key {offload_type} {hex_str}",
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 skip_first_line=3DTrue,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 )
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if verify:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if output.strip():
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self._logger.debug= (f"Failed to set rss hash key: \n{output}")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 raise InteractiveC= ommandExecutionError(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f&qu= ot;Testpmd failed to set {hex_str} on {port_id} with a flag of {offload_typ= e}."
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 return output
+
=C2=A0 =C2=A0 =C2=A0def show_port_info_all(self) -> list[TestPmdPort]: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""Returns the information= of all the ports.

@@ -1952,22 +2036,28 @@ def csum_set_hw(
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {port_id}:\n= {csum_output}"""
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0)

-=C2=A0 =C2=A0 def flow_create(self, flow_rule: FlowRule, port_id: int) -&g= t; int:
+=C2=A0 =C2=A0 def flow_create(self, flow_rule: FlowRule, port_id: int, ver= ify: bool =3D True) -> int:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""Creates a flow rule in = the testpmd session.

-=C2=A0 =C2=A0 =C2=A0 =C2=A0 This command is implicitly verified as needed = to return the created flow rule id.
-
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Args:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0flow_rule: :class:`FlowRule= ` object used for creating testpmd flow rule.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0port_id: Integer representi= ng the port to use.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 verify: If :data:`True`, the out= put of the command is scanned
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 to ensure the flow= rule was created successfully.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Raises:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0InteractiveCommandExecution= Error: If flow rule is invalid.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Returns:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Id of created flow rule.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Id of created flow rule as an in= teger.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0flow_output =3D self.send_command(f"= flow create {port_id} {flow_rule}")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if verify:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if "created" not in fl= ow_output:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self._logger.debug= (f"Failed to create flow rule:\n{flow_output}")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 raise InteractiveC= ommandExecutionError(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f&qu= ot;Failed to create flow rule:\n{flow_output}"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0match =3D re.search(r"#(\d+)", = flow_output)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if match is not None:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0match_str =3D match.group(1= )
@@ -1996,7 +2086,7 @@ def flow_delete(self, flow_id: int, port_id: int, ver= ify: bool =3D True) -> None:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"""Deletes the specified f= low rule from the testpmd session.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Args:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 flow_id: ID of the flow to remov= e.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 flow_id: :class:`FlowRule` id us= ed for deleting testpmd flow rule.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0port_id: Integer representi= ng the port to use.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0verify: If :data:`True`, th= e output of the command is scanned
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0to ensure the= flow rule was deleted successfully.
--
2.43.0

--000000000000acaf9f063d3b76d5--