From patchwork Tue Mar 8 19:17:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 86033 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 58963B6F10 for ; Wed, 9 Mar 2011 06:18:07 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754970Ab1CHTSB (ORCPT ); Tue, 8 Mar 2011 14:18:01 -0500 Received: from mail.vyatta.com ([76.74.103.46]:57422 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754438Ab1CHTSA (ORCPT ); Tue, 8 Mar 2011 14:18:00 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.vyatta.com (Postfix) with ESMTP id 4EE151828FE7; Tue, 8 Mar 2011 11:18:00 -0800 (PST) X-Virus-Scanned: amavisd-new at tahiti.vyatta.com Received: from mail.vyatta.com ([127.0.0.1]) by localhost (mail.vyatta.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T3Z77CGghkzm; Tue, 8 Mar 2011 11:17:59 -0800 (PST) Received: from nehalam (pool-74-107-135-205.ptldor.fios.verizon.net [74.107.135.205]) by mail.vyatta.com (Postfix) with ESMTPSA id 79237182831D; Tue, 8 Mar 2011 11:17:59 -0800 (PST) Date: Tue, 8 Mar 2011 11:17:57 -0800 From: Stephen Hemminger To: David Miller Cc: lucas.nussbaum@loria.fr, netdev@vger.kernel.org, sha2@ncsu.edu Subject: Re: [PATCH] tcp_cubic: enable TCP timestamps Message-ID: <20110308111757.7db14e58@nehalam> In-Reply-To: <20110308.105503.104060436.davem@davemloft.net> References: <20110308080926.GA22641@xanadu.blop.info> <20110308104211.3567526f@nehalam> <20110308.105503.104060436.davem@davemloft.net> Organization: Vyatta X-Mailer: Claws Mail 3.7.6 (GTK+ 2.22.0; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 08 Mar 2011 10:55:03 -0800 (PST) David Miller wrote: Complete the sentence... > on old desktops. But without it enabling RTT_STAMP, packets that get acked in less than a jiffie (1 - 10 ms) will be processed with no rtt value (-1); this causes hystart never to be invoked on local connections. Maybe the following would be better, it passes 0 as RTT when not using RTT_STAMP for quick packets. It turns out the Cubic ends up converting rtt_us back to jiffies anyway, so RTT_STAMP is not really needed. ---- Subject: tcp: fix RTT for quick packets in congestion control In the congestion control interface, the callback for each ACK includes an estimated round trip time in microseconds. Some algorithms need high resolution (Vegas style) but most only need jiffie resolution. If RTT is not accurate (like a retransmission) -1 is used as a flag value. When doing coarse resolution if RTT is less than a a jiffie then 0 should be returned rather than no estimate. Otherwise algorithms that expect good ack's to trigger slow start (like CUBIC Hystart) will be confused. Signed-off-by: Stephen Hemminger --- 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 --- a/net/ipv4/tcp_input.c 2011-03-08 11:11:26.093183654 -0800 +++ b/net/ipv4/tcp_input.c 2011-03-08 11:11:46.641404939 -0800 @@ -3350,7 +3350,7 @@ static int tcp_clean_rtx_queue(struct so net_invalid_timestamp())) rtt_us = ktime_us_delta(ktime_get_real(), last_ackt); - else if (ca_seq_rtt > 0) + else if (ca_seq_rtt >= 0) rtt_us = jiffies_to_usecs(ca_seq_rtt); }