From: Nicholas Pratte <npratte@iol.unh.edu>
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 <npratte@iol.unh.edu>
Subject: [PATCH v6 2/2] dts: Change hugepage 'amount' to a different term
Date: Tue, 7 May 2024 13:44:30 -0400 [thread overview]
Message-ID: <20240507174430.29403-3-npratte@iol.unh.edu> (raw)
In-Reply-To: <20240507174430.29403-1-npratte@iol.unh.edu>
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 <npratte@iol.unh.edu>
---
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,
)
--
2.44.0
next prev parent reply other threads:[~2024-05-07 17:45 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-30 18:45 [PATCH v5 1/2] dts: Change hugepage runtime config to 2MB Exclusively Nicholas Pratte
2024-04-30 18:45 ` [PATCH v5 2/2] dts: Change hugepage 'amount' to a different term Nicholas Pratte
2024-05-02 11:55 ` Juraj Linkeš
2024-05-07 11:15 ` Luca Vizzarro
2024-05-07 12:05 ` Bruce Richardson
2024-05-07 12:43 ` Luca Vizzarro
2024-05-07 13:00 ` Bruce Richardson
2024-05-13 10:06 ` Juraj Linkeš
2024-05-15 15:12 ` Nicholas Pratte
2024-04-30 18:45 ` [PATCH v5 0/2] Methodology change for hugepage configuration Nicholas Pratte
2024-05-07 11:16 ` Luca Vizzarro
2024-05-07 16:37 ` [PATCH v6 " Nicholas Pratte
2024-05-07 16:37 ` [PATCH v6 1/2] dts: Change hugepage runtime config to 2MB Exclusively Nicholas Pratte
2024-05-07 16:37 ` [PATCH v6 2/2] dts: Change hugepage 'amount' to a different term Nicholas Pratte
2024-05-07 17:44 ` [PATCH v6 0/2] Methodology change for hugepage configuration Nicholas Pratte
2024-05-07 17:44 ` [PATCH v6 1/2] dts: Change hugepage runtime config to 2MB Exclusively Nicholas Pratte
2024-05-07 17:44 ` Nicholas Pratte [this message]
2024-05-07 17:46 ` [PATCH v6 0/2] Methodology change for hugepage configuration Nicholas Pratte
2024-05-13 9:53 ` Juraj Linkeš
2024-05-15 14:50 ` Nicholas Pratte
2024-05-29 10:30 ` Juraj Linkeš
2024-05-30 17:58 ` [PATCH v7 " Nicholas Pratte
2024-05-30 17:58 ` [PATCH v7 1/2] dts: Change hugepage runtime config to 2MB Exclusively Nicholas Pratte
2024-05-30 17:58 ` [PATCH v7 2/2] dts: Change hugepage 'amount' to a different term Nicholas Pratte
2024-05-30 18:37 ` [PATCH v8 0/2] Methodology change for hugepage configuration Nicholas Pratte
2024-05-30 19:37 ` Nicholas Pratte
2024-05-30 19:37 ` [PATCH v8 1/2] dts: Change hugepage runtime config to 2MB Exclusively Nicholas Pratte
2024-05-31 6:52 ` Juraj Linkeš
2024-05-31 11:37 ` Luca Vizzarro
2024-05-30 19:38 ` [PATCH v8 2/2] dts: Change hugepage 'amount' to a different term Nicholas Pratte
2024-05-31 6:53 ` Juraj Linkeš
2024-05-31 11:37 ` Luca Vizzarro
2024-06-07 14:31 ` [PATCH v9 0/2] Methodology change for hugepage configuration Nicholas Pratte
2024-06-07 14:31 ` [PATCH v9 1/2] dts: Change hugepage runtime config to 2MB Exclusively Nicholas Pratte
2024-06-07 14:31 ` [PATCH v9 2/2] dts: Change hugepage 'amount' to a different term Nicholas Pratte
2024-06-07 14:59 ` [PATCH v9 0/2] Methodology change for hugepage configuration Nicholas Pratte
2024-06-07 14:59 ` [PATCH v9 1/2] dts: Change hugepage runtime config to 2MB Exclusively Nicholas Pratte
2024-06-10 7:38 ` Juraj Linkeš
2024-06-17 14:59 ` Luca Vizzarro
2024-06-07 14:59 ` [PATCH v9 2/2] dts: Change hugepage 'amount' to a different term Nicholas Pratte
2024-06-10 7:38 ` Juraj Linkeš
2024-06-17 14:59 ` Luca Vizzarro
2024-05-02 11:55 ` [PATCH v5 1/2] dts: Change hugepage runtime config to 2MB Exclusively Juraj Linkeš
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240507174430.29403-3-npratte@iol.unh.edu \
--to=npratte@iol.unh.edu \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=jspewock@iol.unh.edu \
--cc=juraj.linkes@pantheon.tech \
--cc=mb@smartsharesystems.com \
--cc=paul.szczepanek@arm.com \
--cc=probb@iol.unh.edu \
--cc=thomas@monjalon.net \
--cc=wathsala.vithanage@arm.com \
--cc=yoan.picchi@foss.arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).