aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2007-05-27 05:03:20 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:47:53 -0400
commit539d243fdd7900fa5a544c7c154dc3ddf627e840 (patch)
tree68972054f318d614692bdfe76d6d920ae2698a21
parent9bff40fda015c4d0b57b444626cdcbf66066dbe7 (diff)
[TCP]: Access to highest_sack obsoletes forward_cnt_hint
In addition, added a reference about the purpose of the loop. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/tcp.h1
-rw-r--r--net/ipv4/tcp_output.c23
2 files changed, 9 insertions, 15 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index c072f88afb97..d64734389fb6 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -346,7 +346,6 @@ struct tcp_sock {
346 int fastpath_cnt_hint; 346 int fastpath_cnt_hint;
347 int lost_cnt_hint; 347 int lost_cnt_hint;
348 int retransmit_cnt_hint; 348 int retransmit_cnt_hint;
349 int forward_cnt_hint;
350 349
351 u16 advmss; /* Advertised MSS */ 350 u16 advmss; /* Advertised MSS */
352 u16 prior_ssthresh; /* ssthresh saved at recovery start */ 351 u16 prior_ssthresh; /* ssthresh saved at recovery start */
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 666d8a58d14a..b11025e8a49e 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1945,33 +1945,28 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
1945 * and retransmission... Both ways have their merits... 1945 * and retransmission... Both ways have their merits...
1946 * 1946 *
1947 * For now we do not retransmit anything, while we have some new 1947 * For now we do not retransmit anything, while we have some new
1948 * segments to send. 1948 * segments to send. In the other cases, follow rule 3 for
1949 * NextSeg() specified in RFC3517.
1949 */ 1950 */
1950 1951
1951 if (tcp_may_send_now(sk)) 1952 if (tcp_may_send_now(sk))
1952 return; 1953 return;
1953 1954
1954 if (tp->forward_skb_hint) { 1955 /* If nothing is SACKed, highest_sack in the loop won't be valid */
1956 if (!tp->sacked_out)
1957 return;
1958
1959 if (tp->forward_skb_hint)
1955 skb = tp->forward_skb_hint; 1960 skb = tp->forward_skb_hint;
1956 packet_cnt = tp->forward_cnt_hint; 1961 else
1957 } else{
1958 skb = tcp_write_queue_head(sk); 1962 skb = tcp_write_queue_head(sk);
1959 packet_cnt = 0;
1960 }
1961 1963
1962 tcp_for_write_queue_from(skb, sk) { 1964 tcp_for_write_queue_from(skb, sk) {
1963 if (skb == tcp_send_head(sk)) 1965 if (skb == tcp_send_head(sk))
1964 break; 1966 break;
1965 tp->forward_cnt_hint = packet_cnt;
1966 tp->forward_skb_hint = skb; 1967 tp->forward_skb_hint = skb;
1967 1968
1968 /* Similar to the retransmit loop above we 1969 if (after(TCP_SKB_CB(skb)->seq, tp->highest_sack))
1969 * can pretend that the retransmitted SKB
1970 * we send out here will be composed of one
1971 * real MSS sized packet because tcp_retransmit_skb()
1972 * will fragment it if necessary.
1973 */
1974 if (++packet_cnt > tp->fackets_out)
1975 break; 1970 break;
1976 1971
1977 if (tcp_packets_in_flight(tp) >= tp->snd_cwnd) 1972 if (tcp_packets_in_flight(tp) >= tp->snd_cwnd)