diff options
| author | Nataliia Solomko <natalirs1985@gmail.com> | 2025-09-05 11:37:55 +0300 |
|---|---|---|
| committer | Nataliia Solomko <natalirs1985@gmail.com> | 2025-09-09 15:50:16 +0300 |
| commit | b0ae930a9fcb3093d3069bb8296a2f572e6a3d93 (patch) | |
| tree | fc46040209214d556c11d2b1d5d3c7eb8ef649bf /python | |
| parent | 5c6e25f50ddac493ab6c61726fb4a1f96b9bf55c (diff) | |
| download | vyos-1x-b0ae930a9fcb3093d3069bb8296a2f572e6a3d93.tar.gz vyos-1x-b0ae930a9fcb3093d3069bb8296a2f572e6a3d93.zip | |
T7757: VPP add auto calculation of buffer-per-numa parameter as default
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/vpp/config_resource_checks/memory.py | 7 | ||||
| -rw-r--r-- | python/vyos/vpp/config_verify.py | 8 |
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: |
