From: Andrew Bailey <abailey@iol.unh.edu>
To: luca.vizzarro@arm.com
Cc: abailey@iol.unh.edu, dev@dpdk.org, dmarx@iol.unh.edu,
probb@iol.unh.edu, ivan.malov@arknetworks.am
Subject: [PATCH v3 1/3] dts: allow mbuf_fast_free to be set with testpmd shell
Date: Wed, 17 Sep 2025 08:42:41 -0400 [thread overview]
Message-ID: <20250917124243.31567-2-abailey@iol.unh.edu> (raw)
In-Reply-To: <20250917124243.31567-1-abailey@iol.unh.edu>
Currently, there is no way in the testpmd shell class to set the mbuf
fast free offload configuration for queues or ports. This prohibits any
test suites to be written utilizing this offload configuration.
Introduce methods that support calls to testpmd in order to allow
the configuration of mbuf fast free.
Signed-off-by: Andrew Bailey <abailey@iol.unh.edu>
---
dts/framework/remote_session/testpmd_shell.py | 60 +++++++++++++++++++
1 file changed, 60 insertions(+)
diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
index 1df3d5f792..ecbdd66edd 100644
--- a/dts/framework/remote_session/testpmd_shell.py
+++ b/dts/framework/remote_session/testpmd_shell.py
@@ -2672,6 +2672,66 @@ def get_capabilities_physical_function(
else:
unsupported_capabilities.add(NicCapability.PHYSICAL_FUNCTION)
+ @requires_stopped_ports
+ def set_port_mbuf_fast_free(
+ self,
+ on: bool,
+ port_id: int,
+ /,
+ verify: bool = True,
+ ) -> None:
+ """Sets the mbuf_fast_free configuration for the Tx offload of a given port.
+
+ Args:
+ on: If :data:`True` mbuf_fast_free will be enabled, disable it otherwise.
+ port_id: The ID of the port to configure mbuf_fast_free on.
+ verify: If :data:`True` the output of the command will be scanned in an attempt to
+ verify that the mbuf_fast_free was set successfully.
+
+ Raises:
+ InteractiveCommandExecutionError: If mbuf_fast_free could not be set successfully.
+ """
+ mbuf_output = self.send_command(
+ f"port config {port_id} tx_offload mbuf_fast_free {"on" if on else "off"}"
+ )
+
+ if verify and "Error" in mbuf_output:
+ raise InteractiveCommandExecutionError(
+ f"Unable to set mbuf_fast_free config on port {port_id}:\n{mbuf_output}"
+ )
+
+ @requires_stopped_ports
+ def set_queue_mbuf_fast_free(
+ self,
+ on: bool,
+ port_id: int,
+ /,
+ queue_id: int = 0,
+ verify: bool = True,
+ ) -> None:
+ """Sets the Tx mbuf_fast_free configuration of the specified queue on a given port.
+
+ Args:
+ on: If :data:`True` the mbuf_fast_free configuration will be enabled, otherwise
+ disabled.
+ port_id: The ID of the port containing the queues.
+ queue_id: The ID of the queue to configure mbuf_fast_free on.
+ verify: If :data:`True` the output of the command will be scanned in an attempt to
+ verify that mbuf_fast_free was set successfully on all ports.
+
+ Raises:
+ InteractiveCommandExecutionError: If all queues could not be set successfully.
+ """
+ toggle = "on" if on else "off"
+ output = self.send_command(
+ f"port {port_id} txq {queue_id} tx_offload mbuf_fast_free {toggle}"
+ )
+ if verify and "Error" in output:
+ self._logger.debug(f"Set queue offload config error\n{output}")
+ raise InteractiveCommandExecutionError(
+ f"Failed to get offload config on port {port_id}, queue {queue_id}:\n{output}"
+ )
+
class NicCapability(NoAliasEnum):
"""A mapping between capability names and the associated :class:`TestPmdShell` methods.
--
2.50.1
next prev parent reply other threads:[~2025-09-17 12:43 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 14:27 [PATCH v1 0/3] dts: add tx_offload support in dts Andrew Bailey
2025-09-02 14:27 ` [PATCH v1 1/3] dts: allow mbuf_fast_free to be set with testpmd shell Andrew Bailey
2025-09-02 19:37 ` Ivan Malov
2025-09-02 19:48 ` Ivan Malov
2025-09-02 14:27 ` [PATCH v1 2/3] dts: add TX offload capabilities to NIC capabilities Andrew Bailey
2025-09-04 14:43 ` Luca Vizzarro
2025-09-04 14:45 ` Luca Vizzarro
2025-09-02 14:27 ` [PATCH v1 3/3] dts: update tx_offload test from old dts Andrew Bailey
2025-09-03 18:04 ` [PATCH v2 0/3] dts: add tx_offlaod support in dts Andrew Bailey
2025-09-03 18:04 ` [PATCH v2 1/3] dts: allow mbuf_fast_free to be set with testpmd shell Andrew Bailey
2025-09-04 15:15 ` Luca Vizzarro
2025-09-04 21:18 ` Patrick Robb
2025-09-03 18:04 ` [PATCH v2 2/3] dts: add TX offload capabilities to NIC capabilities Andrew Bailey
2025-09-03 18:36 ` Patrick Robb
2025-09-04 14:47 ` Luca Vizzarro
2025-09-03 18:04 ` [PATCH v2 3/3] dts: update tx_offload test from old dts Andrew Bailey
2025-09-04 15:25 ` Luca Vizzarro
2025-09-17 12:42 ` [PATCH v3 0/3] dts: add tx_offload support in dts Andrew Bailey
2025-09-17 12:42 ` Andrew Bailey [this message]
2025-09-17 12:42 ` [PATCH v3 2/3] dts: add TX offload capabilities to NIC capabilities Andrew Bailey
2025-09-17 12:42 ` [PATCH v3 3/3] dts: update tx_offload test from old dts Andrew Bailey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250917124243.31567-2-abailey@iol.unh.edu \
--to=abailey@iol.unh.edu \
--cc=dev@dpdk.org \
--cc=dmarx@iol.unh.edu \
--cc=ivan.malov@arknetworks.am \
--cc=luca.vizzarro@arm.com \
--cc=probb@iol.unh.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).