Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_input.c
Show First 20 Lines • Show All 2,813 Lines • ▼ Show 20 Lines | if (IN_FASTRECOVERY(tp->t_flags)) { | ||||
if (V_tcp_do_prr && to.to_flags & TOF_SACK) | if (V_tcp_do_prr && to.to_flags & TOF_SACK) | ||||
tcp_prr_partialack(tp, th); | tcp_prr_partialack(tp, th); | ||||
else | else | ||||
tcp_sack_partialack(tp, th); | tcp_sack_partialack(tp, th); | ||||
else | else | ||||
tcp_newreno_partial_ack(tp, th); | tcp_newreno_partial_ack(tp, th); | ||||
} else | } else | ||||
cc_post_recovery(tp, th); | cc_post_recovery(tp, th); | ||||
} else if (IN_CONGRECOVERY(tp->t_flags)) { | |||||
if (SEQ_LT(th->th_ack, tp->snd_recover)) { | |||||
if (V_tcp_do_prr) { | |||||
tp->sackhint.delivered_data = BYTES_THIS_ACK(tp, th); | |||||
tp->snd_fack = th->th_ack; | |||||
tcp_prr_partialack(tp, th); | |||||
} | } | ||||
} else | |||||
cc_post_recovery(tp, th); | |||||
} | |||||
/* | /* | ||||
* If we reach this point, ACK is not a duplicate, | * If we reach this point, ACK is not a duplicate, | ||||
* i.e., it ACKs something we sent. | * i.e., it ACKs something we sent. | ||||
*/ | */ | ||||
if (tp->t_flags & TF_NEEDSYN) { | if (tp->t_flags & TF_NEEDSYN) { | ||||
/* | /* | ||||
* T/TCP: Connection was half-synchronized, and our | * T/TCP: Connection was half-synchronized, and our | ||||
* SYN has been ACK'd (so connection is now fully | * SYN has been ACK'd (so connection is now fully | ||||
▲ Show 20 Lines • Show All 1,152 Lines • ▼ Show 20 Lines | if (pipe > tp->snd_ssthresh) { | ||||
snd_cnt = imin((tp->snd_ssthresh - pipe), limit); | snd_cnt = imin((tp->snd_ssthresh - pipe), limit); | ||||
} | } | ||||
snd_cnt = imax(snd_cnt, 0) / maxseg; | snd_cnt = imax(snd_cnt, 0) / maxseg; | ||||
/* | /* | ||||
* Send snd_cnt new data into the network in response to this ack. | * Send snd_cnt new data into the network in response to this ack. | ||||
* If there is going to be a SACK retransmission, adjust snd_cwnd | * If there is going to be a SACK retransmission, adjust snd_cwnd | ||||
* accordingly. | * accordingly. | ||||
*/ | */ | ||||
if (IN_FASTRECOVERY(tp->t_flags)) { | |||||
tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + | tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + | ||||
tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); | tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); | ||||
tp->t_flags |= TF_ACKNOW; | tp->t_flags |= TF_ACKNOW; | ||||
} else if (IN_CONGRECOVERY(tp->t_flags)) | |||||
tp->snd_cwnd = pipe - del_data + (snd_cnt * maxseg); | |||||
(void) tcp_output(tp); | (void) tcp_output(tp); | ||||
} | } | ||||
/* | /* | ||||
* On a partial ack arrives, force the retransmission of the | * On a partial ack arrives, force the retransmission of the | ||||
* next unacknowledged segment. Do not clear tp->t_dupacks. | * next unacknowledged segment. Do not clear tp->t_dupacks. | ||||
* By setting snd_nxt to ti_ack, this forces retransmission timer to | * By setting snd_nxt to ti_ack, this forces retransmission timer to | ||||
* be started again. | * be started again. | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |