From: Patrick Robb <probb@iol.unh.edu>
To: luca.vizzarro@arm.com
Cc: dev@dpdk.org, abailey@iol.unh.edu, dmarx@iol.unh.edu,
Patrick Robb <probb@iol.unh.edu>
Subject: [PATCH v2 2/2] dts: avoid dpdk resources conflict
Date: Mon, 23 Mar 2026 16:20:53 -0400 [thread overview]
Message-ID: <20260323202053.740203-3-probb@iol.unh.edu> (raw)
In-Reply-To: <20260323202053.740203-1-probb@iol.unh.edu>
When starting and stopping DPDK applications in rapid succession,
there may be a resource conflicts on ports, memory, VFIO, etc.
Even after we send "quit" to the testpmd CLI, some resource
cleanup will happen asynchronously in the background. To avoid a
resource conflict upon starting a subsequent DPDK application,
add a very brief sleep after quitting DPDK applications.
Fixes: bfad0948df75 ("dts: rework interactive shells")
Signed-off-by: Patrick Robb <probb@iol.unh.edu>
Tested-by: Patrick Robb <probb@iol.unh.edu>
---
dts/api/testpmd/__init__.py | 2 +-
dts/framework/remote_session/dpdk_shell.py | 12 +++++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/dts/api/testpmd/__init__.py b/dts/api/testpmd/__init__.py
index 703cae487e..e9187440bb 100644
--- a/dts/api/testpmd/__init__.py
+++ b/dts/api/testpmd/__init__.py
@@ -1174,7 +1174,7 @@ def clear_port_stats_all(self, verify: bool = True) -> None:
@only_active
def close(self) -> None:
- """Overrides :meth:`~.interactive_shell.close`."""
+ """Overrides :meth:`~.dpdk_shell.close`."""
self.stop()
self.send_command("quit", "Bye...")
return super().close()
diff --git a/dts/framework/remote_session/dpdk_shell.py b/dts/framework/remote_session/dpdk_shell.py
index 51b97d4ff6..f926c3fa4d 100644
--- a/dts/framework/remote_session/dpdk_shell.py
+++ b/dts/framework/remote_session/dpdk_shell.py
@@ -6,13 +6,14 @@
Provides a base class to create interactive shells based on DPDK.
"""
+import time
from abc import ABC, abstractmethod
from pathlib import PurePath
from framework.context import get_ctx
from framework.params.eal import EalParams
from framework.remote_session.interactive_shell import (
- InteractiveShell,
+ InteractiveShell, only_active,
)
from framework.testbed_model.cpu import LogicalCoreList
@@ -84,3 +85,12 @@ def _make_real_path(self) -> PurePath:
Adds the remote DPDK build directory to the path.
"""
return get_ctx().dpdk_build.remote_dpdk_build_dir.joinpath(self.path)
+
+ @only_active
+ def close(self) -> None:
+ """Overrides :meth:`~.interactive_shell.close`."""
+ # Allow time for VFIO and hardware resources to be released by the kernel after the
+ # DPDK process exits. Without this delay, sequential testpmd instances may have EAL
+ # errors when trying to acquire the same devices.
+ time.sleep(1)
+ return super().close()
--
2.49.0
next prev parent reply other threads:[~2026-03-23 20:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 18:08 [PATCH v1 0/2] dts: dpdk shell bug fixes Patrick Robb
2026-03-23 18:08 ` [PATCH v1 1/2] dts: always use ethdev ports to check capabilities Patrick Robb
2026-03-23 19:14 ` Andrew Bailey
2026-03-23 18:08 ` [PATCH v1 2/2] dts: avoid dpdk resources conflict Patrick Robb
2026-03-23 19:15 ` Andrew Bailey
2026-03-23 19:24 ` Andrew Bailey
2026-03-23 20:20 ` [PATCH v2 0/2] dts: dpdk shell bug fixes Patrick Robb
2026-03-23 20:20 ` [PATCH v2 1/2] dts: always use ethdev ports to check capabilities Patrick Robb
2026-03-23 20:20 ` Patrick Robb [this message]
2026-03-24 0:52 ` [PATCH v3 " Patrick Robb
2026-03-24 0:52 ` [PATCH v3 2/2] dts: avoid dpdk resources conflict 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=20260323202053.740203-3-probb@iol.unh.edu \
--to=probb@iol.unh.edu \
--cc=abailey@iol.unh.edu \
--cc=dev@dpdk.org \
--cc=dmarx@iol.unh.edu \
--cc=luca.vizzarro@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