Skip to content

Link event damping config CLI.#3001

Open
Ashish1805 wants to merge 1 commit intosonic-net:masterfrom
Ashish1805:aksingh_patch
Open

Link event damping config CLI.#3001
Ashish1805 wants to merge 1 commit intosonic-net:masterfrom
Ashish1805:aksingh_patch

Conversation

@Ashish1805
Copy link
Copy Markdown

  • Add the config cli for link event damping.

What I did

Added new config cli for link event damping and

How I did it

Added damping group in interface and added sub-commands algo and aied-param under damping group.

How to verify it

Unit test

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

N/A

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

N/A

Add the config cli for link event damping.
@Ashish1805
Copy link
Copy Markdown
Author

config_set = {}

if max_suppress_time is not None:
if max_suppress_time < 0:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

could you please use click.IntRange for such validation? check https://click.palletsprojects.com/en/8.1.x/api/#click.IntRange

@click.option('--suppress-threshold', required=False, type=int, help="Set suppress threshold")
@click.option('--reuse-threshold', required=False, type=int, help="Set reuse threshold")
@click.option('--flap-penalty', required=False, type=int, help="Set flap penalty")
def aied_param(ctx, interface_name, max_suppress_time, decay_half_life, suppress_threshold, reuse_threshold, flap_penalty):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we need a show command for these parameters?

@prsunny
Copy link
Copy Markdown
Contributor

prsunny commented May 13, 2024

@Ashish1805 , can you please rebase the PR?

prsunny pushed a commit to sonic-net/sonic-swss that referenced this pull request Jun 4, 2024
What I did
Added support for link event damping in SWSS.

Required Syncd PR: sonic-net/sonic-sairedis#1297
CLI PR: sonic-net/sonic-utilities#3001
HLD: https://github.com/sonic-net/SONiC/blob/master/doc/link_event_damping/Link-event-damping-HLD.md

Why I did it

How I verified it
Use the config interface damping CLI to set the port attributes on the switch and observe that Syncd processes link event damping parameters.
henrymao-zz pushed a commit to canonical/sonic-swss that referenced this pull request Jun 23, 2024
What I did
Added support for link event damping in SWSS.

Required Syncd PR: sonic-net/sonic-sairedis#1297
CLI PR: sonic-net/sonic-utilities#3001
HLD: https://github.com/sonic-net/SONiC/blob/master/doc/link_event_damping/Link-event-damping-HLD.md

Why I did it

How I verified it
Use the config interface damping CLI to set the port attributes on the switch and observe that Syncd processes link event damping parameters.
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
What I did
Added support for link event damping in SWSS.

Required Syncd PR: sonic-net/sonic-sairedis#1297
CLI PR: sonic-net/sonic-utilities#3001
HLD: https://github.com/sonic-net/SONiC/blob/master/doc/link_event_damping/Link-event-damping-HLD.md

Why I did it

How I verified it
Use the config interface damping CLI to set the port attributes on the switch and observe that Syncd processes link event damping parameters.
@DendroLabs
Copy link
Copy Markdown

Hi @Ashish1805, @Junchao-Mellanox, and @prsunny,

This PR has been inactive for nearly 2 years. I'm picking up the link event damping feature and plan to open a new PR that supersedes this one with the following improvements:

Addressing review feedback:

Adding missing functionality:

  • show interfaces dampening command -- displays config parameters plus operational state (current penalty, suppressed status, time remaining). This was flagged as missing by @Junchao-Mellanox.
  • sonic-clear interfaces dampening [interface] command -- resets penalty and unsuppresses immediately. This is standard across all vendors (Cisco, Juniper) and recommended by RFC 2439.
  • Industry-standard defaults: half-life=5s, reuse=1000, suppress=2000, max-suppress=20s, penalty=1000

New features based on industry feedback:

  • Monitor-only mode (--monitor flag / algorithm="aied-monitor"): Calculates penalties and emits syslog but does NOT suppress events. Allows safe parameter tuning in production. RFC 7196 recommends this; no vendor has implemented it.
  • Syslog messages on suppress/unsuppress transitions. The use new file location for sys eeprom and sfp eeprom on msn2700 #1 complaint across Cisco, Juniper, and Arista forums is that dampening operates silently with no logging.

Will credit @Ashish1805 as original author.

DendroLabs added a commit to DendroLabs/sonic-utilities that referenced this pull request Mar 17, 2026
Implements CLI support for RFC 2439/7196 link event dampening:
- config interface dampening enable/disable: configure AIED dampening
  with validation (IntRange per review feedback), monitor-only mode,
  and configurable flap-penalty
- show interfaces dampening: display config and operational state from
  CONFIG_DB and STATE_DB with per-interface counters
- sonic-clear interfaces dampening: reset penalty via STATE_DB flag

Supersedes sonic-net#3001 with improvements:
- click.IntRange validation (per @Junchao-Mellanox review)
- Monitor-only mode per RFC 7196 "Calculate But Do Not Damp"
- Configurable flap-penalty (vs hardcoded 1000)
- Show command with operational state and counters
- Clear command per RFC 2439 Section 4.8.6

Co-Authored-By: Ashish Singh <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
DendroLabs added a commit to DendroLabs/sonic-utilities that referenced this pull request Mar 17, 2026
Implements CLI support for RFC 2439/7196 link event dampening:
- config interface dampening enable/disable: configure AIED dampening
  with validation (IntRange per review feedback), monitor-only mode,
  and configurable flap-penalty
- show interfaces dampening: display config and operational state from
  CONFIG_DB and STATE_DB with per-interface counters
- sonic-clear interfaces dampening: reset penalty via STATE_DB flag

Supersedes sonic-net#3001 with improvements:
- click.IntRange validation (per @Junchao-Mellanox review)
- Monitor-only mode per RFC 7196 "Calculate But Do Not Damp"
- Configurable flap-penalty (vs hardcoded 1000)
- Show command with operational state and counters
- Clear command per RFC 2439 Section 4.8.6

Signed-off-by: DendroLabs <[email protected]>
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.

4 participants