From: Luca Vizzarro <luca.vizzarro@arm.com>
To: Andrew Bailey <abailey@iol.unh.edu>
Cc: dev@dpdk.org, dmarx@iol.unh.edu, probb@iol.unh.edu,
ivan.malov@arknetworks.am
Subject: Re: [PATCH v3 3/3] dts: update tx_offload test from old dts
Date: Tue, 23 Sep 2025 13:26:12 +0100 [thread overview]
Message-ID: <175863028955.40368.11422459804064526246.luca.vizzarro@arm.com> (raw)
In-Reply-To: <20250917124243.31567-4-abailey@iol.unh.edu>
Hi Andrew,
Thank you for this. You should also add a documentation page for the new
test.
On Wed, Sep 17, 2025 at 08:42:43AM +0000, Andrew Bailey wrote:
> Currently, the RX/TX offload test in old DTS expects the TX ports to be
> initially configured to use mbuf fast free. This is no longer the case
> and must be updated to assume mbuf fast free is not initially utilized
> by capable NICs. Add updated test suite to test mbuf fast free
> configuration.
>
> Signed-off-by: Andrew Bailey <abailey@iol.unh.edu>
> ---
> dts/tests/TestSuite_rx_tx_offload.py | 130 +++++++++++++++++++++++++++
> 1 file changed, 130 insertions(+)
> create mode 100644 dts/tests/TestSuite_rx_tx_offload.py
>
> diff --git a/dts/tests/TestSuite_rx_tx_offload.py b/dts/tests/TestSuite_rx_tx_offload.py
> new file mode 100644
> index 0000000000..f97bb4978a
> --- /dev/null
> +++ b/dts/tests/TestSuite_rx_tx_offload.py
> @@ -0,0 +1,130 @@
> +# 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 typing import Optional
> +
> +from framework.remote_session.testpmd_shell import (
> + OffloadConfiguration,
> + RxTxLiteralSwitch,
> + TestPmdShell,
> +)
> +from framework.test_suite import TestSuite, func_test
> +from framework.testbed_model.capability import NicCapability, requires
> +
> +
> +class TestRxTxOffload(TestSuite):
> + """RX/TX offload test suite."""
> +
> + def _check_config(
> + self,
> + testpmd: TestPmdShell,
> + port_offload: str | None,
> + rxtx: RxTxLiteralSwitch,
> + port_id: int,
> + /,
> + queue_offload: Optional[list[str | None]] = None,
> + verify: bool = True,
> + ) -> bool:
> + config: OffloadConfiguration = testpmd.get_offload_config(rxtx, port_id, 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: TestPmdShell, on: bool, port_id: int, 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(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 on per port.
> + * Toggle mbuf_fast_free off per port.
> +
> + Verify:
> + * Mbuf_fast_free starts disabled.
> + * Mbuf_fast_free can be configured on per port.
> + * Mbuf_fast_free can be configured off per port.
> + """
> + with TestPmdShell() as testpmd:
> + verify = True
> + port_id = 0
> + testpmd.start_all_ports()
> +
> + # Ensure MBUF_FAST_FREE is disabled by default and verify
> + self.verify(
> + self._check_config(testpmd, None, "tx", port_id, verify=verify),
> + "MBUF_FAST_FREE enabled on port start.",
> + )
> + # Enable MBUF_FAST_FREE per port and verify
> + testpmd.set_port_mbuf_fast_free(True, port_id, verify)
> + self.verify(
> + self._check_config(
> + testpmd, "TX_OFFLOAD_MBUF_FAST_FREE", "tx", port_id, verify=verify
> + ),
> + "Failed to enable MBUF_FAST_FREE on port.",
> + )
> + # Disable MBUF_FAST_FREE per port and verify
> + testpmd.set_port_mbuf_fast_free(False, port_id, verify)
> + self.verify(
> + self._check_config(testpmd, None, "tx", port_id, verify=verify),
> + "Failed to disable MBUF_FAST_FREE on port.",
> + )
> +
> + @requires(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 on per queue.
> + * Toggle mbuf_fast_free off per queue.
> +
> + Verify:
> + * Mbuf_fast_free starts disabled.
> + * Mbuf_fast_free can be configured on per queue.
> + * Mbuf_fast_free can be configured off per queue.
> + """
> + with TestPmdShell() as testpmd:
> + verify = True
> + port_id = 0
> + num_queues = 4
> + queue_off: Optional[list[str | None]] = [None] * num_queues
> + queue_on: Optional[list[str | None]] = ["TX_OFFLOAD_MBUF_FAST_FREE"] * num_queues
Optional is deprecated in the version of Python we are using in favour
of `| None`
> +
> + testpmd.set_ports_queues(num_queues)
> + testpmd.start_all_ports()
> +
> + # Ensure mbuf_fast_free is disabled by default on port and queues
> + self.verify(
> + self._check_config(testpmd, None, "tx", port_id, queue_off, verify=verify),
> + "MBUF_FAST_FREE enabled on queue start.",
> + )
> + # Enable mbuf_fast_free per queue and verify
> + self._set_all_queues_mbuf_fast_free(testpmd, True, port_id, num_queues, verify)
> + self.verify(
> + self._check_config(testpmd, None, "tx", port_id, queue_on, verify),
> + "Failed to enable MBUF_FAST_FREE on all queues.",
> + )
> + # Disable mbuf_fast_free per queue and verify
> + self._set_all_queues_mbuf_fast_free(testpmd, False, port_id, num_queues, verify)
> + self.verify(
> + self._check_config(testpmd, None, "tx", port_id, queue_off, verify),
> + "Failed to disable MBUF_FAST_FREE on all queues.",
> + )
> --
> 2.50.1
>
prev parent reply other threads:[~2025-09-23 12:26 UTC|newest]
Thread overview: 24+ 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 ` [PATCH v3 1/3] dts: allow mbuf_fast_free to be set with testpmd shell Andrew Bailey
2025-09-23 11:49 ` Luca Vizzarro
2025-09-17 12:42 ` [PATCH v3 2/3] dts: add TX offload capabilities to NIC capabilities Andrew Bailey
2025-09-23 12:22 ` Luca Vizzarro
2025-09-17 12:42 ` [PATCH v3 3/3] dts: update tx_offload test from old dts Andrew Bailey
2025-09-23 12:26 ` Luca Vizzarro [this message]
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=175863028955.40368.11422459804064526246.luca.vizzarro@arm.com \
--to=luca.vizzarro@arm.com \
--cc=abailey@iol.unh.edu \
--cc=dev@dpdk.org \
--cc=dmarx@iol.unh.edu \
--cc=ivan.malov@arknetworks.am \
--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).