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 0498945835; Wed, 21 Aug 2024 21:16:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 972B8427E0; Wed, 21 Aug 2024 21:16:17 +0200 (CEST) Received: from mail-yw1-f225.google.com (mail-yw1-f225.google.com [209.85.128.225]) by mails.dpdk.org (Postfix) with ESMTP id 7E0654279D for ; Wed, 21 Aug 2024 21:16:16 +0200 (CEST) Received: by mail-yw1-f225.google.com with SMTP id 00721157ae682-6b6b9867f81so671617b3.1 for ; Wed, 21 Aug 2024 12:16:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1724267776; x=1724872576; 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=W/B6pvpiDonk5EwGiRxKUismGz5E23PPCcvWkwgU1Ew=; b=fRNDAZfDaRTnFryGraItW2z0CKb4EtZmlbDi2ZsAxDzvTK3ugIeUWyP+LmlLRQJXV4 gMZojIsdgDr2EzmTmVY1IRYuzMMQaloUjhPMNAv0WkUmceTcM15I38JJCBFKqXGfRo8U g4PanN/d4i41QjbUL68q1VcpBw/bDXlusYCPw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724267776; x=1724872576; 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=W/B6pvpiDonk5EwGiRxKUismGz5E23PPCcvWkwgU1Ew=; b=MbQt7q3FAO3OKC2R+8PphGMI0TwiOoFwHXtQptiK4aNZ52WjHwaxuVZBqyK8pmyTc4 i5t418UuujLyQkU3hjOnYZSaFMBhi6y3ouVVwhcALaCHeZDMcQ+9cOVrmaZW6YCMrbg1 2OQXcWN+oNu1GJ38/e72JryZTDCGzVO3DJ5GtfmSZYvLqbVhgXeRkljn2RsJ5I/UA7u/ 0PH7/p/MupWff8NXG3U7xckBb9bhrVacZ3a3rfOGUbcuASaWwmilxAxrRoIAM+zNKfTs t0STAasmF6rFutcIb3qUYb5yrx1hEXqIt1zdrO6lZJbxkNyPWxEWH+3yk9GBHLiMPPTP 0Big== X-Gm-Message-State: AOJu0YwEvkiaSQWeGHkaYYg9z/FZgZ6U2dbBk29mxSDBUcb1xZ8LB78o gsssb+A/Gsj+nwQ6qdUDb/685KpD77+N0VI06o3yklOLKk3BO2khXeSAoyw7kVSE1FjWYwMqnRP pXzExtq8yEbf1tBK9mnnqSo5E39ahzsULTJ2y7i5Yx3dYcWIr X-Google-Smtp-Source: AGHT+IFTCmTKUFOlEtBRTzfPr4CuBlMqqeDMGUnHir88r4YU1p6bi+OK4hMwdhyVXRtWexLtKzQ9wuiy+jcK X-Received: by 2002:a05:690c:6588:b0:6b0:f068:8274 with SMTP id 00721157ae682-6c0fdfe09a5mr32458657b3.41.1724267775811; Wed, 21 Aug 2024 12:16:15 -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 00721157ae682-6af9da16818sm4366027b3.49.2024.08.21.12.16.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Aug 2024 12:16:15 -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 DF895605C351; Wed, 21 Aug 2024 15:16:14 -0400 (EDT) From: jspewock@iol.unh.edu To: npratte@iol.unh.edu, thomas@monjalon.net, Luca.Vizzarro@arm.com, yoan.picchi@foss.arm.com, alex.chapman@arm.com, juraj.linkes@pantheon.tech, probb@iol.unh.edu, wathsala.vithanage@arm.com, paul.szczepanek@arm.com, Honnappa.Nagarahalli@arm.com Cc: dev@dpdk.org, Jeremy Spewock Subject: [RFC PATCH v1 1/5] dts: allow binding only a single port to a different driver Date: Wed, 21 Aug 2024 15:15:53 -0400 Message-ID: <20240821191557.18744-2-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240821191557.18744-1-jspewock@iol.unh.edu> References: <20240821191557.18744-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 drivers to their respective ports to solve this problem. Signed-off-by: Jeremy Spewock --- 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