From: Patrick Robb <probb@iol.unh.edu>
To: Luca.Vizzarro@arm.com
Cc: dev@dpdk.org, Paul.Szczepanek@arm.com, dmarx@iol.unh.edu,
abailey@iol.unh.edu, Patrick Robb <probb@iol.unh.edu>
Subject: [PATCH v2] dts: testpmd link check on port start
Date: Wed, 5 Nov 2025 14:49:25 -0500 [thread overview]
Message-ID: <20251105194925.1507334-1-probb@iol.unh.edu> (raw)
In-Reply-To: <20250908014154.82938-1-probb@iol.unh.edu>
When running our existing DTS testsuites on a new
NIC we observed packets would not transmit from
the traffic generator to the system under test
even after DPDK testpmd and the NIC under test
had indicated readiness. After investigation, we
determined that the existing readiness check in DTS
for testpmd start (checking that port is started)
is insufficient, because on some systems the link
will remain down for some measurable time, creating
a race condition between the testpmd port's link
coming up and the DTS execution reaching the packet
transmission step. This change will ensure that
testpmd start will block until the port is reporting
that its link is up. In addition, the interval in
between checking the link state has been reduced in
order to speed up the execution.
Signed-off-by: Patrick Robb <probb@iol.unh.edu>
Tested-by: Patrick Robb <probb@iol.unh.edu>
---
dts/api/testpmd/__init__.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/dts/api/testpmd/__init__.py b/dts/api/testpmd/__init__.py
index aadb7f4e70..49a847494a 100644
--- a/dts/api/testpmd/__init__.py
+++ b/dts/api/testpmd/__init__.py
@@ -93,6 +93,9 @@ def _requires_started_ports(func: TestPmdMethod) -> TestPmdMethod:
Args:
func: The :class:`TestPmd` method to decorate.
+
+ Raises:
+ InteractiveCommandExecutionError: If the ports has been started but a port link will not come up.
"""
@functools.wraps(func)
@@ -100,6 +103,10 @@ def _wrapper(self: "TestPmd", *args: P.args, **kwargs: P.kwargs) -> Any:
if not self.ports_started:
self._logger.debug("Ports need to be started to continue.")
self.start_all_ports()
+ if get_ctx().topology.type is not LinkTopology.NO_LINK:
+ for port in self.ports:
+ if not self.wait_link_status_up(port.id):
+ raise InteractiveCommandExecutionError(f"Port {port.id} link failed to come up.")
return func(self, *args, **kwargs)
@@ -265,7 +272,7 @@ def wait_link_status_up(self, port_id: int, timeout=SETTINGS.timeout) -> bool:
port_info = self.send_command(f"show port info {port_id}")
if "Link status: up" in port_info:
break
- time.sleep(0.5)
+ time.sleep(0.25)
else:
self._logger.error(f"The link for port {port_id} did not come up in the given timeout.")
return "Link status: up" in port_info
--
2.49.0
prev parent reply other threads:[~2025-11-05 19:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-08 1:41 [PATCH] dts: add dpdk shell warm up period Patrick Robb
2025-09-08 1:57 ` Patrick Robb
2025-09-08 10:03 ` Luca Vizzarro
2025-09-08 13:21 ` Patrick Robb
2025-11-05 19:49 ` Patrick Robb [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=20251105194925.1507334-1-probb@iol.unh.edu \
--to=probb@iol.unh.edu \
--cc=Luca.Vizzarro@arm.com \
--cc=Paul.Szczepanek@arm.com \
--cc=abailey@iol.unh.edu \
--cc=dev@dpdk.org \
--cc=dmarx@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).