@@ -4950,38 +4950,15 @@ bool PortsOrch::addInbandVlan(const string &alias, const string &type)
4950
4950
4951
4951
getCpuPort (cpuPort);
4952
4952
4953
- if (!addBridgePort (cpuPort))
4954
- {
4955
- SWSS_LOG_ERROR (" Failed to add CPU port %s as bridge port" , cpuPort.m_alias .c_str ());
4956
- return false ;
4957
- }
4958
-
4959
- if (!addVlanMember (inbandVlan, cpuPort, tagged_mode))
4960
- {
4961
- SWSS_LOG_ERROR (" Failed to add CPU port %s in inband VLAN" , cpuPort.m_alias .c_str ());
4962
- return false ;
4963
- }
4964
-
4965
- SWSS_LOG_NOTICE (" add port %s to inbandVlan %s" , cpuPort.m_alias .c_str (), inbandVlan.m_alias .c_str ());
4966
-
4967
- if (!addHostIntfs (inbandVlan, inbandVlan.m_alias , inbandVlan.m_hif_id ))
4968
- {
4969
- SWSS_LOG_ERROR (" Failed to add host intf for inband VLAN" );
4970
- return false ;
4971
- }
4972
-
4973
- if (!setHostIntfsOperStatus (inbandVlan, true ))
4974
- {
4975
- SWSS_LOG_ERROR (" Failed to set host intf oper status for inband VLAN" );
4976
- return false ;
4977
- }
4978
-
4979
4953
for (auto &it: m_portList)
4980
4954
{
4981
4955
Port port = it.second ;
4982
- if (port.m_type != Port::SYSTEM ||
4983
- port.m_system_port_info .type == SAI_SYSTEM_PORT_TYPE_LOCAL ||
4984
- port.m_alias .find (" Cpu" ) == string::npos)
4956
+
4957
+ // Only add local and remote CPU ports to inband VLAN.
4958
+ if (port.m_alias != cpuPort.m_alias &&
4959
+ (port.m_type != Port::SYSTEM ||
4960
+ port.m_system_port_info .type == SAI_SYSTEM_PORT_TYPE_LOCAL ||
4961
+ port.m_alias .find (" Cpu" ) == string::npos))
4985
4962
{
4986
4963
continue ;
4987
4964
}
@@ -4998,7 +4975,19 @@ bool PortsOrch::addInbandVlan(const string &alias, const string &type)
4998
4975
continue ;
4999
4976
}
5000
4977
5001
- SWSS_LOG_NOTICE (" add sysport %s to inbandVlan %s" , port.m_alias .c_str (), inbandVlan.m_alias .c_str ());
4978
+ SWSS_LOG_NOTICE (" add port %s to inbandVlan %s" , port.m_alias .c_str (), inbandVlan.m_alias .c_str ());
4979
+ }
4980
+
4981
+ if (!addHostIntfs (inbandVlan, inbandVlan.m_alias , inbandVlan.m_hif_id ))
4982
+ {
4983
+ SWSS_LOG_ERROR (" Failed to add host intf for inband VLAN" );
4984
+ return false ;
4985
+ }
4986
+
4987
+ if (!setHostIntfsOperStatus (inbandVlan, true ))
4988
+ {
4989
+ SWSS_LOG_ERROR (" Failed to set host intf oper status for inband VLAN" );
4990
+ return false ;
5002
4991
}
5003
4992
5004
4993
return true ;
0 commit comments