Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_sack.c
| Show First 20 Lines • Show All 1,000 Lines • ▼ Show 20 Lines | if ((V_tcp_do_newsack) && | ||||
| * and also don't create a hole, if only | * and also don't create a hole, if only | ||||
| * the ACK for a FIN is outstanding. | * the ACK for a FIN is outstanding. | ||||
| */ | */ | ||||
| tcp_seq highdata = tp->snd_max; | tcp_seq highdata = tp->snd_max; | ||||
| if (tp->t_flags & TF_SENTFIN) | if (tp->t_flags & TF_SENTFIN) | ||||
| highdata--; | highdata--; | ||||
| highdata = SEQ_MIN(highdata, tp->snd_recover); | highdata = SEQ_MIN(highdata, tp->snd_recover); | ||||
| if (SEQ_LT(th->th_ack, highdata)) { | if (SEQ_LT(th->th_ack, highdata)) { | ||||
| tp->snd_fack = th->th_ack; | tp->snd_fack = SEQ_MAX(th->th_ack, tp->snd_fack); | ||||
| if ((temp = tcp_sackhole_insert(tp, SEQ_MAX(th->th_ack, | if ((temp = tcp_sackhole_insert(tp, SEQ_MAX(th->th_ack, | ||||
| highdata - maxseg), highdata, NULL)) != NULL) { | highdata - maxseg), highdata, NULL)) != NULL) { | ||||
| tp->sackhint.hole_bytes += | tp->sackhint.hole_bytes += | ||||
| temp->end - temp->start; | temp->end - temp->start; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| (void) tcp_output(tp); | (void) tcp_output(tp); | ||||
| ▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt) | ||||
| } | } | ||||
| return (hole); | return (hole); | ||||
| } | } | ||||
| /* | /* | ||||
| * After a timeout, the SACK list may be rebuilt. This SACK information | * After a timeout, the SACK list may be rebuilt. This SACK information | ||||
| * should be used to avoid retransmitting SACKed data. This function | * should be used to avoid retransmitting SACKed data. This function | ||||
| * traverses the SACK list to see if snd_nxt should be moved forward. | * traverses the SACK list to see if snd_nxt should be moved forward. | ||||
| * In addition, cwnd will be inflated by the sacked bytes traversed when | |||||
| * moving snd_nxt forward. This prevents a traffic burst after the final | |||||
| * full ACK, and also keeps ACKs coming back. | |||||
| */ | */ | ||||
| void | int | ||||
| tcp_sack_adjust(struct tcpcb *tp) | tcp_sack_adjust(struct tcpcb *tp) | ||||
| { | { | ||||
| int sacked = 0; | |||||
| struct sackhole *p, *cur = TAILQ_FIRST(&tp->snd_holes); | struct sackhole *p, *cur = TAILQ_FIRST(&tp->snd_holes); | ||||
| INP_WLOCK_ASSERT(tptoinpcb(tp)); | INP_WLOCK_ASSERT(tptoinpcb(tp)); | ||||
| if (cur == NULL) { | if (cur == NULL) { | ||||
| /* No holes */ | /* No holes */ | ||||
| return; | return (0); | ||||
cc: no need `()` | |||||
Not Done Inline ActionsIsn't style.9 saying: Values in return statements should be enclosed in parentheses. tuexen: Isn't `style.9` saying:
```
Values in return statements should be enclosed in parentheses.
``` | |||||
Done Inline ActionsYou are right, other tcp files also has the () in return values. I must have kept some old memory about the style. cc: You are right, other tcp files also has the `()` in return values. I must have kept some old… | |||||
| } | } | ||||
| if (SEQ_GEQ(tp->snd_nxt, tp->snd_fack)) { | if (SEQ_GEQ(tp->snd_nxt, tp->snd_fack)) { | ||||
| /* We're already beyond any SACKed blocks */ | /* We're already beyond any SACKed blocks */ | ||||
| return; | return (tp->sackhint.sacked_bytes); | ||||
Not Done Inline Actionsno need () cc: no need `()` | |||||
| } | } | ||||
| /*- | /* | ||||
| * Two cases for which we want to advance snd_nxt: | * Two cases for which we want to advance snd_nxt: | ||||
| * i) snd_nxt lies between end of one hole and beginning of another | * i) snd_nxt lies between end of one hole and beginning of another | ||||
| * ii) snd_nxt lies between end of last hole and snd_fack | * ii) snd_nxt lies between end of last hole and snd_fack | ||||
| */ | */ | ||||
| while ((p = TAILQ_NEXT(cur, scblink)) != NULL) { | while ((p = TAILQ_NEXT(cur, scblink)) != NULL) { | ||||
| if (SEQ_LT(tp->snd_nxt, cur->end)) { | if (SEQ_LT(tp->snd_nxt, cur->end)) { | ||||
| return; | return (sacked); | ||||
Not Done Inline Actionsno need () cc: no need `()` | |||||
| } | } | ||||
| sacked += p->start - cur->end; | |||||
| if (SEQ_GEQ(tp->snd_nxt, p->start)) { | if (SEQ_GEQ(tp->snd_nxt, p->start)) { | ||||
| cur = p; | cur = p; | ||||
| } else { | } else { | ||||
| tp->snd_nxt = p->start; | tp->snd_nxt = p->start; | ||||
| return; | return (sacked); | ||||
Not Done Inline Actionsno need () cc: no need `()` | |||||
| } | } | ||||
| } | } | ||||
| if (SEQ_LT(tp->snd_nxt, cur->end)) { | if (SEQ_LT(tp->snd_nxt, cur->end)) { | ||||
| return; | return (sacked); | ||||
Not Done Inline Actionsno need () cc: no need `()` | |||||
| } | } | ||||
| tp->snd_nxt = tp->snd_fack; | tp->snd_nxt = tp->snd_fack; | ||||
| return (tp->sackhint.sacked_bytes); | |||||
Not Done Inline Actionsno need () cc: no need `()` | |||||
| } | } | ||||
| /* | /* | ||||
| * Lost Retransmission Detection | * Lost Retransmission Detection | ||||
| * 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. | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines | |||||
no need ()