Skip to content

Commit

Permalink
[pfcwd]: Log port name and queue index during storm detect/restore (s…
Browse files Browse the repository at this point in the history
…onic-net#429)

Signed-off-by: Sihui Han <sihan@microsoft.com>
  • Loading branch information
sihuihan88 committed Jan 18, 2018
1 parent 6634744 commit 26d89f2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
22 changes: 17 additions & 5 deletions orchagent/pfcactionhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,30 @@ PfcWdActionHandler::PfcWdActionHandler(sai_object_id_t port, sai_object_id_t que
{
SWSS_LOG_ENTER();

SWSS_LOG_NOTICE(
"PFC Watchdog detected PFC storm on queue 0x%lx port 0x%lx",
m_queue,
m_port);
Port p;
if (!gPortsOrch->getPort(port, p))
{
SWSS_LOG_ERROR("Unknown port id 0x%lx", port);
}
else
{
SWSS_LOG_NOTICE(
"PFC Watchdog detected PFC storm on port %s, queue index %d, queue id 0x%lx and port id 0x%lx.",
m_portAlias.c_str(),
m_queueId,
m_queue,
m_port);
}
}

PfcWdActionHandler::~PfcWdActionHandler(void)
{
SWSS_LOG_ENTER();

SWSS_LOG_NOTICE(
"Queue 0x%lx port 0x%lx restored from PFC storm.",
"PFC Watchdog strom restored on port %s, queue index %d, queue id 0x%lx and port id 0x%lx.",
m_portAlias.c_str(),
m_queueId,
m_queue,
m_port);
}
Expand Down
1 change: 1 addition & 0 deletions orchagent/pfcactionhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class PfcWdActionHandler
sai_object_id_t m_port = SAI_NULL_OBJECT_ID;
sai_object_id_t m_queue = SAI_NULL_OBJECT_ID;
uint8_t m_queueId = 0;
string m_portAlias;
shared_ptr<Table> m_countersTable = nullptr;
PfcWdHwStats m_hwStats;
};
Expand Down

0 comments on commit 26d89f2

Please sign in to comment.