@@ -34,7 +34,8 @@ TeamMgr::TeamMgr(DBConnector *confDb, DBConnector *applDb, DBConnector *statDb,
3434 m_appLagTable(applDb, APP_LAG_TABLE_NAME),
3535 m_statePortTable(statDb, STATE_PORT_TABLE_NAME),
3636 m_stateLagTable(statDb, STATE_LAG_TABLE_NAME),
37- m_stateMACsecPortTable(statDb, STATE_MACSEC_PORT_TABLE_NAME)
37+ m_stateMACsecPortTable(statDb, STATE_MACSEC_PORT_TABLE_NAME),
38+ m_stateFeatureTable(statDb, " FEATURE" )
3839{
3940 SWSS_LOG_ENTER ();
4041
@@ -99,6 +100,27 @@ bool TeamMgr::isLagStateOk(const string &alias)
99100 return true ;
100101}
101102
103+ bool TeamMgr::isMACsecFeatureEnabled ()
104+ {
105+ SWSS_LOG_ENTER ();
106+
107+ vector<FieldValueTuple> temp;
108+ if (!m_stateFeatureTable.get (" macsec" , temp))
109+ {
110+ return false ;
111+ }
112+
113+ auto opt = swss::fvsGetValue (temp, " state" , true );
114+
115+ if (!opt || *opt != " enabled" )
116+ {
117+ SWSS_LOG_INFO (" MACsec feature isn't enabled" );
118+ return false ;
119+ }
120+
121+ return true ;
122+ }
123+
102124bool TeamMgr::isMACsecSetted (const std::string &port)
103125{
104126 SWSS_LOG_ENTER ();
@@ -348,10 +370,13 @@ void TeamMgr::doLagMemberTask(Consumer &consumer)
348370 continue ;
349371 }
350372
351- if (isMACsecSetted (member) && ! isMACsecStateOk (member ))
373+ if (isMACsecFeatureEnabled ( ))
352374 {
353- it++;
354- continue ;
375+ if (isMACsecSetted (member) && !isMACsecStateOk (member))
376+ {
377+ it++;
378+ continue ;
379+ }
355380 }
356381
357382 if (addLagMember (lag, member) == task_need_retry)
0 commit comments