-
Notifications
You must be signed in to change notification settings - Fork 272
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
[EVPN-MH] Added new APP_L2_NEXTHOP_GROUP_TABLE_NAME table in APPL_DB #952
base: master
Are you sure you want to change the base?
[EVPN-MH] Added new APP_L2_NEXTHOP_GROUP_TABLE_NAME table in APPL_DB #952
Conversation
@pbrisset please have someone from CSCO to help review |
ca41f0e
to
cfb5c77
Compare
And support to register and de-register raw netlink msg Signed-off-by: Kishore Kunal <[email protected]>
cfb5c77
to
d747b97
Compare
@kishorekunal01 , can you improve code coverage by add new test case? |
void NetDispatcher::registerRawMessageHandler(int nlmsg_type, NetMsg *callback) | ||
{ | ||
if (m_rawhandlers.find(nlmsg_type) != m_rawhandlers.end()) | ||
throw "Trying to registered on already registerd netlink message"; |
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.
better to throw specific exception type like runtime_error instead of string literals.
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 is similar to the method registerMessageHandler. Hence similar error handling is done.
@@ -35,12 +35,45 @@ void NetDispatcher::unregisterMessageHandler(int nlmsg_type) | |||
m_handlers.erase(it); | |||
} | |||
|
|||
void NetDispatcher::registerRawMessageHandler(int nlmsg_type, NetMsg *callback) |
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 m_rawhandlers protected by m_mutex? as well as unregisterRawMessageHandler() function.
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.
Good catch, Sure I will put this in mutex as well.
And support to register and de-register raw netlink msg Signed-off-by: Kishore Kunal <[email protected]>
Evpn mh nhg support
@kishorekunal01 , you need add new test case to cover code change: Total: 20 lines |
Sure. |
Why I did it
Added the new APP_L2_NEXTHOP_GROUP_TABLE_NAME table in APPL_DB, along with support for registering and deregistering raw Netlink messages.
Direct handling of raw Netlink messages is required because libnl3 does not support Next Hop Group (NHG) message processing. Therefore, fdbsyncd needs to decode Kernel NHG messages to update the L2_NEXTHOP_GROUP_TABLE.
Check HLD: sonic-net/SONiC#1702
Signed-off-by: Kishore Kunal [email protected]