summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/vyos/vpp/config_resource_checks/memory.py7
-rw-r--r--python/vyos/vpp/config_verify.py8
2 files changed, 9 insertions, 6 deletions
diff --git a/python/vyos/vpp/config_resource_checks/memory.py b/python/vyos/vpp/config_resource_checks/memory.py
index 8b201ef87..ea4697ba2 100644
--- a/python/vyos/vpp/config_resource_checks/memory.py
+++ b/python/vyos/vpp/config_resource_checks/memory.py
@@ -199,11 +199,18 @@ def buffers_required(settings: dict, workers) -> int:
"""
buffers_total = 0
for ifname, iface_config in settings.get('interface', {}).items():
+ # Do not include XDP interfaces in buffer calculations.
+ # Unlike DPDK, XDP does not use VPP-managed mbufs for RX/TX rings,
+ # so buffer requirements cannot be derived from descriptors here.
+ # Buffers for XDP are handled internally by the kernel/XDP layer,
+ # not by VPP’s buffer allocator.
if iface_config.get('driver') == 'xdp':
continue
dpdk_options = iface_config.get('dpdk_options', {})
rx_queues = int(dpdk_options.get('num_rx_queues', 1))
rx_desc = int(dpdk_options.get('num_rx_desc'))
+ # default TX queues is equal to number of worker threads
+ # plus 1 main thread
tx_queues = int(dpdk_options.get('num_tx_queues', workers + 1))
tx_desc = int(dpdk_options.get('num_tx_desc'))
diff --git a/python/vyos/vpp/config_verify.py b/python/vyos/vpp/config_verify.py
index 78c5d420b..71cf97423 100644
--- a/python/vyos/vpp/config_verify.py
+++ b/python/vyos/vpp/config_verify.py
@@ -317,7 +317,7 @@ def verify_vpp_cpu_main_core(cpu_settings: dict) -> None:
)
-def verify_vpp_settings_cpu_workers(cpu_settings: dict) -> int:
+def verify_vpp_settings_cpu_workers(cpu_settings: dict):
"""
Verify that the system has enough available CPU cores
to run a given amount of worker processes (1 worker/core)
@@ -331,10 +331,8 @@ def verify_vpp_settings_cpu_workers(cpu_settings: dict) -> int:
f'(reduce to {available_cores} or less)'
)
- return workers
-
-def verify_vpp_settings_cpu_corelist_workers(cpu_settings: dict) -> int:
+def verify_vpp_settings_cpu_corelist_workers(cpu_settings: dict):
"""
Verify that the CPU cores provided to the config are free and can be used by VPP
"""
@@ -366,8 +364,6 @@ def verify_vpp_settings_cpu_corelist_workers(cpu_settings: dict) -> int:
if len(all_core_nums) > cpu_checks.available_cores_count(cpu_settings):
raise ConfigError(f'{error_msg}: Not enough free CPUs in the system.')
- return len(all_core_nums)
-
def verify_vpp_nat44_workers(workers: int, nat44_workers: list):
if workers < 1: