From 8ea7a42b5a102587cbbb019c943888bf536a7d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Thu, 15 Nov 2007 19:42:54 -0800 Subject: [PATCH] --- yaml --- r: 78127 b: refs/heads/master c: 9f58f3b721f52a4d3f497ea57f830ccd307f1d76 h: refs/heads/master i: 78125: 2e1cd13673f73f32aea67a3b79cb53631af51c3a 78123: 4c0c28e6a5c7ceecf33eac1a43ee97a55a24dbca 78119: 6cc53ba7f77ec1b9a3b1dec34d71a2c5d648d50f 78111: a50e7747a23b8145d6bcc50d8045745745a852e5 v: v3 --- [refs] | 2 +- trunk/net/ipv4/tcp_input.c | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 379e0ed212b8..93f2a05dbb3d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a47e5a988a575e64c8c9bae65a1dfe3dca7cba32 +refs/heads/master: 9f58f3b721f52a4d3f497ea57f830ccd307f1d76 diff --git a/trunk/net/ipv4/tcp_input.c b/trunk/net/ipv4/tcp_input.c index 31294b52ad42..7a2bfd85fff0 100644 --- a/trunk/net/ipv4/tcp_input.c +++ b/trunk/net/ipv4/tcp_input.c @@ -1115,16 +1115,23 @@ static int tcp_is_sackblock_valid(struct tcp_sock *tp, int is_dsack, * * Search retransmitted skbs from write_queue that were sent when snd_nxt was * less than what is now known to be received by the other end (derived from - * SACK blocks by the caller). Also calculate the lowest snd_nxt among the - * remaining retransmitted skbs to avoid some costly processing per ACKs. + * highest SACK block). Also calculate the lowest snd_nxt among the remaining + * retransmitted skbs to avoid some costly processing per ACKs. */ -static int tcp_mark_lost_retrans(struct sock *sk, u32 received_upto) +static int tcp_mark_lost_retrans(struct sock *sk) { + const struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); struct sk_buff *skb; int flag = 0; int cnt = 0; u32 new_low_seq = tp->snd_nxt; + u32 received_upto = TCP_SKB_CB(tp->highest_sack)->end_seq; + + if (!tcp_is_fack(tp) || !tp->retrans_out || + !after(received_upto, tp->lost_retrans_low) || + icsk->icsk_ca_state != TCP_CA_Recovery) + return flag; tcp_for_write_queue(skb, sk) { u32 ack_seq = TCP_SKB_CB(skb)->ack_seq; @@ -1245,7 +1252,6 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ int num_sacks = (ptr[1] - TCPOLEN_SACK_BASE)>>3; int reord = tp->packets_out; int prior_fackets; - u32 highest_sack_end_seq; int flag = 0; int found_dup_sack = 0; int cached_fack_count; @@ -1513,11 +1519,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ flag &= ~FLAG_ONLY_ORIG_SACKED; } - highest_sack_end_seq = TCP_SKB_CB(tp->highest_sack)->end_seq; - if (tcp_is_fack(tp) && tp->retrans_out && - after(highest_sack_end_seq, tp->lost_retrans_low) && - icsk->icsk_ca_state == TCP_CA_Recovery) - flag |= tcp_mark_lost_retrans(sk, highest_sack_end_seq); + flag |= tcp_mark_lost_retrans(sk); tcp_verify_left_out(tp);