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 08E8A45460; Fri, 14 Jun 2024 20:09:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A7C4440B9A; Fri, 14 Jun 2024 20:09:52 +0200 (CEST) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by mails.dpdk.org (Postfix) with ESMTP id EC3BE40B95 for ; Fri, 14 Jun 2024 20:09:51 +0200 (CEST) Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-6e9f52e99c2so1869319a12.1 for ; Fri, 14 Jun 2024 11:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1718388591; x=1718993391; 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=WzFQKImH26+O9MUNB81nRy7R5l70Aq+VEmKxIL3Yyrk=; b=X2nzQQaxxAwSp+giX4ZnJtLDESRxP16TYqwCqxKFqOGM1yYLFxKUVSdpkTvjwjCkXE rQxBohYcCHMcxZfkUlIKjTMJaqF+1R0DOKCOY89mFhTYqHWYAmMZut3UhelXT5AGZ6l9 t3sAwfxGgY+cjIegc10HE0NtOmzW9pTQFa9fs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718388591; x=1718993391; 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=WzFQKImH26+O9MUNB81nRy7R5l70Aq+VEmKxIL3Yyrk=; b=mpixpiUxxlOcrzPNjhhprE4iVphKW/YdYpSgQgfxp9f8S7cESxfpl8ZVI5YNN397w5 Hp4A6nLJrHCYc/t257gzFHvxw9is0zHQxh1FPZl7GiylFk7udeiquhJEPUiIK/StltlR tb9HI2GD/z7bbEo/if+Jhix4YjDiAelbINP8Pm6vr5NZWHjSiZBBLOhqG69ioxUov4uL IpviQsyS/YXhoCjSRnrdUFCM7satLcpgfq/c/e/cbnO96y+dVa3puqz2I/jazcBfUQk5 tLqZbW5waSd7hH6mLusV+K2SKt5CTNox0vuY0ziWhRGlmiu+gAgZ0MP1X+cu9w+X6kOn 1VWQ== X-Forwarded-Encrypted: i=1; AJvYcCW50jgvFqgVmXViWTc5S/KnFJMFgYPIpagh6MhSf8wyL+L5mZv39ZlI67R8++V8ZqCA6PslU8SJV24dh9w= X-Gm-Message-State: AOJu0YxE+rvIGyQ9hSF+003hlWr4ZdMY9WIzOdxVtrM8bbHC1Xms3JAs mV8peIAkte8T1cCLxbdd9bUKLi7nJMFP33rpqNnMFSPsK6Wsjcof9Roqus5C0vx8Uditw06aqzv vQHyztqFBt4KyyKaIinSKI+2qf8eZk0hyBT2zSQ== X-Google-Smtp-Source: AGHT+IFdF72/AdLQTnojtA4LrLt1MoH28hEfKWse+I3DoDsdoWgiWCHwq4hYkPJecRcLAOHDM1ZDL6UeJFN/oF1ARCY= X-Received: by 2002:a17:90a:c401:b0:2b4:b306:ffbc with SMTP id 98e67ed59e1d1-2c4db24ce1bmr3463590a91.17.1718388591083; Fri, 14 Jun 2024 11:09:51 -0700 (PDT) MIME-Version: 1.0 References: <20240613201831.9748-3-npratte@iol.unh.edu> <20240613201831.9748-7-npratte@iol.unh.edu> In-Reply-To: <20240613201831.9748-7-npratte@iol.unh.edu> From: Jeremy Spewock Date: Fri, 14 Jun 2024 14:09:40 -0400 Message-ID: Subject: Re: [PATCH 2/4] dts: Use First Core Logic Change To: Nicholas Pratte Cc: Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, luca.vizzarro@arm.com, juraj.linkes@pantheon.tech, bruce.richardson@intel.com, probb@iol.unh.edu, dmarx@iol.unh.edu, yoan.picchi@foss.arm.com, dev@dpdk.org 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 On Thu, Jun 13, 2024 at 4:21=E2=80=AFPM Nicholas Pratte wrote: > > Removed use_first_core from the conf.yaml in favor of determining this > within the framework. use_first_core continue to serve a purpose in that > it is only enabled when core 0 is explicitly provided in the > configuration. Any other configuration, including "" or "any," will > omit core 0. > > Documentation reworks are included to reflect the changes made. > > Bugzilla ID: 1360 > Signed-off-by: Nicholas Pratte > > --- > doc/guides/tools/dts.rst | 9 +++------ > dts/conf.yaml | 3 +-- > dts/framework/config/__init__.py | 11 +++++++---- > dts/framework/config/conf_yaml_schema.json | 6 +----- > dts/framework/testbed_model/node.py | 9 +++++++++ > 5 files changed, 21 insertions(+), 17 deletions(-) > > diff --git a/doc/guides/tools/dts.rst b/doc/guides/tools/dts.rst > index da85295db9..fbb5c6f17b 100644 > --- a/doc/guides/tools/dts.rst > +++ b/doc/guides/tools/dts.rst > @@ -546,15 +546,12 @@ involved in the testing. These can be defined with = the following mappings: > +-----------------------+--------------------------------------------= -------------------------------------------+ > | ``os`` | The operating system of this node. See `OS`= _ for supported values. | > +-----------------------+--------------------------------------------= -------------------------------------------+ > - | ``lcores`` | | (*optional*, defaults to 1) *string* =E2= =80=93 Comma-separated list of logical | > - | | | cores to use. An empty string means use a= ll lcores. | > + | ``lcores`` | | (*optional*, defaults to 1 if not used) *= string* =E2=80=93 Comma-separated list of logical | I think just leaving this as "defaults to 1" is fine here. It's more explicit to say "if it isn't used", but just saying it defaults I think implies that enough. > + | | | cores to use. An empty string means use a= ll lcores except core 0. core 0 is used | > + | | | only when explicitly specified = | > | | = | > | | **Example**: ``1,2,3,4,5,18-22`` = | > +-----------------------+--------------------------------------------= -------------------------------------------+ > - | ``use_first_core`` | (*optional*, defaults to ``false``) *boolea= n* | > - | | = | > - | | Indicates whether DPDK should use only the = first physical core or not. | > - +-----------------------+--------------------------------------------= -------------------------------------------+ > | ``memory_channels`` | (*optional*, defaults to 1) *integer* = | > | | = | > | | The number of the memory channels to use. = | > diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__in= it__.py > index 5a127a1207..6bc290a56a 100644 > --- a/dts/framework/config/__init__.py > +++ b/dts/framework/config/__init__.py > @@ -245,6 +245,9 @@ def from_dict( > hugepage_config_dict["force_first_numa"] =3D False > hugepage_config =3D HugepageConfiguration(**hugepage_config_= dict) > > + lcores =3D "1" if "lcores" not in d else d["lcores"] if "any" no= t in d["lcores"] else "" > + use_first_core =3D "0" in lcores > + > # The calls here contain duplicated code which is here because M= ypy doesn't > # properly support dictionary unpacking with TypedDicts > if "traffic_generator" in d: > @@ -255,8 +258,8 @@ def from_dict( > password=3Dd.get("password"), > arch=3DArchitecture(d["arch"]), > os=3DOS(d["os"]), > - lcores=3Dd.get("lcores", "1"), > - use_first_core=3Dd.get("use_first_core", False), > + lcores=3Dlcores, > + use_first_core=3Duse_first_core, I wonder if we could completely remove the "use_first_core" attribute from the config classes. It seems like it's only used when you're getting remote CPUs to skip core 0 based on the condition. With these new changes it seems like we just assume that if 0 is in the list, we will use it, otherwise we simply won't, so I don't think we need this condition to detect whether we should skip or not anymore, do we? > hugepages=3Dhugepage_config, > ports=3D[PortConfig.from_dict(d["name"], port) for port = in d["ports"]], > traffic_generator=3DTrafficGeneratorConfig.from_dict(d["= traffic_generator"]), > @@ -269,8 +272,8 @@ def from_dict( > password=3Dd.get("password"), > arch=3DArchitecture(d["arch"]), > os=3DOS(d["os"]), > - lcores=3Dd.get("lcores", "1"), > - use_first_core=3Dd.get("use_first_core", False), > + lcores=3Dlcores, > + use_first_core=3Duse_first_core, > hugepages=3Dhugepage_config, > ports=3D[PortConfig.from_dict(d["name"], port) for port = in d["ports"]], > memory_channels=3Dd.get("memory_channels", 1), > diff --git a/dts/framework/testbed_model/node.py b/dts/framework/testbed_= model/node.py > index 74061f6262..470cd18e30 100644 > --- a/dts/framework/testbed_model/node.py > +++ b/dts/framework/testbed_model/node.py > @@ -93,6 +93,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: This condition fits if you completely remove the `use_first_core` boolean from the NodeConfiguration, but if we decide not to I think it could be shortened to just: if config.use_first_core: > + 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.virtual_devices =3D [] > self._init_ports() > -- > 2.44.0 >