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 3DEB145420; Thu, 13 Jun 2024 22:21:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2AEEF410EA; Thu, 13 Jun 2024 22:21:44 +0200 (CEST) Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) by mails.dpdk.org (Postfix) with ESMTP id 630B2410EA for ; Thu, 13 Jun 2024 22:21:42 +0200 (CEST) Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-6b075bad08bso1968066d6.3 for ; Thu, 13 Jun 2024 13:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1718310102; x=1718914902; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RsTcY7bzHMjKkqEV1ZUMC/n0dgCx7xll8fri+IwA3XE=; b=GqAYHsKDtizwB41+8/hRjODKlPZtBHfnG+yzh7FnPgXog5FEHeFa95tT+j8CMODC/M Vp5IlPikrFAP0B4/O+gJ22271lNdMBle8kwZo942nPk34duoOsKq2o8UznuZsFC+4X4S Ag/gt8OHsyQZR1AadtKlx++/6kgoMWmXo8MD0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718310102; x=1718914902; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RsTcY7bzHMjKkqEV1ZUMC/n0dgCx7xll8fri+IwA3XE=; b=PrKBNUImt1a23oceevQJJYVkAp+JlElokryDuQeyuV9Js0X7fdfRX0E5rVGsSdd3D1 2hpfcViNBaSSEc4mj/X6dTrl1iU/VNDGu93GJa8BFRJBnYuvOgvrNO1k0l3aWulDAr2s GG3UVjGgNlgQsgqaDKBiFBPFHCILuBAsuDT+Oo+/amxbhbPoPq7qKQT1iYrr+j7RwOK8 0D6j1KqnUQ6TxObcb8HAF6Cg7S4ps8CdfMytFisXgz66cwa/brXfebRk9Dg/ElYhBeYY wsLZUuvnLmNF6PH2WQqYhAKX5wyQKdAThHilYphQ5mhlOBy+r+r/SyHanystOKsqGlMY kqlQ== X-Gm-Message-State: AOJu0YxWipwMTt0upGf+RZZg8UD9BkEOQoSOyjbzBUrlJZuujBqqqB+k YGwHLRU8TjWTtrrRJhBCeGbqNsg1vXCIWC5UlYV8dc7kuC9M2zUVkJrW/1obEDc= X-Google-Smtp-Source: AGHT+IE2d4vsb8tzJiaL7x9qkBIk8+o7HQKb05ZJylAMqAiWyJ5xFMX30Ai6DCkYAAi/7YMHeW+Cpg== X-Received: by 2002:ac8:5e4b:0:b0:441:322:af8f with SMTP id d75a77b69052e-44216dbfd47mr5563341cf.4.1718310101617; Thu, 13 Jun 2024 13:21:41 -0700 (PDT) Received: from localhost.unh.edu ([2606:4100:3880:1271:e2f8:4ec3:8bf3:864c]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4420c5e8e4bsm8493731cf.39.2024.06.13.13.21.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 13:21:41 -0700 (PDT) From: Nicholas Pratte To: Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com, luca.vizzarro@arm.com, juraj.linkes@pantheon.tech, bruce.richardson@intel.com, jspewock@iol.unh.edu, probb@iol.unh.edu, dmarx@iol.unh.edu, yoan.picchi@foss.arm.com Cc: dev@dpdk.org, Nicholas Pratte Subject: [PATCH 2/4] dts: Use First Core Logic Change Date: Thu, 13 Jun 2024 16:18:30 -0400 Message-ID: <20240613201831.9748-7-npratte@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240613201831.9748-3-npratte@iol.unh.edu> References: <20240613201831.9748-3-npratte@iol.unh.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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* – Comma-separated list of logical | - | | | cores to use. An empty string means use all lcores. | + | ``lcores`` | | (*optional*, defaults to 1 if not used) *string* – Comma-separated list of logical | + | | | cores to use. An empty string means use all 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``) *boolean* | - | | | - | | 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/conf.yaml b/dts/conf.yaml index 672e6f92b6..c20afb9621 100644 --- a/dts/conf.yaml +++ b/dts/conf.yaml @@ -29,8 +29,7 @@ nodes: user: dtsuser arch: x86_64 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: # optional; if removed, will use system hugepage configuration amount: 256 diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__init__.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"] = False hugepage_config = HugepageConfiguration(**hugepage_config_dict) + lcores = "1" if "lcores" not in d else d["lcores"] if "any" not in d["lcores"] else "" + use_first_core = "0" in lcores + # The calls here contain duplicated code which is here because Mypy doesn't # properly support dictionary unpacking with TypedDicts if "traffic_generator" in d: @@ -255,8 +258,8 @@ def from_dict( password=d.get("password"), arch=Architecture(d["arch"]), os=OS(d["os"]), - lcores=d.get("lcores", "1"), - use_first_core=d.get("use_first_core", False), + lcores=lcores, + use_first_core=use_first_core, hugepages=hugepage_config, ports=[PortConfig.from_dict(d["name"], port) for port in d["ports"]], traffic_generator=TrafficGeneratorConfig.from_dict(d["traffic_generator"]), @@ -269,8 +272,8 @@ def from_dict( password=d.get("password"), arch=Architecture(d["arch"]), os=OS(d["os"]), - lcores=d.get("lcores", "1"), - use_first_core=d.get("use_first_core", False), + lcores=lcores, + use_first_core=use_first_core, hugepages=hugepage_config, ports=[PortConfig.from_dict(d["name"], port) for port in d["ports"]], memory_channels=d.get("memory_channels", 1), diff --git a/dts/framework/config/conf_yaml_schema.json b/dts/framework/config/conf_yaml_schema.json index bf0be28176..7c8429abbc 100644 --- a/dts/framework/config/conf_yaml_schema.json +++ b/dts/framework/config/conf_yaml_schema.json @@ -163,13 +163,9 @@ }, "lcores": { "type": "string", - "pattern": "^(([0-9]+|([0-9]+-[0-9]+))(,([0-9]+|([0-9]+-[0-9]+)))*)?$", + "pattern": "^(([0-9]+|([0-9]+-[0-9]+))(,([0-9]+|([0-9]+-[0-9]+)))*)?$|any", "description": "Optional comma-separated list of logical cores to use, e.g.: 1,2,3,4,5,18-22. Defaults to 1. An empty string means use all lcores." }, - "use_first_core": { - "type": "boolean", - "description": "Indicate whether DPDK should use the first physical core. It won't be used by default." - }, "memory_channels": { "type": "integer", "description": "How many memory channels to use. Optional, defaults to 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=0, core=0, socket=0, node=0) in self.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 = [] self.virtual_devices = [] self._init_ports() -- 2.44.0