From 7a1a4d3588099d3d5565504b7d2d61700ac32855 Mon Sep 17 00:00:00 2001 From: allas Date: Tue, 9 Mar 2021 15:40:57 +0200 Subject: [PATCH] reduce severity of log to info in case of flush on non-existing member Signed-off-by: allas --- orchagent/fdborch.cpp | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/orchagent/fdborch.cpp b/orchagent/fdborch.cpp index dc9efb444b..7640e98032 100644 --- a/orchagent/fdborch.cpp +++ b/orchagent/fdborch.cpp @@ -168,11 +168,24 @@ void FdbOrch::update(sai_fdb_event_t type, type, update.entry.mac.to_string().c_str(), entry->bv_id, bridge_port_id); + if (bridge_port_id && !m_portsOrch->getPortByBridgePortId(bridge_port_id, update.port)) { - SWSS_LOG_ERROR("Failed to get port by bridge port ID 0x%" PRIx64 ".", + if (type == SAI_FDB_EVENT_FLUSHED) + { + /* In case of flush - can be ignored due to a race. + There are notifications about FDB FLUSH (syncd/sai_redis) on port, + which was already removed by orchagent as a result of + removeVlanMember action (removeBridgePort) */ + SWSS_LOG_INFO("Flush event: Failed to get port by bridge port ID 0x%" PRIx64 ".", bridge_port_id); + + } else { + SWSS_LOG_ERROR("Failed to get port by bridge port ID 0x%" PRIx64 ".", + bridge_port_id); + + } return; } @@ -263,7 +276,7 @@ void FdbOrch::update(sai_fdb_event_t type, { /*port added back to vlan before we receive delete notification for flush from SAI. Re-add entry to SAI - */ + */ sai_attribute_t attr; vector attrs; @@ -286,7 +299,7 @@ void FdbOrch::update(sai_fdb_event_t type, update.add = false; if (!update.port.m_alias.empty()) - { + { update.port.m_fdb_count--; m_portsOrch->setPort(update.port.m_alias, update.port); } @@ -1036,8 +1049,8 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name, attr.value.ipaddr = ipaddr; attrs.push_back(attr); } - else if (macUpdate - && (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED) + else if (macUpdate + && (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED) && (fdbData.origin != oldOrigin)) { /* origin is changed from Remote-advertized to Local-provisioned @@ -1051,7 +1064,7 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name, attrs.push_back(attr); } - if (macUpdate && (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED)) + if (macUpdate && (oldOrigin == FDB_ORIGIN_VXLAN_ADVERTIZED)) { if ((fdbData.origin != oldOrigin) || ((oldType == "dynamic") && (oldType != fdbData.type))) @@ -1062,7 +1075,7 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name, } } - + if (macUpdate) { 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) (void)m_entries.erase(entry); // Remove in StateDb - if (fdbData.origin != FDB_ORIGIN_VXLAN_ADVERTIZED) + if (fdbData.origin != FDB_ORIGIN_VXLAN_ADVERTIZED) { m_fdbStateTable.del(key); } @@ -1245,7 +1258,7 @@ bool FdbOrch::removeFdbEntry(const FdbEntry& entry, FdbOrigin origin) return true; } -void FdbOrch::deleteFdbEntryFromSavedFDB(const MacAddress &mac, +void FdbOrch::deleteFdbEntryFromSavedFDB(const MacAddress &mac, const unsigned short &vlanId, FdbOrigin origin, const string portName) { bool found=false; @@ -1268,7 +1281,7 @@ void FdbOrch::deleteFdbEntryFromSavedFDB(const MacAddress &mac, if (iter->fdbData.origin == origin) { SWSS_LOG_INFO("FDB entry found in saved fdb. deleting..." - "mac=%s vlan_id=0x%x origin:%d port:%s", + "mac=%s vlan_id=0x%x origin:%d port:%s", mac.to_string().c_str(), vlanId, origin, itr.first.c_str()); saved_fdb_entries[itr.first].erase(iter); @@ -1280,7 +1293,7 @@ void FdbOrch::deleteFdbEntryFromSavedFDB(const MacAddress &mac, { SWSS_LOG_INFO("FDB entry found in saved fdb, but Origin is " "different mac=%s vlan_id=0x%x reqOrigin:%d " - "foundOrigin:%d port:%s, IGNORED", + "foundOrigin:%d port:%s, IGNORED", mac.to_string().c_str(), vlanId, origin, iter->fdbData.origin, itr.first.c_str()); }