Skip to content

Commit b42710a

Browse files
Shuotian Chenglguohan
authored andcommitted
[teammgrd]: Check if port is enslaved on all conditions (#687)
During the warm restart, port is already enslaved in the kernel. This change is to avoid teammgrd to re-configure those member ports which causes link flap. Signed-off-by: Shu0T1an ChenG <[email protected]>
1 parent 75972e7 commit b42710a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cfgmgr/teammgr.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ void TeamMgr::doPortUpdateTask(Consumer &consumer)
291291
SWSS_LOG_INFO("Received port %s state update", alias.c_str());
292292

293293
string lag;
294-
if (!isPortEnslaved(alias) && findPortMaster(lag, alias))
294+
if (findPortMaster(lag, alias))
295295
{
296296
if (addLagMember(lag, alias) == task_need_retry)
297297
{
@@ -430,6 +430,13 @@ task_process_status TeamMgr::addLagMember(const string &lag, const string &membe
430430
{
431431
SWSS_LOG_ENTER();
432432

433+
// If port is already enslaved, ignore this operation
434+
// TODO: check the current master if it is the same as to be configured
435+
if (isPortEnslaved(member))
436+
{
437+
return task_ignore;
438+
}
439+
433440
stringstream cmd;
434441
string res;
435442

0 commit comments

Comments
 (0)