Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit 2a85de2

Browse files
committed
T7678: Remove host-resources from CLI
It will be configured in section "system option host-resources"
1 parent 5631aed commit 2a85de2

File tree

4 files changed

+0
-77
lines changed

4 files changed

+0
-77
lines changed

interface-definitions/include/vpp_host_resources.xml.i

Lines changed: 0 additions & 35 deletions
This file was deleted.

interface-definitions/vpp.xml.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,6 @@
449449
</leafNode>
450450
</children>
451451
</node>
452-
#include <include/vpp_host_resources.xml.i>
453452
<tagNode name="interface">
454453
<properties>
455454
<help>Interface</help>

python/vyos/vpp/config_verify.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import psutil
2020

2121
from vyos import ConfigError
22-
from vyos.base import Warning
2322
from vyos.utils.cpu import get_core_count as total_core_count
2423

2524
from vyos.vpp.control_host import get_eth_driver
@@ -390,17 +389,3 @@ def verify_vpp_interfaces_dpdk_num_queues(qtype: str, num_queues: int, workers:
390389
f'The number of {qtype} queues cannot be greater than the number of configured VPP workers: '
391390
f'workers: {workers}, queues: {num_queues}'
392391
)
393-
394-
395-
def verify_vpp_host_resources(config: dict):
396-
max_map_count = int(config['settings']['host_resources']['max_map_count'])
397-
398-
# Get HugePages total count
399-
hugepages = mem_checks.get_hugepages_total()
400-
401-
if max_map_count < 2 * hugepages:
402-
Warning(
403-
'The max-map-count should be greater than or equal to (2 * HugePages_Total) '
404-
'or VPP could work not properly. Please set up '
405-
f'"vpp settings host-resources max-map-count" to {2 * hugepages} or higher'
406-
)

src/conf_mode/vpp.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from vyos.template import render
3232
from vyos.utils.boot import boot_configuration_complete
3333
from vyos.utils.process import call
34-
from vyos.utils.system import sysctl_read, sysctl_apply
3534

3635
from vyos.vpp import VPPControl
3736
from vyos.vpp import control_host
@@ -49,7 +48,6 @@
4948
verify_vpp_memory,
5049
verify_vpp_statseg_size,
5150
verify_vpp_interfaces_dpdk_num_queues,
52-
verify_vpp_host_resources,
5351
)
5452
from vyos.vpp.config_filter import iface_filter_eth
5553
from vyos.vpp.utils import EthtoolGDrvinfo
@@ -358,9 +356,6 @@ def verify(config):
358356
# Check if available memory is enough for current VPP config
359357
verify_vpp_memory(config)
360358

361-
if 'max_map_count' in config['settings'].get('host_resources', {}):
362-
verify_vpp_host_resources(config)
363-
364359
if 'statseg' in config['settings']:
365360
verify_vpp_statseg_size(config['settings'])
366361

@@ -471,27 +466,6 @@ def generate(config):
471466
render(service_conf, 'vpp/startup.conf.j2', config['settings'])
472467
render(systemd_override, 'vpp/override.conf.j2', config)
473468

474-
# apply sysctl values
475-
# default: https://github.com/FDio/vpp/blob/v23.10/src/vpp/conf/80-vpp.conf
476-
# vm.nr_hugepages are now configured in section
477-
# 'set system option kernel memory hugepage-size 2M hugepage-count <count>'
478-
sysctl_config: dict[str, str] = {
479-
'vm.max_map_count': config['settings']['host_resources']['max_map_count'],
480-
'vm.hugetlb_shm_group': '0',
481-
'kernel.shmmax': config['settings']['host_resources']['shmmax'],
482-
}
483-
# we do not want to lower current values
484-
for sysctl_key, sysctl_value in sysctl_config.items():
485-
# perform check only for quantitative params
486-
if sysctl_key == 'vm.hugetlb_shm_group':
487-
pass
488-
current_value = sysctl_read(sysctl_key)
489-
if int(current_value) > int(sysctl_value):
490-
sysctl_config[sysctl_key] = current_value
491-
492-
if not sysctl_apply(sysctl_config):
493-
raise ConfigError('Cannot configure sysctl parameters for VPP')
494-
495469
return None
496470

497471

0 commit comments

Comments
 (0)