Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_stacks/rack.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 5,357 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
int32_t t; | int32_t t; | ||||
int32_t tt; | int32_t tt; | ||||
uint32_t ret_val; | uint32_t ret_val; | ||||
t = (tp->t_srtt + (tp->t_rttvar << 2)); | t = (tp->t_srtt + (tp->t_rttvar << 2)); | ||||
RACK_TCPT_RANGESET(tt, t * tcp_backoff[tp->t_rxtshift], | RACK_TCPT_RANGESET(tt, t * tcp_backoff[tp->t_rxtshift], | ||||
rack_persist_min, rack_persist_max, rack->r_ctl.timer_slop); | rack_persist_min, rack_persist_max, rack->r_ctl.timer_slop); | ||||
if (tp->t_rxtshift < TCP_MAXRXTSHIFT) | |||||
tp->t_rxtshift++; | |||||
rack->r_ctl.rc_hpts_flags |= PACE_TMR_PERSIT; | rack->r_ctl.rc_hpts_flags |= PACE_TMR_PERSIT; | ||||
ret_val = (uint32_t)tt; | ret_val = (uint32_t)tt; | ||||
return (ret_val); | return (ret_val); | ||||
} | } | ||||
static uint32_t | static uint32_t | ||||
rack_timer_start(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts, int sup_rack) | rack_timer_start(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts, int sup_rack) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 9,067 Lines • ▼ Show 20 Lines | if (rack->forced_ack) { | ||||
* A persist or keep-alive was forced out, update our | * A persist or keep-alive was forced out, update our | ||||
* min rtt time. Note we do not worry about lost | * min rtt time. Note we do not worry about lost | ||||
* retransmissions since KEEP-ALIVES and persists | * retransmissions since KEEP-ALIVES and persists | ||||
* are usually way long on times of sending (though | * are usually way long on times of sending (though | ||||
* if we were really paranoid or worried we could | * if we were really paranoid or worried we could | ||||
* at least use timestamps if available to validate). | * at least use timestamps if available to validate). | ||||
*/ | */ | ||||
rack->forced_ack = 0; | rack->forced_ack = 0; | ||||
if (tiwin == tp->snd_wnd) { | |||||
/* | |||||
* Only apply the RTT update if this is | |||||
* a response to our window probe. And that | |||||
* means the rwnd sent must match the current | |||||
* snd_wnd. If it does not, then we got a | |||||
* window update ack instead. | |||||
*/ | |||||
us_rtt = us_cts - rack->r_ctl.forced_ack_ts; | us_rtt = us_cts - rack->r_ctl.forced_ack_ts; | ||||
if (us_rtt == 0) | if (us_rtt == 0) | ||||
us_rtt = 1; | us_rtt = 1; | ||||
rack_apply_updated_usrtt(rack, us_rtt, us_cts); | rack_apply_updated_usrtt(rack, us_rtt, us_cts); | ||||
tcp_rack_xmit_timer(rack, us_rtt, 0, us_rtt, 3, NULL, 1); | tcp_rack_xmit_timer(rack, us_rtt, 0, us_rtt, 3, NULL, 1); | ||||
} | |||||
} | } | ||||
/* | /* | ||||
* This is the one exception case where we set the rack state | * This is the one exception case where we set the rack state | ||||
* always. All other times (timers etc) we must have a rack-state | * always. All other times (timers etc) we must have a rack-state | ||||
* set (so we assure we have done the checks above for SACK). | * set (so we assure we have done the checks above for SACK). | ||||
*/ | */ | ||||
rack->r_ctl.rc_rcvtime = cts; | rack->r_ctl.rc_rcvtime = cts; | ||||
if (rack->r_state != tp->t_state) | if (rack->r_state != tp->t_state) | ||||
▲ Show 20 Lines • Show All 6,384 Lines • Show Last 20 Lines |