void tcp_save_congestion_state(struct tcpcb *tp) { /* * Record connection's current states so that they could be * recovered, if this turns out to be a spurious retransmit. */ tp->snd_cwnd_prev = tp->snd_cwnd; tp->snd_wacked_prev = tp->snd_wacked; tp->snd_ssthresh_prev = tp->snd_ssthresh; tp->snd_recover_prev = tp->snd_recover; /* * State for Eifel response after spurious timeout retransmit * is detected. We save the current value of snd_max even if * we are called from fast retransmit code, so if RTO needs * rebase, it will be rebased using the RTT of segment that * is not sent during possible congestion. */ tp->snd_max_prev = tp->snd_max; if (IN_FASTRECOVERY(tp)) tp->rxt_flags |= TRXT_F_WASFRECOVERY; else tp->rxt_flags &= ~TRXT_F_WASFRECOVERY; if (tp->t_flags & TF_RCVD_TSTMP) { /* States for Eifel detection */ tp->t_rexmtTS = ticks; tp->rxt_flags |= TRXT_F_FIRSTACCACK; } #ifdef later tcp_sack_save_scoreboard(&tp->scb); #endif }
void tcp_save_congestion_state(struct tcpcb *tp) { tp->snd_cwnd_prev = tp->snd_cwnd; tp->snd_wacked_prev = tp->snd_wacked; tp->snd_ssthresh_prev = tp->snd_ssthresh; tp->snd_recover_prev = tp->snd_recover; tp->t_rxtcur_prev = tp->t_rxtcur; tp->t_srtt_prev = tp->t_srtt + (tcp_eifel_rtoinc << TCP_RTT_SHIFT); tp->t_rttvar_prev = tp->t_rttvar; tp->snd_max_prev = tp->snd_max; tp->rxt_flags &= ~TRXT_F_REBASERTO; if (IN_FASTRECOVERY(tp)) tp->rxt_flags |= TRXT_F_WASFRECOVERY; else tp->rxt_flags &= ~TRXT_F_WASFRECOVERY; if (tp->t_flags & TF_RCVD_TSTMP) { tp->t_rexmtTS = ticks; tp->rxt_flags |= TRXT_F_FIRSTACCACK; } #ifdef later tcp_sack_save_scoreboard(&tp->scb); #endif }