From 6dba3161c79fff23332a0fa8933e0f464e4dec10 Mon Sep 17 00:00:00 2001 From: pavel-shirshov Date: Thu, 5 Jul 2018 16:47:58 -0700 Subject: [PATCH] Create empty ready lists for buffers by default (#535) * Pospone QueueMap initialization until activation of counters * Generate queue maps only for front panel ports * Create empty buffer lists by default --- orchagent/bufferorch.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/orchagent/bufferorch.cpp b/orchagent/bufferorch.cpp index f8093ee306..ef77aa862a 100644 --- a/orchagent/bufferorch.cpp +++ b/orchagent/bufferorch.cpp @@ -58,9 +58,20 @@ void BufferOrch::initBufferReadyList(Table& table) { SWSS_LOG_ENTER(); + // init all ports with an empty list + for (const auto& it: gPortsOrch->getAllPorts()) + { + if (it.second.m_type == Port::PHY) + { + const auto& port_name = it.first; + m_port_ready_list_ref[port_name] = {}; + } + } + std::vector keys; table.getKeys(keys); + // populate the lists with buffer configuration information for (const auto& key: keys) { m_ready_list[key] = false; @@ -88,7 +99,9 @@ bool BufferOrch::isPortReady(const std::string& port_name) const const auto it = m_port_ready_list_ref.find(port_name); if (it == m_port_ready_list_ref.cend()) { - return false; + // we got a port name which wasn't in our gPortsOrch->getAllPorts() list + // so make the port ready, because we don't have any buffer configuration for it + return true; } const auto& list_of_keys = it->second;