From: Andrew Bailey <abailey@iol.unh.edu>
To: Patrick Robb <probb@iol.unh.edu>
Cc: Luca.Vizzarro@arm.com, dev@dpdk.org, Paul.Szczepanek@arm.com,
dmarx@iol.unh.edu
Subject: Re: [PATCH v2] dts: testpmd link check on port start
Date: Thu, 6 Nov 2025 10:05:27 -0500 [thread overview]
Message-ID: <CABJ3N2XcnGVT2q-BAjutbUYgHjHJH8KTn9nWNXQsdRc82CadhA@mail.gmail.com> (raw)
In-Reply-To: <20251105194925.1507334-1-probb@iol.unh.edu>
[-- Attachment #1: Type: text/plain, Size: 2983 bytes --]
Raises:
+ InteractiveCommandExecutionError: If the ports has been started
but a port link will not come up.
nit: fails check-format because the line is too long.
Reviewed-by: Andrew Bailey <abailey@iol.unh.edu>
On Wed, Nov 5, 2025 at 2:50 PM Patrick Robb <probb@iol.unh.edu> wrote:
> 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
>
>
[-- Attachment #2: Type: text/html, Size: 3920 bytes --]
next prev parent reply other threads:[~2025-11-06 15:05 UTC|newest]
Thread overview: 8+ 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 ` [PATCH v2] dts: testpmd link check on port start Patrick Robb
2025-11-06 15:05 ` Andrew Bailey [this message]
2025-11-06 17:14 ` Dean Marx
2025-11-06 18:00 ` Patrick Robb
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=CABJ3N2XcnGVT2q-BAjutbUYgHjHJH8KTn9nWNXQsdRc82CadhA@mail.gmail.com \
--to=abailey@iol.unh.edu \
--cc=Luca.Vizzarro@arm.com \
--cc=Paul.Szczepanek@arm.com \
--cc=dev@dpdk.org \
--cc=dmarx@iol.unh.edu \
--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).