Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_input.c
Show First 20 Lines • Show All 504 Lines • ▼ Show 20 Lines | cc_post_recovery(struct tcpcb *tp, struct tcphdr *th) | ||||
/* XXXLAS: KASSERT that we're in recovery? */ | /* XXXLAS: KASSERT that we're in recovery? */ | ||||
if (CC_ALGO(tp)->post_recovery != NULL) { | if (CC_ALGO(tp)->post_recovery != NULL) { | ||||
tp->ccv->curack = th->th_ack; | tp->ccv->curack = th->th_ack; | ||||
CC_ALGO(tp)->post_recovery(tp->ccv); | CC_ALGO(tp)->post_recovery(tp->ccv); | ||||
} | } | ||||
/* XXXLAS: EXIT_RECOVERY ? */ | /* XXXLAS: EXIT_RECOVERY ? */ | ||||
tp->t_bytes_acked = 0; | tp->t_bytes_acked = 0; | ||||
tp->sackhint.recover_fs = 0; | |||||
} | } | ||||
/* | /* | ||||
* Indicate whether this ack should be delayed. We can delay the ack if | * Indicate whether this ack should be delayed. We can delay the ack if | ||||
* following conditions are met: | * following conditions are met: | ||||
* - There is no delayed ack timer in progress. | * - There is no delayed ack timer in progress. | ||||
* - Our last ack wasn't a 0-sized window. We never want to delay | * - Our last ack wasn't a 0-sized window. We never want to delay | ||||
* the ack that opens up a 0-sized window. | * the ack that opens up a 0-sized window. | ||||
▲ Show 20 Lines • Show All 2,063 Lines • ▼ Show 20 Lines | if (SEQ_LEQ(th->th_ack, tp->snd_una)) { | ||||
* will be 0. Pipe is the amount of data we | * will be 0. Pipe is the amount of data we | ||||
* estimate to be in the network. | * estimate to be in the network. | ||||
*/ | */ | ||||
del_data = tp->sackhint.delivered_data; | del_data = tp->sackhint.delivered_data; | ||||
pipe = (tp->snd_nxt - tp->snd_fack) + | pipe = (tp->snd_nxt - tp->snd_fack) + | ||||
tp->sackhint.sack_bytes_rexmit; | tp->sackhint.sack_bytes_rexmit; | ||||
tp->sackhint.prr_delivered += del_data; | tp->sackhint.prr_delivered += del_data; | ||||
if (pipe > tp->snd_ssthresh) { | if (pipe > tp->snd_ssthresh) { | ||||
if (tp->sackhint.recover_fs == 0) | |||||
tp->sackhint.recover_fs = | |||||
max(1, tp->snd_nxt - tp->snd_una); | |||||
snd_cnt = (tp->sackhint.prr_delivered * | snd_cnt = (tp->sackhint.prr_delivered * | ||||
tp->snd_ssthresh / | tp->snd_ssthresh / | ||||
tp->sackhint.recover_fs) + | tp->sackhint.recover_fs) + | ||||
1 - tp->sackhint.sack_bytes_rexmit; | 1 - tp->sackhint.sack_bytes_rexmit; | ||||
} else { | } else { | ||||
if (V_tcp_do_prr_conservative) | if (V_tcp_do_prr_conservative) | ||||
limit = tp->sackhint.prr_delivered - | limit = tp->sackhint.prr_delivered - | ||||
tp->sackhint.sack_bytes_rexmit; | tp->sackhint.sack_bytes_rexmit; | ||||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | if (SEQ_LEQ(th->th_ack, tp->snd_una)) { | ||||
} | } | ||||
/* Congestion signal before ack. */ | /* Congestion signal before ack. */ | ||||
cc_cong_signal(tp, th, CC_NDUPACK); | cc_cong_signal(tp, th, CC_NDUPACK); | ||||
cc_ack_received(tp, th, nsegs, | cc_ack_received(tp, th, nsegs, | ||||
CC_DUPACK); | CC_DUPACK); | ||||
tcp_timer_activate(tp, TT_REXMT, 0); | tcp_timer_activate(tp, TT_REXMT, 0); | ||||
tp->t_rtttime = 0; | tp->t_rtttime = 0; | ||||
if (V_tcp_do_prr) { | if (V_tcp_do_prr) { | ||||
/* | /* | ||||
* snd_ssthresh is already updated by | * snd_ssthresh is already updated by | ||||
* cc_cong_signal. | * cc_cong_signal. | ||||
*/ | */ | ||||
tp->sackhint.prr_delivered = 0; | tp->sackhint.prr_delivered = 0; | ||||
tp->sackhint.sack_bytes_rexmit = 0; | tp->sackhint.sack_bytes_rexmit = 0; | ||||
if (!(tp->sackhint.recover_fs = tp->snd_nxt - tp->snd_una)) | tp->sackhint.recover_fs = max(1, | ||||
tp->sackhint.recover_fs = 1; | tp->snd_nxt - tp->snd_una); | ||||
} | } | ||||
if (tp->t_flags & TF_SACK_PERMIT) { | if (tp->t_flags & TF_SACK_PERMIT) { | ||||
TCPSTAT_INC( | TCPSTAT_INC( | ||||
tcps_sack_recovery_episode); | tcps_sack_recovery_episode); | ||||
tp->snd_recover = tp->snd_nxt; | tp->snd_recover = tp->snd_nxt; | ||||
tp->snd_cwnd = maxseg; | tp->snd_cwnd = maxseg; | ||||
(void) tp->t_fb->tfb_tcp_output(tp); | (void) tp->t_fb->tfb_tcp_output(tp); | ||||
goto drop; | goto drop; | ||||
▲ Show 20 Lines • Show All 1,349 Lines • Show Last 20 Lines |