Skip to content

Commit

Permalink
[Link Event Damping] Add per port link event damper class.
Browse files Browse the repository at this point in the history
- Adding per port link event damper class that manages the internal
  behavior and workings of link event damping logic on a port where link
  event damping config is enabled.
- This class keeps track of damping timer, current port state, post
  damping advertised port state and relevant debug counters per port.

HLD: sonic-net/SONiC#1071
  • Loading branch information
Ashish Singh committed Dec 15, 2023
1 parent 641b730 commit 9b15557
Show file tree
Hide file tree
Showing 8 changed files with 1,790 additions and 0 deletions.
1 change: 1 addition & 0 deletions syncd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ libSyncd_a_SOURCES = \
NotificationHandler.cpp \
NotificationProcessor.cpp \
NotificationQueue.cpp \
PortLinkEventDamper.cpp \
PortMap.cpp \
PortMapParser.cpp \
PortStateChangeHandler.cpp \
Expand Down
11 changes: 11 additions & 0 deletions syncd/NotificationHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ void NotificationHandler::updateNotificationsPointers(
}
}

void NotificationHandler::onPortStateChangePostLinkEventDamping(
_In_ uint32_t count,
_In_ const sai_port_oper_status_notification_t *data)
{
SWSS_LOG_ENTER();

auto s = sai_serialize_port_oper_status_ntf(count, data);

enqueueNotification(SAI_SWITCH_NOTIFICATION_NAME_PORT_STATE_CHANGE, s);
}

// TODO use same Notification class from sairedis lib
// then this will handle deserialize free

Expand Down
6 changes: 6 additions & 0 deletions syncd/NotificationHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ namespace syncd
_In_ uint32_t attr_count,
_In_ sai_attribute_t *attr_list) const;

// Handling of port state change event when received after being
// processed in link event damping logic.
virtual void onPortStateChangePostLinkEventDamping(
_In_ uint32_t count,
_In_ const sai_port_oper_status_notification_t *data);

public: // members reflecting SAI callbacks

void onFdbEvent(
Expand Down
Loading

0 comments on commit 9b15557

Please sign in to comment.