@@ -760,18 +760,33 @@ void FdbOrch::doTask(Consumer& consumer)
760
760
}
761
761
}
762
762
763
+ /* FDB type is either dynamic or static */
763
764
assert (type == " dynamic" || type == " dynamic_local" || type == " static" );
764
765
765
766
if (origin == FDB_ORIGIN_VXLAN_ADVERTIZED)
766
767
{
767
768
VxlanTunnelOrch* tunnel_orch = gDirectory .get <VxlanTunnelOrch*>();
768
769
769
- if (!remote_ip. length ())
770
+ if (tunnel_orch-> isDipTunnelsSupported ())
770
771
{
771
- it = consumer.m_toSync .erase (it);
772
- continue ;
772
+ if (!remote_ip.length ())
773
+ {
774
+ it = consumer.m_toSync .erase (it);
775
+ continue ;
776
+ }
777
+ port = tunnel_orch->getTunnelPortName (remote_ip);
778
+ }
779
+ else
780
+ {
781
+ EvpnNvoOrch* evpn_nvo_orch = gDirectory .get <EvpnNvoOrch*>();
782
+ VxlanTunnel* sip_tunnel = evpn_nvo_orch->getEVPNVtep ();
783
+ if (sip_tunnel == NULL )
784
+ {
785
+ it = consumer.m_toSync .erase (it);
786
+ continue ;
787
+ }
788
+ port = tunnel_orch->getTunnelPortName (sip_tunnel->getSrcIP ().to_string (), true );
773
789
}
774
- port = tunnel_orch->getTunnelPortName (remote_ip);
775
790
}
776
791
777
792
@@ -804,8 +819,6 @@ void FdbOrch::doTask(Consumer& consumer)
804
819
}
805
820
port = tunnel_orch->getTunnelPortName (remote_ip);
806
821
}
807
-
808
-
809
822
it = consumer.m_toSync .erase (it);
810
823
}
811
824
else
@@ -1125,11 +1138,14 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
1125
1138
{
1126
1139
Port vlan;
1127
1140
Port port;
1141
+ string end_point_ip = " " ;
1142
+
1143
+ VxlanTunnelOrch* tunnel_orch = gDirectory .get <VxlanTunnelOrch*>();
1128
1144
1129
1145
SWSS_LOG_ENTER ();
1130
- SWSS_LOG_INFO (" mac=%s bv_id=0x%" PRIx64 " port_name=%s type=%s origin=%d" ,
1146
+ SWSS_LOG_INFO (" mac=%s bv_id=0x%" PRIx64 " port_name=%s type=%s origin=%d remote_ip=%s " ,
1131
1147
entry.mac .to_string ().c_str (), entry.bv_id , port_name.c_str (),
1132
- fdbData.type .c_str (), fdbData.origin );
1148
+ fdbData.type .c_str (), fdbData.origin , fdbData. remote_ip . c_str () );
1133
1149
1134
1150
if (!m_portsOrch->getPort (entry.bv_id , vlan))
1135
1151
{
@@ -1146,8 +1162,14 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
1146
1162
return true ;
1147
1163
}
1148
1164
1165
+ /* Assign end point IP only in SIP tunnel scenario since Port + IP address
1166
+ needed to uniquely identify Vlan member */
1167
+ if (!tunnel_orch->isDipTunnelsSupported ())
1168
+ {
1169
+ end_point_ip = fdbData.remote_ip ;
1170
+ }
1149
1171
/* Retry until port is member of vlan*/
1150
- if (vlan. m_members . find (port_name) == vlan. m_members . end ( ))
1172
+ if (!m_portsOrch-> isVlanMember (vlan, port, end_point_ip ))
1151
1173
{
1152
1174
SWSS_LOG_INFO (" Saving a fdb entry until port %s becomes vlan %s member" , port_name.c_str (), vlan.m_alias .c_str ());
1153
1175
saved_fdb_entries[port_name].push_back ({entry.mac ,
@@ -1163,6 +1185,7 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
1163
1185
1164
1186
Port oldPort;
1165
1187
string oldType;
1188
+ string oldRemoteIp;
1166
1189
FdbOrigin oldOrigin = FDB_ORIGIN_INVALID ;
1167
1190
bool macUpdate = false ;
1168
1191
@@ -1172,19 +1195,21 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
1172
1195
/* get existing port and type */
1173
1196
oldType = it->second .type ;
1174
1197
oldOrigin = it->second .origin ;
1198
+ oldRemoteIp = it->second .remote_ip ;
1175
1199
1176
1200
if (!m_portsOrch->getPortByBridgePortId (it->second .bridge_port_id , oldPort))
1177
1201
{
1178
1202
SWSS_LOG_ERROR (" Existing port 0x%" PRIx64 " details not found" , it->second .bridge_port_id );
1179
1203
return false ;
1180
1204
}
1181
1205
1182
- if ((oldOrigin == fdbData.origin ) && (oldType == fdbData.type ) && (port.m_bridge_port_id == it->second .bridge_port_id ))
1206
+ if ((oldOrigin == fdbData.origin ) && (oldType == fdbData.type ) && (port.m_bridge_port_id == it->second .bridge_port_id )
1207
+ && (oldRemoteIp == fdbData.remote_ip ))
1183
1208
{
1184
1209
/* Duplicate Mac */
1185
- SWSS_LOG_INFO (" FdbOrch: mac=%s %s port=%s type=%s origin=%d is duplicate" , entry.mac .to_string ().c_str (),
1210
+ SWSS_LOG_INFO (" FdbOrch: mac=%s %s port=%s type=%s origin=%d remote_ip=%s is duplicate" , entry.mac .to_string ().c_str (),
1186
1211
vlan.m_alias .c_str (), port_name.c_str (),
1187
- fdbData.type .c_str (), fdbData.origin );
1212
+ fdbData.type .c_str (), fdbData.origin , fdbData. remote_ip . c_str () );
1188
1213
return true ;
1189
1214
}
1190
1215
else if (fdbData.origin != oldOrigin)
0 commit comments