Skip to content

Commit 8cf355d

Browse files
authored
Mux state order change (#1902)
*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.
1 parent 7a0ec8f commit 8cf355d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

orchagent/muxorch.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -394,15 +394,14 @@ void MuxCable::setState(string new_state)
394394
SWSS_LOG_NOTICE("[%s] Set MUX state from %s to %s", mux_name_.c_str(),
395395
muxStateValToString.at(state_).c_str(), new_state.c_str());
396396

397-
// Update HW Mux cable state anyways
398-
mux_cb_orch_->updateMuxState(mux_name_, new_state);
399-
400397
MuxState ns = muxStateStringToVal.at(new_state);
401398

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

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

432+
mux_cb_orch_->updateMuxState(mux_name_, new_state);
433433
return;
434434
}
435435

0 commit comments

Comments
 (0)