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 AE2A5460E8; Wed, 22 Jan 2025 19:02:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8667D402EB; Wed, 22 Jan 2025 19:02:31 +0100 (CET) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) by mails.dpdk.org (Postfix) with ESMTP id D10294028F for ; Wed, 22 Jan 2025 19:02:30 +0100 (CET) Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-30600722804so4771481fa.1 for ; Wed, 22 Jan 2025 10:02:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1737568950; x=1738173750; 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=LHbuFH/hugZPgr5pyoCws0Oe1LhbwbK4hwx7APr4K2w=; b=HPXWBy0CRn9DPBeHws7P/c334moDvSU5kUMdDIG5hZMBBfr6D0MWBG7dWugKoKPzJj O0Bmd3ELjjj4YAnkdt4acArSwnRwO7bb1moYBfCZ++Vewxol9dMF8WlJKN3tvjJkPSN9 gK1kc9kZerCYTDYVaEtUOj15AATGDd8eIukuM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737568950; x=1738173750; 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=LHbuFH/hugZPgr5pyoCws0Oe1LhbwbK4hwx7APr4K2w=; b=s0ufZYUDWzss3iyPi2qIl/DHwgo+XGPqj69xKfWySrj2XKXowsdT9qVrRdwsaIk3+F cvkONIgq05cm5lgpGRodnVgDMLtOwDip5RTeBBX4MA6mS50oApSg50kFbLJefdqTqDZY MIoWd3d2H6zk0/fcQFUbPt5/NigHubImiLzXZ/kFPH42K1OsqEJoVadNsQJ9ccIdscT3 zE97/WBzAvpNnZNwKM1Zbn//xGY4OsdAAnVidGCSV0XCUPRqObJM+XlN6+4lumhuM9EB 4BdTU7QJiHjj5qu/tkXAmXE8PLoO6qwIGYkQGrTfJKUsdqLZHYyQb7f/EicqyZJD7vdt 3sIQ== X-Gm-Message-State: AOJu0Yx64b4ar7c8SoU+HNDH64YzK6B9jTgp1DGfZzzCg/CbvVIKfLR/ 45lQAANtZxu9fk3TsStvJOWKjBr2Pho8Uv05QBCCbeCnGBRBPrqu1oKCIP5u32qjBbGQKhZwe77 x2LD75Z8Q9nDBryfR9yTdlUFRcft5mV4U1pMezQ== X-Gm-Gg: ASbGncu4AWTjj0Mgyv/ato00G4Bvi+UuSBFhgOA1UIKpBxikARQY5MkhvWWw+n9cHOG q4hdUjGwet4gY7rH7jHA2r2QGaICgCBJrPia3yYhdpOnxDXrjfph4JfZ9jgd3oi0Na8SwcpN5X6 CsebM/gW2p2Q== X-Google-Smtp-Source: AGHT+IHo2KGjqGw1kDIfl/Lk84l+TEYjzCaUa4vsG51v6BOHggZ09LwMDjbPuv9j/9JfS5ZbDxr8FLF613ME6CK2AYk= X-Received: by 2002:a05:651c:b0f:b0:300:3a15:8f18 with SMTP id 38308e7fff4ca-307586034dcmr6006401fa.0.1737568948566; Wed, 22 Jan 2025 10:02:28 -0800 (PST) MIME-Version: 1.0 References: <20240705171341.23894-2-npratte@iol.unh.edu> <20250115141809.3898708-1-luca.vizzarro@arm.com> <20250115141809.3898708-4-luca.vizzarro@arm.com> In-Reply-To: <20250115141809.3898708-4-luca.vizzarro@arm.com> From: Nicholas Pratte Date: Wed, 22 Jan 2025 13:02:17 -0500 X-Gm-Features: AbW1kvYba5_8bdQJK__A8xGLOmUnQdScTGcVXKyUTsyJxMhdbsQQdSyn2slk0sU Message-ID: Subject: Re: [PATCH v3 3/7] dts: infer use first core without config 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 > > To further the simplification of the user configuration, use_first_core > can be inferred from the lcores. If the user explicitly includes the > core 0 in the lcores range, it will only then be used. > > Bugzilla ID: 1360 > > Signed-off-by: Nicholas Pratte > Signed-off-by: Luca Vizzarro > Reviewed-by: Paul Szczepanek > --- > dts/conf.yaml | 3 +-- > dts/framework/config/__init__.py | 19 ++++++++++++------- > dts/framework/testbed_model/node.py | 9 +++++++++ > 3 files changed, 22 insertions(+), 9 deletions(-) > > diff --git a/dts/conf.yaml b/dts/conf.yaml > index 4b6965b3d7..c93eedbc94 100644 > --- a/dts/conf.yaml > +++ b/dts/conf.yaml > @@ -40,8 +40,7 @@ nodes: > hostname: sut1.change.me.localhost > user: dtsuser > os: linux > - lcores: "" # use all the available logical cores > - use_first_core: false # tells DPDK to use any physical core > + lcores: "" # use all available logical cores (Skips first core) > memory_channels: 4 # tells DPDK to use 4 memory channels > hugepages_2mb: # optional; if removed, will use system hugepage conf= iguration > number_of: 256 > diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__in= it__.py > index 3fa8f4fa8f..5dfa0cf0d4 100644 > --- a/dts/framework/config/__init__.py > +++ b/dts/framework/config/__init__.py > @@ -138,12 +138,12 @@ class ScapyTrafficGeneratorConfig(TrafficGeneratorC= onfig): > #: A union type discriminating traffic generators by the `type` field. > TrafficGeneratorConfigTypes =3D Annotated[ScapyTrafficGeneratorConfig, F= ield(discriminator=3D"type")] > > -#: Comma-separated list of logical cores to use. An empty string means u= se all lcores. > +#: Comma-separated list of logical cores to use. An empty string or ```a= ny``` means use all lcores. > LogicalCores =3D Annotated[ > str, > Field( > - examples=3D["1,2,3,4,5,18-22", "10-15"], > - pattern=3Dr"^(([0-9]+|([0-9]+-[0-9]+))(,([0-9]+|([0-9]+-[0-9]+))= )*)?$", > + examples=3D["1,2,3,4,5,18-22", "10-15", "any"], > + pattern=3Dr"^(([0-9]+|([0-9]+-[0-9]+))(,([0-9]+|([0-9]+-[0-9]+))= )*)?$|any", > ), > ] > > @@ -161,15 +161,20 @@ class NodeConfiguration(FrozenModel): > password: str | None =3D None > #: 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. > - lcores: LogicalCores =3D "1" > - #: If :data:`True`, the first logical core won't be used. > - use_first_core: bool =3D False > + #: A comma delimited list of logical cores to use when running DPDK.= ```any```, an empty > + #: string or omitting this field means use any core except for the f= irst one. The first core > + #: will only be used if explicitly set. > + lcores: LogicalCores =3D "" > #: An optional hugepage configuration. > hugepages: HugepageConfiguration | None =3D Field(None, alias=3D"hug= epages_2mb") > #: The ports that can be used in testing. > ports: list[PortConfig] =3D Field(min_length=3D1) > > + @property > + def use_first_core(self) -> bool: > + """Returns :data:`True` if `lcores` explicitly selects the first= core.""" > + return "0" in self.lcores > + > > class SutNodeConfiguration(NodeConfiguration): > """:class:`~framework.testbed_model.sut_node.SutNode` specific confi= guration.""" > diff --git a/dts/framework/testbed_model/node.py b/dts/framework/testbed_= model/node.py > index 08328ee482..b08b1cf14d 100644 > --- a/dts/framework/testbed_model/node.py > +++ b/dts/framework/testbed_model/node.py > @@ -91,6 +91,15 @@ def __init__(self, node_config: NodeConfiguration): > self.lcores, LogicalCoreList(self.config.lcores) > ).filter() > > + if LogicalCore(lcore=3D0, core=3D0, socket=3D0, node=3D0) in sel= f.lcores: > + self._logger.info( > + """ > + WARNING: First core being used; > + using the first core is considered risky and should only > + be done by advanced users. > + """ > + ) > + > self._other_sessions =3D [] > self._init_ports() > > -- > 2.43.0 >