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 263FD45A1C; Tue, 24 Sep 2024 11:12:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E8FF840295; Tue, 24 Sep 2024 11:12:43 +0200 (CEST) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by mails.dpdk.org (Postfix) with ESMTP id 641484028E for ; Tue, 24 Sep 2024 11:12:42 +0200 (CEST) Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a8d3cde1103so437644266b.2 for ; Tue, 24 Sep 2024 02:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1727169162; x=1727773962; darn=dpdk.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=uITsLW+iMAufGhUNnOCDGlLg5Npfk4hZDK5E28S0r0c=; b=L1OiGH1X7oIm474AknOTMNOk58HQfa3gBXqHl7VERELG0Evin3X+mN9y1LgWj6IYIK Qy3mmS0hR5mhfV/bDqD7atP5hChX0dnfc9gconIPZ+6EGnybrdMI/f+NA3rdLiF7xQ9A i7KH/7P02RCgroOTQOARLXtjPe7Zbmx9IHwdLBb6hvFFDbFaCdajI6J8HzOj2MbZZSgq qi7fBjBBjaTUb/y/502Z9I65ECLsrZ3fEPQAQh23OJEHdRXeumV39wUuGQXEAnwLf3Xd csE2WqEPkhh3S3RZ26b8UAR6Jmfe9UzBIM55FYFlTYm5Uls5qBWLGFTEYIy8IEja4Toj FU7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727169162; x=1727773962; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uITsLW+iMAufGhUNnOCDGlLg5Npfk4hZDK5E28S0r0c=; b=OnlqfXzjq+PDrvMa39OhvsdGGYswN++SHHsNZBTKE1C5OJlhvgdosfLVBxtYOGOreC J7pSCMQ4sPJKJzIV8LQsvbJ1/our4SUb6T6fskbvz6qbcCrtCWUDftSMyoHTHz1HX0Uz f23M1l/SbznS5npqLvZ0ZJxQep7+FZf/1VerCqnvTtAk1Sc6+3qchCM6rw7wyrzkkVZR gGrbIrOG7XEn3Jr43iW+baLqDT78or8mg+PYX2g1Pz/Af/WozEuU1WJs0mauaRrb1yx5 cekqoeNGZfTK6ILvBBaIP6oQFWdjibRFP9/mwuI80fPqLDVWdG+b4UOllf/gEeYMIPdb y7Jw== X-Gm-Message-State: AOJu0YxOD4umFxAFQdCiaJDlmM4meEj7+nriRCM0G26mYMleNZdSzV1q 3WJTFQ6lPJznnea2jzKhZKDclSGyp+nPoMM/NPmTaHUur6r4epFip6sYSixkWJ0= X-Google-Smtp-Source: AGHT+IF5zvdspIpQ5hfSzcoDeT8tGYInS8B1oRH/flRe5s9yJu/VDn5S1tezBeq7CqxWv8zMKBK0lA== X-Received: by 2002:a17:907:7b9f:b0:a8a:8cdb:838c with SMTP id a640c23a62f3a-a90d58bb8eemr1650348766b.53.1727169161939; Tue, 24 Sep 2024 02:12:41 -0700 (PDT) Received: from [10.12.0.236] (81.89.53.154.host.vnet.sk. [81.89.53.154]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93930cb0d0sm59703066b.126.2024.09.24.02.12.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Sep 2024 02:12:41 -0700 (PDT) Message-ID: <0eeacec2-6b17-4ed6-8444-c3963378b7f5@pantheon.tech> Date: Tue, 24 Sep 2024 11:12:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/1] dts: add binding to different drivers to TG node To: jspewock@iol.unh.edu, alex.chapman@arm.com, npratte@iol.unh.edu, thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, probb@iol.unh.edu, yoan.picchi@foss.arm.com, Luca.Vizzarro@arm.com, paul.szczepanek@arm.com, wathsala.vithanage@arm.com Cc: dev@dpdk.org References: <20240812172251.41131-1-jspewock@iol.unh.edu> <20240919181611.20289-1-jspewock@iol.unh.edu> <20240919181611.20289-2-jspewock@iol.unh.edu> Content-Language: en-US From: =?UTF-8?Q?Juraj_Linke=C5=A1?= In-Reply-To: <20240919181611.20289-2-jspewock@iol.unh.edu> Content-Type: text/plain; charset=UTF-8; format=flowed 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 I have some thoughts for the future: 1a. The traffic generator is specified per-node, so maybe we could also change the binding to be for the whole lifetime of the TG node, 1b. But the same is true for the SUT node as well, right? After we do the port update (with kernel driver), we can just bind to DPDK driver. With SUT in the mix, this looks like a change for a different patch, 2. We could add a symlink to the devbind script with the target being in the dts directory. This way we don't have to go outside the dts directory and if DTS ever become a python package, we could just copy the script to the appropriate place. This is also something we don't really need to do. And also two minor comments. A lot of suggestions for separate patches overall. :-) On 19. 9. 2024 20:16, jspewock@iol.unh.edu wrote: > From: Jeremy Spewock > > The DTS framework in its current state supports binding ports to > different drivers on the SUT node but not the TG node. The TG node > already has the information that it needs about the different drivers > that it has available in the configuration file, but it did not > previously have access to the devbind script, so it did not use that > information for anything. > > This patch moves the location of the tmp directory as well as the method > for binding ports into the node class rather than the SUT node class and > adds an abstract method for getting the path to the devbind script into > the node class. Then, binding ports to the correct drivers is moved into > the build target setup and run on both nodes. > > Bugzilla ID: 1420 > > Signed-off-by: Jeremy Spewock > --- With the two minor comments, Reviewed-by: Juraj Linkeš > diff --git a/dts/framework/testbed_model/node.py b/dts/framework/testbed_model/node.py > @@ -58,8 +65,10 @@ class Node(ABC): > lcores: list[LogicalCore] > ports: list[Port] > _logger: DTSLogger > + _remote_tmp_dir: PurePath > _other_sessions: list[OSSession] > _test_run_config: TestRunConfiguration > + _path_to_devbind_script: PurePath | None A note on the naming. We have _remote_tmp_dir and _path_to_devbind_script. Both are pointing to a remote file/dir, but only one has the _remote prefix. They should probably be unified. I've thought a bit about what the right name is. Dropping the prefix makes sense; sut_node.tmp_dir should mean the tmp dir on the SUT node (which would make it remote from the execution host's point of view, but not the node's view; the file is local to SUT node). This could be a good separate patch (improving the remote/local naming scheme to make it consistent and as sensible as possible). > diff --git a/dts/framework/utils.py b/dts/framework/utils.py > @@ -29,6 +29,8 @@ > from .exception import ConfigurationError, InternalError > > REGEX_FOR_PCI_ADDRESS: str = "/[0-9a-fA-F]{4}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}.[0-9]{1}/" > +#: Path to DPDK directory on the host where DTS is being run. > +LOCAL_DPDK_DIR: PurePath = PurePath(__file__).parents[2] Local paths can be just pathlib.Path. PurePaths are for path manipulations only (useful for remote paths in RemoteSessions, OSSessions and Nodes), but for local existing paths we should use Path. The OSSession and subclasses need a bit of an update in this regard - use Path for local paths and PurePaths for remote ones. We added this into our pre-built DPDK patch. > > > def expand_range(range_str: str) -> list[int]: