From: Dean Marx <dmarx@iol.unh.edu>
To: probb@iol.unh.edu, luca.vizzarro@arm.com,
yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com,
paul.szczepanek@arm.com
Cc: dev@dpdk.org, Dean Marx <dmarx@iol.unh.edu>
Subject: [PATCH v2 1/2] dts: add start Tx first method to testpmd shell
Date: Fri, 3 Oct 2025 15:27:15 -0400 [thread overview]
Message-ID: <20251003192717.444490-1-dmarx@iol.unh.edu> (raw)
In-Reply-To: <20250916200458.259376-1-dmarx@iol.unh.edu>
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 <dmarx@iol.unh.edu>
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
---
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 a060ab5639..5cf1ae7fac 100644
--- a/dts/api/testpmd/__init__.py
+++ b/dts/api/testpmd/__init__.py
@@ -199,6 +199,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.
--
2.51.0
next prev parent reply other threads:[~2025-10-03 19:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-16 20:04 [PATCH v1 " Dean Marx
2025-09-16 20:04 ` [PATCH v1 2/2] dts: add virtio forwarding test suite Dean Marx
2025-09-23 11:38 ` Luca Vizzarro
2025-10-03 18:14 ` Dean Marx
2025-09-23 11:27 ` [PATCH v1 1/2] dts: add start Tx first method to testpmd shell Luca Vizzarro
2025-10-03 19:27 ` Dean Marx [this message]
2025-10-03 19:27 ` [PATCH v2 2/2] dts: add virtio forwarding test suite Dean Marx
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=20251003192717.444490-1-dmarx@iol.unh.edu \
--to=dmarx@iol.unh.edu \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=dev@dpdk.org \
--cc=luca.vizzarro@arm.com \
--cc=paul.szczepanek@arm.com \
--cc=probb@iol.unh.edu \
--cc=yoan.picchi@foss.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).