Skip to content

Add link event damping support - #4563

Open
sivat6 wants to merge 11 commits into
sonic-net:masterfrom
sivat6:link_event_damping_feature
Open

Add link event damping support#4563
sivat6 wants to merge 11 commits into
sonic-net:masterfrom
sivat6:link_event_damping_feature

Conversation

@sivat6

@sivat6 sivat6 commented May 22, 2026

Copy link
Copy Markdown

This PR is merging the changes done in #3001.

What I did

  1. Added new config cli for link event damping
  2. Added the test code for the same
  3. Update the doc/Command-Referrence.md with the description of new CLIs.

How I did it
Added 'damping' group in interface and added sub-commands 'algo' and 'aied-param' under damping group.
'algo' has 2 options - aied, disabled
'aied-param' has 5 configs - max-suppress-time, decay-half-life, suppress-threshold, reuse-threshold, flap-penalty

aied-param config params can be configured by executing one or more params.

Example config CLI:
sudo config interface damping algo Ethernet0 aied
sudo config interface damping aied-param Ethernet0 --suppress-threshold 1400 --decay-half-life 20000 --max-suppress-time 40000 --flap-penalty 1000 --reuse-threshold 1100

Here is the CLI syntax:

$ sudo config interface
Usage: config interface [OPTIONS] COMMAND [ARGS]...

Interface-related configuration tasks

Options:
-n, --namespace [] Namespace name
-?, -h, --help Show this message and exit.

Commands:
advertised-speeds Set interface advertised speeds
advertised-types Set interface advertised types
autoneg Set interface auto negotiation mode
breakout Set interface breakout mode

$ sudo config interface damping
Usage: config interface damping [OPTIONS] COMMAND [ARGS]...

Set interface damping configurations

Options:
-?, -h, --help Show this message and exit.

Commands:
aied-param Set AIED link event damping configuration
algo Set link event damping algorithm

$ sudo config interface damping algo Ethernet0
Usage: config interface damping algo [OPTIONS] <interface_name> <algo_type>
Try 'config interface damping algo -h' for help.

Error: Missing argument '<algo_type>'. Choose from:
aied,
disabled

$ sudo config interface damping aied-param Ethernet0 --help
Usage: config interface damping aied-param [OPTIONS] <interface_name>

Set AIED link event damping configuration

Options:
--max-suppress-time INTEGER Set max suppress time in ms
--decay-half-life INTEGER Set decay half life in ms
--suppress-threshold INTEGER Set suppress threshold
--reuse-threshold INTEGER Set reuse threshold
--flap-penalty INTEGER Set flap penalty
-h, -?, --help Show this message and exit.
admin@shifu-garnet01:~$

How to verify it
Unit Testing:
Complete UT was carried out for the link event damping feature (53 test cases and UT logs available)

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@prsunny

prsunny commented May 22, 2026

Copy link
Copy Markdown
Contributor

Changes lgtm, Can you please update description per template?

@prsunny

prsunny commented May 22, 2026

Copy link
Copy Markdown
Contributor

Please check this PR and check anything pending - #4367

@sivat6

sivat6 commented May 26, 2026

Copy link
Copy Markdown
Author

Please check this PR and check anything pending - #4367

Yes, changes are missing from this PR 4367. Added the missing changes.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@sivat6

sivat6 commented May 27, 2026

Copy link
Copy Markdown
Author

Please check this PR and check anything pending - #4367

This PR is not listed in the HLD. Anyway thanks for pointing out. Added all missing code from PR# 4357.

@prsunny

prsunny commented May 28, 2026

Copy link
Copy Markdown
Contributor

Please fix build issues

@sivat6
sivat6 force-pushed the link_event_damping_feature branch from 92ba5fe to 8879ee2 Compare May 28, 2026 05:11
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@prsunny

prsunny commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Changes lgtm, Can you please update description per template?

Please address this comment and also fix build issue

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@sivat6
sivat6 force-pushed the link_event_damping_feature branch from 255b3df to 3c1cca5 Compare June 3, 2026 10:14
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@sivat6
sivat6 force-pushed the link_event_damping_feature branch from 3d80b67 to 533ee52 Compare June 3, 2026 11:18
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@sivat6
sivat6 force-pushed the link_event_damping_feature branch from 56d068d to d0688ff Compare June 3, 2026 11:53
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@sivat6
sivat6 force-pushed the link_event_damping_feature branch from f7b2694 to ced3ee2 Compare June 4, 2026 04:44
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

sivat6 added 11 commits June 4, 2026 13:09
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
@sivat6
sivat6 force-pushed the link_event_damping_feature branch from 38adf57 to 30e05da Compare June 4, 2026 07:40
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@prsunny

prsunny commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Changes lgtm, Can you please update description per template?

Please address this. We need the details of new CLI.

@sivat6

sivat6 commented Jun 8, 2026

Copy link
Copy Markdown
Author

Changes lgtm, Can you please update description per template?

Please address this. We need the details of new CLI.

Added the CLI details. Please let me know if this is ok.

@prsunny

prsunny commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Please check this PR and check anything pending - #4367

This PR is not listed in the HLD. Anyway thanks for pointing out. Added all missing code from PR# 4357.

How about 'show' command?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 CLI support in config interface for configuring link event damping (algorithm selection and AIED parameters), along with new unit tests and corresponding Command Reference documentation updates.

Changes:

  • Add config interface damping command group with algo and aied-param subcommands writing to CONFIG_DB PORT entries.
  • Add unit tests covering valid/invalid damping algorithm selection and AIED parameter validation.
  • Document the new CLI syntax and examples in doc/Command-Reference.md.

Reviewed changes

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

File Description
config/main.py Adds the new config interface damping CLI commands and validation logic.
tests/link_event_damping_test.py Adds direct CLI-invocation tests for damping algorithm and AIED params.
tests/config_int_damping_test.py Adds a basic test suite for damping commands similar to other config interface tests.
doc/Command-Reference.md Documents the new damping CLI commands, usage, and examples.

Comment thread config/main.py
Comment on lines +5546 to +5558
if reuse_threshold is not None and suppress_threshold is not None:
if reuse_threshold >= suppress_threshold:
ctx.fail(
"Invalid configuration: reuse_threshold ({}) must be less than suppress_threshold ({})"
.format(reuse_threshold, suppress_threshold)
)

if decay_half_life is not None and max_suppress_time is not None:
if decay_half_life > max_suppress_time:
ctx.fail(
"Invalid configuration: decay_half_life ({}) must be <= max_suppress_time ({})"
.format(decay_half_life, max_suppress_time)
)
Comment on lines +24 to +28
@classmethod
def setup_class(cls):
print("SETUP")
os.environ["UTILITIES_UNIT_TESTING"] = "1"

Comment thread doc/Command-Reference.md
config interface damping algo Ethernet20 disabled
```

***config interface damping aied-param (Versions >= 202311***
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