From patchwork Tue May 7 16:37:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Pratte X-Patchwork-Id: 139990 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 71F3343FC9; Tue, 7 May 2024 18:38:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1310D43417; Tue, 7 May 2024 18:38:03 +0200 (CEST) Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) by mails.dpdk.org (Postfix) with ESMTP id 7391243422 for ; Tue, 7 May 2024 18:38:01 +0200 (CEST) Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-43d694438faso1962791cf.2 for ; Tue, 07 May 2024 09:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1715099881; x=1715704681; 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=DU3lXzGs9nBjPDKALjtzgu9Titnir/FoBco7fubmkCQ=; b=jZUHThxy2jVvfv5MAymgqOLd9a/dMDSEjdkvexVuFTl8A3nkqfrwrZd0kSmzFL69sH 4Od7+ZaXCRagbL8spWW3uGk+0STveGstEtra4owAduv80MbnaLopMm4NfZyv0H5o8uhZ aVSo9fVpL4dWfOkryoxPIzpGwbtsaa4qx80XI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099881; x=1715704681; 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=DU3lXzGs9nBjPDKALjtzgu9Titnir/FoBco7fubmkCQ=; b=XMooRWGS86uI9jbLEWuOUL9o9lTzffKycAl4idP47aH5fdVEKWKgYgOU01EyrvRrFE OZeXk1RCk5Qb0Fz9IYAqIzdh7jyG2g9r8hBezPo/lFjg7v8IVIeGya8t9+TgDuLOOCAE OJN6oT4n7TbTt37rClCxemvh1uKCHZft6L2JfqzRHKrjqr8jy422rWGAsYDozh1J4qQA opJgQVpSdnUDH5F7X//0heqKw40WFNemU6m+Vhv/IYUdPok4qg9KSgLkDoK4Vr8hNmTD qtl2vtjwVp+mrrF6vVZtFsnl+BX6slEqvqoLxKQt04NSkbaOn4ZP+8tV9wVIoJJjokKn hTqg== X-Gm-Message-State: AOJu0Yz2W1lh7trOAsfeFtjMQN79vCuV1SIjEaokDtyn2mfRhUjaEHFw z7qloFtwLh2vK330lpijRVOwJyeW65joooDEBqjRc5DWCCScZJL71TRSuH/2Cik= X-Google-Smtp-Source: AGHT+IFaXqAVptsTTaGY51eLeUyxyxSoa6eZmPfdWva6NxseDK5nocrOhd2Hl1ZZ1XiVdfiHIEd2pw== X-Received: by 2002:a05:620a:2446:b0:790:eb3b:eec with SMTP id af79cd13be357-792b27c15dfmr21962485a.2.1715099880754; Tue, 07 May 2024 09:38:00 -0700 (PDT) Received: from d121012.iol.unh.edu ([2606:4100:3880:1271:e2f8:4ec3:8bf3:864c]) by smtp.gmail.com with ESMTPSA id e16-20020a05620a12d000b0079296e6646fsm2322647qkl.123.2024.05.07.09.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:38:00 -0700 (PDT) From: Nicholas Pratte To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, paul.szczepanek@arm.com, bruce.richardson@intel.com, probb@iol.unh.edu, wathsala.vithanage@arm.com, yoan.picchi@foss.arm.com, thomas@monjalon.net, jspewock@iol.unh.edu, mb@smartsharesystems.com Cc: dev@dpdk.org, Nicholas Pratte Subject: [PATCH v6 2/2] dts: Change hugepage 'amount' to a different term Date: Tue, 7 May 2024 12:37:52 -0400 Message-ID: <20240507163752.305-3-npratte@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240507163752.305-1-npratte@iol.unh.edu> References: <20240430184533.29247-4-npratte@iol.unh.edu> <20240507163752.305-1-npratte@iol.unh.edu> MIME-Version: 1.0 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 The term 'amount' is used for uncountable nouns. Since total hugepages is a discrete value (i.e. countable), the declaration of the 'amount' key value pair should be changes to a different term in both the config and the rest of the code. Signed-off-by: Nicholas Pratte --- dts/conf.yaml | 4 ++-- dts/framework/config/__init__.py | 4 ++-- dts/framework/config/conf_yaml_schema.json | 6 +++--- dts/framework/config/types.py | 2 +- dts/framework/testbed_model/linux_session.py | 4 ++-- dts/framework/testbed_model/node.py | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dts/conf.yaml b/dts/conf.yaml index 56c3ae6f4c..44b5e4ec84 100644 --- a/dts/conf.yaml +++ b/dts/conf.yaml @@ -36,7 +36,7 @@ nodes: use_first_core: false # tells DPDK to use any physical core memory_channels: 4 # tells DPDK to use 4 memory channels hugepages_2mb: # optional; if removed, will use system hugepage configuration - amount: 256 + quantity: 256 force_first_numa: false ports: # sets up the physical link between "SUT 1"@000:00:08.0 and "TG 1"@0000:00:08.0 @@ -72,7 +72,7 @@ nodes: peer_node: "SUT 1" peer_pci: "0000:00:08.1" hugepages_2mb: # optional; if removed, will use system hugepage configuration - amount: 256 + quantity: 256 force_first_numa: false traffic_generator: type: SCAPY diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__init__.py index b6f820e39e..3a617ef599 100644 --- a/dts/framework/config/__init__.py +++ b/dts/framework/config/__init__.py @@ -127,11 +127,11 @@ class HugepageConfiguration: r"""The hugepage configuration of :class:`~framework.testbed_model.node.Node`\s. Attributes: - amount: The number of hugepages. + quantity: The quantity of hugepages. force_first_numa: If :data:`True`, the hugepages will be configured on the first NUMA node. """ - amount: int + quantity: int force_first_numa: bool diff --git a/dts/framework/config/conf_yaml_schema.json b/dts/framework/config/conf_yaml_schema.json index f4d7199523..980f7d18a0 100644 --- a/dts/framework/config/conf_yaml_schema.json +++ b/dts/framework/config/conf_yaml_schema.json @@ -150,9 +150,9 @@ "type": "object", "description": "Optional hugepage configuration. If not specified, hugepages won't be configured and DTS will use system configuration.", "properties": { - "amount": { + "quantity": { "type": "integer", - "description": "The amount of hugepages to configure. Hugepage size will be the system default." + "description": "The number of hugepages to configure. Hugepage size will be the system default." }, "force_first_numa": { "type": "boolean", @@ -161,7 +161,7 @@ }, "additionalProperties": false, "required": [ - "amount" + "quantity" ] }, "mac_address": { diff --git a/dts/framework/config/types.py b/dts/framework/config/types.py index 016e0c3dbd..57807b0a73 100644 --- a/dts/framework/config/types.py +++ b/dts/framework/config/types.py @@ -37,7 +37,7 @@ class HugepageConfigurationDict(TypedDict): """Allowed keys and values.""" #: - amount: int + quantity: int #: force_first_numa: bool diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py index d0f7cfa77c..ae7d0ba7d2 100644 --- a/dts/framework/testbed_model/linux_session.py +++ b/dts/framework/testbed_model/linux_session.py @@ -138,7 +138,7 @@ def _supports_numa(self) -> bool: # there's no reason to do any numa specific configuration) return len(self._numa_nodes) > 1 - def _configure_huge_pages(self, amount: int, size: int, force_first_numa: bool) -> None: + def _configure_huge_pages(self, quantity: int, size: int, force_first_numa: bool) -> None: self._logger.info("Configuring Hugepages.") hugepage_config_path = f"/sys/kernel/mm/hugepages/hugepages-{size}kB/nr_hugepages" if force_first_numa and self._supports_numa(): @@ -149,7 +149,7 @@ def _configure_huge_pages(self, amount: int, size: int, force_first_numa: bool) f"/hugepages-{size}kB/nr_hugepages" ) - self.send_command(f"echo {amount} | tee {hugepage_config_path}", privileged=True) + self.send_command(f"echo {quantity} | tee {hugepage_config_path}", privileged=True) def update_ports(self, ports: list[Port]) -> None: """Overrides :meth:`~.os_session.OSSession.update_ports`.""" diff --git a/dts/framework/testbed_model/node.py b/dts/framework/testbed_model/node.py index 3f2a727c3b..512fd01db1 100644 --- a/dts/framework/testbed_model/node.py +++ b/dts/framework/testbed_model/node.py @@ -266,7 +266,7 @@ def _setup_hugepages(self) -> None: """ if self.config.hugepages: self.main_session.setup_hugepages( - self.config.hugepages.amount, + self.config.hugepages.quantity, self.main_session.hugepage_size, self.config.hugepages.force_first_numa, )