@@ -168,11 +168,23 @@ void FdbOrch::update(sai_fdb_event_t type,
168
168
type, update.entry .mac .to_string ().c_str (),
169
169
entry->bv_id , bridge_port_id);
170
170
171
+
171
172
if (bridge_port_id &&
172
173
!m_portsOrch->getPortByBridgePortId (bridge_port_id, update.port ))
173
174
{
174
- SWSS_LOG_ERROR (" Failed to get port by bridge port ID 0x%" PRIx64 " ." ,
175
+ if (type == SAI_FDB_EVENT_FLUSHED)
176
+ {
177
+ /* in case of flush - can be ignored due to a race */
178
+ /* there are notifications about FDB FLUSH (syncd/sai_redis) on port which was already removed
179
+ * by orchagent as a result of removeVlanMember action (removeBridgePort) */
180
+ SWSS_LOG_INFO (" Flush ignored. Received event on bridge port ID 0x%" PRIx64 " which is not exist." ,
175
181
bridge_port_id);
182
+
183
+ } else {
184
+ SWSS_LOG_ERROR (" Failed to get port by bridge port ID 0x%" PRIx64 " ." ,
185
+ bridge_port_id);
186
+
187
+ }
176
188
return ;
177
189
}
178
190
@@ -263,7 +275,7 @@ void FdbOrch::update(sai_fdb_event_t type,
263
275
{
264
276
/* port added back to vlan before we receive delete
265
277
notification for flush from SAI. Re-add entry to SAI
266
- */
278
+ */
267
279
sai_attribute_t attr;
268
280
vector<sai_attribute_t > attrs;
269
281
@@ -286,7 +298,7 @@ void FdbOrch::update(sai_fdb_event_t type,
286
298
287
299
update.add = false ;
288
300
if (!update.port .m_alias .empty ())
289
- {
301
+ {
290
302
update.port .m_fdb_count --;
291
303
m_portsOrch->setPort (update.port .m_alias , update.port );
292
304
}
@@ -1036,8 +1048,8 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
1036
1048
attr.value .ipaddr = ipaddr;
1037
1049
attrs.push_back (attr);
1038
1050
}
1039
- else if (macUpdate
1040
- && (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED)
1051
+ else if (macUpdate
1052
+ && (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED)
1041
1053
&& (fdbData.origin != oldOrigin))
1042
1054
{
1043
1055
/* origin is changed from Remote-advertized to Local-provisioned
@@ -1051,7 +1063,7 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
1051
1063
attrs.push_back (attr);
1052
1064
}
1053
1065
1054
- if (macUpdate && (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED))
1066
+ if (macUpdate && (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED))
1055
1067
{
1056
1068
if ((fdbData.origin != oldOrigin)
1057
1069
|| ((oldType == " dynamic" ) && (oldType != fdbData.type )))
@@ -1062,7 +1074,7 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
1062
1074
}
1063
1075
}
1064
1076
1065
-
1077
+
1066
1078
if (macUpdate)
1067
1079
{
1068
1080
SWSS_LOG_INFO (" MAC-Update FDB %s in %s on from-%s:to-%s from-%s:to-%s origin-%d-to-%d" ,
@@ -1225,7 +1237,7 @@ bool FdbOrch::removeFdbEntry(const FdbEntry& entry, FdbOrigin origin)
1225
1237
(void )m_entries.erase (entry);
1226
1238
1227
1239
// Remove in StateDb
1228
- if (fdbData.origin != FDB_ORIGIN_VXLAN_ADVERTIZED)
1240
+ if (fdbData.origin != FDB_ORIGIN_VXLAN_ADVERTIZED)
1229
1241
{
1230
1242
m_fdbStateTable.del (key);
1231
1243
}
@@ -1245,7 +1257,7 @@ bool FdbOrch::removeFdbEntry(const FdbEntry& entry, FdbOrigin origin)
1245
1257
return true ;
1246
1258
}
1247
1259
1248
- void FdbOrch::deleteFdbEntryFromSavedFDB (const MacAddress &mac,
1260
+ void FdbOrch::deleteFdbEntryFromSavedFDB (const MacAddress &mac,
1249
1261
const unsigned short &vlanId, FdbOrigin origin, const string portName)
1250
1262
{
1251
1263
bool found=false ;
@@ -1268,7 +1280,7 @@ void FdbOrch::deleteFdbEntryFromSavedFDB(const MacAddress &mac,
1268
1280
if (iter->fdbData .origin == origin)
1269
1281
{
1270
1282
SWSS_LOG_INFO (" FDB entry found in saved fdb. deleting..."
1271
- " mac=%s vlan_id=0x%x origin:%d port:%s" ,
1283
+ " mac=%s vlan_id=0x%x origin:%d port:%s" ,
1272
1284
mac.to_string ().c_str (), vlanId, origin,
1273
1285
itr.first .c_str ());
1274
1286
saved_fdb_entries[itr.first ].erase (iter);
@@ -1280,7 +1292,7 @@ void FdbOrch::deleteFdbEntryFromSavedFDB(const MacAddress &mac,
1280
1292
{
1281
1293
SWSS_LOG_INFO (" FDB entry found in saved fdb, but Origin is "
1282
1294
" different mac=%s vlan_id=0x%x reqOrigin:%d "
1283
- " foundOrigin:%d port:%s, IGNORED" ,
1295
+ " foundOrigin:%d port:%s, IGNORED" ,
1284
1296
mac.to_string ().c_str (), vlanId, origin,
1285
1297
iter->fdbData .origin , itr.first .c_str ());
1286
1298
}
0 commit comments