DPDK patches and discussions
 help / color / mirror / Atom feed
From: Luca Vizzarro <luca.vizzarro@arm.com>
To: dev@dpdk.org
Cc: Nicholas Pratte <npratte@iol.unh.edu>,
	Luca Vizzarro <luca.vizzarro@arm.com>,
	Paul Szczepanek <paul.szczepanek@arm.com>,
	Patrick Robb <probb@iol.unh.edu>
Subject: [PATCH v3 2/7] dts: simplify build options config
Date: Wed, 15 Jan 2025 14:18:04 +0000	[thread overview]
Message-ID: <20250115141809.3898708-3-luca.vizzarro@arm.com> (raw)
In-Reply-To: <20250115141809.3898708-1-luca.vizzarro@arm.com>

From: Nicholas Pratte <npratte@iol.unh.edu>

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 <npratte@iol.unh.edu>
Signed-off-by: Luca Vizzarro <luca.vizzarro@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
---
 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="ccache gcc"
         compiler: gcc
         compiler_wrapper: ccache # Optional.
diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__init__.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 = ConfigDict(frozen=True, extra="forbid")
 
 
-@unique
-class Architecture(StrEnum):
-    r"""The supported architectures of :class:`~framework.testbed_model.node.Node`\s."""
-
-    #:
-    i686 = auto()
-    #:
-    x86_64 = auto()
-    #:
-    x86_32 = auto()
-    #:
-    arm64 = auto()
-    #:
-    ppc64le = auto()
-
-
 @unique
 class OS(StrEnum):
     r"""The supported operating systems of :class:`~framework.testbed_model.node.Node`\s."""
@@ -91,22 +75,6 @@ class OS(StrEnum):
     windows = auto()
 
 
-@unique
-class CPUType(StrEnum):
-    r"""The supported CPUs of :class:`~framework.testbed_model.node.Node`\s."""
-
-    #:
-    native = auto()
-    #:
-    armv8a = auto()
-    #:
-    dpaa2 = auto()
-    #:
-    thunderx = auto()
-    #:
-    xgene1 = 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 the build. Useful for adding
     #: wrapper commands, such as ``ccache``.
     compiler_wrapper: str = ""
 
-    @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 ba7c1c9804..381f72b974 100644
--- a/dts/framework/test_result.py
+++ b/dts/framework/test_result.py
@@ -337,7 +337,7 @@ class DTSResult(BaseResult):
     """Stores environment information and test results from a DTS run.
 
         * Test run level information, such as testbed, the test suite list 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_model/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 = auto()
+    #:
+    x86_64 = auto()
+    #:
+    x86_32 = auto()
+    #:
+    aarch64 = auto()
+    #:
+    ppc64le = auto()
 
 
 @dataclass(slots=True, frozen=True)
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/testbed_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, RemoteCommandExecutionError
 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/testbed_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: DPDKBuildOptionsConfiguration
             dpdk_build_config: A DPDK build configuration to test.
         """
         self._env_vars = {}
-        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 := dpdk_build_config.compiler_wrapper:
             self._env_vars["CC"] = f"'{compiler_wrapper} {dpdk_build_config.compiler.name}'"
         else:
@@ -410,8 +410,10 @@ def _configure_dpdk_build(self, dpdk_build_config: DPDKBuildOptionsConfiguration
             dpdk_build_config.compiler.name
         )
 
+        build_dir_name = f"{self.arch}-{self.config.os}-{dpdk_build_config.compiler}"
+
         self._remote_dpdk_build_dir = self.main_session.join_remote_path(
-            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


  parent reply	other threads:[~2025-01-15 14:19 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-13 20:18 [PATCH 0/4] dts: Remove Excess Attributes From User Config Nicholas Pratte
2024-06-13 20:18 ` [PATCH 1/4] dts: Remove build target config and list of devices Nicholas Pratte
2024-06-14 18:07   ` Jeremy Spewock
2024-06-13 20:18 ` [PATCH 2/4] dts: Use First Core Logic Change Nicholas Pratte
2024-06-14 18:09   ` Jeremy Spewock
2024-06-20 13:41     ` Nicholas Pratte
2024-06-13 20:18 ` [PATCH 3/4] dts: Self-Discovering Architecture Change Nicholas Pratte
2024-06-14 18:09   ` Jeremy Spewock
2024-06-13 20:18 ` [PATCH 4/4] dts: Rework DPDK Attributes In SUT Node Config Nicholas Pratte
2024-06-14 18:11   ` Jeremy Spewock
2024-07-05 17:13 ` [PATCH v2 0/6] dts: Remove Excess Attributes From User Config Nicholas Pratte
2024-07-05 18:29   ` [PATCH v2 1/6] dts: Remove build target config and list of devices Nicholas Pratte
2024-11-06 19:29     ` Dean Marx
2024-07-05 18:31   ` [PATCH v2 2/6] dts: Use First Core Logic Change Nicholas Pratte
2024-11-06 19:48     ` Dean Marx
2024-07-05 18:32   ` [PATCH v2 3/6] dts: Self-Discovering Architecture Change Nicholas Pratte
2024-11-06 20:13     ` Dean Marx
2024-07-05 18:32   ` [PATCH v2 4/6] dts: Rework DPDK Attributes In SUT Node Config Nicholas Pratte
2024-11-06 20:32     ` Dean Marx
2024-07-05 18:33   ` [PATCH v2 5/6] dts: add conditional behavior for test suite Nicholas Pratte
2024-07-05 18:33   ` [PATCH v2 6/6] doc: dpdk documentation changes for new dts config Nicholas Pratte
2025-01-15 14:18   ` [PATCH v3 0/7] dts: refactor configuration Luca Vizzarro
2025-01-15 14:18     ` [PATCH v3 1/7] dts: enable arch self-discovery Luca Vizzarro
2025-01-15 14:18     ` Luca Vizzarro [this message]
2025-01-15 14:18     ` [PATCH v3 3/7] dts: infer use first core without config Luca Vizzarro
2025-01-15 14:18     ` [PATCH v3 4/7] dts: rework DPDK attributes in SUT node config Luca Vizzarro
2025-01-15 14:18     ` [PATCH v3 5/7] dts: handle CLI overrides in the configuration Luca Vizzarro
2025-01-15 14:18     ` [PATCH v3 6/7] dts: split configuration file Luca Vizzarro
2025-01-15 14:18     ` [PATCH v3 7/7] dts: run all test suites by default Luca Vizzarro
2024-07-05 17:13 ` [PATCH v2 1/6] dts: Remove build target config and list of devices Nicholas Pratte
2024-07-16 15:07   ` Jeremy Spewock
2024-09-12 20:33     ` Nicholas Pratte
2024-09-10 11:30   ` Juraj Linkeš
2024-09-12 20:31     ` Nicholas Pratte
2024-11-18 16:51   ` Luca Vizzarro
2024-07-05 17:13 ` [PATCH v2 2/6] dts: Use First Core Logic Change Nicholas Pratte
2024-09-10 13:34   ` Juraj Linkeš
2024-11-18 16:54   ` Luca Vizzarro
2024-07-05 17:13 ` [PATCH v2 3/6] dts: Self-Discovering Architecture Change Nicholas Pratte
2024-09-10 13:41   ` Juraj Linkeš
2024-11-18 17:14   ` Luca Vizzarro
2024-07-05 17:13 ` [PATCH v2 4/6] dts: Rework DPDK Attributes In SUT Node Config Nicholas Pratte
2024-09-10 14:04   ` Juraj Linkeš
2024-11-18 17:16   ` Luca Vizzarro
2024-07-05 17:13 ` [PATCH v2 5/6] dts: add conditional behavior for test suite Nicholas Pratte
2024-07-16 14:59   ` Jeremy Spewock
2024-09-10 14:12   ` Juraj Linkeš
2024-11-06 20:52   ` Dean Marx
2024-11-18 17:21   ` Luca Vizzarro
2024-07-05 17:13 ` [PATCH v2 6/6] doc: dpdk documentation changes for new dts config Nicholas Pratte
2024-09-10 14:17   ` Juraj Linkeš
2024-11-06 20:57   ` Dean Marx
2024-11-18 17:21   ` Luca Vizzarro
2024-07-05 18:24 ` [PATCH v2 1/6] dts: Remove build target config and list of devices Nicholas Pratte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250115141809.3898708-3-luca.vizzarro@arm.com \
    --to=luca.vizzarro@arm.com \
    --cc=dev@dpdk.org \
    --cc=npratte@iol.unh.edu \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).