Skip to content

Commit

Permalink
Disable the feature that decreases link probe interval for measuring …
Browse files Browse the repository at this point in the history
…switch overhead #49 (#54)

### Description of PR
Can't cleanly cherry pick the commit from master branch: 
34a68d1 disable switchover measuring based on link prober (#49)

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 zhangjing@microsoft.com

### 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 256b01b commit c72fa2a
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 @@ -260,13 +260,24 @@ class MuxPortConfig
*/
inline uint32_t getDecreasedTimeoutIpv4_msec() const {return mMuxConfig.getDecreasedTimeoutIpv4_msec();};

/**
* @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;
boost::asio::ip::address mBladeIpv4Address;
std::array<uint8_t, ETHER_ADDR_LEN> mBladeMacAddress = {0, 0, 0, 0, 0, 0};
uint16_t mServerId;
Mode mMode = Manual;

bool mEnableSwitchoverMeasurement = false;
};

} /* namespace common */
Expand Down
4 changes: 3 additions & 1 deletion src/link_manager/LinkManagerStateMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@ void LinkManagerStateMachine::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 c72fa2a

Please sign in to comment.