From patchwork Mon Aug 22 06:57:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Li Yu X-Patchwork-Id: 110858 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.180.67]) by ozlabs.org (Postfix) with ESMTP id 746FDB6F00 for ; Mon, 22 Aug 2011 16:57:42 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752013Ab1HVG5g (ORCPT ); Mon, 22 Aug 2011 02:57:36 -0400 Received: from mail-pz0-f42.google.com ([209.85.210.42]:64381 "EHLO mail-pz0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750806Ab1HVG5f (ORCPT ); Mon, 22 Aug 2011 02:57:35 -0400 Received: by pzk37 with SMTP id 37so8193213pzk.1 for ; Sun, 21 Aug 2011 23:57:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:cc:subject :content-type:content-transfer-encoding; bh=+qTELybVmF5ZJHvuiPHK/da/YLr6OgraUrnjR+yDCuw=; b=wrSEnuqFx2isCvpNfG5adRHpGbXSCSdDh4i3SB9lFXTYTcIClFwZYMVoUGCSfEpCGd aCNXaez66SC6PRx3xotC7uIaGe36QSIro6qTvuavXfTOgEMdJNrrUjM75G+o8nilUBR8 4TeushCS043o7MscR4qNj7QOpSxxgnUfhW99E= Received: by 10.143.58.7 with SMTP id l7mr1532895wfk.26.1313996254979; Sun, 21 Aug 2011 23:57:34 -0700 (PDT) Received: from [10.32.160.31] ([182.92.247.1]) by mx.google.com with ESMTPS id s3sm4074909pbg.61.2011.08.21.23.57.32 (version=SSLv3 cipher=OTHER); Sun, 21 Aug 2011 23:57:33 -0700 (PDT) Message-ID: <4E51FDD1.2010607@gmail.com> Date: Mon, 22 Aug 2011 14:57:21 +0800 From: Li Yu User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11 MIME-Version: 1.0 CC: "netdev@vger.kernel.org" , davem@davemloft.net, ilpo.jarvinen@helsinki.fi Subject: [PATCH] fix pushed_seq in keepalive / zero window probe timer To: unlisted-recipients:; (no To-header on input) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In tcp_write_wakeup(), we may split the probe segment since send window or mss is larger than it. so I think that we should update tp->pushed_seq after tcp_fragment(), is it right? thanks. Signed-off-by: Li Yu CC: Ilpo Järvinen CC: David S. Miller --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 882e0b0..659a71f 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -2784,9 +2784,6 @@ int tcp_write_wakeup(struct sock *sk) unsigned int mss = tcp_current_mss(sk); unsigned int seg_size = tcp_wnd_end(tp) - TCP_SKB_CB(skb)->seq; - if (before(tp->pushed_seq, TCP_SKB_CB(skb)->end_seq)) - tp->pushed_seq = TCP_SKB_CB(skb)->end_seq; - /* We are probing the opening of a window * but the window size is != 0 * must have been a result SWS avoidance ( sender ) @@ -2803,8 +2800,11 @@ int tcp_write_wakeup(struct sock *sk) TCP_SKB_CB(skb)->flags |= TCPHDR_PSH; TCP_SKB_CB(skb)->when = tcp_time_stamp; err = tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC); - if (!err) + if (!err) { tcp_event_new_data_sent(sk, skb); + if (before(tp->pushed_seq, TCP_SKB_CB(skb)->end_seq)) + tp->pushed_seq = TCP_SKB_CB(skb)->end_seq; + } return err; } else { if (between(tp->snd_up, tp->snd_una + 1, tp->snd_una + 0xFFFF))