From 2761376bf8cf88e28548a386acfd66105696f778 Mon Sep 17 00:00:00 2001 From: Ze Gan Date: Wed, 22 Sep 2021 15:36:28 +0000 Subject: [PATCH] Skip create port if the lane set isn't available in ASIC Signed-off-by: Ze Gan --- orchagent/portsorch.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/orchagent/portsorch.cpp b/orchagent/portsorch.cpp index 68028e2c21..5917808bb4 100755 --- a/orchagent/portsorch.cpp +++ b/orchagent/portsorch.cpp @@ -2737,6 +2737,19 @@ void PortsOrch::doPortTask(Consumer &consumer) for (auto it = m_lanesAliasSpeedMap.begin(); it != m_lanesAliasSpeedMap.end();) { + if (m_portListLaneMap.find(it->first) == m_portListLaneMap.end()) + { + string tmp_lane_str = ""; + for (auto s : lane_set) + { + tmp_lane_str += to_string(s) + " "; + } + tmp_lane_str = tmp_lane_str.substr(0, tmp_lane_str.size() - 1); + + SWSS_LOG_WARN("The lane set %s isn't available in ASIC", tmp_lane_str.c_str()); + continue; + } + if (m_portListLaneMap.find(it->first) == m_portListLaneMap.end()) { if (!addPort(it->first, get<1>(it->second), get<2>(it->second), get<3>(it->second)))