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 483BF46130; Fri, 24 Jan 2025 19:14:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 20357402CE; Fri, 24 Jan 2025 19:14:32 +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 4B6F84028C for ; Fri, 24 Jan 2025 19:14:30 +0100 (CET) Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-30156c52c25so1746711fa.0 for ; Fri, 24 Jan 2025 10:14:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1737742470; x=1738347270; 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=IgNoI3REBzGJWC+uQw9GfL5T/CiJCEwcaTU4loSIArA=; b=ADEI4WTSoUagx6JGa09XDzwATKScAj9MxVR0F9FTGjbQQCRDtv2esWcAqChkltG0k1 0pFlujEo1bL/VINnePooSFgYc25CyoPkKmeYgM+WG7/uUO4r/uSOu2gCJ6kO/DdWgfSl lYkuvKbzNQL439UQGd1XLlVxv7lLB0Ma32JNw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737742470; x=1738347270; 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=IgNoI3REBzGJWC+uQw9GfL5T/CiJCEwcaTU4loSIArA=; b=mF4N5pJfjKLLKFx7x0qp2f1inae/N02PsAfUTrNtXbOIzzZWZafqYTO2S634CLvBqB YatD8qIoNMwCLqC70c6UhXrVLFzHy+CiIwysGJMVM//yGUUyrGRSyGgUy7UHFwu1KHx+ KC9yccdpmNKOdgF6TigeThtJU5JekxUwpxgwCjdMkmHpE7+mVT4Pxa/w0z/wR0VPGhf1 +4POdjukAooZ99cJFQh0iMHUTRncg9kTtb9D5gvSqjvdCsnihMnxE1EyI8dhCe4rlBuq Ut/fZ+c+1QHRD4grIjFq6KM31zYC4nAohlLJMhz4FQlABw4jfj+FcMzuv0Btq3htmyw1 W1LA== X-Gm-Message-State: AOJu0YyNaYbXlBxvlj4Jx/XEJ61iok1uk5BejVPaylS5/Vgmcioh3KNJ Xec471KqX8o4+vRYB6dv3V1F5WHxkmwIYlyfMUr5TKswzSCaCzLflg36aCSs/imdzUfbGXO0gAO rM7O7GWaaW4zGzlww3s0SleBx5nSDxXbGUqz1hQ== X-Gm-Gg: ASbGnctiaaW0MpfVzcEAeBYuklpSiKsi7SpkRiVrDko7rLYxXGwmmqlTl8/fdKKvJKF +4eE5BrImVdJXqYZoWlPxzhNZzsU6OF4vb57q6VdL99fQSunR0oTAKGYvUO5T5p5v0TdstoC0yj vUdgUveZQ5w3x5JsSCD4zI X-Google-Smtp-Source: AGHT+IHspM52VaujrEVv4yZ16Xz8Hf4x2UkpFPOxED0oCPZoS3K9/sICWD5JSNGtXTGYNvrE7/SwZzPwO76IMcfoT9U= X-Received: by 2002:a05:651c:b0f:b0:300:3a15:8f18 with SMTP id 38308e7fff4ca-307586034dcmr16877171fa.0.1737742469677; Fri, 24 Jan 2025 10:14:29 -0800 (PST) MIME-Version: 1.0 References: <20240613201831.9748-3-npratte@iol.unh.edu> <20250124113909.137128-1-luca.vizzarro@arm.com> <20250124113909.137128-4-luca.vizzarro@arm.com> In-Reply-To: <20250124113909.137128-4-luca.vizzarro@arm.com> From: Nicholas Pratte Date: Fri, 24 Jan 2025 13:14:18 -0500 X-Gm-Features: AWEUYZk2ZmoB5kQUOGVCqGw20S7wnmHCDkYaT4idM9BdC92BOFvWnl0SUkLUJXM Message-ID: Subject: Re: [PATCH v4 3/7] dts: infer use first core without 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 I wonder if you could remove this particular patch entirely, since this particular 'use_first_core' issue is addressed differently in the proceeding patch. I left this patch in the original series so that we might discuss what the best mode of action would be for tackling this problem. In any case, it doesn't hurt to keep this patch in the series. Reviewed-by: Nicholas Pratte On Fri, Jan 24, 2025 at 6:39=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 > Reviewed-by: Dean Marx > --- > 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 >