VPP: T7175: Add sFlow conf mode CLI and startup template#32
VPP: T7175: Add sFlow conf mode CLI and startup template#32dmbaturin merged 5 commits intovyos-legacy:currentfrom
Conversation
|
I do not see any config dependencies that probably should be https://github.com/vyos/vyos-vpp/blob/current/data/config-mode-dependencies/vyos-vpp.json
|
|
All contributors have signed the CLA ✍️ ✅ |
|
Adding another config afterwards did break it. It should be resolved now. Tested with the following. Starting config: Additions: |
|
recheck |
src/conf_mode/vpp_sflow.py
Outdated
| raise ConfigError('sFlow sample rate must be a valid integer') | ||
|
|
||
| # Verify that system sflow has enable-vpp defined | ||
| if 'system_sflow' not in config or 'enable_vpp' not in config.get('system_sflow', {}): |
There was a problem hiding this comment.
The actual node for the system sflow is vpp, not enable_vpp
set system sflow interface 'eth1'
set system sflow server 127.0.0.1
set system sflow vpp
|
|
||
| # Verify that all interfaces specified exist in VPP | ||
| for interface in config['interface']: | ||
| if interface not in config['vpp_ifaces']: |
There was a problem hiding this comment.
@ServerForge do you know if subinterfaces are also allowed for this plugin?
For example
set interfaces ethernet eth1 address '192.0.2.1/30'
set interfaces ethernet eth1 description 'LAN'
set interfaces ethernet eth1 vif 11 address '10.0.11.1/30'
set interfaces ethernet eth1 vif 12 address '10.0.12.1/30'
set interfaces ethernet eth1 vif 13 address '10.0.13.1/30'
set interfaces ethernet eth1 vif 14 address '10.0.14.1/30'
set interfaces ethernet eth1 vif 15 address '10.0.15.1/30'
set interfaces ethernet eth1 vif 16 address '10.0.16.1/30'
set interfaces ethernet eth1 vif 17 address '10.0.17.1/30'
set interfaces ethernet eth1 vif 18 address '10.0.18.1/30'
set interfaces ethernet eth1 vif 19 address '10.0.19.1/30'
set interfaces ethernet eth1 vif 20 address '10.0.20.1/30'
set interfaces ethernet eth1 vif 21 address '10.0.21.1/30'
set interfaces ethernet eth1 vif 22 address '10.0.22.1/30'
set interfaces ethernet eth1 vif 23 address '10.0.23.1/30'
set interfaces ethernet eth1 vif 24 address '10.0.24.1/30'
set interfaces ethernet eth1 vif 25 address '10.0.25.1/30'
set interfaces ethernet eth1 vif 26 address '10.0.26.1/30'
set system option kernel cpu disable-nmi-watchdog
set system option kernel cpu isolate-cpus '1,2,4-5'
set system option kernel cpu nohz-full '1,2,4-5'
set system option kernel cpu rcu-no-cbs '1,2,4-5'
set system option kernel disable-hpet
set system option kernel disable-mce
set system option kernel disable-mitigations
set system option kernel disable-softlockup
set system option kernel memory default-hugepage-size '2M'
set system option kernel memory disable-numa-balancing
set system option kernel memory hugepage-size 1G hugepage-count '2'
set system option kernel memory hugepage-size 2M hugepage-count '1650'
set system sflow interface 'eth1'
set system sflow server 127.0.0.1
set system sflow vpp
set vpp settings host-resources max-map-count '65535'
set vpp settings interface eth1 dpdk-options promisc
set vpp settings interface eth1 driver 'dpdk'
set vpp settings memory main-heap-page-size '2M'
set vpp settings memory main-heap-size '3G'
set vpp settings statseg size '128M'
set vpp settings unix poll-sleep-usec '222'
vyos@r14# set vpp sflow interface eth1.11
[edit]
vyos@r14# commit
[ vpp sflow ]
eth1.11 must be a VPP interface for sFlow monitoring
[[vpp sflow]] failed
Commit failed
[edit]
vyos@r14#
There was a problem hiding this comment.
Pull Request Overview
Adds sFlow monitoring capabilities to VyOS VPP data-plane configuration by implementing configuration mode CLI and enabling the sFlow plugin. The feature allows configuring VPP interfaces for sFlow sampling with configurable sample rates.
- Implements configuration mode handler for VPP sFlow settings including interface selection and sample rate configuration
- Updates VPP startup template to enable the sFlow plugin by default
- Adds configuration dependencies and interface definitions to integrate sFlow into the VyOS configuration system
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/conf_mode/vpp_sflow.py | New configuration mode script implementing sFlow validation, configuration parsing, and VPP API integration |
| src/conf_mode/vpp.py | Adds sFlow dependency tracking to main VPP configuration handler |
| interface-definitions/vpp.xml.in | Defines CLI interface for sFlow configuration with interface and sample-rate options |
| data/templates/vpp/startup.conf.j2 | Enables sFlow plugin in VPP startup configuration |
| data/config-mode-dependencies/vyos-vpp.json | Adds sFlow to VPP configuration dependencies |
Added conf mode CLI for VPP sflow plugin and updated VPP template to include plugin.
There was a problem hiding this comment.
Basic feature works
Added some fixes and the smoketest
vyos@r14:~$ /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) ... ok
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
test_18_vpp_sflow (__main__.TestVPP.test_18_vpp_sflow) ... ok
----------------------------------------------------------------------
Ran 20 tests in 367.223s
OK (skipped=2)
vyos@r14:~$
We'll extend and improve it later
|
a0cba9e to
784edb4
Compare
|
@ServerForge Thanks for the effort! The PR is now merged and we'll apply our suggestions ourselves. |


Change Summary
Added conf mode CLI for VPP sflow plugin and updated VPP template to include plugin.
Types of changes
Related Task(s)
https://vyos.dev/T7175
Related PR(s)
vyos/vyos-build#962
Proposed changes
Added conf mode CLI for VPP sflow plugin and updated VPP template to include plugin. It allows configuring the VPP interfaces that will be sampled and the sample rate. Currently only ingress sampling is supported by the plugin. There is an additional setting that needs to be flipped under the "system sflow" that will tell it to poll the VPP plugin and has a PR active under the vyos-1x repo.
How to test
Checklist: