Skip to content

Commit 17d0dae

Browse files
authored
[Fdborch] Fix for arm compilation (#1592)
1 parent 693a02c commit 17d0dae

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

orchagent/fdborch.cpp

+22-19
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ bool FdbOrch::storeFdbEntryState(const FdbUpdate& update)
109109
m_entries[entry] = fdbdata;
110110
SWSS_LOG_INFO("FdbOrch notification: mac %s was inserted in port %s into bv_id 0x%" PRIx64,
111111
entry.mac.to_string().c_str(), portName.c_str(), entry.bv_id);
112-
SWSS_LOG_INFO("m_entries size=%lu mac=%s port=0x%" PRIx64,
112+
SWSS_LOG_INFO("m_entries size=%zu mac=%s port=0x%" PRIx64,
113113
m_entries.size(), entry.mac.to_string().c_str(), m_entries[entry].bridge_port_id);
114114

115115
// Write to StateDb
@@ -213,29 +213,31 @@ void FdbOrch::update(sai_fdb_event_t type,
213213
}
214214
case SAI_FDB_EVENT_AGED:
215215
{
216-
SWSS_LOG_INFO("Received AGE event for bvid=%lx mac=%s port=%lx", entry->bv_id, update.entry.mac.to_string().c_str(), bridge_port_id);
216+
SWSS_LOG_INFO("Received AGE event for bvid=0x%" PRIx64 " mac=%s port=0x%" PRIx64,
217+
entry->bv_id, update.entry.mac.to_string().c_str(), bridge_port_id);
217218

218219
if (!m_portsOrch->getPort(entry->bv_id, vlan))
219220
{
220-
SWSS_LOG_NOTICE("FdbOrch AGE notification: Failed to locate vlan port from bv_id 0x%lx", entry->bv_id);
221+
SWSS_LOG_NOTICE("FdbOrch AGE notification: Failed to locate vlan port from bv_id 0x%" PRIx64, entry->bv_id);
221222
}
222223

223224
auto existing_entry = m_entries.find(update.entry);
224225
// we don't have such entries
225226
if (existing_entry == m_entries.end())
226227
{
227-
SWSS_LOG_INFO("FdbOrch AGE notification: mac %s is not present in bv_id 0x%lx bp 0x%lx",
228+
SWSS_LOG_INFO("FdbOrch AGE notification: mac %s is not present in bv_id 0x%" PRIx64 " bp 0x%" PRIx64,
228229
update.entry.mac.to_string().c_str(), entry->bv_id, bridge_port_id);
229230
break;
230231
}
231232

232233
if (existing_entry->second.bridge_port_id != bridge_port_id)
233234
{
234-
SWSS_LOG_INFO("FdbOrch AGE notification: Stale aging event received for mac-bv_id %s-0x%lx with bp=0x%lx existing bp=0x%lx", update.entry.mac.to_string().c_str(), entry->bv_id, bridge_port_id, existing_entry->second.bridge_port_id);
235+
SWSS_LOG_INFO("FdbOrch AGE notification: Stale aging event received for mac-bv_id %s-0x%" PRIx64 " with bp=0x%" PRIx64 " existing bp=0x%" PRIx64,
236+
update.entry.mac.to_string().c_str(), entry->bv_id, bridge_port_id, existing_entry->second.bridge_port_id);
235237
// We need to get the port for bridge-port in existing fdb
236238
if (!m_portsOrch->getPortByBridgePortId(existing_entry->second.bridge_port_id, update.port))
237239
{
238-
SWSS_LOG_INFO("FdbOrch AGE notification: Failed to get port by bridge port ID 0x%lx", existing_entry->second.bridge_port_id);
240+
SWSS_LOG_INFO("FdbOrch AGE notification: Failed to get port by bridge port ID 0x%" PRIx64, existing_entry->second.bridge_port_id);
239241
}
240242
// dont return, let it delete just to bring SONiC and SAI in sync
241243
// return;
@@ -305,23 +307,24 @@ void FdbOrch::update(sai_fdb_event_t type,
305307
Port port_old;
306308
auto existing_entry = m_entries.find(update.entry);
307309

308-
SWSS_LOG_INFO("Received MOVE event for bvid=%lx mac=%s port=%lx", entry->bv_id, update.entry.mac.to_string().c_str(), bridge_port_id);
310+
SWSS_LOG_INFO("Received MOVE event for bvid=0x%" PRIx64 " mac=%s port=0x%" PRIx64,
311+
entry->bv_id, update.entry.mac.to_string().c_str(), bridge_port_id);
309312

310313
if (!m_portsOrch->getPort(entry->bv_id, vlan))
311314
{
312-
SWSS_LOG_ERROR("FdbOrch MOVE notification: Failed to locate vlan port from bv_id 0x%lx", entry->bv_id);
315+
SWSS_LOG_ERROR("FdbOrch MOVE notification: Failed to locate vlan port from bv_id 0x%" PRIx64, entry->bv_id);
313316
return;
314317
}
315318

316319
// We should already have such entry
317320
if (existing_entry == m_entries.end())
318321
{
319-
SWSS_LOG_WARN("FdbOrch MOVE notification: mac %s is not found in bv_id 0x%lx",
322+
SWSS_LOG_WARN("FdbOrch MOVE notification: mac %s is not found in bv_id 0x%" PRIx64,
320323
update.entry.mac.to_string().c_str(), entry->bv_id);
321324
}
322325
else if (!m_portsOrch->getPortByBridgePortId(existing_entry->second.bridge_port_id, port_old))
323326
{
324-
SWSS_LOG_ERROR("FdbOrch MOVE notification: Failed to get port by bridge port ID 0x%lx", existing_entry->second.bridge_port_id);
327+
SWSS_LOG_ERROR("FdbOrch MOVE notification: Failed to get port by bridge port ID 0x%" PRIx64, existing_entry->second.bridge_port_id);
325328
return;
326329
}
327330

@@ -880,13 +883,13 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
880883
Port port;
881884

882885
SWSS_LOG_ENTER();
883-
SWSS_LOG_INFO("mac=%s bv_id=0x%lx port_name=%s type=%s origin=%d",
886+
SWSS_LOG_INFO("mac=%s bv_id=0x%" PRIx64 " port_name=%s type=%s origin=%d",
884887
entry.mac.to_string().c_str(), entry.bv_id, port_name.c_str(),
885888
fdbData.type.c_str(), fdbData.origin);
886889

887890
if (!m_portsOrch->getPort(entry.bv_id, vlan))
888891
{
889-
SWSS_LOG_NOTICE("addFdbEntry: Failed to locate vlan port from bv_id 0x%lx", entry.bv_id);
892+
SWSS_LOG_NOTICE("addFdbEntry: Failed to locate vlan port from bv_id 0x%" PRIx64, entry.bv_id);
890893
return false;
891894
}
892895

@@ -927,7 +930,7 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
927930

928931
if (!m_portsOrch->getPortByBridgePortId(it->second.bridge_port_id, oldPort))
929932
{
930-
SWSS_LOG_ERROR("Existing port 0x%lx details not found", it->second.bridge_port_id);
933+
SWSS_LOG_ERROR("Existing port 0x%" PRIx64 " details not found", it->second.bridge_port_id);
931934
return false;
932935
}
933936

@@ -1153,18 +1156,18 @@ bool FdbOrch::removeFdbEntry(const FdbEntry& entry, FdbOrigin origin)
11531156

11541157
SWSS_LOG_ENTER();
11551158

1156-
SWSS_LOG_INFO("FdbOrch RemoveFDBEntry: mac=%s bv_id=0x%lx origin %d", entry.mac.to_string().c_str(), entry.bv_id, origin);
1159+
SWSS_LOG_INFO("FdbOrch RemoveFDBEntry: mac=%s bv_id=0x%" PRIx64 "origin %d", entry.mac.to_string().c_str(), entry.bv_id, origin);
11571160

11581161
if (!m_portsOrch->getPort(entry.bv_id, vlan))
11591162
{
1160-
SWSS_LOG_NOTICE("FdbOrch notification: Failed to locate vlan port from bv_id 0x%lx", entry.bv_id);
1163+
SWSS_LOG_NOTICE("FdbOrch notification: Failed to locate vlan port from bv_id 0x%" PRIx64, entry.bv_id);
11611164
return false;
11621165
}
11631166

11641167
auto it= m_entries.find(entry);
11651168
if (it == m_entries.end())
11661169
{
1167-
SWSS_LOG_INFO("FdbOrch RemoveFDBEntry: FDB entry isn't found. mac=%s bv_id=0x%lx", entry.mac.to_string().c_str(), entry.bv_id);
1170+
SWSS_LOG_INFO("FdbOrch RemoveFDBEntry: FDB entry isn't found. mac=%s bv_id=0x%" PRIx64, entry.mac.to_string().c_str(), entry.bv_id);
11681171

11691172
/* check whether the entry is in the saved fdb, if so delete it from there. */
11701173
deleteFdbEntryFromSavedFDB(entry.mac, vlan.m_vlan_info.vlan_id, origin);
@@ -1174,7 +1177,7 @@ bool FdbOrch::removeFdbEntry(const FdbEntry& entry, FdbOrigin origin)
11741177
FdbData fdbData = it->second;
11751178
if (!m_portsOrch->getPortByBridgePortId(fdbData.bridge_port_id, port))
11761179
{
1177-
SWSS_LOG_NOTICE("FdbOrch RemoveFDBEntry: Failed to locate port from bridge_port_id 0x%lx", fdbData.bridge_port_id);
1180+
SWSS_LOG_NOTICE("FdbOrch RemoveFDBEntry: Failed to locate port from bridge_port_id 0x%" PRIx64, fdbData.bridge_port_id);
11781181
return false;
11791182
}
11801183

@@ -1207,12 +1210,12 @@ bool FdbOrch::removeFdbEntry(const FdbEntry& entry, FdbOrigin origin)
12071210
status = sai_fdb_api->remove_fdb_entry(&fdb_entry);
12081211
if (status != SAI_STATUS_SUCCESS)
12091212
{
1210-
SWSS_LOG_ERROR("FdbOrch RemoveFDBEntry: Failed to remove FDB entry. mac=%s, bv_id=0x%lx",
1213+
SWSS_LOG_ERROR("FdbOrch RemoveFDBEntry: Failed to remove FDB entry. mac=%s, bv_id=0x%" PRIx64,
12111214
entry.mac.to_string().c_str(), entry.bv_id);
12121215
return true; //FIXME: it should be based on status. Some could be retried. some not
12131216
}
12141217

1215-
SWSS_LOG_INFO("Removed mac=%s bv_id=0x%lx port:%s",
1218+
SWSS_LOG_INFO("Removed mac=%s bv_id=0x%" PRIx64 " port:%s",
12161219
entry.mac.to_string().c_str(), entry.bv_id, port.m_alias.c_str());
12171220

12181221
port.m_fdb_count--;

0 commit comments

Comments
 (0)