<div dir="ltr">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.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 23, 2025 at 8:32 AM Andrew Bailey <<a href="mailto:abailey@iol.unh.edu" target="_blank">abailey@iol.unh.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Currently, there is no way in the testpmd shell class to set the mbuf<br>
fast free offload configuration for queues or ports. This prohibits any<br>
test suites to be written utilizing this offload configuration.<br>
Introduce methods that support calls to testpmd in order to allow<br>
the configuration of mbuf fast free.<br>
<br>
Signed-off-by: Andrew Bailey <<a href="mailto:abailey@iol.unh.edu" target="_blank">abailey@iol.unh.edu</a>><br>
---<br>
 dts/api/testpmd/__init__.py          |  60 +++++++++++++<br>
 dts/tests/TestSuite_rx_tx_offload.py | 129 +++++++++++++++++++++++++++<br>
 2 files changed, 189 insertions(+)<br>
 create mode 100644 dts/tests/TestSuite_rx_tx_offload.py<br>
<br>
diff --git a/dts/api/testpmd/__init__.py b/dts/api/testpmd/__init__.py<br>
index a060ab5639..9e9cbaf495 100644<br>
--- a/dts/api/testpmd/__init__.py<br>
+++ b/dts/api/testpmd/__init__.py<br>
@@ -1292,3 +1292,63 @@ def get_capabilities_physical_function(<br>
             supported_capabilities.add(NicCapability.PHYSICAL_FUNCTION)<br>
         else:<br>
             unsupported_capabilities.add(NicCapability.PHYSICAL_FUNCTION)<br>
+<br>
+    @_requires_stopped_ports<br>
+    def set_port_mbuf_fast_free(<br>
+        self,<br>
+        port_id: int,<br>
+        on: bool,<br>
+        /,<br>
+        verify: bool = True,<br>
+    ) -> None:<br>
+        """Sets the mbuf_fast_free configuration for the Tx offload of a given port.<br>
+<br>
+        Args:<br>
+            port_id: The ID of the port to configure mbuf_fast_free on.<br>
+            on: If :data:`True` mbuf_fast_free will be enabled, disable it otherwise.<br>
+            verify: If :data:`True` the output of the command will be scanned in an attempt to<br>
+                verify that the mbuf_fast_free was set successfully.<br>
+<br>
+        Raises:<br>
+            InteractiveCommandExecutionError: If mbuf_fast_free could not be set successfully.<br>
+        """<br>
+        mbuf_output = self.send_command(<br>
+            f"port config {port_id} tx_offload mbuf_fast_free {"on" if on else "off"}"<br>
+        )<br>
+<br>
+        if verify and "Error" in mbuf_output:<br>
+            raise InteractiveCommandExecutionError(<br>
+                f"Unable to set mbuf_fast_free config on port {port_id}:\n{mbuf_output}"<br>
+            )<br>
+<br>
+    @_requires_stopped_ports<br>
+    def set_queue_mbuf_fast_free(<br>
+        self,<br>
+        port_id: int,<br>
+        on: bool,<br>
+        /,<br>
+        queue_id: int = 0,<br>
+        verify: bool = True,<br>
+    ) -> None:<br>
+        """Sets the Tx mbuf_fast_free configuration of the specified queue on a given port.<br>
+<br>
+        Args:<br>
+            port_id: The ID of the port containing the queues.<br>
+            on: If :data:`True` the mbuf_fast_free configuration will be enabled, otherwise<br>
+                disabled.<br>
+            queue_id: The ID of the queue to configure mbuf_fast_free on.<br>
+            verify: If :data:`True` the output of the command will be scanned in an attempt to<br>
+                verify that mbuf_fast_free was set successfully on all ports.<br>
+<br>
+        Raises:<br>
+            InteractiveCommandExecutionError: If all queues could not be set successfully.<br>
+        """<br>
+        toggle = "on" if on else "off"<br>
+        output = self.send_command(<br>
+            f"port {port_id} txq {queue_id} tx_offload mbuf_fast_free {toggle}"<br>
+        )<br>
+        if verify and "Error" in output:<br>
+            self._logger.debug(f"Set queue offload config error\n{output}")<br>
+            raise InteractiveCommandExecutionError(<br>
+                f"Failed to get offload config on port {port_id}, queue {queue_id}:\n{output}"<br>
+            )<br>
diff --git a/dts/tests/TestSuite_rx_tx_offload.py b/dts/tests/TestSuite_rx_tx_offload.py<br>
new file mode 100644<br>
index 0000000000..16e1b8cf93<br>
--- /dev/null<br>
+++ b/dts/tests/TestSuite_rx_tx_offload.py<br>
@@ -0,0 +1,129 @@<br>
+# SPDX-License-Identifier: BSD-3-Clause<br>
+# Copyright(c) 2025 University of New Hampshire<br>
+<br>
+"""RX TX offload test suite.<br>
+<br>
+Test the testpmd feature of configuring RX and TX offloads.<br>
+"""<br>
+<br>
+from api.capabilities import NicCapability, requires_nic_capability<br>
+from api.test import verify<br>
+from api.testpmd import TestPmd<br>
+from api.testpmd.types import (<br>
+    OffloadConfiguration,<br>
+    RxTxLiteralSwitch,<br>
+)<br>
+from framework.test_suite import TestSuite, func_test<br>
+<br>
+<br>
+class TestRxTxOffload(TestSuite):<br>
+    """RX/TX offload test suite."""<br>
+<br>
+    def _check_config(<br>
+        self,<br>
+        testpmd: TestPmd,<br>
+        port_id: int,<br>
+        port_offload: str | None,<br>
+        rxtx: RxTxLiteralSwitch,<br>
+        /,<br>
+        queue_offload: list[str | None] | None = None,<br>
+        verify: bool = True,<br>
+    ) -> bool:<br>
+        config: OffloadConfiguration = testpmd.get_offload_config(port_id, rxtx, verify)<br>
+        if <a href="http://config.port.name" rel="noreferrer" target="_blank">config.port.name</a> != port_offload:<br>
+            return False<br>
+<br>
+        if queue_offload:<br>
+            for i, q in enumerate(config.queues):<br>
+                if <a href="http://q.name" rel="noreferrer" target="_blank">q.name</a> != queue_offload[i]:<br>
+                    return False<br>
+        return True<br>
+<br>
+    def _set_all_queues_mbuf_fast_free(<br>
+        self, testpmd: TestPmd, port_id: int, on: bool, num_queues: int, /, verify: bool = True<br>
+    ) -> None:<br>
+        for i in range(num_queues):<br>
+            testpmd.set_queue_mbuf_fast_free(on, port_id, i, verify)<br>
+<br>
+    @requires_nic_capability(NicCapability.PORT_TX_OFFLOAD_MBUF_FAST_FREE)<br>
+    @func_test<br>
+    def test_mbuf_fast_free_configuration_per_port(self) -> None:<br>
+        """Ensure mbuf_fast_free can be configured with testpmd per port.<br>
+<br>
+        Steps:<br>
+            * Start up testpmd shell.<br>
+            * Toggle mbuf_fast_free off per port.<br>
+            * Toggle mbuf_fast_free on per port.<br>
+<br>
+        Verify:<br>
+            * Mbuf_fast_free starts enabled.<br>
+            * Mbuf_fast_free can be configured off per port.<br>
+            * Mbuf_fast_free can be configured on per port.<br>
+        """<br>
+        with TestPmd() as testpmd:<br>
+            to_verify = True<br>
+            port_id = 0<br>
+            testpmd.start_all_ports()<br>
+<br>
+            # Ensure MBUF_FAST_FREE is enabled by default and verify<br>
+            verify(<br>
+                self._check_config(testpmd, port_id, "MBUF_FAST_FREE", "tx", verify=to_verify),<br>
+                "MBUF_FAST_FREE disabled on port start.",<br>
+            )<br>
+            # disable MBUF_FAST_FREE per port and verify<br>
+            testpmd.set_port_mbuf_fast_free(port_id, False, to_verify)<br>
+            verify(<br>
+                self._check_config(testpmd, port_id, None, "tx", verify=to_verify),<br>
+                "Failed to enable MBUF_FAST_FREE on port.",<br>
+            )<br>
+            # Enable MBUF_FAST_FREE per port and verify<br>
+            testpmd.set_port_mbuf_fast_free(port_id, True, to_verify)<br>
+            verify(<br>
+                self._check_config(testpmd, port_id, "MBUF_FAST_FREE", "tx", verify=to_verify),<br>
+                "Failed to disable MBUF_FAST_FREE on port.",<br>
+            )<br>
+<br>
+    @requires_nic_capability(NicCapability.QUEUE_TX_OFFLOAD_MBUF_FAST_FREE)<br>
+    @func_test<br>
+    def test_mbuf_fast_free_configuration_per_queue(self) -> None:<br>
+        """Ensure mbuf_fast_free can be configured with testpmd.<br>
+<br>
+        Steps:<br>
+            * Start up testpmd shell.<br>
+            * Toggle mbuf_fast_free off per queue.<br>
+            * Toggle mbuf_fast_free on per queue.<br>
+<br>
+        Verify:<br>
+            * Mbuf_fast_free starts disabled.<br>
+            * Mbuf_fast_free can be configured off per queue.<br>
+            * Mbuf_fast_free can be configured on per queue.<br>
+        """<br>
+        with TestPmd() as testpmd:<br>
+            to_verify = True<br>
+            port_id = 0<br>
+            num_queues = 4<br>
+            queue_off: list[str | None] | None = [None] * num_queues<br>
+            queue_on: list[str | None] | None = ["MBUF_FAST_FREE"] * num_queues<br>
+<br>
+            testpmd.set_ports_queues(num_queues)<br>
+            testpmd.start_all_ports()<br>
+<br>
+            # Ensure mbuf_fast_free is enabled by default on port and queues<br>
+            verify(<br>
+                self._check_config(<br>
+                    testpmd, port_id, "MBUF_FAST_FREE", "tx", queue_on, verify=to_verify<br>
+                ),<br>
+                "MBUF_FAST_FREE disabled on queue start.",<br>
+            )<br>
+            # Disable mbuf_fast_free per queue and verify<br>
+            self._set_all_queues_mbuf_fast_free(testpmd, port_id, False, num_queues, to_verify)<br>
+            verify(<br>
+                self._check_config(testpmd, port_id, "MBUF_FAST_FREE", "tx", queue_off, to_verify),<br>
+                "Failed to disable MBUF_FAST_FREE on all queues.",<br>
+            )<br>
+            # Disable mbuf_fast_free per queue and verify<br>
+            self._set_all_queues_mbuf_fast_free(testpmd, port_id, True, num_queues, to_verify)<br>
+            verify(<br>
+                self._check_config(testpmd, port_id, "MBUF_FAST_FREE", "tx", queue_on, to_verify),<br>
+                "Failed to enable MBUF_FAST_FREE on all queues.",<br>
+            )<br>
-- <br>
2.50.1<br>
<br>
</blockquote></div>