[PATCH v11 1/3] dts: allow mbuf fast free to be set with testpmd shell
Patrick Robb
probb at iol.unh.edu
Tue Oct 28 23:32:49 CET 2025
Applied to next-dts, thanks.
On Tue, Oct 28, 2025 at 8:22 AM Andrew Bailey <abailey at iol.unh.edu> wrote:
> 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 at iol.unh.edu>
> ---
> dts/api/testpmd/__init__.py | 60 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 60 insertions(+)
>
> diff --git a/dts/api/testpmd/__init__.py b/dts/api/testpmd/__init__.py
> index a060ab5639..9e9cbaf495 100644
> --- a/dts/api/testpmd/__init__.py
> +++ b/dts/api/testpmd/__init__.py
> @@ -1292,3 +1292,63 @@ def get_capabilities_physical_function(
> supported_capabilities.add(NicCapability.PHYSICAL_FUNCTION)
> else:
> unsupported_capabilities.add(NicCapability.PHYSICAL_FUNCTION)
> +
> + @_requires_stopped_ports
> + def set_port_mbuf_fast_free(
> + self,
> + port_id: int,
> + on: bool,
> + /,
> + verify: bool = True,
> + ) -> None:
> + """Sets the mbuf_fast_free configuration for the Tx offload of a
> given port.
> +
> + Args:
> + port_id: The ID of the port to configure mbuf_fast_free on.
> + on: If :data:`True` mbuf_fast_free will be enabled, disable
> it otherwise.
> + 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,
> + port_id: int,
> + on: bool,
> + /,
> + queue_id: int = 0,
> + verify: bool = True,
> + ) -> None:
> + """Sets the Tx mbuf_fast_free configuration of the specified
> queue on a given port.
> +
> + Args:
> + port_id: The ID of the port containing the queues.
> + on: If :data:`True` the mbuf_fast_free configuration will be
> enabled, otherwise
> + disabled.
> + 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}"
> + )
> --
> 2.50.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20251028/bea88f80/attachment.htm>
More information about the dev
mailing list