From 625b9a971083251527ee52a798b55863ff0f087f Mon Sep 17 00:00:00 2001 From: Kyle McClammy Date: Mon, 12 May 2025 16:55:54 +0000 Subject: [PATCH] Sflow: T7175 Updated hsflowd CLI to have VPP option and updated error check to handle interface checks when using VPP. --- data/templates/sflow/hsflowd.conf.j2 | 3 +++ interface-definitions/system_sflow.xml.in | 6 ++++++ src/conf_mode/system_sflow.py | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/data/templates/sflow/hsflowd.conf.j2 b/data/templates/sflow/hsflowd.conf.j2 index 6a1ba2956f..089d2c5587 100644 --- a/data/templates/sflow/hsflowd.conf.j2 +++ b/data/templates/sflow/hsflowd.conf.j2 @@ -32,4 +32,7 @@ sflow { dropmon { limit={{ drop_monitor_limit }} start=on sw=on hw=off } {% endif %} dbus { } +{% if enable_vpp is vyos_defined %} + vpp { } +{% endif %} } diff --git a/interface-definitions/system_sflow.xml.in b/interface-definitions/system_sflow.xml.in index 2cd7a5d12f..485125fbb9 100644 --- a/interface-definitions/system_sflow.xml.in +++ b/interface-definitions/system_sflow.xml.in @@ -112,6 +112,12 @@ + + + Enable VPP sampling + + + #include diff --git a/src/conf_mode/system_sflow.py b/src/conf_mode/system_sflow.py index a22dac36f5..e35b08de6f 100755 --- a/src/conf_mode/system_sflow.py +++ b/src/conf_mode/system_sflow.py @@ -60,7 +60,8 @@ def verify(sflow): ) # Check if at least one interface is configured - if 'interface' not in sflow: + # Skip this check if VPP is enabled + if 'interface' not in sflow and 'enable_vpp' not in sflow: raise ConfigError( 'sFlow requires at least one interface to be configured!')