From de99b0f181721076b1ea8112d9987a77d3fd393f Mon Sep 17 00:00:00 2001 From: junchao Date: Mon, 18 Oct 2021 10:13:18 +0800 Subject: [PATCH] Fix review comment --- orchagent/copporch.cpp | 14 +++++++------- orchagent/copporch.h | 4 ++-- orchagent/flexcounterorch.cpp | 2 +- orchagent/flow_counter/flow_counter_handler.cpp | 2 +- orchagent/flow_counter/flow_counter_handler.h | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/orchagent/copporch.cpp b/orchagent/copporch.cpp index 4d735f3d3d7..721905745b6 100644 --- a/orchagent/copporch.cpp +++ b/orchagent/copporch.cpp @@ -1152,7 +1152,7 @@ bool CoppOrch::bindTrapCounter(sai_object_id_t hostif_trap_id, sai_hostif_trap_t return false; } - if (m_trap_id_name_map.count(hostif_trap_id) > 0) + if (m_trap_obj_name_map.count(hostif_trap_id) > 0) { return true; } @@ -1186,16 +1186,16 @@ bool CoppOrch::bindTrapCounter(sai_object_id_t hostif_trap_id, sai_hostif_trap_t // Update FLEX_COUNTER table std::unordered_set counter_stats; - FlowCounterHandler::getGenericCounterIdList(counter_stats); + FlowCounterHandler::getGenericCounterStatIdList(counter_stats); m_trap_counter_manager.setCounterIdList(counter_id, CounterType::HOSTIF_TRAP, counter_stats); - m_trap_id_name_map.emplace(hostif_trap_id, trap_name); + m_trap_obj_name_map.emplace(hostif_trap_id, trap_name); return true; } void CoppOrch::unbindTrapCounter(sai_object_id_t hostif_trap_id) { - auto iter = m_trap_id_name_map.find(hostif_trap_id); - if (iter == m_trap_id_name_map.end()) + auto iter = m_trap_obj_name_map.find(hostif_trap_id); + if (iter == m_trap_obj_name_map.end()) { return; } @@ -1208,7 +1208,7 @@ void CoppOrch::unbindTrapCounter(sai_object_id_t hostif_trap_id) sai_deserialize_object_id(counter_oid_str, counter_id); m_trap_counter_manager.clearCounterIdList(counter_id); - // Remmove trap from COUNTERS_TRAP_NAME_MAP + // Remove trap from COUNTERS_TRAP_NAME_MAP m_counter_table->hdel("", iter->second); // Unbind generic counter to trap @@ -1224,7 +1224,7 @@ void CoppOrch::unbindTrapCounter(sai_object_id_t hostif_trap_id) // Remove generic counter FlowCounterHandler::removeGenericCounter(counter_id); - m_trap_id_name_map.erase(iter); + m_trap_obj_name_map.erase(iter); } void CoppOrch::generateHostIfTrapCounterIdList() diff --git a/orchagent/copporch.h b/orchagent/copporch.h index e1a17b61d36..b62c5950035 100644 --- a/orchagent/copporch.h +++ b/orchagent/copporch.h @@ -56,7 +56,7 @@ typedef std::map TrapIdHostIfTableMap; /* Trap group to trap ID attributes */ typedef std::map TrapGroupTrapIdAttribs; /* Trap OID to trap name*/ -typedef std::map TrapIdNameMap; +typedef std::map TrapObjectTrapNameMap; class CoppOrch : public Orch { @@ -73,7 +73,7 @@ class CoppOrch : public Orch TrapGroupHostIfMap m_trap_group_hostif_map; TrapIdHostIfTableMap m_trapid_hostif_table_map; TrapGroupTrapIdAttribs m_trap_group_trap_id_attrs; - TrapIdNameMap m_trap_id_name_map; + TrapObjectTrapNameMap m_trap_obj_name_map; std::shared_ptr m_counter_db; std::shared_ptr m_flex_db; diff --git a/orchagent/flexcounterorch.cpp b/orchagent/flexcounterorch.cpp index 1f51af9309a..b96759e77a1 100644 --- a/orchagent/flexcounterorch.cpp +++ b/orchagent/flexcounterorch.cpp @@ -31,7 +31,7 @@ unordered_map flexCounterGroupMap = { {"PORT", PORT_STAT_COUNTER_FLEX_COUNTER_GROUP}, {"PORT_RATES", PORT_RATE_COUNTER_FLEX_COUNTER_GROUP}, - {"PORT_BUFFER_DROP", PORT_BUFFER_DROP_STAT_FLEX_COUNTER_GROUP}, + {"PORT_BUFFER_DROP", PORT_STAT_COUNTER_FLEX_COUNTER_GROUP}, {"QUEUE", QUEUE_STAT_COUNTER_FLEX_COUNTER_GROUP}, {"PFCWD", PFC_WD_FLEX_COUNTER_GROUP}, {"QUEUE_WATERMARK", QUEUE_WATERMARK_STAT_COUNTER_FLEX_COUNTER_GROUP}, diff --git a/orchagent/flow_counter/flow_counter_handler.cpp b/orchagent/flow_counter/flow_counter_handler.cpp index 01f08dfce74..89f621fe7ba 100644 --- a/orchagent/flow_counter/flow_counter_handler.cpp +++ b/orchagent/flow_counter/flow_counter_handler.cpp @@ -40,7 +40,7 @@ bool FlowCounterHandler::removeGenericCounter(sai_object_id_t counter_id) return true; } -void FlowCounterHandler::getGenericCounterIdList(std::unordered_set& counter_stats) +void FlowCounterHandler::getGenericCounterStatIdList(std::unordered_set& counter_stats) { for (const auto& it: generic_counter_stat_ids) { diff --git a/orchagent/flow_counter/flow_counter_handler.h b/orchagent/flow_counter/flow_counter_handler.h index 58b3eb8a30b..1b6a8bbe2a9 100644 --- a/orchagent/flow_counter/flow_counter_handler.h +++ b/orchagent/flow_counter/flow_counter_handler.h @@ -12,5 +12,5 @@ class FlowCounterHandler public: static bool createGenericCounter(sai_object_id_t &counter_id); static bool removeGenericCounter(sai_object_id_t counter_id); - static void getGenericCounterIdList(std::unordered_set& counter_stats); + static void getGenericCounterStatIdList(std::unordered_set& counter_stats); };