From: Luca Vizzarro <luca.vizzarro@arm.com>
To: dev@dpdk.org
Cc: Luca Vizzarro <luca.vizzarro@arm.com>,
Paul Szczepanek <paul.szczepanek@arm.com>,
Patrick Robb <probb@iol.unh.edu>
Subject: [PATCH 5/6] dts: enable build-less DPDK driver binding
Date: Mon, 24 Feb 2025 13:28:22 +0000 [thread overview]
Message-ID: <20250224132823.196509-6-luca.vizzarro@arm.com> (raw)
In-Reply-To: <20250224132823.196509-1-luca.vizzarro@arm.com>
Add a facility to bind drivers for DPDK on runtimes where the DPDK build
is lacking. This is needed to execute any program that is based on DPDK,
but is unrelated to the testing.
Bugzilla ID: 1420
Signed-off-by: Luca Vizzarro <luca.vizzarro@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
---
dts/framework/remote_session/dpdk.py | 34 +++++++++++++++++++++-------
1 file changed, 26 insertions(+), 8 deletions(-)
diff --git a/dts/framework/remote_session/dpdk.py b/dts/framework/remote_session/dpdk.py
index 50c22769c1..8d9f3b8948 100644
--- a/dts/framework/remote_session/dpdk.py
+++ b/dts/framework/remote_session/dpdk.py
@@ -419,6 +419,7 @@ def setup(self, ports: Iterable[Port]):
"""Set up the DPDK runtime on the target node."""
if self.build:
self.build.setup()
+ self._prepare_devbind_script()
self.bind_ports_to_driver(ports)
def teardown(self, ports: Iterable[Port]) -> None:
@@ -467,21 +468,38 @@ def bind_ports_to_driver(self, ports: Iterable[Port], for_dpdk: bool = True) ->
)
port.bound_for_dpdk = for_dpdk
- @cached_property
- def devbind_script_path(self) -> PurePath:
- """The path to the dpdk-devbind.py script on the node.
+ def _prepare_devbind_script(self) -> None:
+ """Prepare the devbind script.
+
+ If the environment has a build associated with it, then use the script within that build's
+ tree. Otherwise, copy the script from the local repository.
Raises:
- InternalError: If attempting to retrieve the devbind script in a build-less runtime.
+ InternalError: If dpdk-devbind.py could not be found.
"""
if self.build:
- return self._node.main_session.join_remote_path(
+ self.devbind_script_path = self._node.main_session.join_remote_path(
self.build.remote_dpdk_tree_path, "usertools", "dpdk-devbind.py"
)
+ else:
+ local_script_path = Path("..", "usertools", "dpdk-devbind.py").resolve()
+ if not local_script_path.exists():
+ raise InternalError("Could not find dpdk-devbind.py locally.")
- raise InternalError(
- "DPDK runtime is not associated with any DPDK build. Can't retrieve dpdk-devbind.py."
- )
+ self.devbind_script_path = self._node.main_session.join_remote_path(
+ self._node.tmp_dir, local_script_path.name
+ )
+
+ self._node.main_session.copy_to(local_script_path, self.devbind_script_path)
+
+ @cached_property
+ def devbind_script_path(self) -> PurePath:
+ """The path to the dpdk-devbind.py script on the node.
+
+ Raises:
+ InternalError: If accessed before environment setup.
+ """
+ raise InternalError("Accessed devbind script path before setup.")
def filter_lcores(
self,
--
2.43.0
next prev parent reply other threads:[~2025-02-24 13:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 13:28 [PATCH 0/6] dts: add build-less " Luca Vizzarro
2025-02-24 13:28 ` [PATCH 1/6] dts: ensure runtime working directory Luca Vizzarro
2025-02-24 13:28 ` [PATCH 2/6] dts: use topology in smoke tests Luca Vizzarro
2025-02-24 13:28 ` [PATCH 3/6] dts: add tmp directory facility Luca Vizzarro
2025-02-24 13:28 ` [PATCH 4/6] dts: decouple DPDK runtime from build Luca Vizzarro
2025-02-24 13:28 ` Luca Vizzarro [this message]
2025-02-24 13:28 ` [PATCH 6/6] dts: restore TG setup and teardown Luca Vizzarro
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=20250224132823.196509-6-luca.vizzarro@arm.com \
--to=luca.vizzarro@arm.com \
--cc=dev@dpdk.org \
--cc=paul.szczepanek@arm.com \
--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).