Skip to content

Commit

Permalink
[portorch]: Skip to create port if the lane set isn't available in AS…
Browse files Browse the repository at this point in the history
…IC (sonic-net#1923)

* Skip create port if the lane set isn't available in ASIC

Signed-off-by: Ze Gan <ganze718@gmail.com>

* Fix port breakout

Signed-off-by: Ze Gan <ganze718@gmail.com>

* Revert "Fix port breakout"

This reverts commit b6c62b9a9cf4c4b4ccc5ab82ddb9732c899f8dea.

* Revert "Skip create port if the lane set isn't available in ASIC"

This reverts commit f521da377ba8dbc888fdc9cb7156450079339824.

* Skip if add port failure

Signed-off-by: Ze Gan <ganze718@gmail.com>

* Fix bug

Signed-off-by: Ze Gan <ganze718@gmail.com>

* Skip if init port failure

Signed-off-by: Ze Gan <ganze718@gmail.com>
  • Loading branch information
Pterosaur authored Oct 12, 2021
1 parent ef6b5d4 commit fd0cafe
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
17 changes: 17 additions & 0 deletions orchagent/orch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,23 @@ task_process_status Orch::handleSaiCreateStatus(sai_api_t api, sai_status_t stat
exit(EXIT_FAILURE);
}
break;
case SAI_API_HOSTIF:
switch (status)
{
case SAI_STATUS_SUCCESS:
return task_success;
case SAI_STATUS_FAILURE:
/*
* Host interface maybe failed due to lane not available.
* In some scenarios, like SONiC virtual machine, the invalid lane may be not enabled by VM configuration,
* So just ignore the failure and report an error log.
*/
return task_ignore;
default:
SWSS_LOG_ERROR("Encountered failure in create operation, exiting orchagent, SAI API: %s, status: %s",
sai_serialize_api(api).c_str(), sai_serialize_status(status).c_str());
exit(EXIT_FAILURE);
}
default:
switch (status)
{
Expand Down
4 changes: 3 additions & 1 deletion orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2747,7 +2747,9 @@ void PortsOrch::doPortTask(Consumer &consumer)

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

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

0 comments on commit fd0cafe

Please sign in to comment.