diff --git a/orchagent/portsorch.cpp b/orchagent/portsorch.cpp index 48c04b956d..61cf0df979 100644 --- a/orchagent/portsorch.cpp +++ b/orchagent/portsorch.cpp @@ -1339,7 +1339,7 @@ string PortsOrch::getPriorityGroupWatermarkFlexCounterTableKey(string key) return string(PG_WATERMARK_STAT_COUNTER_FLEX_COUNTER_GROUP) + ":" + key; } -bool PortsOrch::initPort(const string &alias, const set &lane_set) +bool PortsOrch::initPort(const string &alias, const set &lane_set, uint32_t speed, int an, string fec_mode) { SWSS_LOG_ENTER(); @@ -1359,6 +1359,12 @@ bool PortsOrch::initPort(const string &alias, const set &lane_set) p.m_index = static_cast(m_portList.size()); // TODO: Assume no deletion of physical port p.m_port_id = id; + if (!fec_mode.empty()) + if (fec_mode_map.find(fec_mode) != fec_mode_map.end()) + p.m_fec_mode = fec_mode_map[fec_mode]; + p.m_speed = speed; + if (an != -1) + p.m_autoneg = an; /* Initialize the port and create corresponding host interface */ if (initializePort(p)) @@ -1672,7 +1678,7 @@ void PortsOrch::doPortTask(Consumer &consumer) if (port_created) { - if (!initPort(get<0>(it->second), it->first)) + if (!initPort(get<0>(it->second), it->first, get<1>(it->second), get<2>(it->second), get<3>(it->second))) { throw runtime_error("PortsOrch initialization failure."); } diff --git a/orchagent/portsorch.h b/orchagent/portsorch.h index 5eb8558e28..ac05098c73 100644 --- a/orchagent/portsorch.h +++ b/orchagent/portsorch.h @@ -158,7 +158,7 @@ class PortsOrch : public Orch, public Subject bool addPort(const set &lane_set, uint32_t speed, int an=0, string fec=""); bool removePort(sai_object_id_t port_id); - bool initPort(const string &alias, const set &lane_set); + bool initPort(const string &alias, const set &lane_set, uint32_t speed, int an, string fec_mode); bool setPortAdminStatus(sai_object_id_t id, bool up); bool getPortAdminStatus(sai_object_id_t id, bool& up);