Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_sack.c
Show First 20 Lines • Show All 1,007 Lines • ▼ Show 20 Lines | |||||
* Check is FACK is beyond the rexmit of the leftmost hole. | * Check is FACK is beyond the rexmit of the leftmost hole. | ||||
* If yes, we restart sending from still existing holes, | * If yes, we restart sending from still existing holes, | ||||
* and adjust cwnd via the congestion control module. | * and adjust cwnd via the congestion control module. | ||||
*/ | */ | ||||
void | void | ||||
tcp_sack_lost_retransmission(struct tcpcb *tp, struct tcphdr *th) | tcp_sack_lost_retransmission(struct tcpcb *tp, struct tcphdr *th) | ||||
{ | { | ||||
struct sackhole *temp; | struct sackhole *temp; | ||||
uint32_t prev_cwnd; | |||||
if (IN_RECOVERY(tp->t_flags) && | if (IN_RECOVERY(tp->t_flags) && | ||||
SEQ_GT(tp->snd_fack, tp->snd_recover) && | SEQ_GT(tp->snd_fack, tp->snd_recover) && | ||||
((temp = TAILQ_FIRST(&tp->snd_holes)) != NULL) && | ((temp = TAILQ_FIRST(&tp->snd_holes)) != NULL) && | ||||
SEQ_GEQ(temp->rxmit, temp->end) && | SEQ_GEQ(temp->rxmit, temp->end) && | ||||
SEQ_GEQ(tp->snd_fack, temp->rxmit)) { | SEQ_GEQ(tp->snd_fack, temp->rxmit)) { | ||||
TCPSTAT_INC(tcps_sack_lostrexmt); | TCPSTAT_INC(tcps_sack_lostrexmt); | ||||
/* | /* | ||||
* Start retransmissions from the first hole, and | * Start retransmissions from the first hole, and | ||||
* subsequently all other remaining holes, including | * subsequently all other remaining holes, including | ||||
* those, which had been sent completely before. | * those, which had been sent completely before. | ||||
*/ | */ | ||||
tp->sackhint.nexthole = temp; | tp->sackhint.nexthole = temp; | ||||
TAILQ_FOREACH(temp, &tp->snd_holes, scblink) { | TAILQ_FOREACH(temp, &tp->snd_holes, scblink) { | ||||
if (SEQ_GEQ(tp->snd_fack, temp->rxmit) && | if (SEQ_GEQ(tp->snd_fack, temp->rxmit) && | ||||
SEQ_GEQ(temp->rxmit, temp->end)) | SEQ_GEQ(temp->rxmit, temp->end)) | ||||
temp->rxmit = temp->start; | temp->rxmit = temp->start; | ||||
} | } | ||||
/* | /* | ||||
* Remember the old ssthresh, to deduct the beta factor used | * Remember the old ssthresh, to deduct the beta factor used | ||||
* by the CC module. Finally, set cwnd to ssthresh just | * by the CC module. Finally, set cwnd to ssthresh just | ||||
* prior to invoking another cwnd reduction by the CC | * prior to invoking another cwnd reduction by the CC | ||||
* module, to not shrink it excessively. | * module, to not shrink it excessively. | ||||
*/ | */ | ||||
prev_cwnd = tp->snd_cwnd; | |||||
tp->snd_cwnd = tp->snd_ssthresh; | tp->snd_cwnd = tp->snd_ssthresh; | ||||
/* | /* | ||||
* Formally exit recovery, and let the CC module adjust | * Formally exit recovery, and let the CC module adjust | ||||
* ssthresh as intended. | * ssthresh as intended. | ||||
*/ | */ | ||||
EXIT_RECOVERY(tp->t_flags); | EXIT_RECOVERY(tp->t_flags); | ||||
cc_cong_signal(tp, th, CC_NDUPACK); | cc_cong_signal(tp, th, CC_NDUPACK); | ||||
/* | /* | ||||
Show All 10 Lines |