diff --git a/src/common/MuxPortConfig.h b/src/common/MuxPortConfig.h index 1bdca25c..a64db4ff 100644 --- a/src/common/MuxPortConfig.h +++ b/src/common/MuxPortConfig.h @@ -292,6 +292,15 @@ class MuxPortConfig */ inline void setPortCableType(PortCableType portCableType) { mPortCableType = portCableType; }; + /** + * @method ifEnableSwitchoverMeasurement + * + * @brief check if the feature that decreases link prober interval to measure switch overhead is enabled or not + * + * @return if switch overhead measurement feature is enabled + */ + inline bool ifEnableSwitchoverMeasurement() {return mEnableSwitchoverMeasurement;}; + private: MuxConfig &mMuxConfig; std::string mPortName; @@ -300,6 +309,8 @@ class MuxPortConfig uint16_t mServerId; Mode mMode = Manual; PortCableType mPortCableType; + + bool mEnableSwitchoverMeasurement = false; }; } /* namespace common */ diff --git a/src/link_manager/LinkManagerStateMachineActiveStandby.cpp b/src/link_manager/LinkManagerStateMachineActiveStandby.cpp index 5bac7f9c..38016056 100644 --- a/src/link_manager/LinkManagerStateMachineActiveStandby.cpp +++ b/src/link_manager/LinkManagerStateMachineActiveStandby.cpp @@ -337,7 +337,9 @@ void ActiveStandbyStateMachine::switchMuxState( mMuxStateMachine.setWaitStateCause(mux_state::WaitState::WaitStateCause::SwssUpdate); mMuxPortPtr->postMetricsEvent(Metrics::SwitchingStart, label); mMuxPortPtr->setMuxState(label); - mDecreaseIntervalFnPtr(mMuxPortConfig.getLinkWaitTimeout_msec()); + if(mMuxPortConfig.ifEnableSwitchoverMeasurement()) { + mDecreaseIntervalFnPtr(mMuxPortConfig.getLinkWaitTimeout_msec()); + } mDeadlineTimer.cancel(); startMuxWaitTimer(); } else {