Link event damping feature#1906
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@sivat6 , can you check the build failure? |
|
HLD PR - sonic-net/SONiC#1071 |
There was a problem hiding this comment.
Pull request overview
This PR implements the link event damping feature end-to-end in sairedis/syncd: it introduces Redis-extension PORT attributes to configure damping, applies the damping algorithm to port state change notifications in syncd, and adds a periodic timer to end suppression even without new link events.
Changes:
- Add Redis-extension PORT attributes and plumbing (libsai ⇄ syncd) for link-event damping algorithm/config.
- Apply damping during port state change notification processing, plus a timer thread to enforce max-suppress-time expiry.
- Emit per-port damping counters/state into a dedicated DB table for observability.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
unittest/lib/TestClientServerSai.cpp |
Adds unit tests for setting Redis PORT damping attributes and client-mode rejection. |
syncd/tests/TestSyncdLinkEventDamping.cpp |
Adds a syncd integration-style test for damping config set behavior. |
syncd/tests/Makefile.am |
Registers the new syncd damping test source file. |
syncd/Syncd.h |
Introduces per-port damping state structure, helper APIs, and thread/db members. |
syncd/Syncd.cpp |
Implements config handling, damping algorithm, timer thread, and stats publishing. |
syncd/NotificationProcessor.h |
Extends constructor to accept an optional “apply damping” callback. |
syncd/NotificationProcessor.cpp |
Filters port state change notifications by applying damping before sending. |
lib/sairediscommon.h |
Adds the Redis op name for damping config set. |
lib/Sai.cpp |
Bypasses metadata for Redis PORT extension attributes and routes them to RedisSai. |
lib/RedisRemoteSaiInterface.h |
Declares Redis PORT attribute detection and damping config setter helpers. |
lib/RedisRemoteSaiInterface.cpp |
Implements Redis PORT attribute set handling and op dispatch to syncd. |
lib/ClientSai.cpp |
Rejects Redis extension attrs (including Redis PORT attrs) in CLIENT mode. |
|
Please address copilot comments |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Addressed all copilot comments. |
|
/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). |
|
Can you check the build failure? |
4bb4573 to
8f4866a
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
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>
…yncd/tests/TestSyncdLinkEventDamping.cpp 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>
46ac713 to
6fc0dd4
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks! ---Powered by SONiC BuildBot
|
|
/azpw retry |
|
Retrying failed(or canceled) jobs... |
|
Retrying failed(or canceled) stages in build 1136667: ✅Stage Test:
|
* Adding link event damping support Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Revert "Adding link event damping support" This reverts commit 0953e68. Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Adding link event damping support Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Addressing review comments Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Wrongly checked !=0 instead of ==0 Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing indentation issues Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fix build errors Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing build error Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing unit test failure Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing white space error and missing SWSS_LOG_ENTER Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing dpkg dependency problems for libswsscommon Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Removing my changes in build-template.yml file Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing spell check failures Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Removing the fix added to build-swss-template.yml Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Adding more test cases to increase coverage Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing the failed UT case Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing the typo in the last commit Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Removing few test cases Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Removing similar tests Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Removing the notification from timer thread to main thread Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Test purpose to see PR# 1925 fixes current build issue Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Remove the code of PR# 1925 Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Fixing build issue Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * SWSS_LOG_ENTER missed in new API Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Adding suppress and reuse threshold invalid config check Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Adding tests to increase coverage Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Added SWSS_LOG_ENTER() in the APIs in test file Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Addressed review comments Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Addressed code review comments Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Adding tests under unittest and removing the unnecessary tests from syncd/tests/TestSyncdLinkEventDamping.cpp Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Trigger pipeline Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Adding SWSS_LOG_ENTER() Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Debugging the test case Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Tweaking some timing value in one test Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> * Tweaking params Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net> --------- Signed-off-by: Sivakumar Thirukkanna Thevar <sthirukkanna@juniper.net>
Other changes:
Feature Functionality implementation was missing:
The existing implementation only defines structures and enums for configuration provisioning. The damping functional logic was not implemented. Implemented the damping algorithm as mentioned in the HLD and invoked during the link event handling.
Missing Damping Statistics
Damping-related counters mentioned in HLD are not present in STATS_DB. Added the damping stats (pre & post damping counters) to STATS_DB
Physical vs Operational State Mismatch
The damping algorithm is triggered during link up/down events, with timer and threshold checks handled there.
Once the maximum suppress time is reached, the actual status update occurs only during the next link event, causing a mismatch. Added the timer thread which periodically checks the damping timer and if the damping ends, it updates the physical link status.
Test Plan: Test plan is already in place (https://github.com/sivat6/sonic-mgmt/blob/master/docs/testplan/Link_event_damping.md)
Test Results: This test plan has 9 major test cases and there are about 54 total test cases (Including sub test cases). All these 54 test cases are executed.