Skip to content

Commit fd0cafe

Browse files
authored
[portorch]: Skip to create port if the lane set isn't available in ASIC (#1923)
* Skip create port if the lane set isn't available in ASIC Signed-off-by: Ze Gan <[email protected]> * Fix port breakout Signed-off-by: Ze Gan <[email protected]> * Revert "Fix port breakout" This reverts commit b6c62b9. * Revert "Skip create port if the lane set isn't available in ASIC" This reverts commit f521da3. * Skip if add port failure Signed-off-by: Ze Gan <[email protected]> * Fix bug Signed-off-by: Ze Gan <[email protected]> * Skip if init port failure Signed-off-by: Ze Gan <[email protected]>
1 parent ef6b5d4 commit fd0cafe

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

orchagent/orch.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,23 @@ task_process_status Orch::handleSaiCreateStatus(sai_api_t api, sai_status_t stat
705705
exit(EXIT_FAILURE);
706706
}
707707
break;
708+
case SAI_API_HOSTIF:
709+
switch (status)
710+
{
711+
case SAI_STATUS_SUCCESS:
712+
return task_success;
713+
case SAI_STATUS_FAILURE:
714+
/*
715+
* Host interface maybe failed due to lane not available.
716+
* In some scenarios, like SONiC virtual machine, the invalid lane may be not enabled by VM configuration,
717+
* So just ignore the failure and report an error log.
718+
*/
719+
return task_ignore;
720+
default:
721+
SWSS_LOG_ERROR("Encountered failure in create operation, exiting orchagent, SAI API: %s, status: %s",
722+
sai_serialize_api(api).c_str(), sai_serialize_status(status).c_str());
723+
exit(EXIT_FAILURE);
724+
}
708725
default:
709726
switch (status)
710727
{

orchagent/portsorch.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -2747,7 +2747,9 @@ void PortsOrch::doPortTask(Consumer &consumer)
27472747

27482748
if (!initPort(get<0>(it->second), get<5>(it->second), get<4>(it->second), it->first))
27492749
{
2750-
throw runtime_error("PortsOrch initialization failure.");
2750+
// Failure has been recorded in initPort
2751+
it++;
2752+
continue;
27512753
}
27522754

27532755
initPortSupportedSpeeds(get<0>(it->second), m_portListLaneMap[it->first]);

0 commit comments

Comments
 (0)