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 6CC554559C; Fri, 5 Jul 2024 20:31:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5900C410FD; Fri, 5 Jul 2024 20:31:56 +0200 (CEST) Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) by mails.dpdk.org (Postfix) with ESMTP id 454D2410F2 for ; Fri, 5 Jul 2024 20:31:55 +0200 (CEST) Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-6b5dfa18db1so2135756d6.0 for ; Fri, 05 Jul 2024 11:31:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1720204314; x=1720809114; 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=yjQ3pSbo/a80oFZM2tzQhbSXVFQ6PO+c2n+ZzCA6LWU=; b=CWgAoN2uCE/fUZrK7yQxtV8cqpEWBHYpXsGWLz937wcjWMajEwz7JHrT+KotSGa1LP 8mAsWMfRK6lyZFJtNcz3e4Ym/b+pZg7DmdB4OlJxah9USqC8Xns4UMASfFi/0AnTKJzG 0YzO8pNIBbYYDVtG6XPpuDX+6IjGJu+LRrZH4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720204314; x=1720809114; 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=yjQ3pSbo/a80oFZM2tzQhbSXVFQ6PO+c2n+ZzCA6LWU=; b=wGLHg3rv+HoeYVG3WUDHXIy7UBqZ3Bazo5Dv6iWtY6kp7bUjG8lmOZEiskGFNHgKbT ZhsES3SWwWjrCmkr8/vCBQfAxAXqbRH/dHzW01qrWqKJR69QSiR2x1qAMzA1fJlcgO32 7AYE9UbmCLSjx8lK8wc1L/uwS5w9pJ1nfIuUWxjJ3+qaRfwxJTbO8CrN9x4tqIi0CnIh Vx7BOTC0b+RTeFrXiE0azPDyejDGPbILM/UZVSip1nbSazKdLpvpy0dLvI9qCiT+F6m7 4yuXScBXSBYxZuN6NMPZjsyX2w4N8thG1JtTveU7xX8BqbEy5TFzK/KpcTTbTxSL1ir2 08nA== X-Gm-Message-State: AOJu0YwtN8F++RrinQz+cpZRV+zCGEon6cLe8TAIbAi6OejlFtXRLSMW DDh6Qh60GkZQSjdkOaOnrGKvZHajbKPeFP6h1DUePUjpkUpsK2L7Sty/22USaio= X-Google-Smtp-Source: AGHT+IErVvmXZC3jUqBwPQvp5bBn4u3l4OTazYqior/pie48Ku9Y6zXr4228ZtWAleCriP7nmP1APA== X-Received: by 2002:a05:620a:820f:b0:79c:d2fc:8b27 with SMTP id af79cd13be357-79eee2e4d77mr510214785a.7.1720204314390; Fri, 05 Jul 2024 11:31:54 -0700 (PDT) Received: from localhost.unh.edu ([2606:4100:3880:1257::1003]) by smtp.gmail.com with ESMTPSA id af79cd13be357-79ef9aa8889sm59382485a.20.2024.07.05.11.31.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 11:31:53 -0700 (PDT) From: Nicholas Pratte To: dmarx@iol.unh.edu, paul.szczepanek@arm.com, juraj.linkes@pantheon.tech, yoan.picchi@foss.arm.com, jspewock@iol.unh.edu, luca.vizzarro@arm.com, probb@iol.unh.edu, Honnappa.Nagarahalli@arm.com Cc: dev@dpdk.org, Nicholas Pratte Subject: [PATCH v2 2/6] dts: Use First Core Logic Change Date: Fri, 5 Jul 2024 14:31:35 -0400 Message-ID: <20240705183135.30255-1-npratte@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240705171341.23894-2-npratte@iol.unh.edu> References: <20240705171341.23894-2-npratte@iol.unh.edu> MIME-Version: 1.0 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 --- 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 +++++++++ 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/dts/conf.yaml b/dts/conf.yaml index 56cc08ced2..53192e0761 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_2mb: # optional; if removed, will use system hugepage configuration number_of: 256 diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__init__.py index 456a8a83ab..4c05373ef3 100644 --- a/dts/framework/config/__init__.py +++ b/dts/framework/config/__init__.py @@ -246,6 +246,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: @@ -256,8 +259,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"]), @@ -270,8 +273,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 3f7bc2acae..01a6afdc72 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 12a40170ac..9b3f01f1e9 100644 --- a/dts/framework/testbed_model/node.py +++ b/dts/framework/testbed_model/node.py @@ -86,6 +86,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._init_ports() -- 2.44.0