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 32E8045837; Wed, 21 Aug 2024 21:22:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4694342D80; Wed, 21 Aug 2024 21:22:26 +0200 (CEST) Received: from mail-vs1-f97.google.com (mail-vs1-f97.google.com [209.85.217.97]) by mails.dpdk.org (Postfix) with ESMTP id 800CC42D3F for ; Wed, 21 Aug 2024 21:22:24 +0200 (CEST) Received: by mail-vs1-f97.google.com with SMTP id ada2fe7eead31-498d1e97214so559934137.3 for ; Wed, 21 Aug 2024 12:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1724268144; x=1724872944; 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=XZy2TmKtetDmen3mrZwad/HH3wUvlilx5N/XPEWl3CG4XlqVImefrykNHz6WXESgww kBcIeBN91OWs+s4jH/sl2mFIZ0AIH7ztUJ9mjPyussXjvEie8tSvL5VyGo/ECLnEpCn2 KvCJZSSzHY/SauBVvaKYZF1LljvhEWLjnhrXA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724268144; x=1724872944; 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=wHMtAPHtc7dpVKVNVWMzxjHPpxQiCurBN+U3QrqrOzxRUa5tyc8AqDcr+65T6aYFzF lh6POBpBrXv7Q9ECoGaMeOZvfStGwThveaERTMqs+Rx8zfcXSreNjcuVoME+AQUiC9Gu p+qZULAiMDRUjnisHxcNPnRdhaMtrZPDn40O2agoLTqHxPDLWh14Oia1FFbadHyG57Rr ZMm/orB4i2hHwdMJjRZpmvu39qpsrmtNYsaznKRNAkcKr7++YoMHk4z878NbewRUnjR0 ruVbnQeO2OrlGM0ZHKzoJD6slZe4D7hmQmFcGmgXZGXwWIDvDh48z2qz0JDc1OOYxkS1 PLiQ== X-Gm-Message-State: AOJu0YyAKHyzUBqYa3BjjgYfQURmdILb30g8IsmPvTf0lzAg5EwYqV7J 4XoI+ppAV6wdJHSZMey73kTHVVSym61S7v9KjnLvXRHacoMdlVxRYjIfZqYlWdgMgqHi/7XxQ01 bJLIGj5vr8AR9kyWmkDoLxUGJfdR90KafL3Gul9Qsy6d/Xp+Q X-Google-Smtp-Source: AGHT+IHlCDCv6Kj76Yxh6Zudo7gTwlsb7M2ynCxSdDnIJSOFQnYkXmpSFeDL5V5h5C+wlH1p6sqwKh0eoLPN X-Received: by 2002:a05:6102:2906:b0:48f:e57a:e2f6 with SMTP id ada2fe7eead31-498d2e769a4mr4048836137.1.1724268143669; Wed, 21 Aug 2024 12:22:23 -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 a1e0cc1a2514c-844ce4dd41bsm561241.1.2024.08.21.12.22.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Aug 2024 12:22:23 -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 B5E46605C351; Wed, 21 Aug 2024 15:22:22 -0400 (EDT) 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 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 Message-ID: <20240821192151.20874-3-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