aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2007-12-01 17:48:06 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:55:46 -0500
commit6859d49475d4f32abe640372117e4b687906e6b6 (patch)
tree2133f2e26af6540f2a212c36f219873d34db2c1e /net/ipv4/tcp_output.c
parent7201883599ac8bff76300117155e299b1a54092f (diff)
[TCP]: Abstract tp->highest_sack accessing & point to next skb
Pointing to the next skb is necessary to avoid referencing already SACKed skbs which will soon be on a separate list. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 7d8583a15d02..9a985b55e7d8 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -667,7 +667,7 @@ static void tcp_adjust_fackets_out(struct sock *sk, struct sk_buff *skb,
667 if (!tp->sacked_out || tcp_is_reno(tp)) 667 if (!tp->sacked_out || tcp_is_reno(tp))
668 return; 668 return;
669 669
670 if (!before(tcp_highest_sack_seq(tp), TCP_SKB_CB(skb)->seq)) 670 if (after(tcp_highest_sack_seq(tp), TCP_SKB_CB(skb)->seq))
671 tp->fackets_out -= decr; 671 tp->fackets_out -= decr;
672} 672}
673 673
@@ -711,9 +711,6 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss
711 TCP_SKB_CB(buff)->end_seq = TCP_SKB_CB(skb)->end_seq; 711 TCP_SKB_CB(buff)->end_seq = TCP_SKB_CB(skb)->end_seq;
712 TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(buff)->seq; 712 TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(buff)->seq;
713 713
714 if (tcp_is_sack(tp) && tp->sacked_out && (skb == tp->highest_sack))
715 tp->highest_sack = buff;
716
717 /* PSH and FIN should only be set in the second packet. */ 714 /* PSH and FIN should only be set in the second packet. */
718 flags = TCP_SKB_CB(skb)->flags; 715 flags = TCP_SKB_CB(skb)->flags;
719 TCP_SKB_CB(skb)->flags = flags & ~(TCPCB_FLAG_FIN|TCPCB_FLAG_PSH); 716 TCP_SKB_CB(skb)->flags = flags & ~(TCPCB_FLAG_FIN|TCPCB_FLAG_PSH);
@@ -1707,9 +1704,7 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
1707 BUG_ON(tcp_skb_pcount(skb) != 1 || 1704 BUG_ON(tcp_skb_pcount(skb) != 1 ||
1708 tcp_skb_pcount(next_skb) != 1); 1705 tcp_skb_pcount(next_skb) != 1);
1709 1706
1710 if (WARN_ON(tcp_is_sack(tp) && tp->sacked_out && 1707 tcp_highest_sack_combine(sk, next_skb, skb);
1711 (next_skb == tp->highest_sack)))
1712 return;
1713 1708
1714 /* Ok. We will be able to collapse the packet. */ 1709 /* Ok. We will be able to collapse the packet. */
1715 tcp_unlink_write_queue(next_skb, sk); 1710 tcp_unlink_write_queue(next_skb, sk);
@@ -2019,7 +2014,7 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
2019 break; 2014 break;
2020 tp->forward_skb_hint = skb; 2015 tp->forward_skb_hint = skb;
2021 2016
2022 if (after(TCP_SKB_CB(skb)->seq, tcp_highest_sack_seq(tp))) 2017 if (!before(TCP_SKB_CB(skb)->seq, tcp_highest_sack_seq(tp)))
2023 break; 2018 break;
2024 2019
2025 if (tcp_packets_in_flight(tp) >= tp->snd_cwnd) 2020 if (tcp_packets_in_flight(tp) >= tp->snd_cwnd)