From 26d89f26f8a0e01c0199699028424653c8da33a4 Mon Sep 17 00:00:00 2001 From: sihuihan88 Date: Thu, 18 Jan 2018 10:55:03 -0800 Subject: [PATCH] [pfcwd]: Log port name and queue index during storm detect/restore (#429) Signed-off-by: Sihui Han --- orchagent/pfcactionhandler.cpp | 22 +++++++++++++++++----- orchagent/pfcactionhandler.h | 1 + 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/orchagent/pfcactionhandler.cpp b/orchagent/pfcactionhandler.cpp index 32ba8f922eb3..10287680b7bb 100644 --- a/orchagent/pfcactionhandler.cpp +++ b/orchagent/pfcactionhandler.cpp @@ -38,10 +38,20 @@ 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) @@ -49,7 +59,9 @@ 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); } diff --git a/orchagent/pfcactionhandler.h b/orchagent/pfcactionhandler.h index 905ca76d4bdf..d1450d50f3aa 100644 --- a/orchagent/pfcactionhandler.h +++ b/orchagent/pfcactionhandler.h @@ -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 m_countersTable = nullptr; PfcWdHwStats m_hwStats; };