summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNataliia Solomko <natalirs1985@gmail.com>2025-08-12 18:48:05 +0300
committerNataliia Solomko <natalirs1985@gmail.com>2025-08-13 14:18:16 +0300
commitebb4b887f888ba71afd8c52d17520de4bcc53889 (patch)
tree358835190b99714e90409471e95b0f161a226e92
parent4c47b5c170baa189d9a4983f050856a226b6553e (diff)
downloadvyos-1x-ebb4b887f888ba71afd8c52d17520de4bcc53889.tar.gz
vyos-1x-ebb4b887f888ba71afd8c52d17520de4bcc53889.zip
T7678: Remove host-resources from CLI
It will be configured in section "system option host-resources"
-rw-r--r--interface-definitions/include/vpp_host_resources.xml.i35
-rw-r--r--interface-definitions/vpp.xml.in1
-rw-r--r--python/vyos/vpp/config_resource_checks/memory.py8
-rw-r--r--python/vyos/vpp/config_verify.py15
-rwxr-xr-xsrc/conf_mode/vpp.py26
5 files changed, 0 insertions, 85 deletions
diff --git a/interface-definitions/include/vpp_host_resources.xml.i b/interface-definitions/include/vpp_host_resources.xml.i
deleted file mode 100644
index 1706c8c87..000000000
--- a/interface-definitions/include/vpp_host_resources.xml.i
+++ /dev/null
@@ -1,35 +0,0 @@
-<!-- include start from vpp_host_resources.xml.i -->
-<node name="host-resources">
- <properties>
- <help>Host resources control</help>
- </properties>
- <children>
- <leafNode name="max-map-count">
- <properties>
- <help>Maximum number of memory map areas a process may have</help>
- <valueHelp>
- <format>u32:65535-2147483647</format>
- <description>Areas count</description>
- </valueHelp>
- <constraint>
- <validator name="numeric" argument="--range 65535-2147483647"/>
- </constraint>
- </properties>
- <defaultValue>65535</defaultValue>
- </leafNode>
- <leafNode name="shmmax">
- <properties>
- <help>Maximum shared memory segment size that can be created</help>
- <valueHelp>
- <format>u32:0-18446744073709551612</format>
- <description>Size in bytes</description>
- </valueHelp>
- <constraint>
- <validator name="numeric" argument="--range 0-18446744073709551612"/>
- </constraint>
- </properties>
- <defaultValue>2147483648</defaultValue>
- </leafNode>
- </children>
-</node>
-<!-- include end -->
diff --git a/interface-definitions/vpp.xml.in b/interface-definitions/vpp.xml.in
index dff56a228..a0cd0be45 100644
--- a/interface-definitions/vpp.xml.in
+++ b/interface-definitions/vpp.xml.in
@@ -449,7 +449,6 @@
</leafNode>
</children>
</node>
- #include <include/vpp_host_resources.xml.i>
<tagNode name="interface">
<properties>
<help>Interface</help>
diff --git a/python/vyos/vpp/config_resource_checks/memory.py b/python/vyos/vpp/config_resource_checks/memory.py
index bce2df2bb..66b9fd9a3 100644
--- a/python/vyos/vpp/config_resource_checks/memory.py
+++ b/python/vyos/vpp/config_resource_checks/memory.py
@@ -51,14 +51,6 @@ def get_total_hugepages_memory() -> int:
return hugepage_size * hugepages_total
-def get_total_hugepages_count() -> int:
- """
- Returns the total count of hugepages
- """
- info = get_hugepages_info()
- return info.get('HugePages_Total')
-
-
def get_numa_count():
"""
Run `numactl --hardware` and parse the 'available:' line.
diff --git a/python/vyos/vpp/config_verify.py b/python/vyos/vpp/config_verify.py
index 1beb3141b..9c56c8b95 100644
--- a/python/vyos/vpp/config_verify.py
+++ b/python/vyos/vpp/config_verify.py
@@ -19,7 +19,6 @@
import psutil
from vyos import ConfigError
-from vyos.base import Warning
from vyos.utils.cpu import get_core_count as total_core_count
from vyos.vpp.control_host import get_eth_driver
@@ -391,17 +390,3 @@ def verify_vpp_interfaces_dpdk_num_queues(qtype: str, num_queues: int, workers:
f'The number of {qtype} queues cannot be greater than the number of configured VPP workers: '
f'workers: {workers}, queues: {num_queues}'
)
-
-
-def verify_vpp_host_resources(config: dict):
- max_map_count = int(config['settings']['host_resources']['max_map_count'])
-
- # Get HugePages total count
- hugepages = mem_checks.get_total_hugepages_count()
-
- if max_map_count < 2 * hugepages:
- Warning(
- 'The max-map-count should be greater than or equal to (2 * HugePages_Total) '
- 'or VPP could work not properly. Please set up '
- f'"vpp settings host-resources max-map-count" to {2 * hugepages} or higher'
- )
diff --git a/src/conf_mode/vpp.py b/src/conf_mode/vpp.py
index 6e02f9593..ace3c9f9f 100755
--- a/src/conf_mode/vpp.py
+++ b/src/conf_mode/vpp.py
@@ -35,7 +35,6 @@ from vyos.ifconfig import Section
from vyos.template import render
from vyos.utils.boot import boot_configuration_complete
from vyos.utils.process import call
-from vyos.utils.system import sysctl_read, sysctl_apply
from vyos.vpp import VPPControl
from vyos.vpp import control_host
@@ -53,7 +52,6 @@ from vyos.vpp.config_verify import (
verify_vpp_memory,
verify_vpp_statseg_size,
verify_vpp_interfaces_dpdk_num_queues,
- verify_vpp_host_resources,
)
from vyos.vpp.config_filter import iface_filter_eth
from vyos.vpp.utils import EthtoolGDrvinfo
@@ -362,9 +360,6 @@ def verify(config):
# Check if available memory is enough for current VPP config
verify_vpp_memory(config)
- if 'max_map_count' in config['settings'].get('host_resources', {}):
- verify_vpp_host_resources(config)
-
if 'statseg' in config['settings']:
verify_vpp_statseg_size(config['settings'])
@@ -475,27 +470,6 @@ def generate(config):
render(service_conf, 'vpp/startup.conf.j2', config['settings'])
render(systemd_override, 'vpp/override.conf.j2', config)
- # apply sysctl values
- # default: https://github.com/FDio/vpp/blob/v23.10/src/vpp/conf/80-vpp.conf
- # vm.nr_hugepages are now configured in section
- # 'set system option kernel memory hugepage-size 2M hugepage-count <count>'
- sysctl_config: dict[str, str] = {
- 'vm.max_map_count': config['settings']['host_resources']['max_map_count'],
- 'vm.hugetlb_shm_group': '0',
- 'kernel.shmmax': config['settings']['host_resources']['shmmax'],
- }
- # we do not want to lower current values
- for sysctl_key, sysctl_value in sysctl_config.items():
- # perform check only for quantitative params
- if sysctl_key == 'vm.hugetlb_shm_group':
- pass
- current_value = sysctl_read(sysctl_key)
- if int(current_value) > int(sysctl_value):
- sysctl_config[sysctl_key] = current_value
-
- if not sysctl_apply(sysctl_config):
- raise ConfigError('Cannot configure sysctl parameters for VPP')
-
return None