aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2008-11-25 00:26:56 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-25 00:26:56 -0500
commit92ee76b6d99bfcdab6162816c9025541ef7248eb (patch)
tree84ff34e13792073b32e8e767f47598e373d2689d /net
parent832d11c5cd076abc0aa1eaf7be96c81d1a59ce41 (diff)
tcp: Make shifting not clear the hints
The earlier version was just very basic one which is "playing safe" by always clearing the hints. However, clearing of a hint is extremely costly operation with large windows, so it must be avoided at all cost whenever possible, there is a way with shifting too achieve not-clearing. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/tcp_input.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 97d57676b8ee..e6291dde3348 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1379,6 +1379,11 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *prev,
1379 1379
1380 BUG_ON(!pcount); 1380 BUG_ON(!pcount);
1381 1381
1382 /* Tweak before seqno plays */
1383 if (!tcp_is_fack(tp) && tcp_is_sack(tp) && tp->lost_skb_hint &&
1384 !before(TCP_SKB_CB(tp->lost_skb_hint)->seq, TCP_SKB_CB(skb)->seq))
1385 tp->lost_cnt_hint += pcount;
1386
1382 TCP_SKB_CB(prev)->end_seq += shifted; 1387 TCP_SKB_CB(prev)->end_seq += shifted;
1383 TCP_SKB_CB(skb)->seq += shifted; 1388 TCP_SKB_CB(skb)->seq += shifted;
1384 1389
@@ -1408,8 +1413,6 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *prev,
1408 /* Difference in this won't matter, both ACKed by the same cumul. ACK */ 1413 /* Difference in this won't matter, both ACKed by the same cumul. ACK */
1409 TCP_SKB_CB(prev)->sacked |= (TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS); 1414 TCP_SKB_CB(prev)->sacked |= (TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS);
1410 1415
1411 tcp_clear_all_retrans_hints(tp);
1412
1413 if (skb->len > 0) { 1416 if (skb->len > 0) {
1414 BUG_ON(!tcp_skb_pcount(skb)); 1417 BUG_ON(!tcp_skb_pcount(skb));
1415 return 0; 1418 return 0;
@@ -1417,6 +1420,15 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *prev,
1417 1420
1418 /* Whole SKB was eaten :-) */ 1421 /* Whole SKB was eaten :-) */
1419 1422
1423 if (skb == tp->retransmit_skb_hint)
1424 tp->retransmit_skb_hint = prev;
1425 if (skb == tp->scoreboard_skb_hint)
1426 tp->scoreboard_skb_hint = prev;
1427 if (skb == tp->lost_skb_hint) {
1428 tp->lost_skb_hint = prev;
1429 tp->lost_cnt_hint -= tcp_skb_pcount(prev);
1430 }
1431
1420 TCP_SKB_CB(skb)->flags |= TCP_SKB_CB(prev)->flags; 1432 TCP_SKB_CB(skb)->flags |= TCP_SKB_CB(prev)->flags;
1421 if (skb == tcp_highest_sack(sk)) 1433 if (skb == tcp_highest_sack(sk))
1422 tcp_advance_highest_sack(sk, skb); 1434 tcp_advance_highest_sack(sk, skb);