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 CF31C460E8; Wed, 22 Jan 2025 18:38:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2F6540647; Wed, 22 Jan 2025 18:38:41 +0100 (CET) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by mails.dpdk.org (Postfix) with ESMTP id 8FE584060B for ; Wed, 22 Jan 2025 18:38:40 +0100 (CET) Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-303548a9332so4134311fa.1 for ; Wed, 22 Jan 2025 09:38:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1737567520; x=1738172320; 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=p/F1MLOCgjSNn3HpQXht6cZMxOk/f0qv7Gen8MVr1LQ=; b=NwHS1pyysAmzJC/3ahhBUZU5KyRgz4MvKIZu1NPjHuGC7Ktcsbf5jwM2lVRTYFxnZJ lqV4rEybCINAfLYKYjHiCuvg4oILqMDqf1f5YjyS19/wRh0F2ljYixoel9BFkeLcfrn8 HHuiUuCeUsoNnMik+VWR5olje5xhNrslOQ+94= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737567520; x=1738172320; 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=p/F1MLOCgjSNn3HpQXht6cZMxOk/f0qv7Gen8MVr1LQ=; b=wAw5t00/z0u/js8A84weIgVXWCGQYvAYcS24FY8yG8R1Pa4i5I79gwUi+DXGpFzwh8 385v6uJZhAOOwGBwKCqopx/dSs/pKmsAP7C8+fQZ3OhpKPkhdTuSSCigs2gGBg+Z/u3t fzRqotefpprb/Bzvg+DUN/xFX7ORaLIHHtutvdeB78Y8iDlk46yyIywLVHf00oT5SXqI 5PpWe5ANzl2pBGSuiAqE61I27Y0ZZ/XDZ0MX2xrUxwPTfsb1B+iBjskA6UdnKy99TtKE HveoEivWEPuolp348BsITHDGcNveS87mGS3inIi4iuk4FNejnHmRYjJMp5hlTNjSo4SN Zkvg== X-Gm-Message-State: AOJu0YzcBQT3rmR38y/RK6tduDfv8bLBNC8YzDF7kmiipV6ge3dgZkMN ShVS7BQTWq9tQBD8W1MxNojN8owlLwSSgVd7It4SY62fMQooUaaktaNQMLJKV7aw0qRssCF2Vqq Vv/8eHLSKYkPGPrffGl1saCUObdRh0PdfAuyTBA== X-Gm-Gg: ASbGncvfN5ImlnWKi6k97AwEIMVx6OWhDByUs3URyGcnCFhHMWzoV1A8+Pan+pTTGdt LLF7eTmY1kN6KOv0N18Uq1DPsPtG2VyFtsADipNXt0SsZ3mDazSKN6bqZTOLHh3Loy3CUbRk6ph L3jp7BSCMVdA== X-Google-Smtp-Source: AGHT+IFwUojGWHtw+ctgV604zVlDZDVRGR/o+U0MjZLSsYB63kaccaTOrq7F5Nq/bd2lzc0q6YSIYzulhmfGKvmp3Qw= X-Received: by 2002:a2e:be0b:0:b0:300:43e5:51a with SMTP id 38308e7fff4ca-3072c98f111mr27248101fa.0.1737567519832; Wed, 22 Jan 2025 09:38:39 -0800 (PST) MIME-Version: 1.0 References: <20240705171341.23894-2-npratte@iol.unh.edu> <20250115141809.3898708-1-luca.vizzarro@arm.com> <20250115141809.3898708-2-luca.vizzarro@arm.com> In-Reply-To: <20250115141809.3898708-2-luca.vizzarro@arm.com> From: Nicholas Pratte Date: Wed, 22 Jan 2025 12:38:28 -0500 X-Gm-Features: AbW1kvbVNF6T1d-Vn7wihhzsFwJL0b0jk7b7Jlk4e0WYI9PIan0D3A9t5xrb2Xo Message-ID: Subject: Re: [PATCH v3 1/7] dts: enable arch self-discovery To: Luca Vizzarro Cc: dev@dpdk.org, Paul Szczepanek , 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 Wed, Jan 15, 2025 at 9:19=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 > --- > 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 >