Skip to content

Commit 315f16a

Browse files
committed
reduce severity of log to info in case of flush on non-existing member
Signed-off-by: allas <[email protected]>
1 parent 85ff67c commit 315f16a

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

orchagent/fdborch.cpp

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,23 @@ void FdbOrch::update(sai_fdb_event_t type,
168168
type, update.entry.mac.to_string().c_str(),
169169
entry->bv_id, bridge_port_id);
170170

171+
171172
if (bridge_port_id &&
172173
!m_portsOrch->getPortByBridgePortId(bridge_port_id, update.port))
173174
{
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.",
175181
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+
}
176188
return;
177189
}
178190

@@ -263,7 +275,7 @@ void FdbOrch::update(sai_fdb_event_t type,
263275
{
264276
/*port added back to vlan before we receive delete
265277
notification for flush from SAI. Re-add entry to SAI
266-
*/
278+
*/
267279
sai_attribute_t attr;
268280
vector<sai_attribute_t> attrs;
269281

@@ -286,7 +298,7 @@ void FdbOrch::update(sai_fdb_event_t type,
286298

287299
update.add = false;
288300
if (!update.port.m_alias.empty())
289-
{
301+
{
290302
update.port.m_fdb_count--;
291303
m_portsOrch->setPort(update.port.m_alias, update.port);
292304
}
@@ -1036,8 +1048,8 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
10361048
attr.value.ipaddr = ipaddr;
10371049
attrs.push_back(attr);
10381050
}
1039-
else if (macUpdate
1040-
&& (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED)
1051+
else if (macUpdate
1052+
&& (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED)
10411053
&& (fdbData.origin != oldOrigin))
10421054
{
10431055
/* origin is changed from Remote-advertized to Local-provisioned
@@ -1051,7 +1063,7 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
10511063
attrs.push_back(attr);
10521064
}
10531065

1054-
if (macUpdate && (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED))
1066+
if (macUpdate && (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED))
10551067
{
10561068
if ((fdbData.origin != oldOrigin)
10571069
|| ((oldType == "dynamic") && (oldType != fdbData.type)))
@@ -1062,7 +1074,7 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
10621074
}
10631075
}
10641076

1065-
1077+
10661078
if (macUpdate)
10671079
{
10681080
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)
12251237
(void)m_entries.erase(entry);
12261238

12271239
// Remove in StateDb
1228-
if (fdbData.origin != FDB_ORIGIN_VXLAN_ADVERTIZED)
1240+
if (fdbData.origin != FDB_ORIGIN_VXLAN_ADVERTIZED)
12291241
{
12301242
m_fdbStateTable.del(key);
12311243
}
@@ -1245,7 +1257,7 @@ bool FdbOrch::removeFdbEntry(const FdbEntry& entry, FdbOrigin origin)
12451257
return true;
12461258
}
12471259

1248-
void FdbOrch::deleteFdbEntryFromSavedFDB(const MacAddress &mac,
1260+
void FdbOrch::deleteFdbEntryFromSavedFDB(const MacAddress &mac,
12491261
const unsigned short &vlanId, FdbOrigin origin, const string portName)
12501262
{
12511263
bool found=false;
@@ -1268,7 +1280,7 @@ void FdbOrch::deleteFdbEntryFromSavedFDB(const MacAddress &mac,
12681280
if (iter->fdbData.origin == origin)
12691281
{
12701282
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",
12721284
mac.to_string().c_str(), vlanId, origin,
12731285
itr.first.c_str());
12741286
saved_fdb_entries[itr.first].erase(iter);
@@ -1280,7 +1292,7 @@ void FdbOrch::deleteFdbEntryFromSavedFDB(const MacAddress &mac,
12801292
{
12811293
SWSS_LOG_INFO("FDB entry found in saved fdb, but Origin is "
12821294
"different mac=%s vlan_id=0x%x reqOrigin:%d "
1283-
"foundOrigin:%d port:%s, IGNORED",
1295+
"foundOrigin:%d port:%s, IGNORED",
12841296
mac.to_string().c_str(), vlanId, origin,
12851297
iter->fdbData.origin, itr.first.c_str());
12861298
}

0 commit comments

Comments
 (0)