diff --git a/orchagent/port/porthlpr.cpp b/orchagent/port/porthlpr.cpp index 5b4cc0f32f..3fe8a18d77 100644 --- a/orchagent/port/porthlpr.cpp +++ b/orchagent/port/porthlpr.cpp @@ -119,7 +119,7 @@ static const std::unordered_map portRoleMap = { PORT_ROLE_DPC, Port::Role::Dpc } }; -static const std::unordered_map linkEventDampingAlgorithmMap = +static const std::unordered_map g_linkEventDampingAlgorithmMap = { { "disabled", SAI_REDIS_LINK_EVENT_DAMPING_ALGORITHM_DISABLED }, { "aied", SAI_REDIS_LINK_EVENT_DAMPING_ALGORITHM_AIED } @@ -240,7 +240,7 @@ std::string PortHelper::getAdminStatusStr(const PortConfig &port) const return this->getFieldValueStr(port, PORT_ADMIN_STATUS); } -std::string PortHelper::getDampingAlgoStr(const PortConfig &port) const +std::string PortHelper::getDampingAlgorithm(const PortConfig &port) const { return this->getFieldValueStr(port, PORT_DAMPING_ALGO); } @@ -771,8 +771,8 @@ bool PortHelper::parsePortLinkEventDampingAlgorithm(PortConfig &port, const std: return false; } - const auto &cit = linkEventDampingAlgorithmMap.find(value); - if (cit == linkEventDampingAlgorithmMap.cend()) + const auto &cit = g_linkEventDampingAlgorithmMap.find(value); + if (cit == g_linkEventDampingAlgorithmMap.cend()) { SWSS_LOG_ERROR("Failed to parse field(%s): invalid value(%s)", field.c_str(), value.c_str()); return false; diff --git a/orchagent/port/porthlpr.h b/orchagent/port/porthlpr.h index 643ef0a230..8d7854848e 100644 --- a/orchagent/port/porthlpr.h +++ b/orchagent/port/porthlpr.h @@ -26,7 +26,7 @@ class PortHelper final std::string getLearnModeStr(const PortConfig &port) const; std::string getLinkTrainingStr(const PortConfig &port) const; std::string getAdminStatusStr(const PortConfig &port) const; - std::string getDampingAlgoStr(const PortConfig &port) const; + std::string getDampingAlgoritm(const PortConfig &port) const; bool parsePortConfig(PortConfig &port) const; bool validatePortConfig(PortConfig &port) const; diff --git a/orchagent/portsorch.cpp b/orchagent/portsorch.cpp index df8b7b48f7..6d2f01a836 100755 --- a/orchagent/portsorch.cpp +++ b/orchagent/portsorch.cpp @@ -3003,7 +3003,8 @@ task_process_status PortsOrch::setPortLinkTraining(const Port &port, bool state) } ReturnCode PortsOrch::setPortLinkEventDampingAlgorithm(Port &port, - sai_redis_link_event_damping_algorithm_t &link_event_damping_algorithm) { + sai_redis_link_event_damping_algorithm_t &link_event_damping_algorithm) +{ SWSS_LOG_ENTER(); sai_attribute_t attr; attr.id = SAI_REDIS_PORT_ATTR_LINK_EVENT_DAMPING_ALGORITHM; @@ -3915,7 +3916,7 @@ void PortsOrch::doPortTask(Consumer &consumer) { SWSS_LOG_ERROR( "Failed to set port %s link event damping algorithm to %s", - p.m_alias.c_str(), m_portHlpr.getDampingAlgoStr(pCfg).c_str() + p.m_alias.c_str(), m_portHlpr.getDampingAlgorithm(pCfg).c_str() ); it = taskMap.erase(it); continue; @@ -3926,7 +3927,7 @@ void PortsOrch::doPortTask(Consumer &consumer) SWSS_LOG_NOTICE( "Set port %s link event damping algorithm to %s", - p.m_alias.c_str(), m_portHlpr.getDampingAlgoStr(pCfg).c_str() + p.m_alias.c_str(), m_portHlpr.getDampingAlgorithm(pCfg).c_str() ); } }