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 E606545837; Wed, 21 Aug 2024 21:39:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D279342DBD; Wed, 21 Aug 2024 21:39:43 +0200 (CEST) Received: from mail-oa1-f100.google.com (mail-oa1-f100.google.com [209.85.160.100]) by mails.dpdk.org (Postfix) with ESMTP id 28B1942DB0 for ; Wed, 21 Aug 2024 21:39:43 +0200 (CEST) Received: by mail-oa1-f100.google.com with SMTP id 586e51a60fabf-27032e6dbf2so24641fac.1 for ; Wed, 21 Aug 2024 12:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1724269182; x=1724873982; 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=DykB1nV4EH2BkW6ccka09zn84psRDncWLDLpFqvNZe9Hb45DPAzV0zQaFRXoWXdPVG mD8F8EkbEdUkhlI8dY+WJe4SjcPeLjIpy6WXAE7mN6YiXV53F3zY1C6W2sYpSSSBE/+N GAnzznoqel2Amy9F/R/WRoU9+amsP1Cl9cvLA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724269182; x=1724873982; 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=iGma8rJySykNJJ1t7Y//HrPZN3lb5MADjpegKPzOi4HCPYqSL0EGPWx1S5r250Bo+K 4qJwEzCVEAnmnlgef7EIgC6m6pBMnnlE6gP5z2SqhAt19nyOh1Wxj//GblIE+eWv8Jki GKNZlJibGBe15X7IfAgxbOfOgghA/qjunUbn9nwcjbLpizvD64LAasF7FLpiCArxVpdp a706rqUIuksE/dwU/51e8Lr/E6x+Sie8bNPrsJow/CiJTVSELOpbighLFpxCdCufskIy PTMpbxJutQafAtCafK+MuotSKz5tXua8v7IOAAOBSXzwE7MLYVDXVD4u1zK8RVbQNexL aU5g== X-Gm-Message-State: AOJu0YyXBS/s+utDmYKRqDMxlD/xtK511gX0ozFAagX44GcVy1SEn3pm f5vk8nzm83SQyt+eY4WbZg+rpRJe0M/1GdaKs3HbwJ0UvFCktiW34OUYuH2g5aOI1eaXzT3/UCo 5nWOdvm/3ZPy74K2jvmfNtygWWdgubr6Dl2Gzcu19Ii0hrztv X-Google-Smtp-Source: AGHT+IES9QBYBnQwpmpnzqt7FF8NW7s7l4++PKoZ5rK3+BhPGcWWxotRGBuhAZDeGaHkRInyAnKVdNKSG+ej X-Received: by 2002:a05:6870:e6d3:b0:260:8f6d:f01f with SMTP id 586e51a60fabf-2738be3163emr3473357fac.39.1724269182315; Wed, 21 Aug 2024 12:39:42 -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 586e51a60fabf-2706612e77esm436943fac.4.2024.08.21.12.39.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Aug 2024 12:39:42 -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 F37C8605C351; Wed, 21 Aug 2024 15:39:40 -0400 (EDT) From: jspewock@iol.unh.edu To: npratte@iol.unh.edu, paul.szczepanek@arm.com, thomas@monjalon.net, probb@iol.unh.edu, yoan.picchi@foss.arm.com, juraj.linkes@pantheon.tech, wathsala.vithanage@arm.com, Luca.Vizzarro@arm.com, alex.chapman@arm.com, Honnappa.Nagarahalli@arm.com Cc: dev@dpdk.org, Jeremy Spewock Subject: [RFC PATCH v2 1/5] dts: allow binding only a single port to a different driver Date: Wed, 21 Aug 2024 15:38:37 -0400 Message-ID: <20240821193841.21033-2-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240821193841.21033-1-jspewock@iol.unh.edu> References: <20240821191557.18744-1-jspewock@iol.unh.edu> <20240821193841.21033-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