-
Notifications
You must be signed in to change notification settings - Fork 529
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
Conversation
retest this please |
Sadly, the current virtual switch test will not pass due to the lack of teammgrd. |
test failure. |
orchagent/intfsorch.cpp
Outdated
@@ -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", |
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 change to INFO?
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.
DEBUG comes with function ENTER and EXIT. It is better to separate this with DEBUG level messages which is too verbose.
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.
this is still DEBUG level message, does not feel it should be info level.
In reply to: 219416641 [](ancestors = 219416641)
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.
https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
In reply to: 219422213 [](ancestors = 219422213,219416641)
cfgmgr/portmgr.cpp
Outdated
@@ -145,6 +124,7 @@ void PortMgr::doTask(Consumer &consumer) | |||
alias.c_str(), status.c_str()); | |||
} | |||
} | |||
m_portList.insert(alias); |
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.
m_portList [](start = 12, length = 10)
is this used anywhere?
cfgmgr/teammgrd.cpp
Outdated
|
||
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); |
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.
state? stat usually means stats
cfgmgr/teammgr.cpp
Outdated
|
||
if (op == SET_COMMAND) | ||
{ | ||
int min_links = 0; |
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.
4 spaces
cfgmgr/teammgr.cpp
Outdated
|
||
for (auto key : keys) | ||
{ | ||
SWSS_LOG_NOTICE("current key: %s", key.c_str()); |
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.
SWSS_LOG_NOTICE("current key: %s", key.c_str()); [](start = 19, length = 49)
this cannot be notice level
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.
orchagent/portsorch.cpp
Outdated
vector<FieldValueTuple> fvVector; | ||
FieldValueTuple s("state", "ok"); | ||
fvVector.push_back(s); | ||
m_stateLagTable->set(lag_alias, fvVector); |
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.
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.
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.
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)
orchagent/portsorch.cpp
Outdated
@@ -2643,6 +2653,8 @@ bool PortsOrch::removeLag(Port lag) | |||
|
|||
m_portList.erase(lag.m_alias); | |||
|
|||
m_stateLagTable->del(lag.m_alias); |
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.
m_stateLagTable->del(lag.m_alias); [](start = 4, length = 34)
not here
teamsyncd/teamsync.cpp
Outdated
@@ -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"); |
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 move to portsorch.cpp?
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.
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); |
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.
Could port config comes before port channel config?
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.
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"; |
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, you force team device recreation in case if already exist, we probably need to revisit in the warm restart context.
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.
sure
this is tested with the pull request sonic-net/sonic-buildimage#2064 |
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