From owner-freebsd-net@FreeBSD.ORG Sun Jul 15 10:26:03 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3F0C106566C for ; Sun, 15 Jul 2012 10:26:03 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9B3518FC16 for ; Sun, 15 Jul 2012 10:26:03 +0000 (UTC) Received: by obbun3 with SMTP id un3so9636079obb.13 for ; Sun, 15 Jul 2012 03:26:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=XVRN2FoIEUKrrOB+56xCYlFD7abZPUQto5zANhMhK3Y=; b=nt8wHFVtfnRLaWC0OfEuozJssyZlUnPgAfRsmik+Hy7btqiDCjW42FMEJGKE8eqHMf LC7adYS0aK59QiEcscDC6izSrDnwWOaBvcvrSbh09pOkuc7LSr4Bz1m78SCWlj4r521H ZQeInNWeUvcXVCkGoMl6SQEQi1vU+aVekHA3McFCWbc/wJWFTzfcJPsS3RYkPAUm+exw PuZbo8xjR7vTbA9qUT8mNaDnEgSlshxMiyBIMI/53SU2ESaESFG5C5IwqAVO3OwmOnRH EUxB/V2LLrhj+Ct5EJ3T7LNrORvRHgQhaXLOLlpxiaHq0iYkdA5bNA2SPBpUjlhGG9Nu 46LA== MIME-Version: 1.0 Received: by 10.182.226.104 with SMTP id rr8mr6170695obc.41.1342347963023; Sun, 15 Jul 2012 03:26:03 -0700 (PDT) Received: by 10.182.35.135 with HTTP; Sun, 15 Jul 2012 03:26:02 -0700 (PDT) In-Reply-To: <500060DB.3090407@myri.com> References: <4FFF9E48.6000403@myri.com> <500060DB.3090407@myri.com> Date: Sun, 15 Jul 2012 18:26:02 +0800 Message-ID: From: Sepherosa Ziehau To: Reese Faucette Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net@freebsd.org Subject: Re: question in tcp_do_segment() X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jul 2012 10:26:03 -0000 On Sat, Jul 14, 2012 at 1:54 AM, Reese Faucette wrote: > Hi, freebsd-net- > > I don't have a testcase for this at the moment, but there's a test > in tcp_do_segment that looks backwards to me... > > http://svnweb.freebsd.org/base/release/9.0.0/sys/netinet/tcp_input.c?view=markup > > line 2398 - > if (!tcp_timer_active(tp, TT_REXMT) || > th->th_ack != tp->snd_una) > tp->t_dupacks = 0; > > says "If we get a DUP ack and the retransmit timer is NOT > fired, then ignore it and reset DUP ACK count." > > Isn't that exactly backwards? I could see ignoring the DUP ACK if we > know the retransmit timer HAS fired, and we don't want to interfere with > its retransmission efforts. The way the code is written now, as far as > I can see, completely defeats retransmission based on DUP acks. I > accidentally ran across this by breaking the timer, so that the > retransmit timer never fires, and my streams get stuck, even with plenty of > DUP ACKs. > > Am I missing something, or should that "!" go ? !tcp_timer_active() means that the connection's retransmit timer is not _set_ yet (please note, it is _not_ "has fired"). As far as I understand this code, it in turn means that this connection doesn't have any segments that were sent but not yet ACKed. Best Regards, sephe -- Tomorrow Will Never Die