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