diff options
author | ps <ps@FreeBSD.org> | 2005-05-11 21:37:42 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2005-05-11 21:37:42 +0000 |
commit | 0ee231720168f91505019116179aa59a3f939618 (patch) | |
tree | 136eaa5e8df38eb44a216776b146e7f2be9d17d5 /sys/netinet/tcp_reass.c | |
parent | b2be2c6b08ec2d5c2b4b24ddd94f0f026c865ff9 (diff) | |
download | FreeBSD-src-0ee231720168f91505019116179aa59a3f939618.zip FreeBSD-src-0ee231720168f91505019116179aa59a3f939618.tar.gz |
When looking for the next hole to retransmit from the scoreboard,
or to compute the total retransmitted bytes in this sack recovery
episode, the scoreboard is traversed. While in sack recovery, this
traversal occurs on every call to tcp_output(), every dupack and
every partial ack. The scoreboard could potentially get quite large,
making this traversal expensive.
This change optimizes this by storing hints (for the next hole to
retransmit and the total retransmitted bytes in this sack recovery
episode) reducing the complexity to find these values from O(n) to
constant time.
The debug code that sanity checks the hints against the computed
value will be removed eventually.
Submitted by: Mohan Srinivasan, Noritoshi Demizu, Raja Mukerji.
Diffstat (limited to 'sys/netinet/tcp_reass.c')
-rw-r--r-- | sys/netinet/tcp_reass.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 93e45e1..c3b562f 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -1843,7 +1843,6 @@ trimthenstep6: if (tp->sack_enable && IN_FASTRECOVERY(tp)) { int data_in_pipe; - int sacked, lost_not_rexmitted; /* * Compute the amount of data in flight first. @@ -1851,9 +1850,8 @@ trimthenstep6: * we have less than 1/2 the original window's * worth of data in flight. */ - sacked = tcp_sacked_bytes(tp, &lost_not_rexmitted); - data_in_pipe = (tp->snd_nxt - tp->snd_una) - - (sacked + lost_not_rexmitted); + data_in_pipe = (tp->snd_nxt - tp->rcv_lastsack) + + tp->sackhint.sack_bytes_rexmit; if (data_in_pipe < tp->snd_ssthresh) { tp->snd_cwnd += tp->t_maxseg; if (tp->snd_cwnd > tp->snd_ssthresh) @@ -1896,6 +1894,9 @@ trimthenstep6: callout_stop(tp->tt_rexmt); tp->t_rtttime = 0; if (tp->sack_enable) { + KASSERT(tp->sackhint. + sack_bytes_rexmit == 0, + ("sackhint rexmit == 0")); tcpstat.tcps_sack_recovery_episode++; tp->sack_newdata = tp->snd_nxt; tp->snd_cwnd = tp->t_maxseg; |