diff --git a/orchagent/fdborch.cpp b/orchagent/fdborch.cpp index 91ae4dbd9581..7963e074e17a 100644 --- a/orchagent/fdborch.cpp +++ b/orchagent/fdborch.cpp @@ -636,29 +636,23 @@ bool FdbOrch::getPort(const MacAddress& mac, uint16_t vlan, Port& port) return false; } - sai_fdb_entry_t entry; - entry.switch_id = gSwitchId; - memcpy(entry.mac_address, mac.getMac(), sizeof(sai_mac_t)); + FdbEntry entry; + entry.mac = mac; entry.bv_id = port.m_vlan_info.vlan_oid; - sai_attribute_t attr; - attr.id = SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID; - - sai_status_t status = sai_fdb_api->get_fdb_entry_attribute(&entry, 1, &attr); - if (status != SAI_STATUS_SUCCESS) + auto it = m_entries.find(entry); + if (it == m_entries.end()) { - SWSS_LOG_ERROR("Failed to get bridge port ID for FDB entry %s, rv:%d", - mac.to_string().c_str(), status); - task_process_status handle_status = handleSaiGetStatus(SAI_API_FDB, status); - if (handle_status != task_process_status::task_success) - { - return false; - } + // This message is now expected in many cases since orchagent will process events such as + // learning new neighbor entries prior to updating the m_entries FDB cache. + SWSS_LOG_INFO("Failed to get cached bridge port ID for FDB entry %s", + mac.to_string().c_str()); + return false; } - if (!m_portsOrch->getPortByBridgePortId(attr.value.oid, port)) + if (!m_portsOrch->getPortByBridgePortId(it->second.bridge_port_id, port)) { - SWSS_LOG_ERROR("Failed to get port by bridge port ID 0x%" PRIx64, attr.value.oid); + SWSS_LOG_ERROR("Failed to get port by bridge port ID 0x%" PRIx64, it->second.bridge_port_id); return false; } diff --git a/orchagent/muxorch.cpp b/orchagent/muxorch.cpp index 07b015616195..8c807341c545 100644 --- a/orchagent/muxorch.cpp +++ b/orchagent/muxorch.cpp @@ -534,6 +534,8 @@ bool MuxCable::isIpInSubnet(IpAddress ip) bool MuxCable::nbrHandler(bool enable, bool update_rt) { + SWSS_LOG_NOTICE("Processing neighbors for mux %s, enable %d, state %d", + mux_name_.c_str(), enable, state_); if (enable) { return nbr_handler_->enable(update_rt); @@ -553,6 +555,8 @@ bool MuxCable::nbrHandler(bool enable, bool update_rt) void MuxCable::updateNeighbor(NextHopKey nh, bool add) { + SWSS_LOG_NOTICE("Processing update on neighbor %s for mux %s, add %d, state %d", + nh.ip_address.to_string().c_str(), mux_name_.c_str(), add, state_); sai_object_id_t tnh = mux_orch_->getNextHopTunnelId(MUX_TUNNEL, peer_ip4_); nbr_handler_->update(nh, tnh, add, state_); if (add)