From patchwork Fri Dec 5 20:58:54 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: 12511 X-Patchwork-Delegate: davem@davemloft.net 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 15ACADDDDB for ; Sat, 6 Dec 2008 07:59:35 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755338AbYLEU7V (ORCPT ); Fri, 5 Dec 2008 15:59:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755402AbYLEU7R (ORCPT ); Fri, 5 Dec 2008 15:59:17 -0500 Received: from courier.cs.helsinki.fi ([128.214.9.1]:50779 "EHLO mail.cs.helsinki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753351AbYLEU7B (ORCPT ); Fri, 5 Dec 2008 15:59:01 -0500 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; Fri, 05 Dec 2008 22:58:56 +0200 id 0008C193.49399610.000048FA Received: by wrl-59.cs.helsinki.fi (Postfix, from userid 50795) id 69511A00AA; Fri, 5 Dec 2008 22:58:56 +0200 (EET) From: "=?ISO-8859-1?Q?Ilpo_J=E4rvinen?=" To: David Miller Cc: netdev@vger.kernel.org, "=?utf-8?q?Ilpo=20J=E4rvinen?=" Subject: [PATCH 08/10] tcp: move some parts from tcp_write_xmit Date: Fri, 5 Dec 2008 22:58:54 +0200 Message-Id: <1228510736-3655-9-git-send-email-ilpo.jarvinen@helsinki.fi> X-Mailer: git-send-email 1.5.4.2.156.ge3c5 In-Reply-To: <1228510736-3655-8-git-send-email-ilpo.jarvinen@helsinki.fi> References: <1228510736-3655-1-git-send-email-ilpo.jarvinen@helsinki.fi> <1228510736-3655-2-git-send-email-ilpo.jarvinen@helsinki.fi> <1228510736-3655-3-git-send-email-ilpo.jarvinen@helsinki.fi> <1228510736-3655-4-git-send-email-ilpo.jarvinen@helsinki.fi> <1228510736-3655-5-git-send-email-ilpo.jarvinen@helsinki.fi> <1228510736-3655-6-git-send-email-ilpo.jarvinen@helsinki.fi> <1228510736-3655-7-git-send-email-ilpo.jarvinen@helsinki.fi> <1228510736-3655-8-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 Signed-off-by: Ilpo Järvinen --- net/ipv4/tcp_output.c | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 0744b9f..59505ce 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -1527,13 +1527,6 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle) int cwnd_quota; int result; - /* If we are closed, the bytes will have to remain here. - * In time closedown will finish, we empty the write queue and all - * will be happy. - */ - if (unlikely(sk->sk_state == TCP_CLOSE)) - return 0; - sent_pkts = 0; /* Do MTU probing. */ @@ -1605,10 +1598,18 @@ void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, { struct sk_buff *skb = tcp_send_head(sk); - if (skb) { - if (tcp_write_xmit(sk, cur_mss, nonagle)) - tcp_check_probe_timer(sk); - } + if (!skb) + return; + + /* If we are closed, the bytes will have to remain here. + * In time closedown will finish, we empty the write queue and + * all will be happy. + */ + if (unlikely(sk->sk_state == TCP_CLOSE)) + return; + + if (tcp_write_xmit(sk, cur_mss, nonagle)) + tcp_check_probe_timer(sk); } /* Send _single_ skb sitting at the send head. This function requires