Hello dts guys,
On Fri, 7 Nov 2025 at 22:50, Dean Marx <[email protected]> wrote:
>
> Add start tx_first method to testpmd shell, which sends
> a specified number of burst packets prior to starting
> packet forwarding.
>
> Signed-off-by: Dean Marx <[email protected]>
> Reviewed-by: Luca Vizzarro <[email protected]>
> ---
> dts/api/testpmd/__init__.py | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/dts/api/testpmd/__init__.py b/dts/api/testpmd/__init__.py
> index aadb7f4e70..6d70927660 100644
> --- a/dts/api/testpmd/__init__.py
> +++ b/dts/api/testpmd/__init__.py
> @@ -204,6 +204,27 @@ def start(self, verify: bool = True) -> None:
> self._logger.debug(f"Failed to start packet forwarding:
> \n{start_cmd_output}")
> raise InteractiveCommandExecutionError("Testpmd failed to
> start packet forwarding.")
>
> + @_requires_started_ports
> + def start_tx_first(self, burst_num: int, verify: bool = True) -> None:
> + """Start packet forwarding after sending specified number of bursts
> of packets.
> +
> + Args:
> + burst_num: Number of packets to send before stopping
> transmission.
> + verify: If :data:`True` , a second start command will be sent in
> an attempt to verify
> + packet forwarding started as expected.
> +
> + Raises:
> + InteractiveCommandExecutionError: If `verify` is :data:`True`
> and forwarding fails to
> + start or ports fail to come up.
> + """
> + self.send_command(f"start tx_first {burst_num if burst_num is not
> None else ""}")
> + if verify:
> + # If forwarding was already started, sending "start" again
> should tell us
> + start_cmd_output = self.send_command("start")
> + if "Packet forwarding already started" not in start_cmd_output:
> + self._logger.debug(f"Failed to start packet forwarding:
> \n{start_cmd_output}")
> + raise InteractiveCommandExecutionError("Testpmd failed to
> start packet forwarding.")
> +
> def stop(self, verify: bool = True) -> str:
> """Stop packet forwarding.
>
I can see (uncaught) warnings in GHA when generating the documentation.
I don't know if this is something new, or if it was like this from the start.
Please have a look.
2026-01-20T08:16:58.5130393Z [250/252] Generating dts_api_html with a
custom command
2026-01-20T08:16:58.5131324Z WARNING: autodoc: failed to import module
'testpmd' from module 'api'; the following exception was raised:
2026-01-20T08:16:58.5132132Z Traceback (most recent call last):
2026-01-20T08:16:58.5132676Z File
"/usr/lib/python3/dist-packages/sphinx/ext/autodoc/importer.py", line
70, in import_module
2026-01-20T08:16:58.5133175Z return importlib.import_module(modname)
2026-01-20T08:16:58.5133807Z File
"/usr/lib/python3.10/importlib/__init__.py", line 126, in
import_module
2026-01-20T08:16:58.5134351Z return
_bootstrap._gcd_import(name[level:], package, level)
2026-01-20T08:16:58.5134771Z File "<frozen importlib._bootstrap>",
line 1050, in _gcd_import
2026-01-20T08:16:58.5135202Z File "<frozen importlib._bootstrap>",
line 1027, in _find_and_load
2026-01-20T08:16:58.5135997Z File "<frozen importlib._bootstrap>",
line 1006, in _find_and_load_unlocked
2026-01-20T08:16:58.5136465Z File "<frozen importlib._bootstrap>",
line 688, in _load_unlocked
2026-01-20T08:16:58.5136900Z File "<frozen
importlib._bootstrap_external>", line 879, in exec_module
2026-01-20T08:16:58.5137348Z File "<frozen
importlib._bootstrap_external>", line 1017, in get_code
2026-01-20T08:16:58.5137795Z File "<frozen
importlib._bootstrap_external>", line 947, in source_to_code
2026-01-20T08:16:58.5138259Z File "<frozen importlib._bootstrap>",
line 241, in _call_with_frames_removed
2026-01-20T08:16:58.5138733Z File
"/home/runner/work/dpdk/dpdk/dts/api/testpmd/__init__.py", line 230
2026-01-20T08:16:58.5139388Z self.send_command(f"start tx_first
{burst_num if burst_num is not None else ""}")
2026-01-20T08:16:58.5139819Z
^
2026-01-20T08:16:58.5140133Z SyntaxError: f-string: expecting '}'
2026-01-20T08:16:58.5140317Z
...
https://github.com/DPDK/dpdk/actions/runs/21163780224/job/60863594703#step:19:9587
--
David Marchand