From patchwork Tue May 7 17:44:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Pratte X-Patchwork-Id: 139991 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 20A1743FCC; Tue, 7 May 2024 19:44:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0919543463; Tue, 7 May 2024 19:44:56 +0200 (CEST) Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) by mails.dpdk.org (Postfix) with ESMTP id D29D0402DF for ; Tue, 7 May 2024 19:44:54 +0200 (CEST) Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-6a1506f9a74so739806d6.2 for ; Tue, 07 May 2024 10:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1715103894; x=1715708694; 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=SCGo/V6dVxL3Sg7tZOXXFQs0e11UfppqqYKJrqOsTCg=; b=Xv0CK0H3wEfEzLLiLUWEcJYKq7elHbG1m93nQXjbjVRq1iycMFg4jR6VL1APtHiyMX PGu9oYEiZ4lQWXpKFsbRpqGIo5IYeGUh+g0pfYVgqfXODkdvniXjXZ+eOljnY02hUsD5 VnKj5aLhviwJ2txTB+1TZsZLHQhCbohXwRl0Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715103894; x=1715708694; 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=SCGo/V6dVxL3Sg7tZOXXFQs0e11UfppqqYKJrqOsTCg=; b=Xu1U9IXsD0d1TItmNqDzQaVl+q3aw+NG8E1K0/cqBZbZ644zht93/uXjBRoOnY55+p HjHoY83tN2WHUqr89WBSrXERDV+YtDXvDeWzBMXM+7gmOxcws7zj0lBdP/YrKvmEkqs3 r5VtYCqsOnCxHashpqWhWyGrG8ol86CU79a+HKFxVVvlHMah0Rm086Uln2EiEQTc9J60 upzdnYHT1JlNKAypJpbqNO8AJb61qS6Ra+Rg3qSVWuiGINUH7TU/2dmMbBd4+cUVQ8jU 8P5bzFrd/mytKl9AeEEawUn+qNTm5Cy3bpNqmTYws1V1zAbOiDF4Nq6jDcJl2b6GbDph Im1g== X-Gm-Message-State: AOJu0Ywiv7lbtbov5hpDBbOKUcFl6nHjm/GVGVlEUkpdn0hr7gEUET8B Kf6I2FAR1q82TlJW4ZSNoknLBAT0V6mvLUw1Wiy3ugRTnU2aBPkfPauOPky3ePo= X-Google-Smtp-Source: AGHT+IFICPyM27OTV+lsgsDSq2Oazl+HGEpNLRHZOovqKR5B5ssDlldFt988toQIACN5LUXlqJnVyg== X-Received: by 2002:ac8:5f0b:0:b0:43c:5d3a:1d94 with SMTP id d75a77b69052e-43dbed1a0b0mr4781781cf.2.1715103894206; Tue, 07 May 2024 10:44:54 -0700 (PDT) Received: from localhost.unh.edu ([2606:4100:3880:1271:e2f8:4ec3:8bf3:864c]) by smtp.gmail.com with ESMTPSA id bp20-20020a05622a1b9400b00434a165d45asm6621623qtb.38.2024.05.07.10.44.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 10:44:53 -0700 (PDT) From: Nicholas Pratte To: probb@iol.unh.edu, bruce.richardson@intel.com, Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, jspewock@iol.unh.edu, yoan.picchi@foss.arm.com, mb@smartsharesystems.com, wathsala.vithanage@arm.com, paul.szczepanek@arm.com Cc: dev@dpdk.org, Nicholas Pratte Subject: [PATCH v6 1/2] dts: Change hugepage runtime config to 2MB Exclusively Date: Tue, 7 May 2024 13:44:29 -0400 Message-ID: <20240507174430.29403-2-npratte@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240507174430.29403-1-npratte@iol.unh.edu> References: <20240430184533.29247-4-npratte@iol.unh.edu> <20240507174430.29403-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 previous implementation configures and allocates hugepage sizes based on a system default. This can lead to two problems: overallocation of hugepages (which may crash the remote host), and configuration of hugepage sizes that are not recommended during runtime. This new implementation allows only 2MB hugepage allocation during runtime; any other unique hugepage size must be configured by the end-user for initializing DTS. If the amount of 2MB hugepages requested exceeds the amount of 2MB hugepages already configured on the system, then the system will remount hugepages to cover the difference. If the amount of hugepages requested is either less than or equal to the amount already configured on the system, then nothing is done. Bugzilla ID: 1370 Signed-off-by: Nicholas Pratte Reviewed-by: Jeremy Spewock --- v4: * dts.rst punctuation/grammar corrections and 2mb exclusivity justifications included in documentation --- doc/guides/tools/dts.rst | 6 ++++- 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 | 24 +++++++++++--------- dts/framework/testbed_model/node.py | 4 +++- dts/framework/testbed_model/os_session.py | 7 +++++- 8 files changed, 35 insertions(+), 22 deletions(-) diff --git a/doc/guides/tools/dts.rst b/doc/guides/tools/dts.rst index 47b218b2c6..40c3ddafb6 100644 --- a/doc/guides/tools/dts.rst +++ b/doc/guides/tools/dts.rst @@ -131,7 +131,11 @@ There are two areas that need to be set up on a System Under Test: You may specify the optional hugepage configuration in the DTS config file. If you do, DTS will take care of configuring hugepages, - overwriting your current SUT hugepage configuration. + overwriting your current SUT hugepage configuration. Configuration of hugepages via DTS + allows only for allocation of 2MB hugepages, as doing so prevents accidental/over + allocation of hugepage sizes not recommended during runtime due to + contiguous memory space requirements. Thus, if you require hugepage + sizes not equal to 2MB, then this configuration must be done outside of the DTS framework. * System under test configuration diff --git a/dts/conf.yaml b/dts/conf.yaml index 8068345dd5..56c3ae6f4c 100644 --- a/dts/conf.yaml +++ b/dts/conf.yaml @@ -35,7 +35,7 @@ nodes: lcores: "" # use all the available logical cores use_first_core: false # tells DPDK to use any physical core memory_channels: 4 # tells DPDK to use 4 memory channels - hugepages: # optional; if removed, will use system hugepage configuration + hugepages_2mb: # optional; if removed, will use system hugepage configuration amount: 256 force_first_numa: false ports: @@ -71,7 +71,7 @@ nodes: os_driver: rdma peer_node: "SUT 1" peer_pci: "0000:00:08.1" - hugepages: # optional; if removed, will use system hugepage configuration + hugepages_2mb: # optional; if removed, will use system hugepage configuration amount: 256 force_first_numa: false traffic_generator: diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__init__.py index 4cb5c74059..b6f820e39e 100644 --- a/dts/framework/config/__init__.py +++ b/dts/framework/config/__init__.py @@ -255,8 +255,8 @@ def from_dict( Either an SUT or TG configuration instance. """ hugepage_config = None - if "hugepages" in d: - hugepage_config_dict = d["hugepages"] + if "hugepages_2mb" in d: + hugepage_config_dict = d["hugepages_2mb"] if "force_first_numa" not in hugepage_config_dict: hugepage_config_dict["force_first_numa"] = False hugepage_config = HugepageConfiguration(**hugepage_config_dict) diff --git a/dts/framework/config/conf_yaml_schema.json b/dts/framework/config/conf_yaml_schema.json index 4731f4511d..f4d7199523 100644 --- a/dts/framework/config/conf_yaml_schema.json +++ b/dts/framework/config/conf_yaml_schema.json @@ -146,7 +146,7 @@ "compiler" ] }, - "hugepages": { + "hugepages_2mb": { "type": "object", "description": "Optional hugepage configuration. If not specified, hugepages won't be configured and DTS will use system configuration.", "properties": { @@ -253,8 +253,8 @@ "type": "integer", "description": "How many memory channels to use. Optional, defaults to 1." }, - "hugepages": { - "$ref": "#/definitions/hugepages" + "hugepages_2mb": { + "$ref": "#/definitions/hugepages_2mb" }, "ports": { "type": "array", diff --git a/dts/framework/config/types.py b/dts/framework/config/types.py index 1927910d88..016e0c3dbd 100644 --- a/dts/framework/config/types.py +++ b/dts/framework/config/types.py @@ -46,7 +46,7 @@ class NodeConfigDict(TypedDict): """Allowed keys and values.""" #: - hugepages: HugepageConfigurationDict + hugepages_2mb: HugepageConfigurationDict #: name: str #: diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py index 5d24030c3d..d0f7cfa77c 100644 --- a/dts/framework/testbed_model/linux_session.py +++ b/dts/framework/testbed_model/linux_session.py @@ -15,7 +15,7 @@ from typing_extensions import NotRequired -from framework.exception import RemoteCommandExecutionError +from framework.exception import ConfigurationError, RemoteCommandExecutionError from framework.utils import expand_range from .cpu import LogicalCore @@ -84,14 +84,20 @@ def get_dpdk_file_prefix(self, dpdk_prefix: str) -> str: """Overrides :meth:`~.os_session.OSSession.get_dpdk_file_prefix`.""" return dpdk_prefix - def setup_hugepages(self, hugepage_count: int, force_first_numa: bool) -> None: + def setup_hugepages( + self, hugepage_count: int, hugepage_size: int, force_first_numa: bool + ) -> None: """Overrides :meth:`~.os_session.OSSession.setup_hugepages`.""" self._logger.info("Getting Hugepage information.") - hugepage_size = self._get_hugepage_size() - hugepages_total = self._get_hugepages_total() + hugepages_total = self._get_hugepages_total(hugepage_size) + if ( + f"hugepages-{hugepage_size}kB" + not in self.send_command("ls /sys/kernel/mm/hugepages").stdout + ): + raise ConfigurationError("hugepage size not supported by operating system") self._numa_nodes = self._get_numa_nodes() - if force_first_numa or hugepages_total != hugepage_count: + if force_first_numa or hugepages_total < hugepage_count: # when forcing numa, we need to clear existing hugepages regardless # of size, so they can be moved to the first numa node self._configure_huge_pages(hugepage_count, hugepage_size, force_first_numa) @@ -99,13 +105,9 @@ def setup_hugepages(self, hugepage_count: int, force_first_numa: bool) -> None: self._logger.info("Hugepages already configured.") self._mount_huge_pages() - def _get_hugepage_size(self) -> int: - hugepage_size = self.send_command("awk '/Hugepagesize/ {print $2}' /proc/meminfo").stdout - return int(hugepage_size) - - def _get_hugepages_total(self) -> int: + def _get_hugepages_total(self, hugepage_size: int) -> int: hugepages_total = self.send_command( - "awk '/HugePages_Total/ { print $2 }' /proc/meminfo" + f"cat /sys/kernel/mm/hugepages/hugepages-{hugepage_size}kB/nr_hugepages" ).stdout return int(hugepages_total) diff --git a/dts/framework/testbed_model/node.py b/dts/framework/testbed_model/node.py index 74061f6262..3f2a727c3b 100644 --- a/dts/framework/testbed_model/node.py +++ b/dts/framework/testbed_model/node.py @@ -266,7 +266,9 @@ def _setup_hugepages(self) -> None: """ if self.config.hugepages: self.main_session.setup_hugepages( - self.config.hugepages.amount, self.config.hugepages.force_first_numa + self.config.hugepages.amount, + self.main_session.hugepage_size, + self.config.hugepages.force_first_numa, ) def configure_port_state(self, port: Port, enable: bool = True) -> None: diff --git a/dts/framework/testbed_model/os_session.py b/dts/framework/testbed_model/os_session.py index d5bf7e0401..19dcf5f963 100644 --- a/dts/framework/testbed_model/os_session.py +++ b/dts/framework/testbed_model/os_session.py @@ -64,6 +64,7 @@ class OSSession(ABC): _logger: DTSLogger remote_session: RemoteSession interactive_session: InteractiveRemoteSession + hugepage_size: int def __init__( self, @@ -80,6 +81,7 @@ def __init__( name: The name of the session. logger: The logger instance this session will use. """ + self.hugepage_size = 2048 self._config = node_config self.name = name self._logger = logger @@ -345,7 +347,9 @@ def get_dpdk_file_prefix(self, dpdk_prefix: str) -> str: """ @abstractmethod - def setup_hugepages(self, hugepage_count: int, force_first_numa: bool) -> None: + def setup_hugepages( + self, hugepage_count: int, hugepage_size: int, force_first_numa: bool + ) -> None: """Configure hugepages on the node. Get the node's Hugepage Size, configure the specified count of hugepages @@ -353,6 +357,7 @@ def setup_hugepages(self, hugepage_count: int, force_first_numa: bool) -> None: Args: hugepage_count: Configure this many hugepages. + hugepage_size: Configure hugepages of this size. force_first_numa: If :data:`True`, configure hugepages just on the first numa node. """ From patchwork Tue May 7 17:44:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Pratte X-Patchwork-Id: 139992 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 5D61243FCC; Tue, 7 May 2024 19:45:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4133C4346B; Tue, 7 May 2024 19:45:03 +0200 (CEST) Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by mails.dpdk.org (Postfix) with ESMTP id CF6284346B for ; Tue, 7 May 2024 19:45:01 +0200 (CEST) Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-6a1506f9a74so739916d6.2 for ; Tue, 07 May 2024 10:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1715103901; x=1715708701; 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=HqYZeKa5zxHNzQlXBZ+Fr5mikS34URuo3lywykH89F+HS9I4P512Y0B4AckVTk4n0I i91XipXLNYGCQdQkCsDZvxk5UpoehumpV4iUZBbam2HKd/R+XRlq3VHApiE5oBlgWABN J57TID3GSulB5KnGnNyLfoAjMAI8U+twDR4Zc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715103901; x=1715708701; 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=qIOUBKveijVVlIGv7zsE+kX50n/yI+ZT8lfJS5EP3T5b5r4V9g4usPgbf3DCVcDiDa LcZ1Q43PSICYaT6pmGnX3LFMmKJHuYkv+BRCRpum23kzFBOpByymdrxJhne2zNT+vJjO LjTDw779NJZrxWxOh6IX3Smi9tQz1qrzbx5tKLzm58V3M/+/SM2zIGma+fOSD7qokiff Le402IbHyFK8FYtYfp7EBQEULR2aVDTJ1LH3EpI5C5axFE35vrDt25YVpA4E8iJRScNn Yheysz5ICD+FaTjjfuhZMApqs803U3mSjMG5chQ486tp9ISvLVe8SMo7xuo/964uNCD7 v7aw== X-Gm-Message-State: AOJu0Yys+4zJwj3sXV1+jT6InILYvebxV6O/o0cBTR5HqDF1Cqr02Qxf BP0F/tOUH77N347OCjQXRbDeLpqjKoXIYH+EvHJbF7mu1KXqjvuBUrd/T/+YrL0= X-Google-Smtp-Source: AGHT+IHkyc2PrwjKtYMN+A3G/wvpFbTquXBUKLm+3xRMwLPcjSajtPdJf5kLwmH8m6w6GqLPQ9Absw== X-Received: by 2002:a05:622a:138e:b0:43a:b1e3:e018 with SMTP id d75a77b69052e-43dbf4fe5b7mr4397001cf.6.1715103901206; Tue, 07 May 2024 10:45:01 -0700 (PDT) Received: from localhost.unh.edu ([2606:4100:3880:1271:e2f8:4ec3:8bf3:864c]) by smtp.gmail.com with ESMTPSA id bp20-20020a05622a1b9400b00434a165d45asm6621623qtb.38.2024.05.07.10.45.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 10:45:00 -0700 (PDT) From: Nicholas Pratte To: probb@iol.unh.edu, bruce.richardson@intel.com, Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, jspewock@iol.unh.edu, yoan.picchi@foss.arm.com, mb@smartsharesystems.com, wathsala.vithanage@arm.com, paul.szczepanek@arm.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 13:44:30 -0400 Message-ID: <20240507174430.29403-3-npratte@iol.unh.edu> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240507174430.29403-1-npratte@iol.unh.edu> References: <20240430184533.29247-4-npratte@iol.unh.edu> <20240507174430.29403-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, )