Skip to content

Commit 3e7d385

Browse files
allas-nvidiaraphaelt-nvidia
authored andcommitted
reduce severity of log to info in case of flush on non-existing member (sonic-net#1669)
- What I did Reduced severity of log to info in case of flush on non-existing member. - Why I did it There is a race in the infra which can cause the scenario: FDB FLUSH notification is received on port which was already removed. - How I verified it > sudo config vlan add 3 > sudo config vlan member add 3 Ethernet8 > sudo config vlan member del 3 Ethernet8 Signed-off-by: allas <[email protected]>
1 parent 62312d4 commit 3e7d385

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

orchagent/fdborch.cpp

+24-11
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,24 @@ 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,
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 ".",
175182
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+
}
176189
return;
177190
}
178191

@@ -263,7 +276,7 @@ void FdbOrch::update(sai_fdb_event_t type,
263276
{
264277
/*port added back to vlan before we receive delete
265278
notification for flush from SAI. Re-add entry to SAI
266-
*/
279+
*/
267280
sai_attribute_t attr;
268281
vector<sai_attribute_t> attrs;
269282

@@ -286,7 +299,7 @@ void FdbOrch::update(sai_fdb_event_t type,
286299

287300
update.add = false;
288301
if (!update.port.m_alias.empty())
289-
{
302+
{
290303
update.port.m_fdb_count--;
291304
m_portsOrch->setPort(update.port.m_alias, update.port);
292305
}
@@ -1036,8 +1049,8 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
10361049
attr.value.ipaddr = ipaddr;
10371050
attrs.push_back(attr);
10381051
}
1039-
else if (macUpdate
1040-
&& (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED)
1052+
else if (macUpdate
1053+
&& (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED)
10411054
&& (fdbData.origin != oldOrigin))
10421055
{
10431056
/* origin is changed from Remote-advertized to Local-provisioned
@@ -1051,7 +1064,7 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
10511064
attrs.push_back(attr);
10521065
}
10531066

1054-
if (macUpdate && (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED))
1067+
if (macUpdate && (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED))
10551068
{
10561069
if ((fdbData.origin != oldOrigin)
10571070
|| ((oldType == "dynamic") && (oldType != fdbData.type)))
@@ -1062,7 +1075,7 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
10621075
}
10631076
}
10641077

1065-
1078+
10661079
if (macUpdate)
10671080
{
10681081
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)
12251238
(void)m_entries.erase(entry);
12261239

12271240
// Remove in StateDb
1228-
if (fdbData.origin != FDB_ORIGIN_VXLAN_ADVERTIZED)
1241+
if (fdbData.origin != FDB_ORIGIN_VXLAN_ADVERTIZED)
12291242
{
12301243
m_fdbStateTable.del(key);
12311244
}
@@ -1245,7 +1258,7 @@ bool FdbOrch::removeFdbEntry(const FdbEntry& entry, FdbOrigin origin)
12451258
return true;
12461259
}
12471260

1248-
void FdbOrch::deleteFdbEntryFromSavedFDB(const MacAddress &mac,
1261+
void FdbOrch::deleteFdbEntryFromSavedFDB(const MacAddress &mac,
12491262
const unsigned short &vlanId, FdbOrigin origin, const string portName)
12501263
{
12511264
bool found=false;
@@ -1268,7 +1281,7 @@ void FdbOrch::deleteFdbEntryFromSavedFDB(const MacAddress &mac,
12681281
if (iter->fdbData.origin == origin)
12691282
{
12701283
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",
12721285
mac.to_string().c_str(), vlanId, origin,
12731286
itr.first.c_str());
12741287
saved_fdb_entries[itr.first].erase(iter);
@@ -1280,7 +1293,7 @@ void FdbOrch::deleteFdbEntryFromSavedFDB(const MacAddress &mac,
12801293
{
12811294
SWSS_LOG_INFO("FDB entry found in saved fdb, but Origin is "
12821295
"different mac=%s vlan_id=0x%x reqOrigin:%d "
1283-
"foundOrigin:%d port:%s, IGNORED",
1296+
"foundOrigin:%d port:%s, IGNORED",
12841297
mac.to_string().c_str(), vlanId, origin,
12851298
iter->fdbData.origin, itr.first.c_str());
12861299
}

0 commit comments

Comments
 (0)