@@ -636,29 +636,23 @@ bool FdbOrch::getPort(const MacAddress& mac, uint16_t vlan, Port& port)
636
636
return false ;
637
637
}
638
638
639
- sai_fdb_entry_t entry;
640
- entry.switch_id = gSwitchId ;
641
- memcpy (entry.mac_address , mac.getMac (), sizeof (sai_mac_t ));
639
+ FdbEntry entry;
640
+ entry.mac = mac;
642
641
entry.bv_id = port.m_vlan_info .vlan_oid ;
643
642
644
- sai_attribute_t attr;
645
- attr.id = SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID;
646
-
647
- sai_status_t status = sai_fdb_api->get_fdb_entry_attribute (&entry, 1 , &attr);
648
- if (status != SAI_STATUS_SUCCESS)
643
+ auto it = m_entries.find (entry);
644
+ if (it == m_entries.end ())
649
645
{
650
- SWSS_LOG_ERROR (" Failed to get bridge port ID for FDB entry %s, rv:%d" ,
651
- mac.to_string ().c_str (), status);
652
- task_process_status handle_status = handleSaiGetStatus (SAI_API_FDB, status);
653
- if (handle_status != task_process_status::task_success)
654
- {
655
- return false ;
656
- }
646
+ // This message is now expected in many cases since orchagent will process events such as
647
+ // learning new neighbor entries prior to updating the m_entries FDB cache.
648
+ SWSS_LOG_INFO (" Failed to get cached bridge port ID for FDB entry %s" ,
649
+ mac.to_string ().c_str ());
650
+ return false ;
657
651
}
658
652
659
- if (!m_portsOrch->getPortByBridgePortId (attr. value . oid , port))
653
+ if (!m_portsOrch->getPortByBridgePortId (it-> second . bridge_port_id , port))
660
654
{
661
- SWSS_LOG_ERROR (" Failed to get port by bridge port ID 0x%" PRIx64, attr. value . oid );
655
+ SWSS_LOG_ERROR (" Failed to get port by bridge port ID 0x%" PRIx64, it-> second . bridge_port_id );
662
656
return false ;
663
657
}
664
658
0 commit comments