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

[teamsyncd]: Add LAG members to syncd when created. #183

Closed
wants to merge 1 commit into from

Conversation

marian-pritsak
Copy link
Collaborator

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]

@stcheng
Copy link
Contributor

stcheng commented Mar 27, 2017

@marian-pritsak could you update the pull request as i just merged #182.
And according to my understanding of this pull request, we don't need to have teamdctl in /etc/network/interfaces file, correct? Or make this change as an option when starting teamsyncd, so we could later switch to this method when we moving interfaces information into each of the containers.

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

Choose a reason for hiding this comment

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

or change to teamName?

Copy link
Collaborator Author

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

Copy link
Contributor

@nikos-github nikos-github Sep 25, 2017

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.

void TeamSync::TeamPortSync::syncMember(const std::string& intfName)
{
const std::string config(teamdctl_config_get_raw(m_tdc));
const std::string intfNameStr("\"" + (intfName + "\""));
Copy link
Contributor

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

@nikos-github nikos-github Sep 25, 2017

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

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?

@marian-pritsak
Copy link
Collaborator Author

Not valid anymore, closing

EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants