Skip to content

Conversation

@yehjunying
Copy link

What I did

Added sflow dropped packet notification support, HLD : sonic-net/SONiC#1786

How I did it

Enhancement

How to verify it

Added UT to verify the commands.

Previous command output (if the output of a command-line utility has changed)

show sflow

sFlow Global Information:
  sFlow Admin State:               up
  sFlow Sample Direction:          both
  sFlow Polling Interval:          0
  sFlow AgentID:                   default

  2 Collectors configured:
    Name: prod                     IP addr: fe80::6e82:6aff:fe1e:cd8e UDP port: 6343   VRF: mgmt
    Name: ser5                     IP addr: 172.21.35.15    UDP port: 6343   VRF: default

New command output (if the output of a command-line utility has changed)

show sflow

sFlow Global Information:
  sFlow Admin State:               up
  sFlow Sample Direction:          both
  sFlow Polling Interval:          0
  sFlow Drop Notification Limit:   0
  sFlow AgentID:                   default

  2 Collectors configured:
    Name: prod                     IP addr: fe80::6e82:6aff:fe1e:cd8e UDP port: 6343   VRF: mgmt
    Name: ser5                     IP addr: 172.21.35.15    UDP port: 6343   VRF: default

Copilot AI review requested due to automatic review settings November 4, 2025 05:42
Copy link
Contributor

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 adds support for sFlow drop notification monitoring with rate limiting. It introduces a new CLI command to enable/disable drop monitoring and configure the maximum rate of drop notifications.

  • New drop-monitor-limit command to configure drop notification rate limiting (0-500 packets/sec)
  • Updated display formatting with consistent column alignment (ljust_len = 35)
  • Added test coverage for the new drop-monitor-limit functionality

Reviewed Changes

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

File Description
config/main.py Added drop_monitor_limit command and is_sflow_mirror_on_drop_supported() helper function to configure drop notification rate limiting
show/sflow.py Updated display formatting for consistent alignment and added drop notification limit to output
tests/sflow_test.py Added test for drop-monitor-limit command and updated expected output strings to match new formatting, fixed import path for YANG validation mocks
doc/Command-Reference.md Added documentation for the new config sflow drop-monitor-limit command

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

yehjunying and others added 2 commits November 10, 2025 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant