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 41124440B7; Fri, 31 May 2024 17:21:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A36642D72; Fri, 31 May 2024 17:21:43 +0200 (CEST) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) by mails.dpdk.org (Postfix) with ESMTP id 12F1242C24 for ; Fri, 31 May 2024 17:21:42 +0200 (CEST) Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2ea89a9c012so1707651fa.1 for ; Fri, 31 May 2024 08:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1717168901; x=1717773701; 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=RANb7Amxmb2s6sbBWRjHzaVn/gTCpSpeB2NBGn+WWv8=; b=BXHpApeMnaUwlEhtNVz7gNiuAnAM2O4UskxEcKRQMnALtRT/1UK/4S/LOU54I9k58Z kcLwJzZ+vdFLAPATg74SW7Moq0lxztnokHOstm9F/5+b4Te+4hA1BW9hx8FxzDNs82Kv +PeliGBUJHPluDuVRsTr9jlNfTNzM/dlkcCc8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717168901; x=1717773701; 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=RANb7Amxmb2s6sbBWRjHzaVn/gTCpSpeB2NBGn+WWv8=; b=PNFy07lUd/fLOztsu+SkOOte99imCLFc9Qi8Kv0NzMV+FRYqkJkU8KaNNK/pP6hHp5 Wdih/ODud0UNOhjAMNBiJwCEJGHqW7aJMyjb/vpfOS6F3f8nOjAMoRjDw048N0aRmBe3 eGLbODMCGksMtHcutC8WM44xE/F5uLIQx4TOXhLz6oo5jwhzVcFl56qDYWmJXFsvFNVW 2uqMEnwvG8NGECyqUwUzF99k1DR2W9RdijXnNBy62i6/lhBPK+LLFAzJJdERB5PMObCv 8OM7MNiCKW0D3fRgZn+ToAPOt3zqDZEjQPAbIqD4uAs9VE+MB6QHRZSmLUtjauHtum1r u5yA== X-Gm-Message-State: AOJu0YzYS6XsWcfiX91yeq8Sb0kNlj0rBuW6I5z+4u7y3GzjS/Y9v58u btmgIVj4yGnB8+4XyE9xpmyjXqQs1HyoHSO5Er31YVQbALA2H5MHflwKvnjvyoaSog/k4VOQgaZ 9v21qLGWzfo0pZY5Obth8UKktUdbNd71r+Z7w2w== X-Google-Smtp-Source: AGHT+IFc1wv/ioucmBk6I1FEDz5Jtb31zF6SvU5KBx6QbDFG9lBWoLziI1F95qsr3VFvUFF0I4qYE11anZpfuPaK0Ls= X-Received: by 2002:a2e:8756:0:b0:2ea:8442:2096 with SMTP id 38308e7fff4ca-2ea95153f82mr13572951fa.2.1717168901463; Fri, 31 May 2024 08:21:41 -0700 (PDT) MIME-Version: 1.0 References: <20240326190422.577028-1-luca.vizzarro@arm.com> <20240530152505.389167-1-luca.vizzarro@arm.com> <20240530152505.389167-4-luca.vizzarro@arm.com> In-Reply-To: <20240530152505.389167-4-luca.vizzarro@arm.com> From: Nicholas Pratte Date: Fri, 31 May 2024 11:21:30 -0400 Message-ID: Subject: Re: [PATCH v3 3/8] dts: refactor EalParams To: Luca Vizzarro Cc: dev@dpdk.org, =?UTF-8?Q?Juraj_Linke=C5=A1?= , Jeremy Spewock , Paul Szczepanek 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 Tested-by: Nicholas Pratte Reviewed-by: Nicholas Pratte On Thu, May 30, 2024 at 11:25=E2=80=AFAM Luca Vizzarro wrote: > > Move EalParams to its own module to avoid circular dependencies. > > Signed-off-by: Luca Vizzarro > Reviewed-by: Paul Szczepanek > --- > dts/framework/params/eal.py | 50 +++++++++++++++++++ > dts/framework/remote_session/testpmd_shell.py | 2 +- > dts/framework/testbed_model/sut_node.py | 42 +--------------- > 3 files changed, 53 insertions(+), 41 deletions(-) > create mode 100644 dts/framework/params/eal.py > > diff --git a/dts/framework/params/eal.py b/dts/framework/params/eal.py > new file mode 100644 > index 0000000000..bbdbc8f334 > --- /dev/null > +++ b/dts/framework/params/eal.py > @@ -0,0 +1,50 @@ > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright(c) 2024 Arm Limited > + > +"""Module representing the DPDK EAL-related parameters.""" > + > +from dataclasses import dataclass, field > +from typing import Literal > + > +from framework.params import Params, Switch > +from framework.testbed_model.cpu import LogicalCoreList > +from framework.testbed_model.port import Port > +from framework.testbed_model.virtual_device import VirtualDevice > + > + > +def _port_to_pci(port: Port) -> str: > + return port.pci > + > + > +@dataclass(kw_only=3DTrue) > +class EalParams(Params): > + """The environment abstraction layer parameters. > + > + Attributes: > + lcore_list: The list of logical cores to use. > + memory_channels: The number of memory channels to use. > + prefix: Set the file prefix string with which to start DPDK, e.g= .: ``prefix=3D"vf"``. > + no_pci: Switch to disable PCI bus, e.g.: ``no_pci=3DTrue``. > + vdevs: Virtual devices, e.g.:: > + vdevs=3D[ > + VirtualDevice('net_ring0'), > + VirtualDevice('net_ring1') > + ] > + ports: The list of ports to allow. > + other_eal_param: user defined DPDK EAL parameters, e.g.: > + ``other_eal_param=3D'--single-file-segments'`` > + """ > + > + lcore_list: LogicalCoreList =3D field(metadata=3DParams.short("l")) > + memory_channels: int =3D field(metadata=3DParams.short("n")) > + prefix: str =3D field(metadata=3DParams.long("file-prefix")) > + no_pci: Switch =3D None > + vdevs: list[VirtualDevice] | None =3D field( > + default=3DNone, metadata=3DParams.multiple() | Params.long("vdev= ") > + ) > + ports: list[Port] | None =3D field( > + default=3DNone, > + metadata=3DParams.convert_value(_port_to_pci) | Params.multiple(= ) | Params.short("a"), > + ) > + other_eal_param: Params | None =3D None > + _separator: Literal[True] =3D field(default=3DTrue, init=3DFalse, me= tadata=3DParams.short("-")) > diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framewor= k/remote_session/testpmd_shell.py > index 7eced27096..841d456a2f 100644 > --- a/dts/framework/remote_session/testpmd_shell.py > +++ b/dts/framework/remote_session/testpmd_shell.py > @@ -21,8 +21,8 @@ > from typing import Callable, ClassVar > > from framework.exception import InteractiveCommandExecutionError > +from framework.params.eal import EalParams > from framework.settings import SETTINGS > -from framework.testbed_model.sut_node import EalParams > from framework.utils import StrEnum > > from .interactive_shell import InteractiveShell > diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/test= bed_model/sut_node.py > index c886590979..e1163106a3 100644 > --- a/dts/framework/testbed_model/sut_node.py > +++ b/dts/framework/testbed_model/sut_node.py > @@ -15,9 +15,8 @@ > import os > import tarfile > import time > -from dataclasses import dataclass, field > from pathlib import PurePath > -from typing import Literal, Type > +from typing import Type > > from framework.config import ( > BuildTargetConfiguration, > @@ -26,6 +25,7 @@ > SutNodeConfiguration, > ) > from framework.params import Params, Switch > +from framework.params.eal import EalParams > from framework.remote_session import CommandResult > from framework.settings import SETTINGS > from framework.utils import MesonArgs > @@ -37,44 +37,6 @@ > from .virtual_device import VirtualDevice > > > -def _port_to_pci(port: Port) -> str: > - return port.pci > - > - > -@dataclass(kw_only=3DTrue) > -class EalParams(Params): > - """The environment abstraction layer parameters. > - > - Attributes: > - lcore_list: The list of logical cores to use. > - memory_channels: The number of memory channels to use. > - prefix: Set the file prefix string with which to start DPDK, e.g= .: ``prefix=3D"vf"``. > - no_pci: Switch to disable PCI bus, e.g.: ``no_pci=3DTrue``. > - vdevs: Virtual devices, e.g.:: > - vdevs=3D[ > - VirtualDevice('net_ring0'), > - VirtualDevice('net_ring1') > - ] > - ports: The list of ports to allow. > - other_eal_param: user defined DPDK EAL parameters, e.g.: > - ``other_eal_param=3D'--single-file-segments'`` > - """ > - > - lcore_list: LogicalCoreList =3D field(metadata=3DParams.short("l")) > - memory_channels: int =3D field(metadata=3DParams.short("n")) > - prefix: str =3D field(metadata=3DParams.long("file-prefix")) > - no_pci: Switch > - vdevs: list[VirtualDevice] | None =3D field( > - default=3DNone, metadata=3DParams.multiple() | Params.long("vdev= ") > - ) > - ports: list[Port] | None =3D field( > - default=3DNone, > - metadata=3DParams.convert_value(_port_to_pci) | Params.multiple(= ) | Params.short("a"), > - ) > - other_eal_param: Params | None =3D None > - _separator: Literal[True] =3D field(default=3DTrue, init=3DFalse, me= tadata=3DParams.short("-")) > - > - > class SutNode(Node): > """The system under test node. > > -- > 2.34.1 >