Skip to content

Commit d2fc67c

Browse files
Fix review comment
1 parent 4e3a0ad commit d2fc67c

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

orchagent/copporch.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ bool CoppOrch::bindTrapCounter(sai_object_id_t hostif_trap_id, sai_hostif_trap_t
11561156
return false;
11571157
}
11581158

1159-
if (m_trap_id_name_map.count(hostif_trap_id) > 0)
1159+
if (m_trap_obj_name_map.count(hostif_trap_id) > 0)
11601160
{
11611161
return true;
11621162
}
@@ -1190,16 +1190,16 @@ bool CoppOrch::bindTrapCounter(sai_object_id_t hostif_trap_id, sai_hostif_trap_t
11901190

11911191
// Update FLEX_COUNTER table
11921192
std::unordered_set<std::string> counter_stats;
1193-
FlowCounterHandler::getGenericCounterIdList(counter_stats);
1193+
FlowCounterHandler::getGenericCounterStatIdList(counter_stats);
11941194
m_trap_counter_manager.setCounterIdList(counter_id, CounterType::HOSTIF_TRAP, counter_stats);
1195-
m_trap_id_name_map.emplace(hostif_trap_id, trap_name);
1195+
m_trap_obj_name_map.emplace(hostif_trap_id, trap_name);
11961196
return true;
11971197
}
11981198

11991199
void CoppOrch::unbindTrapCounter(sai_object_id_t hostif_trap_id)
12001200
{
1201-
auto iter = m_trap_id_name_map.find(hostif_trap_id);
1202-
if (iter == m_trap_id_name_map.end())
1201+
auto iter = m_trap_obj_name_map.find(hostif_trap_id);
1202+
if (iter == m_trap_obj_name_map.end())
12031203
{
12041204
return;
12051205
}
@@ -1212,7 +1212,7 @@ void CoppOrch::unbindTrapCounter(sai_object_id_t hostif_trap_id)
12121212
sai_deserialize_object_id(counter_oid_str, counter_id);
12131213
m_trap_counter_manager.clearCounterIdList(counter_id);
12141214

1215-
// Remmove trap from COUNTERS_TRAP_NAME_MAP
1215+
// Remove trap from COUNTERS_TRAP_NAME_MAP
12161216
m_counter_table->hdel("", iter->second);
12171217

12181218
// Unbind generic counter to trap
@@ -1228,7 +1228,7 @@ void CoppOrch::unbindTrapCounter(sai_object_id_t hostif_trap_id)
12281228
// Remove generic counter
12291229
FlowCounterHandler::removeGenericCounter(counter_id);
12301230

1231-
m_trap_id_name_map.erase(iter);
1231+
m_trap_obj_name_map.erase(iter);
12321232
}
12331233

12341234
void CoppOrch::generateHostIfTrapCounterIdList()

orchagent/copporch.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ typedef std::map<sai_hostif_trap_type_t, sai_object_id_t> TrapIdHostIfTableMap;
5656
/* Trap group to trap ID attributes */
5757
typedef std::map<std::string, TrapIdAttribs> TrapGroupTrapIdAttribs;
5858
/* Trap OID to trap name*/
59-
typedef std::map<sai_object_id_t, std::string> TrapIdNameMap;
59+
typedef std::map<sai_object_id_t, std::string> TrapObjectTrapNameMap;
6060

6161
class CoppOrch : public Orch
6262
{
@@ -73,7 +73,7 @@ class CoppOrch : public Orch
7373
TrapGroupHostIfMap m_trap_group_hostif_map;
7474
TrapIdHostIfTableMap m_trapid_hostif_table_map;
7575
TrapGroupTrapIdAttribs m_trap_group_trap_id_attrs;
76-
TrapIdNameMap m_trap_id_name_map;
76+
TrapObjectTrapNameMap m_trap_obj_name_map;
7777

7878
std::shared_ptr<DBConnector> m_counter_db;
7979
std::shared_ptr<DBConnector> m_flex_db;

orchagent/flexcounterorch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ unordered_map<string, string> flexCounterGroupMap =
3131
{
3232
{"PORT", PORT_STAT_COUNTER_FLEX_COUNTER_GROUP},
3333
{"PORT_RATES", PORT_RATE_COUNTER_FLEX_COUNTER_GROUP},
34-
{"PORT_BUFFER_DROP", PORT_BUFFER_DROP_STAT_FLEX_COUNTER_GROUP},
34+
{"PORT_BUFFER_DROP", PORT_STAT_COUNTER_FLEX_COUNTER_GROUP},
3535
{"QUEUE", QUEUE_STAT_COUNTER_FLEX_COUNTER_GROUP},
3636
{"PFCWD", PFC_WD_FLEX_COUNTER_GROUP},
3737
{"QUEUE_WATERMARK", QUEUE_WATERMARK_STAT_COUNTER_FLEX_COUNTER_GROUP},

orchagent/flow_counter/flow_counter_handler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ bool FlowCounterHandler::removeGenericCounter(sai_object_id_t counter_id)
4040
return true;
4141
}
4242

43-
void FlowCounterHandler::getGenericCounterIdList(std::unordered_set<std::string>& counter_stats)
43+
void FlowCounterHandler::getGenericCounterStatIdList(std::unordered_set<std::string>& counter_stats)
4444
{
4545
for (const auto& it: generic_counter_stat_ids)
4646
{

orchagent/flow_counter/flow_counter_handler.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ class FlowCounterHandler
1212
public:
1313
static bool createGenericCounter(sai_object_id_t &counter_id);
1414
static bool removeGenericCounter(sai_object_id_t counter_id);
15-
static void getGenericCounterIdList(std::unordered_set<std::string>& counter_stats);
15+
static void getGenericCounterStatIdList(std::unordered_set<std::string>& counter_stats);
1616
};

0 commit comments

Comments
 (0)