Skip to content

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
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.

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