Skip to content

Commit

Permalink
disable switchover measuring based on link prober (#49)
Browse files Browse the repository at this point in the history
### Description of PR
Summary:
Fixes # (issue)

Disable part of the feature introduced in #43. 

The link probing interval will NOT be decreased by default. Link prober state change events will still be posted in `LINK_PROBE_STATS|PORTNAME` in state db. 

sign-off: Jing Zhang [email protected]

### Type of change
- [x] New feature

### Approach
#### What is the motivation for this PR?
We need to reconsider the design of this feature. 

To be more specific, this is a special case of decreasing probing interval, it's for measurement purposes only. We still want to trigger the toggle in 300ms when pack loss happens. The negative count should be 30 instead of 3 when interval is decreased to 10ms.
  • Loading branch information
zjswhhh authored Apr 1, 2022
1 parent 898a655 commit 34a68d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/common/MuxPortConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -300,6 +309,8 @@ class MuxPortConfig
uint16_t mServerId;
Mode mMode = Manual;
PortCableType mPortCableType;

bool mEnableSwitchoverMeasurement = false;
};

} /* namespace common */
Expand Down
4 changes: 3 additions & 1 deletion src/link_manager/LinkManagerStateMachineActiveStandby.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 34a68d1

Please sign in to comment.