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

Conversation

@natali-rs1985
Copy link
Contributor

Change Summary

nr_hugepages are now configured in set system option kernel memory hugepage-size 2M hugepage-count '2048' section

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Other (please describe): Delete config section

Related Task(s)

Related PR(s)

Proposed changes

How to test

vyos@vyos:~$ /usr/libexec/vyos/tests/smoke/cli/test_vpp.py
test_01_vpp_basic (__main__.TestVPP.test_01_vpp_basic) ... ok
test_02_vpp_vxlan (__main__.TestVPP.test_02_vpp_vxlan) ... ok
test_03_vpp_gre (__main__.TestVPP.test_03_vpp_gre) ... ok
test_04_vpp_geneve (__main__.TestVPP.test_04_vpp_geneve) ... skipped 'Skipping this test geneve index always is 0'
test_05_vpp_loopback (__main__.TestVPP.test_05_vpp_loopback) ... ok
test_06_vpp_bonding (__main__.TestVPP.test_06_vpp_bonding) ... skipped 'Skipping temporary bonding, sometimes get recursion T7117'
test_07_vpp_bridge (__main__.TestVPP.test_07_vpp_bridge) ... ok
test_08_vpp_ipip (__main__.TestVPP.test_08_vpp_ipip) ... ok
test_09_vpp_xconnect (__main__.TestVPP.test_09_vpp_xconnect) ... ok
test_10_vpp_driver_options (__main__.TestVPP.test_10_vpp_driver_options) ... ok
test_11_vpp_cpu_settings (__main__.TestVPP.test_11_vpp_cpu_settings) ... ok
test_12_vpp_cpu_corelist_workers (__main__.TestVPP.test_12_vpp_cpu_corelist_workers) ... ok
test_13_1_buffer_page_size (__main__.TestVPP.test_13_1_buffer_page_size) ... ok
test_13_2_statseg_page_size (__main__.TestVPP.test_13_2_statseg_page_size) ... ok
test_13_3_mem_page_size (__main__.TestVPP.test_13_3_mem_page_size) ... skipped 'Skipping'
test_14_mem_default_hugepage (__main__.TestVPP.test_14_mem_default_hugepage) ... ok
test_15_vpp_ipsec_xfrm_nl (__main__.TestVPP.test_15_vpp_ipsec_xfrm_nl) ... ok
test_16_vpp_cgnat (__main__.TestVPP.test_16_vpp_cgnat) ... ok
test_17_vpp_nat (__main__.TestVPP.test_17_vpp_nat) ... ok

----------------------------------------------------------------------
Ran 19 tests in 699.199s

OK (skipped=3)

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the deprecated nr_hugepages host resource setting and centralizes hugepage count management through system kernel options. It updates verification logic to use actual system metrics and refactors resource-check helpers accordingly.

  • Replaced inline nr_hugepages validation in verify with a new verify_vpp_host_resources function that checks against HugePages_Total.
  • Removed vm.nr_hugepages assignment in sysctl generation; updated helper functions (get_hugepages_info, get_hugepages_total, get_total_hugepages_free_memory) to normalize /proc/meminfo parsing.
  • Dropped the nr-hugepages XML leaf from the VPP host_resources interface definition.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/conf_mode/vpp.py Calls new verify_vpp_host_resources, removes old inline checks and vm.nr_hugepages sysctl
python/vyos/vpp/config_verify.py Added verify_vpp_host_resources that enforces max_map_count >= 2 * HugePages_Total
python/vyos/vpp/config_resource_checks/memory.py Extracted get_hugepages_info, added get_hugepages_total, refactored free-memory logic
interface-definitions/include/vpp_host_resources.xml.i Removed nr-hugepages leaf node
Comments suppressed due to low confidence (2)

python/vyos/vpp/config_verify.py:404

  • Add unit tests for verify_vpp_host_resources to cover cases where max_map_count is both below and above 2 * HugePages_Total, ensuring the new validation behaves correctly.
def verify_vpp_host_resources(config: dict):

python/vyos/vpp/config_verify.py:408

  • [nitpick] The variable hugepages holds the total huge pages count; renaming it to total_hugepages would improve clarity.
    hugepages = mem_checks.get_hugepages_total()

@dmbaturin dmbaturin merged commit 5d0f6aa into vyos-legacy:current Jul 8, 2025
1 check passed
natali-rs1985 added a commit to natali-rs1985/vyos-vpp that referenced this pull request Aug 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants