Skip to content
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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

harjotsinghpawra
Copy link

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

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -36,6 +36,7 @@ libsaimeta_la_SOURCES = \
NotificationSwitchShutdownRequest.cpp \
NotificationSwitchStateChange.cpp \
NotificationBfdSessionStateChange.cpp \
NotificationIcmpEchoSessionStateChange.cpp \
Copy link
Collaborator

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
Copy link
Collaborator

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);
}


Copy link
Collaborator

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 \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct ident

Comment on lines +6918 to +6932
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

This switch statement should either handle more cases, or be rewritten as an if statement.
{
json item;

item["icmp_echo"] = sai_serialize_object_id(icmp_echo_session_state[i].icmp_echo_session_id);

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"

Copy link
Contributor

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?

Copy link

@manamand2020 manamand2020 left a 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()

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.

5 participants