Skip to content

Commit

Permalink
use TCP slow timer tick as defined
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmoon authored and hhaim committed Mar 10, 2021
1 parent acea0e3 commit c1125f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/44bsd/tcp_subr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -884,8 +884,7 @@ void CTcpPerThreadCtx::init_sch_rampup(profile_id_t profile_id){
}

int CTcpTunableCtx::convert_slow_sec_to_ticks(uint16_t sec) {
// tcp_slow_fast_ratio + 1 for the slow_tcp bug (tick starts at 0, ratio at 1)
float sec_to_ticks = 1000.0f / ((tcp_slow_fast_ratio + 1) * TCP_TIMER_TICK_FAST_MS);
float sec_to_ticks = 1000.0f / TCP_TIMER_TICK_SLOW_MS;
return int(round(float(sec) * sec_to_ticks));
}

Expand Down
5 changes: 2 additions & 3 deletions src/44bsd/tcp_var.h
Original file line number Diff line number Diff line change
Expand Up @@ -1728,11 +1728,10 @@ class CEmulAppApiUdpImpl : public CEmulAppApi {

inline void CTcpFlow::on_tick(){
on_fast_tick();
m_tick++;
if (m_tick == m_pctx->m_tunable_ctx.tcp_slow_fast_ratio) {
m_tick=0;
on_slow_tick();
}else{
m_tick++;
m_tick=0;
}
}

Expand Down

0 comments on commit c1125f3

Please sign in to comment.