Skip to content

Conversation

@natali-rs1985
Copy link
Contributor

@natali-rs1985 natali-rs1985 commented Oct 17, 2025

Execute commands for vpp sflow with API calls. Use values for polling and sampling rate from 'system sflow'.
Add op mode command show vpp sflow

Change summary

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)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe): rewrite feature implementation

Related Task(s)

Related PR(s)

vyos/vyos-documentation#1694

How to test / Smoketest result

set interfaces ethernet eth1 address '192.0.2.1/30'
set interfaces ethernet eth1 description 'LAN'
set system sflow interface 'eth1'
set system sflow server 127.0.0.1
set system sflow vpp

set vpp settings interface eth1 driver 'dpdk'
set vpp settings interface eth0 driver 'dpdk'
set vpp settings unix poll-sleep-usec '222'
set vpp sflow interface 'eth1'
commit

vyos@vyos# run show vpp sflow
sflow sampling-rate 1000
sflow sampling-direction ingress
sflow polling-interval 30
sflow header-bytes 128
sflow enable eth1
Status
  interfaces enabled: 1
  packet samples sent: 0
  packet samples dropped: 0
  counter samples sent: 1
  counter samples dropped: 0
[edit]


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) ... ok
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_vpp_ipsec_xfrm_nl (__main__.TestVPP.test_14_vpp_ipsec_xfrm_nl) ... ok
test_15_1_vpp_cgnat (__main__.TestVPP.test_15_1_vpp_cgnat) ... ok
test_15_2_vpp_cgnat_bond_with_vifs (__main__.TestVPP.test_15_2_vpp_cgnat_bond_with_vifs) ... ok
test_16_vpp_nat (__main__.TestVPP.test_16_vpp_nat) ... ok
test_17_vpp_sflow (__main__.TestVPP.test_17_vpp_sflow) ... ok
test_18_resource_limits (__main__.TestVPP.test_18_resource_limits) ... ok
test_19_vpp_pppoe_mapping (__main__.TestVPP.test_19_vpp_pppoe_mapping) ... ok
test_20_kernel_options_hugepages (__main__.TestVPP.test_20_kernel_options_hugepages) ... ok

----------------------------------------------------------------------
Ran 23 tests in 576.071s

OK (skipped=1)

Checklist:

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

@github-actions
Copy link

github-actions bot commented Oct 17, 2025

👍
No issues in PR Title / Commit Title

Execute commands for vpp sflow with API calls. Use values for polling interval and sampling rate from 'system sflow'. Add op-mode command
@github-actions
Copy link

CI integration ❌ failed!

Details

CI logs

  • CLI Smoketests (no interfaces) 👍 passed
  • CLI Smoketests VPP 👍 passed
  • CLI Smoketests (interfaces only) ❌ failed
  • Config tests 👍 passed
  • Config tests VPP 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

@sever-sever sever-sever requested a review from zdc October 22, 2025 11:04
Copy link
Member

@sever-sever sever-sever left a comment

Choose a reason for hiding this comment

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

Works as expected in my tests:

set system sflow agent-address '192.168.122.14'
set system sflow interface 'eth0'
set system sflow sampling-rate '1'
set system sflow server 10.0.0.2
set system sflow vpp
set vpp settings interface eth0 driver 'dpdk'
set vpp settings unix poll-sleep-usec '222'
set vpp sflow header-bytes '160'
set vpp sflow interface 'eth0'

vyos@r14:~$ ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=58 time=8.99 ms

sFlow server:

vyos@r16# sudo goflow2 | jq
time=2025-10-22T12:49:36.286Z level=INFO msg="starting GoFlow2"
time=2025-10-22T12:49:36.286Z level=INFO msg="starting collection" scheme=sflow hostname="" port=6343 count=1 workers=2 blocking=false queue_size=1000000
time=2025-10-22T12:49:36.288Z level=INFO msg="starting collection" scheme=netflow hostname="" port=2055 count=1 workers=2 blocking=false queue_size=1000000
{
  "type": "SFLOW_5",
  "time_received_ns": 1761137381262240800,
  "sequence_num": 217,
  "sampling_rate": 1,
  "sampler_address": "192.168.122.14",
  "time_flow_start_ns": 1761137381262240800,
  "time_flow_end_ns": 1761137381262240800,
  "bytes": 102,
  "packets": 1,
  "src_addr": "192.168.122.14",
  "dst_addr": "1.1.1.1",
  "etype": "IPv4",
  "proto": "ICMP",
  "src_port": 0,
  "dst_port": 0,
  "in_if": 1073741823,
  "out_if": 26,
  "src_mac": "52:54:00:8d:67:6e",
  "dst_mac": "52:54:00:d4:d9:a1",
  "src_vlan": 0,
  "dst_vlan": 0,
  "vlan_id": 0,
  "ip_tos": 0,
  "forwarding_status": 0,
  "ip_ttl": 64,
  "ip_flags": 2,
  "tcp_flags": 0,
  "icmp_type": 0,
  "icmp_code": 0,
  "ipv6_flow_label": 0,
  "fragment_id": 28036,
  "fragment_offset": 0,
  "src_as": 0,
  "dst_as": 0,
  "next_hop": "",
  "next_hop_as": 0,
  "src_net": "0.0.0.0/0",
  "dst_net": "0.0.0.0/0",
  "bgp_next_hop": "",
  "bgp_communities": [],
  "as_path": [],
  "mpls_ttl": [],
  "mpls_label": [],
  "mpls_ip": [],
  "observation_domain_id": 0,
  "observation_point_id": 0,
  "layer_stack": [
    "Ethernet",
    "IPv4",
    "ICMP"
  ],
  "layer_size": [
    14,
    20,
    8
  ],
  "ipv6_routing_header_addresses": [],
  "ipv6_routing_header_seg_left": 0
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bp/circinus Create automatic backport for circinus current

Development

Successfully merging this pull request may close these issues.

3 participants