From patchwork Sat Sep 20 17:52:33 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 728 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id F1E19DDED8 for ; Sun, 21 Sep 2008 03:52:56 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751456AbYITRww (ORCPT ); Sat, 20 Sep 2008 13:52:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751400AbYITRwu (ORCPT ); Sat, 20 Sep 2008 13:52:50 -0400 Received: from courier.cs.helsinki.fi ([128.214.9.1]:39329 "EHLO mail.cs.helsinki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751112AbYITRwj (ORCPT ); Sat, 20 Sep 2008 13:52:39 -0400 Received: from wrl-59.cs.helsinki.fi (wrl-59.cs.helsinki.fi [128.214.166.179]) (AUTH: PLAIN cs-relay, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by mail.cs.helsinki.fi with esmtp; Sat, 20 Sep 2008 20:52:34 +0300 id 0005BEE4.48D53862.00002DC7 Received: by wrl-59.cs.helsinki.fi (Postfix, from userid 50795) id B769FA00AD; Sat, 20 Sep 2008 20:52:34 +0300 (EEST) From: "=?ISO-8859-1?Q?Ilpo_J=E4rvinen?=" To: David Miller Cc: netdev@vger.kernel.org, "=?utf-8?q?Ilpo=20J=E4rvinen?=" Subject: [PATCH net-next 15/15] tcp: back retransmit_high when it over-estimated Date: Sat, 20 Sep 2008 20:52:33 +0300 Message-Id: <1221933153-11874-16-git-send-email-ilpo.jarvinen@helsinki.fi> X-Mailer: git-send-email 1.5.4.2.156.ge3c5 In-Reply-To: <1221933153-11874-15-git-send-email-ilpo.jarvinen@helsinki.fi> References: <1221933153-11874-1-git-send-email-ilpo.jarvinen@helsinki.fi> <1221933153-11874-2-git-send-email-ilpo.jarvinen@helsinki.fi> <1221933153-11874-3-git-send-email-ilpo.jarvinen@helsinki.fi> <1221933153-11874-4-git-send-email-ilpo.jarvinen@helsinki.fi> <1221933153-11874-5-git-send-email-ilpo.jarvinen@helsinki.fi> <1221933153-11874-6-git-send-email-ilpo.jarvinen@helsinki.fi> <1221933153-11874-7-git-send-email-ilpo.jarvinen@helsinki.fi> <1221933153-11874-8-git-send-email-ilpo.jarvinen@helsinki.fi> <1221933153-11874-9-git-send-email-ilpo.jarvinen@helsinki.fi> <1221933153-11874-10-git-send-email-ilpo.jarvinen@helsinki.fi> <1221933153-11874-11-git-send-email-ilpo.jarvinen@helsinki.fi> <1221933153-11874-12-git-send-email-ilpo.jarvinen@helsinki.fi> <1221933153-11874-13-git-send-email-ilpo.jarvinen@helsinki.fi> <1221933153-11874-14-git-send-email-ilpo.jarvinen@helsinki.fi> <1221933153-11874-15-git-send-email-ilpo.jarvinen@helsinki.fi> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If lost skb is sacked, we might have nothing to retransmit as high as the retransmit_high is pointing to, so place it lower to avoid unnecessary walking. This is mainly for the case where high L'ed skbs gets sacked. Signed-off-by: Ilpo Järvinen --- net/ipv4/tcp_output.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 01fb610..727522c 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -2037,16 +2037,22 @@ void tcp_xmit_retransmit_queue(struct sock *sk) struct tcp_sock *tp = tcp_sk(sk); struct sk_buff *skb; struct sk_buff *hole = NULL; + u32 last_lost; int mib_idx; int fwd_rexmitting = 0; if (!tp->lost_out) tp->retransmit_high = tp->snd_una; - if (tp->retransmit_skb_hint) + if (tp->retransmit_skb_hint) { skb = tp->retransmit_skb_hint; - else + last_lost = TCP_SKB_CB(skb)->end_seq; + if (after(last_lost, tp->retransmit_high)) + last_lost = tp->retransmit_high; + } else { skb = tcp_write_queue_head(sk); + last_lost = tp->snd_una; + } /* First pass: retransmit lost packets. */ tcp_for_write_queue_from(skb, sk) { @@ -2075,6 +2081,7 @@ begin_fwd: mib_idx = LINUX_MIB_TCPFORWARDRETRANS; } else if (!before(TCP_SKB_CB(skb)->seq, tp->retransmit_high)) { + tp->retransmit_high = last_lost; if (!tcp_can_forward_retransmit(sk)) break; /* Backtrack if necessary to non-L'ed skb */ @@ -2091,6 +2098,7 @@ begin_fwd: continue; } else { + last_lost = TCP_SKB_CB(skb)->end_seq; if (icsk->icsk_ca_state != TCP_CA_Loss) mib_idx = LINUX_MIB_TCPFASTRETRANS; else