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

[EVPN-MH] Added new APP_L2_NEXTHOP_GROUP_TABLE_NAME table in APPL_DB #952

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

kishorekunal01
Copy link
Contributor

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]

@adyeung
Copy link

adyeung commented Nov 14, 2024

@pbrisset please have someone from CSCO to help review

And support to register and de-register raw netlink msg

Signed-off-by: Kishore Kunal <[email protected]>
@liuh-80
Copy link
Contributor

liuh-80 commented Nov 18, 2024

@kishorekunal01 , can you improve code coverage by add new test case?

@liuh-80 liuh-80 self-requested a review November 18, 2024 02:09
common/netdispatcher.h Outdated Show resolved Hide resolved
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";
Copy link
Contributor

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.

Copy link
Contributor Author

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)
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@liuh-80
Copy link
Contributor

liuh-80 commented Dec 9, 2024

@kishorekunal01 , you need add new test case to cover code change:

Total: 20 lines
Missing: 20 lines
Coverage: 0%
Threshold: 80%

@kishorekunal01
Copy link
Contributor Author

@kishorekunal01 , you need add new test case to cover code change:

Total: 20 lines Missing: 20 lines Coverage: 0% Threshold: 80%

Sure.

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.

4 participants