aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-09-23 02:32:56 -0400
committerDavid S. Miller <davem@davemloft.net>2005-09-23 02:32:56 -0400
commit83ca28befc43e93849e79c564cda10e39d983e75 (patch)
treeb86c768738f929246e4a0f858f8f6df88c015da8 /net
parente484585ec3ee66cd07a627d3a9e2364640a3807f (diff)
[TCP]: Adjust Reno SACK estimate in tcp_fragment
Since the introduction of TSO pcount a year ago, it has been possible for tcp_fragment() to cause packets_out to decrease. Prior to that, tcp_retrans_try_collapse() was the only way for that to happen on the retransmission path. When this happens with Reno, it is possible for sasked_out to become invalid because it is only an estimate and not tied to any particular packet on the retransmission queue. Therefore we need to adjust sacked_out as well as left_out in the Reno case. The following patch does exactly that. This bug is pretty difficult to trigger in practice though since you need a SACKless peer with a retransmission that occurs just as the cached MTU value expires. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/tcp_output.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 5dd6dd7d091e..d6e3d269e906 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -509,7 +509,16 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
509 tp->lost_out -= diff; 509 tp->lost_out -= diff;
510 tp->left_out -= diff; 510 tp->left_out -= diff;
511 } 511 }
512
512 if (diff > 0) { 513 if (diff > 0) {
514 /* Adjust Reno SACK estimate. */
515 if (!tp->rx_opt.sack_ok) {
516 tp->sacked_out -= diff;
517 if ((int)tp->sacked_out < 0)
518 tp->sacked_out = 0;
519 tcp_sync_left_out(tp);
520 }
521
513 tp->fackets_out -= diff; 522 tp->fackets_out -= diff;
514 if ((int)tp->fackets_out < 0) 523 if ((int)tp->fackets_out < 0)
515 tp->fackets_out = 0; 524 tp->fackets_out = 0;