Add link event damping support - #4563
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Changes lgtm, Can you please update description per template? |
|
Please check this PR and check anything pending - #4367 |
Yes, changes are missing from this PR 4367. Added the missing changes. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This PR is not listed in the HLD. Anyway thanks for pointing out. Added all missing code from PR# 4357. |
|
Please fix build issues |
92ba5fe to
8879ee2
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Please address this comment and also fix build issue |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
255b3df to
3c1cca5
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
3d80b67 to
533ee52
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
56d068d to
d0688ff
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
f7b2694 to
ced3ee2
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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>
38adf57 to
30e05da
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Please address this. We need the details of new CLI. |
Added the CLI details. Please let me know if this is ok. |
How about 'show' command? |
There was a problem hiding this comment.
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 dampingcommand group withalgoandaied-paramsubcommands writing toCONFIG_DBPORTentries. - 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. |
| 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) | ||
| ) |
| @classmethod | ||
| def setup_class(cls): | ||
| print("SETUP") | ||
| os.environ["UTILITIES_UNIT_TESTING"] = "1" | ||
|
|
| config interface damping algo Ethernet20 disabled | ||
| ``` | ||
|
|
||
| ***config interface damping aied-param (Versions >= 202311*** |
This PR is merging the changes done in #3001.
What I did
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)