Description:
There is an inconsistency between VPP behavior cores utilization and system options settings when configuring isolated CPU cores.
Expected Behavior:
When CPU cores are isolated using set system option kernel cpu isolate-cpu, it is expected that only these isolated cores will be utilized by the VPP dataplane.
By default, at least one CPU core should be isolated to ensure VPP starts correctly. If set vpp settings resource-allocation cpu-cores is used, the number of isolated cores should at least match the allocation specified.
Actual Behavior:
VPP currently always selects cores starting from the third core, regardless of the isolated CPU configuration. This does not align with the isolated cores specified in the system settings.
This mismatch can lead to suboptimal resource allocation and may cause performance and stability issues, as VPP does not respect the intended CPU isolation.
The problem is here: https://github.com/vyos/vyos-1x/blob/0792a6b2b7ab32006ff45832a35de4536547cbd3/src/conf_mode/vpp.py#L170-L185
We should not use vyos.utils.cpu.get_available_cpus() for this operation, but introduce a new function that returns only isolated cores. The rest should be tuned accordingly.
Steps to Reproduce:
- Configure isolated CPU cores and hugepages:
set system option kernel cpu isolate-cpus '3' set system option kernel memory hugepage-size 2M hugepage-count '1024'
- Commit, save, reboot.
- Configure VPP:
set vpp settings interface eth0 set vpp settings resource-allocation memory main-heap-size '1G'
- Verify which CPU core is used by VPP.