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

[teammgrd]: Add teammgrd to manage LAG related configurations #626

Merged
merged 1 commit into from
Oct 19, 2018

Conversation

stcheng
Copy link
Contributor

@stcheng stcheng commented Sep 20, 2018

teammgrd will monitor configuration changes in CFG_LAG_TABLE_NAME
and CFG_LAG_MEMBER_TABLE_NAME. It supports creation/removal of
LAGs as well as membership changes of the LAG members.

Signed-off-by: Shu0T1an ChenG shuche@microsoft.com

@lguohan
Copy link
Contributor

lguohan commented Sep 21, 2018

retest this please

@stcheng
Copy link
Contributor Author

stcheng commented Sep 21, 2018

Sadly, the current virtual switch test will not pass due to the lack of teammgrd.
The test will fail because portmgrd is no longer responsible for the port channel MTU changes, and the failure of the test case leads to the failure of clean up previous states and it causes more tests to fail. I have added the pull request: sonic-net/sonic-buildimage#2064 in buildimage to update the submodule as well as update the virtual switch so that it will pass after both commits are merged.

@lguohan
Copy link
Contributor

lguohan commented Sep 21, 2018

test failure.

@@ -46,7 +46,7 @@ void IntfsOrch::increaseRouterIntfsRefCount(const string &alias)
SWSS_LOG_ENTER();

m_syncdIntfses[alias].ref_count++;
SWSS_LOG_DEBUG("Router interface %s ref count is increased to %d",
SWSS_LOG_INFO("Router interface %s ref count is increased to %d",
Copy link
Contributor

Choose a reason for hiding this comment

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

why change to INFO?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DEBUG comes with function ENTER and EXIT. It is better to separate this with DEBUG level messages which is too verbose.

Copy link
Contributor

Choose a reason for hiding this comment

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

this is still DEBUG level message, does not feel it should be info level.


In reply to: 219416641 [](ancestors = 219416641)

Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -145,6 +124,7 @@ void PortMgr::doTask(Consumer &consumer)
alias.c_str(), status.c_str());
}
}
m_portList.insert(alias);
Copy link
Contributor

Choose a reason for hiding this comment

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

m_portList [](start = 12, length = 10)

is this used anywhere?


TableConnector conf_lag_table(&conf_db, CFG_LAG_TABLE_NAME);
TableConnector conf_lag_member_table(&conf_db, CFG_LAG_MEMBER_TABLE_NAME);
TableConnector stat_port_table(&stat_db, STATE_PORT_TABLE_NAME);
Copy link
Contributor

Choose a reason for hiding this comment

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

state? stat usually means stats


if (op == SET_COMMAND)
{
int min_links = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

4 spaces


for (auto key : keys)
{
SWSS_LOG_NOTICE("current key: %s", key.c_str());
Copy link
Contributor

Choose a reason for hiding this comment

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

SWSS_LOG_NOTICE("current key: %s", key.c_str()); [](start = 19, length = 49)

this cannot be notice level

Copy link
Contributor

Choose a reason for hiding this comment

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

debug level.


In reply to: 219432425 [](ancestors = 219432425)

vector<FieldValueTuple> fvVector;
FieldValueTuple s("state", "ok");
fvVector.push_back(s);
m_stateLagTable->set(lag_alias, fvVector);
Copy link
Contributor

Choose a reason for hiding this comment

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

state ok is always linux kernel state ok, in this case, after you have created lag port in the linux kernel, you should say ok.

Copy link
Contributor

Choose a reason for hiding this comment

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

should be in teamgr.cpp or if you want to use netlink message to decide whether lag has been created or not.


In reply to: 219434221 [](ancestors = 219434221)

@@ -2643,6 +2653,8 @@ bool PortsOrch::removeLag(Port lag)

m_portList.erase(lag.m_alias);

m_stateLagTable->del(lag.m_alias);
Copy link
Contributor

Choose a reason for hiding this comment

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

m_stateLagTable->del(lag.m_alias); [](start = 4, length = 34)

not here

@@ -70,11 +70,6 @@ void TeamSync::addLag(const string &lagName, int ifindex, bool admin_state,
auto sync = make_shared<TeamPortSync>(lagName, ifindex, &m_lagMemberTable);
m_select->addSelectable(sync.get());
m_teamPorts[lagName] = sync;

fvVector.clear();
FieldValueTuple s("state", "ok");
Copy link
Contributor

Choose a reason for hiding this comment

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

why move to portsorch.cpp?

Copy link
Contributor

@jipanyang jipanyang left a comment

Choose a reason for hiding this comment

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

One general comment:
are the changes warm restart compatible? It looks to me those lag/lag member add operations will interrupt existing lag status.

@@ -119,9 +82,25 @@ void PortMgr::doTask(Consumer &consumer)
string alias = kfvKey(t);
string op = kfvOp(t);

// Skip port which is a member of a port channel
vector<string> keys;
m_cfgLagMemberTable.getKeys(keys);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could port config comes before port channel config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that is fine, once the port channel configuration comes, the configurations of port will be overwritten

teammgrd will monitor configuration changes in CFG_LAG_TABLE_NAME
and CFG_LAG_MEMBER_TABLE_NAME. It supports creation/removal of
LAGs as well as membership changes of the LAG members.

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
SWSS_LOG_INFO("Port channel %s teamd configuration: %s",
alias.c_str(), conf.str().c_str());

cmd << TEAMD_CMD << " -r -t " << alias << " -c " << conf.str() << " -d";
Copy link
Contributor

Choose a reason for hiding this comment

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

here, you force team device recreation in case if already exist, we probably need to revisit in the warm restart context.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

@stcheng
Copy link
Contributor Author

stcheng commented Oct 19, 2018

image

@stcheng
Copy link
Contributor Author

stcheng commented Oct 19, 2018

this is tested with the pull request sonic-net/sonic-buildimage#2064

@lguohan lguohan merged commit 2115a99 into sonic-net:master Oct 19, 2018
@stcheng stcheng deleted the teammgrd branch October 19, 2018 07:31
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