From: Patrick Robb <probb@iol.unh.edu>
To: Andrew Bailey <abailey@iol.unh.edu>
Cc: luca.vizzarro@arm.com, dev@dpdk.org, dmarx@iol.unh.edu
Subject: Re: [PATCH v9 1/3] dts: allow mbuf fast free to be set with testpmd shell
Date: Fri, 24 Oct 2025 15:20:43 -0400 [thread overview]
Message-ID: <CAJvnSUB4++TYCnbsN47Z=yEJr0AaZ_T0pzqRuKcy-ky1DZuW7A@mail.gmail.com> (raw)
In-Reply-To: <20251023123223.56924-2-abailey@iol.unh.edu>
[-- Attachment #1: Type: text/plain, Size: 9672 bytes --]
I think there was an issue with your rebase. You are now adding in the
testsuite in your 1/3 when it should be added in the 3/3. Let me know if
you need help untangling this.
On Thu, Oct 23, 2025 at 8:32 AM Andrew Bailey <abailey@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@iol.unh.edu>
> ---
> dts/api/testpmd/__init__.py | 60 +++++++++++++
> dts/tests/TestSuite_rx_tx_offload.py | 129 +++++++++++++++++++++++++++
> 2 files changed, 189 insertions(+)
> create mode 100644 dts/tests/TestSuite_rx_tx_offload.py
>
> 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}"
> + )
> diff --git a/dts/tests/TestSuite_rx_tx_offload.py
> b/dts/tests/TestSuite_rx_tx_offload.py
> new file mode 100644
> index 0000000000..16e1b8cf93
> --- /dev/null
> +++ b/dts/tests/TestSuite_rx_tx_offload.py
> @@ -0,0 +1,129 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2025 University of New Hampshire
> +
> +"""RX TX offload test suite.
> +
> +Test the testpmd feature of configuring RX and TX offloads.
> +"""
> +
> +from api.capabilities import NicCapability, requires_nic_capability
> +from api.test import verify
> +from api.testpmd import TestPmd
> +from api.testpmd.types import (
> + OffloadConfiguration,
> + RxTxLiteralSwitch,
> +)
> +from framework.test_suite import TestSuite, func_test
> +
> +
> +class TestRxTxOffload(TestSuite):
> + """RX/TX offload test suite."""
> +
> + def _check_config(
> + self,
> + testpmd: TestPmd,
> + port_id: int,
> + port_offload: str | None,
> + rxtx: RxTxLiteralSwitch,
> + /,
> + queue_offload: list[str | None] | None = None,
> + verify: bool = True,
> + ) -> bool:
> + config: OffloadConfiguration =
> testpmd.get_offload_config(port_id, rxtx, verify)
> + if config.port.name != port_offload:
> + return False
> +
> + if queue_offload:
> + for i, q in enumerate(config.queues):
> + if q.name != queue_offload[i]:
> + return False
> + return True
> +
> + def _set_all_queues_mbuf_fast_free(
> + self, testpmd: TestPmd, port_id: int, on: bool, num_queues: int,
> /, verify: bool = True
> + ) -> None:
> + for i in range(num_queues):
> + testpmd.set_queue_mbuf_fast_free(on, port_id, i, verify)
> +
> + @requires_nic_capability(NicCapability.PORT_TX_OFFLOAD_MBUF_FAST_FREE)
> + @func_test
> + def test_mbuf_fast_free_configuration_per_port(self) -> None:
> + """Ensure mbuf_fast_free can be configured with testpmd per port.
> +
> + Steps:
> + * Start up testpmd shell.
> + * Toggle mbuf_fast_free off per port.
> + * Toggle mbuf_fast_free on per port.
> +
> + Verify:
> + * Mbuf_fast_free starts enabled.
> + * Mbuf_fast_free can be configured off per port.
> + * Mbuf_fast_free can be configured on per port.
> + """
> + with TestPmd() as testpmd:
> + to_verify = True
> + port_id = 0
> + testpmd.start_all_ports()
> +
> + # Ensure MBUF_FAST_FREE is enabled by default and verify
> + verify(
> + self._check_config(testpmd, port_id, "MBUF_FAST_FREE",
> "tx", verify=to_verify),
> + "MBUF_FAST_FREE disabled on port start.",
> + )
> + # disable MBUF_FAST_FREE per port and verify
> + testpmd.set_port_mbuf_fast_free(port_id, False, to_verify)
> + verify(
> + self._check_config(testpmd, port_id, None, "tx",
> verify=to_verify),
> + "Failed to enable MBUF_FAST_FREE on port.",
> + )
> + # Enable MBUF_FAST_FREE per port and verify
> + testpmd.set_port_mbuf_fast_free(port_id, True, to_verify)
> + verify(
> + self._check_config(testpmd, port_id, "MBUF_FAST_FREE",
> "tx", verify=to_verify),
> + "Failed to disable MBUF_FAST_FREE on port.",
> + )
> +
> +
> @requires_nic_capability(NicCapability.QUEUE_TX_OFFLOAD_MBUF_FAST_FREE)
> + @func_test
> + def test_mbuf_fast_free_configuration_per_queue(self) -> None:
> + """Ensure mbuf_fast_free can be configured with testpmd.
> +
> + Steps:
> + * Start up testpmd shell.
> + * Toggle mbuf_fast_free off per queue.
> + * Toggle mbuf_fast_free on per queue.
> +
> + Verify:
> + * Mbuf_fast_free starts disabled.
> + * Mbuf_fast_free can be configured off per queue.
> + * Mbuf_fast_free can be configured on per queue.
> + """
> + with TestPmd() as testpmd:
> + to_verify = True
> + port_id = 0
> + num_queues = 4
> + queue_off: list[str | None] | None = [None] * num_queues
> + queue_on: list[str | None] | None = ["MBUF_FAST_FREE"] *
> num_queues
> +
> + testpmd.set_ports_queues(num_queues)
> + testpmd.start_all_ports()
> +
> + # Ensure mbuf_fast_free is enabled by default on port and
> queues
> + verify(
> + self._check_config(
> + testpmd, port_id, "MBUF_FAST_FREE", "tx", queue_on,
> verify=to_verify
> + ),
> + "MBUF_FAST_FREE disabled on queue start.",
> + )
> + # Disable mbuf_fast_free per queue and verify
> + self._set_all_queues_mbuf_fast_free(testpmd, port_id, False,
> num_queues, to_verify)
> + verify(
> + self._check_config(testpmd, port_id, "MBUF_FAST_FREE",
> "tx", queue_off, to_verify),
> + "Failed to disable MBUF_FAST_FREE on all queues.",
> + )
> + # Disable mbuf_fast_free per queue and verify
> + self._set_all_queues_mbuf_fast_free(testpmd, port_id, True,
> num_queues, to_verify)
> + verify(
> + self._check_config(testpmd, port_id, "MBUF_FAST_FREE",
> "tx", queue_on, to_verify),
> + "Failed to enable MBUF_FAST_FREE on all queues.",
> + )
> --
> 2.50.1
>
>
[-- Attachment #2: Type: text/html, Size: 11819 bytes --]
next prev parent reply other threads:[~2025-10-24 19:21 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 11:43 [PATCH v1 0/3] dts: add tx_offload support in dts Andrew Bailey
2025-09-02 11:43 ` [PATCH v1 1/3] dts: fix docstring typo in checksum suite Andrew Bailey
2025-09-02 11:43 ` [PATCH v1 2/3] dts: add reception check to checksum offload suite Andrew Bailey
2025-09-02 11:43 ` [PATCH v1 3/3] dts: all are one Andrew Bailey
2025-09-02 11:48 ` [PATCH v1 0/3] dts: add tx_offload support in dts Andrew Bailey
2025-09-24 16:47 ` [PATCH v4 0/3] dts:add " Andrew Bailey
2025-09-24 16:47 ` [PATCH v4 1/3] dts: allow mbuf_fast_free to be set with testpmd shell Andrew Bailey
2025-09-24 20:51 ` Patrick Robb
2025-09-25 16:01 ` Luca Vizzarro
2025-09-24 16:47 ` [PATCH v4 2/3] dts: add TX offload capabilities to NIC capabilities Andrew Bailey
2025-09-24 20:51 ` Patrick Robb
2025-09-25 16:05 ` Luca Vizzarro
2025-09-24 16:47 ` [PATCH v4 3/3] dts: update tx_offload test from old dts Andrew Bailey
2025-09-24 20:53 ` Patrick Robb
2025-09-29 17:06 ` [PATCH v5 0/3] dts: add tx_offload support in dts Andrew Bailey
2025-09-29 17:06 ` [PATCH v5 1/3] dts: allow mbuf_fast_free to be set with testpmd shell Andrew Bailey
2025-09-29 17:06 ` [PATCH v5 3/3] dts: update tx_offload test from old dts Andrew Bailey
2025-10-15 15:34 ` Patrick Robb
2025-09-29 17:27 ` [PATCH v6 0/3] dts: add tx_offload support in dts Andrew Bailey
2025-09-29 17:27 ` [PATCH v6 1/3] dts: allow mbuf_fast_free to be set with testpmd shell Andrew Bailey
2025-09-30 12:51 ` Luca Vizzarro
2025-10-09 15:53 ` Dean Marx
2025-09-29 17:27 ` [PATCH v6 2/3] dts: add TX offload capabilities to NIC capabilities Andrew Bailey
2025-09-30 12:55 ` Luca Vizzarro
2025-10-09 15:55 ` Dean Marx
2025-09-29 17:27 ` [PATCH v6 3/3] dts: update tx_offload test from old dts Andrew Bailey
2025-09-30 12:57 ` Luca Vizzarro
2025-10-09 15:56 ` Dean Marx
2025-10-16 13:24 ` [PATCH v7 0/3] add tx_offload support in dts Andrew Bailey
2025-10-16 13:24 ` [PATCH v7 1/3] dts: allow mbuf_fast_free to be set with testpmd shell Andrew Bailey
2025-10-21 13:28 ` Luca Vizzarro
2025-10-16 13:24 ` [PATCH v7 2/3] dts: add TX offload capabilities to NIC capabilities Andrew Bailey
2025-10-21 13:50 ` Luca Vizzarro
2025-10-16 13:24 ` [PATCH v7 3/3] dts: update tx_offload test from legacy dts to next dts Andrew Bailey
2025-10-21 13:51 ` Luca Vizzarro
2025-10-21 14:45 ` [PATCH v8 0/3] dts: add tx_offload support in dts Andrew Bailey
2025-10-21 14:45 ` [PATCH v8 1/3] dts: allow mbuf_fast_free to be set with testpmd shell Andrew Bailey
2025-10-21 15:15 ` Luca Vizzarro
2025-10-21 15:27 ` Luca Vizzarro
2025-10-21 14:45 ` [PATCH v8 2/3] dts: add TX offload capabilities to NIC capabilities Andrew Bailey
2025-10-21 15:19 ` Luca Vizzarro
2025-10-21 15:29 ` Luca Vizzarro
2025-10-21 14:45 ` [PATCH v8 3/3] dts: update tx_offload test from legacy dts to next dts Andrew Bailey
2025-10-21 15:31 ` Luca Vizzarro
[not found] ` <20251023123223.56924-1-abailey@iol.unh.edu>
2025-10-23 12:32 ` [PATCH v9 1/3] dts: allow mbuf fast free to be set with testpmd shell Andrew Bailey
2025-10-24 19:20 ` Patrick Robb [this message]
2025-10-23 12:32 ` [PATCH v9 2/3] dts: add Tx offload capabilities to NIC capabilities Andrew Bailey
2025-10-23 12:32 ` [PATCH v9 3/3] dts: add Rx Tx offload test suite Andrew Bailey
2025-10-24 19:21 ` Patrick Robb
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='CAJvnSUB4++TYCnbsN47Z=yEJr0AaZ_T0pzqRuKcy-ky1DZuW7A@mail.gmail.com' \
--to=probb@iol.unh.edu \
--cc=abailey@iol.unh.edu \
--cc=dev@dpdk.org \
--cc=dmarx@iol.unh.edu \
--cc=luca.vizzarro@arm.com \
/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).