From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7A1DD45838; Wed, 21 Aug 2024 23:31:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0727D42DDF; Wed, 21 Aug 2024 23:31:08 +0200 (CEST) Received: from mail-yb1-f227.google.com (mail-yb1-f227.google.com [209.85.219.227]) by mails.dpdk.org (Postfix) with ESMTP id 61A9742DDF for ; Wed, 21 Aug 2024 23:31:06 +0200 (CEST) Received: by mail-yb1-f227.google.com with SMTP id 3f1490d57ef6-e1674508eb9so223960276.1 for ; Wed, 21 Aug 2024 14:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1724275866; x=1724880666; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=g+Knz4UpdCuWtKRQ9cT7Y5vdFRbtS+xGKit+j0tcCss=; b=U62UThrPhkDUkZXS1B1EJSgs2bVcuvIuEi3JXdp7SVRek51qF425LLUMf3+qFw5elY WEI0ImU674ooWFZcia7VzIeipi9rbwv0boMthEt9TcgGmKGl7B9oO66Kl1LllRLwxhjs A9DADdNuBMblfTnwZ8a/PWrE5rr95eLGTpr3I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724275866; x=1724880666; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g+Knz4UpdCuWtKRQ9cT7Y5vdFRbtS+xGKit+j0tcCss=; b=uNeqXOGZs7FPvHqSyIuUFva+ajk1kZ4A1CgWimdl5Dk6oqnf+rok3nT5mwdEYiCHow 0YivU9G0whTpOYTqDwxK/LQtI68v55bsfJaFVCYf+9/ficR2VwAbMeTdKBOXh8plAPQp 0VCQAos/9FrecLteqgF6NR9+P8hHQnZM1Lda5whjR0ix9+jx10N1PLbC2+PfjNWWNaHA UWRbHDe7ph2S/gtwbfi1DVDuwUw7D08TlzInhb6UQeIIGD3ibloxYVk7Z67A9CORSWAj a1FrLYbIAtjHm8uGjAmCZCoTXEAUHUqKNn4vAE88g2tz45BArTFBnd4t7X80XCjGgpIZ Bbzw== X-Gm-Message-State: AOJu0Yz+dzz6H8uHD/UAxQTv8Qnd/9vWtz//MUjdOWZnGZcG+PqfokHn Zy3HmO6UMvrrWU0DY8WN0PvFGv9LZkPfHExP+ErMD/se3LT44lA9guXjAhCeRBUDIkpOURB0H7p nxx3KH3Qeebvz49xCuYcX4t9BSCvIrHYsMtdeqqR99HIWV1k6 X-Google-Smtp-Source: AGHT+IELnTfXh8marZVIxHw4MkF0SSsDMHNowAHspa6UqmFFMTnIj17LLNX6H+Qa3xwE/avVvWbTm+GEvA+B X-Received: by 2002:a05:6902:128d:b0:e11:7b58:851 with SMTP id 3f1490d57ef6-e1665471614mr4441524276.21.1724275865723; Wed, 21 Aug 2024 14:31:05 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id 3f1490d57ef6-e178e475c4fsm6763276.11.2024.08.21.14.31.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Aug 2024 14:31:05 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id CBD02605C351; Wed, 21 Aug 2024 17:31:04 -0400 (EDT) From: jspewock@iol.unh.edu To: Luca.Vizzarro@arm.com, thomas@monjalon.net, paul.szczepanek@arm.com, wathsala.vithanage@arm.com, probb@iol.unh.edu, yoan.picchi@foss.arm.com, juraj.linkes@pantheon.tech, Honnappa.Nagarahalli@arm.com, npratte@iol.unh.edu, alex.chapman@arm.com Cc: dev@dpdk.org, Jeremy Spewock Subject: [RFC PATCH v3 1/5] dts: allow binding only a single port to a different driver Date: Wed, 21 Aug 2024 17:30:38 -0400 Message-ID: <20240821213042.24814-2-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240821213042.24814-1-jspewock@iol.unh.edu> References: <20240821191557.18744-1-jspewock@iol.unh.edu> <20240821213042.24814-1-jspewock@iol.unh.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock 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 ports to their respective drviers to solve this problem. Depends-on: patch-143101 ("dts: add binding to different drivers to TG node") Signed-off-by: Jeremy Spewock --- dts/framework/testbed_model/node.py | 21 ++++++++++++--------- dts/tests/TestSuite_os_udp.py | 4 ++-- 2 files changed, 14 insertions(+), 11 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: diff --git a/dts/tests/TestSuite_os_udp.py b/dts/tests/TestSuite_os_udp.py index a78bd74139..5e9469bbac 100644 --- a/dts/tests/TestSuite_os_udp.py +++ b/dts/tests/TestSuite_os_udp.py @@ -23,7 +23,7 @@ def set_up_suite(self) -> None: Bind the SUT ports to the OS driver, configure the ports and configure the SUT to route traffic from if1 to if2. """ - self.sut_node.bind_ports_to_driver(for_dpdk=False) + self.sut_node.bind_all_ports_to_driver(for_dpdk=False) self.configure_testbed_ipv4() def test_os_udp(self) -> None: @@ -50,4 +50,4 @@ def tear_down_suite(self) -> None: """ self.configure_testbed_ipv4(restore=True) # Assume other suites will likely need dpdk driver - self.sut_node.bind_ports_to_driver(for_dpdk=True) + self.sut_node.bind_all_ports_to_driver(for_dpdk=True) -- 2.46.0