-
Notifications
You must be signed in to change notification settings - Fork 549
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
[teamsyncd]: Add LAG members to syncd when created. #183
Conversation
@marian-pritsak could you update the pull request as i just merged #182. |
@@ -28,18 +29,27 @@ void TeamSync::onMsg(int nlmsg_type, struct nl_object *obj) | |||
if ((nlmsg_type != RTM_NEWLINK) && (nlmsg_type != RTM_DELLINK)) | |||
return; | |||
|
|||
string lagName = rtnl_link_get_name(link); | |||
string intfName = rtnl_link_get_name(link); |
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.
or change to teamName?
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.
Here we can have either a LAG or its member, so I picked a more general name
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.
Please put a comment to that effect. That this can be the LAG or a member.
teamsyncd/teamsync.cpp
Outdated
void TeamSync::TeamPortSync::syncMember(const std::string& intfName) | ||
{ | ||
const std::string config(teamdctl_config_get_raw(m_tdc)); | ||
const std::string intfNameStr("\"" + (intfName + "\"")); |
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.
why there is one more '(' and ')' inside?
It is possible that LAG members are created after teamd creates LAG. In that case we have to monitor RTM_NEWLINK messages and addd them via teamdctl. Signed-off-by: marian-pritsak <[email protected]> Conflicts: teamsyncd/teamsync.cpp
@@ -28,18 +29,27 @@ void TeamSync::onMsg(int nlmsg_type, struct nl_object *obj) | |||
if ((nlmsg_type != RTM_NEWLINK) && (nlmsg_type != RTM_DELLINK)) | |||
return; | |||
|
|||
string lagName = rtnl_link_get_name(link); | |||
string intfName = rtnl_link_get_name(link); |
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.
Please put a comment to that effect. That this can be the LAG or a member.
SWSS_LOG_THROW("Failed to allocate teamdctl context."); | ||
} | ||
|
||
err = teamdctl_connect(m_tdc, m_lagName.c_str(), NULL, NULL); |
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.
Where is this defined? I'm sorry but I couldn't find the function. Can you please tell me which file has it?
Not valid anymore, closing |
It is possible that LAG members are created after teamd
creates LAG. In that case we have to monitor RTM_NEWLINK
messages and addd them via teamdctl.
Signed-off-by: marian-pritsak [email protected]