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 705AE46130; Fri, 24 Jan 2025 19:09:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 424E5402CE; Fri, 24 Jan 2025 19:09:57 +0100 (CET) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) by mails.dpdk.org (Postfix) with ESMTP id 2F3F540294 for ; Fri, 24 Jan 2025 19:09:56 +0100 (CET) Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-5402ec870b4so339883e87.2 for ; Fri, 24 Jan 2025 10:09:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1737742195; x=1738346995; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Lca1MRI4ykKssvPyaWgOWeG+APFXLg/0x9ot9mH2Fsg=; b=Y2Ha18VAfEQi+gNiDDRqnioCz3w7wHgfJcNehTHXXK6F9ipKNpj+Mb0S+ksUCzWM2u bpb/QVIvTzMCqEQd1aV/2JA4dS/CBWxBY+1yE6z+KW2sP6gF7Sv+tKbZt024alBhThAg SOLsj7h2HT0PyuK4ZsbWIt5WWZlFspslA/60A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737742195; x=1738346995; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Lca1MRI4ykKssvPyaWgOWeG+APFXLg/0x9ot9mH2Fsg=; b=ZXDRJwczgQh+mHUs3hveLVdkHGOGoidpgwm1bwZ43SUJBDf1C3feq3YtGSUS//nM9n 3ncKlhiBuut7JR9lX8+c4U7rs1iVgw674Ky1lfA7EmKsSf+V9slPpwsDjZ530/onwzR4 L8C8wkF+3qXRPEkZFWR/6HlW3KOgLwwX5INWsJAvJbeeDIhRsb05LstO57X6W1N7wFME NBT1ptqriXgeWrjZW6hpefNb8p0/5JyVxV6TLdP6wg6up3RukIwchL+bMxWxbkjFKAOg XbbXsANzlqVHQ1mKtTjBs0GR7j5eoRn9fM6wTpqg7LE+lPNaNQJeEW+4OPVI1/kjf1IF 47kw== X-Gm-Message-State: AOJu0Yx6evO9mzzjEjiZz3rjejwYMXB5DPdk3iQ4j6hG4DPWSsm5jro9 5mvTViB0StF+y23Iv9J+KEpFqP//tCQBYlAWhxrpIMKyNEosL5lTxM/MnnX0viyswZMgAIGpWAa bz6NSOmtmwFZ22sCjfmBlvhOsvXSqpxjy7rivSA== X-Gm-Gg: ASbGncsH48knCARfB5eWHKSN7e2b6ZZgusQUkXXMXXAAdy+e4duGhYoc3gknyoY+RBS AWxWaxTMKCClyvR0yQjnRzRSpN7Z+RWGJfXn+5ABY1c3fdLshfKVN5f6EAA0qmjrIU9n9mJeqpA 9ZcUTRIGopQiyup7nAhEqM X-Google-Smtp-Source: AGHT+IHgKW964WjmkPOsITyJXazqqyfspd+G6W7t11gAvLuY1YuEtBsY51go4VGM7Kk5gQzypqOLxtmy+m/FUYREH8Q= X-Received: by 2002:a2e:bc1c:0:b0:305:d86a:4f1e with SMTP id 38308e7fff4ca-307587d5d7cmr17569121fa.9.1737742195229; Fri, 24 Jan 2025 10:09:55 -0800 (PST) MIME-Version: 1.0 References: <20240613201831.9748-3-npratte@iol.unh.edu> <20250124113909.137128-1-luca.vizzarro@arm.com> <20250124113909.137128-2-luca.vizzarro@arm.com> In-Reply-To: <20250124113909.137128-2-luca.vizzarro@arm.com> From: Nicholas Pratte Date: Fri, 24 Jan 2025 13:09:44 -0500 X-Gm-Features: AWEUYZmPEHOyfF9ROg09dawdVtTXImlf2QxKUYTcFQZ0VTdQ19i_uZUod4WUP9k Message-ID: Subject: Re: [PATCH v4 1/7] dts: enable arch self-discovery To: Luca Vizzarro Cc: dev@dpdk.org, Paul Szczepanek , Dean Marx , Patrick Robb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Reviewed-by: Nicholas Pratte On Fri, Jan 24, 2025 at 6:39=E2=80=AFAM Luca Vizzarro wrote: > > From: Nicholas Pratte > > The 'arch' attribute in the conf.yaml is unnecessary, as this can be > readily discovered directly from any given node. > > Bugzilla ID: 1360 > > Signed-off-by: Nicholas Pratte > Signed-off-by: Luca Vizzarro > Reviewed-by: Paul Szczepanek > Reviewed-by: Dean Marx > --- > dts/conf.yaml | 2 -- > dts/framework/config/__init__.py | 2 -- > dts/framework/testbed_model/node.py | 3 +++ > dts/framework/testbed_model/os_session.py | 8 ++++++++ > dts/framework/testbed_model/posix_session.py | 4 ++++ > 5 files changed, 15 insertions(+), 4 deletions(-) > > diff --git a/dts/conf.yaml b/dts/conf.yaml > index f83dbb0e90..80aba0d63a 100644 > --- a/dts/conf.yaml > +++ b/dts/conf.yaml > @@ -42,7 +42,6 @@ nodes: > - name: "SUT 1" > hostname: sut1.change.me.localhost > user: dtsuser > - arch: x86_64 > os: linux > lcores: "" # use all the available logical cores > use_first_core: false # tells DPDK to use any physical core > @@ -68,7 +67,6 @@ nodes: > - name: "TG 1" > hostname: tg1.change.me.localhost > user: dtsuser > - arch: x86_64 > os: linux > ports: > # sets up the physical link between "TG 1"@0000:00:08.0 and "SUT 1= "@0000:00:08.0 > diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__in= it__.py > index 6bf4885815..1127c6474a 100644 > --- a/dts/framework/config/__init__.py > +++ b/dts/framework/config/__init__.py > @@ -191,8 +191,6 @@ class NodeConfiguration(FrozenModel): > user: str > #: The password of the user. The use of passwords is heavily discour= aged, please use SSH keys. > password: str | None =3D None > - #: The architecture of the :class:`~framework.testbed_model.node.Nod= e`. > - arch: Architecture > #: The operating system of the :class:`~framework.testbed_model.node= .Node`. > os: OS > #: A comma delimited list of logical cores to use when running DPDK. > diff --git a/dts/framework/testbed_model/node.py b/dts/framework/testbed_= model/node.py > index c6f12319ca..c56872aa99 100644 > --- a/dts/framework/testbed_model/node.py > +++ b/dts/framework/testbed_model/node.py > @@ -17,6 +17,7 @@ > > from framework.config import ( > OS, > + Architecture, > DPDKBuildConfiguration, > NodeConfiguration, > TestRunConfiguration, > @@ -57,6 +58,7 @@ class Node(ABC): > main_session: OSSession > config: NodeConfiguration > name: str > + arch: Architecture > lcores: list[LogicalCore] > ports: list[Port] > _logger: DTSLogger > @@ -79,6 +81,7 @@ def __init__(self, node_config: NodeConfiguration): > self.name =3D node_config.name > self._logger =3D get_dts_logger(self.name) > self.main_session =3D create_session(self.config, self.name, sel= f._logger) > + self.arch =3D Architecture(self.main_session.get_arch_info()) > > self._logger.info(f"Connected to node: {self.name}") > > diff --git a/dts/framework/testbed_model/os_session.py b/dts/framework/te= stbed_model/os_session.py > index 28eccc05ed..30d781c355 100644 > --- a/dts/framework/testbed_model/os_session.py > +++ b/dts/framework/testbed_model/os_session.py > @@ -507,6 +507,14 @@ def get_node_info(self) -> OSSessionInfo: > Node information. > """ > > + @abstractmethod > + def get_arch_info(self) -> str: > + """Discover CPU architecture of the remote host. > + > + Returns: > + Remote host CPU architecture. > + """ > + > @abstractmethod > def update_ports(self, ports: list[Port]) -> None: > """Get additional information about ports from the operating sys= tem and update them. > diff --git a/dts/framework/testbed_model/posix_session.py b/dts/framework= /testbed_model/posix_session.py > index 29e314db6e..220618cacc 100644 > --- a/dts/framework/testbed_model/posix_session.py > +++ b/dts/framework/testbed_model/posix_session.py > @@ -404,3 +404,7 @@ def get_node_info(self) -> OSSessionInfo: > ).stdout.split("\n") > kernel_version =3D self.send_command("uname -r", SETTINGS.timeou= t).stdout > return OSSessionInfo(os_release_info[0].strip(), os_release_info= [1].strip(), kernel_version) > + > + def get_arch_info(self) -> str: > + """Overrides :meth'~.os_session.OSSession.get_arch_info'.""" > + return self.send_command("uname -m").stdout.strip() > -- > 2.43.0 >