-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICMP_ECHO_SESSION meta and notification layer changes #1542
base: master
Are you sure you want to change the base?
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -36,6 +36,7 @@ libsaimeta_la_SOURCES = \ | |||
NotificationSwitchShutdownRequest.cpp \ | |||
NotificationSwitchStateChange.cpp \ | |||
NotificationBfdSessionStateChange.cpp \ | |||
NotificationIcmpEchoSessionStateChange.cpp \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct ident
|
||
switch (ot) | ||
{ | ||
// TODO hardcoded types, must advance SAI repository commit to get metadata for this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this is already done, SAI repo was advanced enough to get that metadata, please use it here
sendNotification(SAI_SWITCH_NOTIFICATION_NAME_ICMP_ECHO_SESSION_STATE_CHANGE, s); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra empty lines not needed
@@ -26,6 +26,7 @@ tests_SOURCES = \ | |||
TestNotificationSwitchAsicSdkHealthEvent.cpp \ | |||
TestNotificationSwitchStateChange.cpp \ | |||
TestNotificationBfdSessionStateChange.cpp \ | |||
TestNotificationIcmpEchoSessionStateChange.cpp \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct ident
switch (ot) | ||
{ | ||
// TODO hardcoded types, must advance SAI repository commit to get metadata for this | ||
case SAI_OBJECT_TYPE_ICMP_ECHO_SESSION: | ||
|
||
valid = true; | ||
break; | ||
|
||
default: | ||
|
||
SWSS_LOG_ERROR("data.icmp_echo_session_id %s has unexpected type: %s, expected ICMP_ECHO_SESSION", | ||
sai_serialize_object_id(data.icmp_echo_session_id).c_str(), | ||
sai_serialize_object_type(ot).c_str()); | ||
break; | ||
} |
Check notice
Code scanning / CodeQL
No trivial switch statements Note
{ | ||
json item; | ||
|
||
item["icmp_echo"] = sai_serialize_object_id(icmp_echo_session_state[i].icmp_echo_session_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be "icmp_echo_session_id"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is UT covering this function? No?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix sai_serialize_icmp_echo_session_state_ntf()
Added support for ICMP_ECHO_SESSION in following areas of sonic-sairedis
meta layer
syncd
Notification Handling
added unittest to test notification and attribute handling