From 2f2b0562db6be29086fb2052d07a8686ff0dfe33 Mon Sep 17 00:00:00 2001 From: zjswhhh Date: Mon, 28 Mar 2022 22:02:11 +0000 Subject: [PATCH] disable switchover measuring based on link prober --- src/common/MuxPortConfig.h | 11 +++++++++++ src/link_manager/LinkManagerStateMachine.cpp | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) 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/LinkManagerStateMachine.cpp b/src/link_manager/LinkManagerStateMachine.cpp index 002e1c40..9fdb5e17 100644 --- a/src/link_manager/LinkManagerStateMachine.cpp +++ b/src/link_manager/LinkManagerStateMachine.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 {