Skip to content

Commit

Permalink
[pfcwd]: Clean up auxilary fields, port ID (sonic-net#431)
Browse files Browse the repository at this point in the history
Signed-off-by: marian-pritsak <marianp@mellanox.com>
  • Loading branch information
marian-pritsak authored and lguohan committed Jan 29, 2018
1 parent bc58daa commit bb366ed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions orchagent/pfcwdorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "redisapi.h"
#include "select.h"
#include "notifier.h"
#include "redisclient.h"

#define PFC_WD_ACTION "action"
#define PFC_WD_DETECTION_TIME "detection_time"
Expand Down Expand Up @@ -439,6 +440,9 @@ void PfcWdSwOrch<DropHandler, ForwardHandler>::unregisterFromWdDb(const Port& po
{
SWSS_LOG_ENTER();

string key = sai_serialize_object_id(port.m_port_id) + ":" + std::to_string(m_pollInterval);
m_pfcWdTable->del(key);

for (uint8_t i = 0; i < PFC_WD_TC_MAX; i++)
{
sai_object_id_t queueId = port.m_queue_ids[i];
Expand All @@ -447,6 +451,14 @@ void PfcWdSwOrch<DropHandler, ForwardHandler>::unregisterFromWdDb(const Port& po
// Unregister in syncd
m_pfcWdTable->del(key);
m_entryMap.erase(queueId);

// Clean up
RedisClient redisClient(PfcWdOrch<DropHandler, ForwardHandler>::getCountersDb().get());
string countersKey = COUNTERS_TABLE ":" + sai_serialize_object_id(queueId);
redisClient.hdel(countersKey, "PFC_WD_DETECTION_TIME");
redisClient.hdel(countersKey, "PFC_WD_RESTORATION_TIME");
redisClient.hdel(countersKey, "PFC_WD_ACTION");
redisClient.hdel(countersKey, "PFC_WD_STATUS");
}
}

Expand Down

0 comments on commit bb366ed

Please sign in to comment.