Skip to content

Commit

Permalink
Mux state order change (sonic-net#1902)
Browse files Browse the repository at this point in the history
*Orchagent sometimes took >50ms to finish the state change operations. This change is to update notification to xcvrd (via APPDB) after execution is complete. This enables xcvrd to simulate the direction change after orchagent has completed the state transition.
  • Loading branch information
prsunny authored Sep 13, 2021
1 parent 7a0ec8f commit 8cf355d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions orchagent/muxorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,15 +394,14 @@ void MuxCable::setState(string new_state)
SWSS_LOG_NOTICE("[%s] Set MUX state from %s to %s", mux_name_.c_str(),
muxStateValToString.at(state_).c_str(), new_state.c_str());

// Update HW Mux cable state anyways
mux_cb_orch_->updateMuxState(mux_name_, new_state);

MuxState ns = muxStateStringToVal.at(new_state);

auto it = muxStateTransition.find(make_pair(state_, ns));

if (it == muxStateTransition.end())
{
// Update HW Mux cable state anyways
mux_cb_orch_->updateMuxState(mux_name_, new_state);
SWSS_LOG_ERROR("State transition from %s to %s is not-handled ",
muxStateValToString.at(state_).c_str(), new_state.c_str());
return;
Expand Down Expand Up @@ -430,6 +429,7 @@ void MuxCable::setState(string new_state)
st_chg_failed_ = false;
SWSS_LOG_INFO("Changed state to %s", new_state.c_str());

mux_cb_orch_->updateMuxState(mux_name_, new_state);
return;
}

Expand Down

0 comments on commit 8cf355d

Please sign in to comment.