DPDK patches and discussions
 help / color / mirror / Atom feed
From: jspewock@iol.unh.edu
To: wathsala.vithanage@arm.com, npratte@iol.unh.edu,
	thomas@monjalon.net, Honnappa.Nagarahalli@arm.com,
	Luca.Vizzarro@arm.com, probb@iol.unh.edu,
	yoan.picchi@foss.arm.com, alex.chapman@arm.com,
	juraj.linkes@pantheon.tech, paul.szczepanek@arm.com
Cc: dev@dpdk.org, Jeremy Spewock <jspewock@iol.unh.edu>
Subject: [RFC PATCH v2 1/5] dts: allow binding only a single port to a different driver
Date: Wed, 21 Aug 2024 15:21:48 -0400	[thread overview]
Message-ID: <20240821192151.20874-3-jspewock@iol.unh.edu> (raw)
In-Reply-To: <20240821191557.18744-1-jspewock@iol.unh.edu>

From: Jeremy Spewock <jspewock@iol.unh.edu>

Previously the DTS framework only included methods that bind all ports
that the test run was aware of to either the DPDK driver or the OS
driver. There are however some cases, like creating virtual functions,
where you would want some ports bound to the OS driver and others bound
to their DPDK driver. This patch adds the ability to bind individual
drivers to their respective ports to solve this problem.

Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
---
 dts/framework/testbed_model/node.py | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/dts/framework/testbed_model/node.py b/dts/framework/testbed_model/node.py
index 8e6181e424..85d4eb1f7c 100644
--- a/dts/framework/testbed_model/node.py
+++ b/dts/framework/testbed_model/node.py
@@ -167,12 +167,12 @@ def set_up_build_target(self, build_target_config: BuildTargetConfiguration) ->
                 the setup steps will be taken.
         """
         self._copy_dpdk_tarball()
-        self.bind_ports_to_driver()
+        self.bind_all_ports_to_driver()
 
     def tear_down_build_target(self) -> None:
         """Reset DPDK variables and bind port driver to the OS driver."""
         self.__remote_dpdk_dir = None
-        self.bind_ports_to_driver(for_dpdk=False)
+        self.bind_all_ports_to_driver(for_dpdk=False)
 
     def create_session(self, name: str) -> OSSession:
         """Create and return a new OS-aware remote session.
@@ -317,7 +317,7 @@ def _copy_dpdk_tarball(self) -> None:
         # then extract to remote path
         self.main_session.extract_remote_tarball(remote_tarball_path, self._remote_dpdk_dir)
 
-    def bind_ports_to_driver(self, for_dpdk: bool = True) -> None:
+    def bind_all_ports_to_driver(self, for_dpdk: bool = True) -> None:
         """Bind all ports on the node to a driver.
 
         Args:
@@ -325,12 +325,15 @@ def bind_ports_to_driver(self, for_dpdk: bool = True) -> None:
                 If :data:`False`, binds to os_driver.
         """
         for port in self.ports:
-            driver = port.os_driver_for_dpdk if for_dpdk else port.os_driver
-            self.main_session.send_command(
-                f"{self.path_to_devbind_script} -b {driver} --force {port.pci}",
-                privileged=True,
-                verify=True,
-            )
+            self._bind_port_to_driver(port, for_dpdk)
+
+    def _bind_port_to_driver(self, port: Port, for_dpdk: bool = True) -> None:
+        driver = port.os_driver_for_dpdk if for_dpdk else port.os_driver
+        self.main_session.send_command(
+            f"{self.path_to_devbind_script} -b {driver} --force {port.pci}",
+            privileged=True,
+            verify=True,
+        )
 
 
 def create_session(node_config: NodeConfiguration, name: str, logger: DTSLogger) -> OSSession:
-- 
2.46.0


  parent reply	other threads:[~2024-08-21 19:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 19:15 [RFC PATCH v1 0/5] dts: add VFs to the framework jspewock
2024-08-21 19:15 ` [RFC PATCH v1 1/5] dts: allow binding only a single port to a different driver jspewock
2024-08-21 19:15 ` [RFC PATCH v1 2/5] dts: parameterize what ports the TG sends packets to jspewock
2024-08-21 19:15 ` [RFC PATCH v1 3/5] dts: add class for virtual functions jspewock
2024-08-21 19:15 ` [RFC PATCH v1 4/5] dts: add OS abstractions for creating " jspewock
2024-08-21 19:15 ` [RFC PATCH v1 5/5] dts: add functions for managing VFs to Node jspewock
2024-08-21 19:21 ` [RFC PATCH v2 0/5] dts: add VFs to the framework jspewock
2024-08-21 19:21 ` jspewock [this message]
2024-08-21 19:21 ` [RFC PATCH v2 2/5] dts: parameterize what ports the TG sends packets to jspewock
2024-08-21 19:21 ` [RFC PATCH v2 3/5] dts: add class for virtual functions jspewock
2024-08-21 19:21 ` [RFC PATCH v2 4/5] dts: add OS abstractions for creating " jspewock
2024-08-21 19:21 ` [RFC PATCH v2 5/5] dts: add functions for managing VFs to Node jspewock
2024-08-21 19:38 ` [RFC PATCH v2 0/5] dts: add VFs to the framework jspewock
2024-08-21 19:38   ` [RFC PATCH v2 1/5] dts: allow binding only a single port to a different driver jspewock
2024-08-21 19:38   ` [RFC PATCH v2 2/5] dts: parameterize what ports the TG sends packets to jspewock
2024-08-21 19:38   ` [RFC PATCH v2 3/5] dts: add class for virtual functions jspewock
2024-08-21 19:38   ` [RFC PATCH v2 4/5] dts: add OS abstractions for creating " jspewock
2024-08-21 19:38   ` [RFC PATCH v2 5/5] dts: add functions for managing VFs to Node jspewock
2024-08-21 19:44   ` [RFC PATCH v2 0/5] dts: add VFs to the framework Jeremy Spewock
2024-08-21 21:30 ` [RFC PATCH v3 " jspewock
2024-08-21 21:30   ` [RFC PATCH v3 1/5] dts: allow binding only a single port to a different driver jspewock
2024-08-21 21:30   ` [RFC PATCH v3 2/5] dts: parameterize what ports the TG sends packets to jspewock
2024-08-21 21:30   ` [RFC PATCH v3 3/5] dts: add class for virtual functions jspewock
2024-08-21 21:30   ` [RFC PATCH v3 4/5] dts: add OS abstractions for creating " jspewock
2024-08-21 21:30   ` [RFC PATCH v3 5/5] dts: add functions for managing VFs to Node jspewock

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=20240821192151.20874-3-jspewock@iol.unh.edu \
    --to=jspewock@iol.unh.edu \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Luca.Vizzarro@arm.com \
    --cc=alex.chapman@arm.com \
    --cc=dev@dpdk.org \
    --cc=juraj.linkes@pantheon.tech \
    --cc=npratte@iol.unh.edu \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --cc=thomas@monjalon.net \
    --cc=wathsala.vithanage@arm.com \
    --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).