From f448a22ac38850889b07d69bfe601a5eaf575c92 Mon Sep 17 00:00:00 2001 From: Tyler Li Date: Tue, 10 Apr 2018 02:52:44 -0700 Subject: [PATCH 1/2] FdbOrch getPort failed because fdb_entry have no switch_id --- orchagent/fdborch.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/orchagent/fdborch.cpp b/orchagent/fdborch.cpp index 64dea1b23d5..d55d1a724ea 100644 --- a/orchagent/fdborch.cpp +++ b/orchagent/fdborch.cpp @@ -168,6 +168,7 @@ bool FdbOrch::getPort(const MacAddress& mac, uint16_t vlan, Port& port) } sai_fdb_entry_t entry; + entry.switch_id = gSwitchId; memcpy(entry.mac_address, mac.getMac(), sizeof(sai_mac_t)); entry.bv_id = port.m_vlan_info.vlan_oid; @@ -423,6 +424,7 @@ bool FdbOrch::removeFdbEntry(const FdbEntry& entry) sai_status_t status; sai_fdb_entry_t fdb_entry; + fdb_entry.switch_id = gSwitchId; memcpy(fdb_entry.mac_address, entry.mac.getMac(), sizeof(sai_mac_t)); fdb_entry.bv_id = entry.bv_id; From 7f81135c00ddd1e83461325f2f0dd4d909627b58 Mon Sep 17 00:00:00 2001 From: Tyler Li Date: Mon, 16 Apr 2018 00:08:07 -0700 Subject: [PATCH 2/2] [crmorch]: neighbor used counter increased twice --- orchagent/neighorch.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/orchagent/neighorch.cpp b/orchagent/neighorch.cpp index 4ddedaa080e..961fc1f4147 100644 --- a/orchagent/neighorch.cpp +++ b/orchagent/neighorch.cpp @@ -395,16 +395,16 @@ bool NeighOrch::addNeighbor(NeighborEntry neighborEntry, MacAddress macAddress) } m_intfsOrch->decreaseRouterIntfsRefCount(alias); - return false; - } + if (neighbor_entry.ip_address.addr_family == SAI_IP_ADDR_FAMILY_IPV4) + { + gCrmOrch->decCrmResUsedCounter(CrmResourceType::CRM_IPV4_NEIGHBOR); + } + else + { + gCrmOrch->decCrmResUsedCounter(CrmResourceType::CRM_IPV6_NEIGHBOR); + } - if (neighbor_entry.ip_address.addr_family == SAI_IP_ADDR_FAMILY_IPV4) - { - gCrmOrch->incCrmResUsedCounter(CrmResourceType::CRM_IPV4_NEIGHBOR); - } - else - { - gCrmOrch->incCrmResUsedCounter(CrmResourceType::CRM_IPV6_NEIGHBOR); + return false; } } else