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 A0D2C46130; Fri, 24 Jan 2025 19:10:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7326140B8F; Fri, 24 Jan 2025 19:10:41 +0100 (CET) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by mails.dpdk.org (Postfix) with ESMTP id 5168C402CE for ; Fri, 24 Jan 2025 19:10:40 +0100 (CET) Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-53e36a1cf4fso358741e87.0 for ; Fri, 24 Jan 2025 10:10:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1737742240; x=1738347040; 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=ZPwu6yv4eCe0rU8aiyMEzqQOVFTajGeH7Kexpq7GQB8=; b=VfivruNDONGZad37a6WMg8aIZCO2S7bJa51DC7t1vF36AAX99E5utDTQqqmG2qNt1e 25P6nZqFS+cqatQiBksze97RRnUzk5PYpjvCBkQwih/spYPU+qFzhzOX0A/D4/ifqylv YmNBt5P+G3rnSCsuNnwEYstBfP/3ENYQI0UVg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737742240; x=1738347040; 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=ZPwu6yv4eCe0rU8aiyMEzqQOVFTajGeH7Kexpq7GQB8=; b=kQsHazAOZ56YvdR0rSFw4lfZtqm0V2oUeJUOrWVB4W9CD9OXYBz3QxiOLTqcvmCrFd JkUYJf6oF4llFgKqkJPN3NLgVg72C52q19dwFwZV7xaq5VcpWowTnvnLJwwz3d3L7FZI JMUXbt0+QkQcCmxuJso12ycO0wSzMd2wC0tVAZpfjzkVDvmyrp5Lgr4nyQR8UxrbImgS ZKz5Y3MmrHoyhQPq24UAUcrWGLgsfpPjIHfGgLvSvSqd9wCKUl31+S9er37Xhxt+qE37 vEc0O9sTKPWgSVasi/SQNPsCUPxPcFNNnn79kxOG8HPGprnVHYU3zxaXzWX672eaIjgB AgNw== X-Gm-Message-State: AOJu0YzrIgcWBc1dQxO9vq41ar0HaA1le5kmsuuvwFZmHlkGlq6O1QIX 0WdmNy5oH8CIgOZmNxE5MYl06aUtIi0RqJaEQDRVMm+CWGwzrgd66bnS+YYd3VzZhW/i55tjfqu eCkeHUtDhaDeqHAsSl1a7MF8PAfMv8DXsgr+Dug== X-Gm-Gg: ASbGncvmYbKQabeJ4N3IOGHNCfXmER6ryj912xIbKUa5K3Wq0XbTtALS+pfdWFZclBs vSwaNq/t+XrkDbJ73uwag6g4Mi0JL64ZZ5ZqhlL7q66X1f8bSVdc0gnXOf3kLa8yQHUVretb67B MQeLbJNUVnSppwym3bqI7M X-Google-Smtp-Source: AGHT+IHWkuD1Yy6XH2Umm2RKgpjq0orfrbRUGjxImL3NQNLSW+vqdBTlJTjPBZ3TzoA7H+eYa/AyqDDytpBdFNmsC+0= X-Received: by 2002:ac2:4c51:0:b0:542:7198:986d with SMTP id 2adb3069b0e04-5439c22cba0mr3772716e87.2.1737742239765; Fri, 24 Jan 2025 10:10:39 -0800 (PST) MIME-Version: 1.0 References: <20240613201831.9748-3-npratte@iol.unh.edu> <20250124113909.137128-1-luca.vizzarro@arm.com> <20250124113909.137128-3-luca.vizzarro@arm.com> In-Reply-To: <20250124113909.137128-3-luca.vizzarro@arm.com> From: Nicholas Pratte Date: Fri, 24 Jan 2025 13:10:28 -0500 X-Gm-Features: AWEUYZmVBbNd6c5gG9Ik6EVJuSXlcPBKR4FS3Ck2s5LOiK91D2F4XtB4UYQHgBk Message-ID: Subject: Re: [PATCH v4 2/7] dts: simplify build options config 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 build options configuration contained redundant fields that were not > in use, and there is no future scope for their use. > > Bugzilla ID: 1360 > > Signed-off-by: Nicholas Pratte > Signed-off-by: Luca Vizzarro > Reviewed-by: Paul Szczepanek > Reviewed-by: Dean Marx > --- > dts/conf.yaml | 3 -- > dts/framework/config/__init__.py | 43 -------------------- > dts/framework/test_result.py | 2 +- > dts/framework/testbed_model/cpu.py | 20 ++++++++- > dts/framework/testbed_model/node.py | 2 +- > dts/framework/testbed_model/os_session.py | 4 +- > dts/framework/testbed_model/posix_session.py | 2 +- > dts/framework/testbed_model/sut_node.py | 6 ++- > 8 files changed, 28 insertions(+), 54 deletions(-) > > diff --git a/dts/conf.yaml b/dts/conf.yaml > index 80aba0d63a..4b6965b3d7 100644 > --- a/dts/conf.yaml > +++ b/dts/conf.yaml > @@ -14,9 +14,6 @@ test_runs: > > # precompiled_build_dir: Commented out because `build_options` is = defined. > build_options: > - arch: x86_64 > - os: linux > - cpu: native > # the combination of the following two makes CC=3D"ccache gcc" > compiler: gcc > compiler_wrapper: ccache # Optional. > diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__in= it__.py > index 1127c6474a..3fa8f4fa8f 100644 > --- a/dts/framework/config/__init__.py > +++ b/dts/framework/config/__init__.py > @@ -63,22 +63,6 @@ class FrozenModel(BaseModel): > model_config =3D ConfigDict(frozen=3DTrue, extra=3D"forbid") > > > -@unique > -class Architecture(StrEnum): > - r"""The supported architectures of :class:`~framework.testbed_model.= node.Node`\s.""" > - > - #: > - i686 =3D auto() > - #: > - x86_64 =3D auto() > - #: > - x86_32 =3D auto() > - #: > - arm64 =3D auto() > - #: > - ppc64le =3D auto() > - > - > @unique > class OS(StrEnum): > r"""The supported operating systems of :class:`~framework.testbed_mo= del.node.Node`\s.""" > @@ -91,22 +75,6 @@ class OS(StrEnum): > windows =3D auto() > > > -@unique > -class CPUType(StrEnum): > - r"""The supported CPUs of :class:`~framework.testbed_model.node.Node= `\s.""" > - > - #: > - native =3D auto() > - #: > - armv8a =3D auto() > - #: > - dpaa2 =3D auto() > - #: > - thunderx =3D auto() > - #: > - xgene1 =3D auto() > - > - > @unique > class Compiler(StrEnum): > r"""The supported compilers of :class:`~framework.testbed_model.node= .Node`\s.""" > @@ -351,23 +319,12 @@ class DPDKBuildOptionsConfiguration(FrozenModel): > The build options used for building DPDK. > """ > > - #: The target architecture to build for. > - arch: Architecture > - #: The target OS to build for. > - os: OS > - #: The target CPU to build for. > - cpu: CPUType > #: The compiler executable to use. > compiler: Compiler > #: This string will be put in front of the compiler when executing t= he build. Useful for adding > #: wrapper commands, such as ``ccache``. > compiler_wrapper: str =3D "" > > - @cached_property > - def name(self) -> str: > - """The name of the compiler.""" > - return f"{self.arch}-{self.os}-{self.cpu}-{self.compiler}" > - > > class DPDKUncompiledBuildConfiguration(BaseDPDKBuildConfiguration): > """DPDK uncompiled build configuration.""" > diff --git a/dts/framework/test_result.py b/dts/framework/test_result.py > index 45fc2e8241..0060155ef9 100644 > --- a/dts/framework/test_result.py > +++ b/dts/framework/test_result.py > @@ -334,7 +334,7 @@ class DTSResult(BaseResult): > """Stores environment information and test results from a DTS run. > > * Test run level information, such as testbed, the test suite li= st and > - DPDK build configuration (compiler, target OS and cpu), > + DPDK build compiler configuration, > * Test suite and test case results, > * All errors that are caught and recorded during DTS execution. > > diff --git a/dts/framework/testbed_model/cpu.py b/dts/framework/testbed_m= odel/cpu.py > index 46bf13960d..d19fa5d597 100644 > --- a/dts/framework/testbed_model/cpu.py > +++ b/dts/framework/testbed_model/cpu.py > @@ -1,5 +1,6 @@ > # SPDX-License-Identifier: BSD-3-Clause > # Copyright(c) 2023 PANTHEON.tech s.r.o. > +# Copyright(c) 2025 Arm Limited > > """CPU core representation and filtering. > > @@ -21,8 +22,25 @@ > from abc import ABC, abstractmethod > from collections.abc import Iterable, ValuesView > from dataclasses import dataclass > +from enum import auto, unique > > -from framework.utils import expand_range > +from framework.utils import StrEnum, expand_range > + > + > +@unique > +class Architecture(StrEnum): > + r"""The supported architectures of :class:`~framework.testbed_model.= node.Node`\s.""" > + > + #: > + i686 =3D auto() > + #: > + x86_64 =3D auto() > + #: > + x86_32 =3D auto() > + #: > + aarch64 =3D auto() > + #: > + ppc64le =3D auto() > > > @dataclass(slots=3DTrue, frozen=3DTrue) > diff --git a/dts/framework/testbed_model/node.py b/dts/framework/testbed_= model/node.py > index c56872aa99..08328ee482 100644 > --- a/dts/framework/testbed_model/node.py > +++ b/dts/framework/testbed_model/node.py > @@ -17,7 +17,6 @@ > > from framework.config import ( > OS, > - Architecture, > DPDKBuildConfiguration, > NodeConfiguration, > TestRunConfiguration, > @@ -26,6 +25,7 @@ > from framework.logger import DTSLogger, get_dts_logger > > from .cpu import ( > + Architecture, > LogicalCore, > LogicalCoreCount, > LogicalCoreList, > diff --git a/dts/framework/testbed_model/os_session.py b/dts/framework/te= stbed_model/os_session.py > index 30d781c355..fcda9b3de1 100644 > --- a/dts/framework/testbed_model/os_session.py > +++ b/dts/framework/testbed_model/os_session.py > @@ -28,7 +28,7 @@ > from dataclasses import dataclass > from pathlib import Path, PurePath, PurePosixPath > > -from framework.config import Architecture, NodeConfiguration > +from framework.config import NodeConfiguration > from framework.logger import DTSLogger > from framework.remote_session import ( > InteractiveRemoteSession, > @@ -40,7 +40,7 @@ > from framework.settings import SETTINGS > from framework.utils import MesonArgs, TarCompressionFormat > > -from .cpu import LogicalCore > +from .cpu import Architecture, LogicalCore > from .port import Port > > > diff --git a/dts/framework/testbed_model/posix_session.py b/dts/framework= /testbed_model/posix_session.py > index 220618cacc..981600e24c 100644 > --- a/dts/framework/testbed_model/posix_session.py > +++ b/dts/framework/testbed_model/posix_session.py > @@ -15,7 +15,6 @@ > from collections.abc import Iterable > from pathlib import Path, PurePath, PurePosixPath > > -from framework.config import Architecture > from framework.exception import DPDKBuildError, RemoteCommandExecutionEr= ror > from framework.settings import SETTINGS > from framework.utils import ( > @@ -26,6 +25,7 @@ > extract_tarball, > ) > > +from .cpu import Architecture > from .os_session import OSSession, OSSessionInfo > > > diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/test= bed_model/sut_node.py > index a9dc0a474a..11d4b22089 100644 > --- a/dts/framework/testbed_model/sut_node.py > +++ b/dts/framework/testbed_model/sut_node.py > @@ -400,7 +400,7 @@ def _configure_dpdk_build(self, dpdk_build_config: DP= DKBuildOptionsConfiguration > dpdk_build_config: A DPDK build configuration to test. > """ > self._env_vars =3D {} > - self._env_vars.update(self.main_session.get_dpdk_build_env_vars(= dpdk_build_config.arch)) > + self._env_vars.update(self.main_session.get_dpdk_build_env_vars(= self.arch)) > if compiler_wrapper :=3D dpdk_build_config.compiler_wrapper: > self._env_vars["CC"] =3D f"'{compiler_wrapper} {dpdk_build_c= onfig.compiler.name}'" > else: > @@ -410,8 +410,10 @@ def _configure_dpdk_build(self, dpdk_build_config: D= PDKBuildOptionsConfiguration > dpdk_build_config.compiler.name > ) > > + build_dir_name =3D f"{self.arch}-{self.config.os}-{dpdk_build_co= nfig.compiler}" > + > self._remote_dpdk_build_dir =3D self.main_session.join_remote_pa= th( > - self._remote_dpdk_tree_path, dpdk_build_config.name > + self._remote_dpdk_tree_path, build_dir_name > ) > > def _build_dpdk(self) -> None: > -- > 2.43.0 >