From patchwork Thu Mar 10 16:51:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 86312 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 CE888B6EFF for ; Fri, 11 Mar 2011 03:56:27 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753811Ab1CJQ4Y (ORCPT ); Thu, 10 Mar 2011 11:56:24 -0500 Received: from suva.vyatta.com ([76.74.103.44]:45020 "EHLO suva.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753683Ab1CJQ4X (ORCPT ); Thu, 10 Mar 2011 11:56:23 -0500 Received: from suva.vyatta.com (suva [127.0.0.1]) by suva.vyatta.com (8.13.7/8.13.7) with ESMTP id p2AGtjLp006501; Thu, 10 Mar 2011 08:55:45 -0800 Received: (from shemminger@localhost) by suva.vyatta.com (8.13.7/8.13.7/Submit) id p2AGtjYj006500; Thu, 10 Mar 2011 08:55:45 -0800 Message-Id: <20110310165328.811355927@vyatta.com> User-Agent: quilt/0.48-1 Date: Thu, 10 Mar 2011 08:51:23 -0800 From: Stephen Hemminger To: davem@davemloft.net, sangtae.ha@gmail.com, rhee@ncsu.edu Cc: netdev@vger.kernel.org Subject: [PATCH 1/6] tcp: fix RTT for quick packets in congestion control References: <20110310165119.224046957@vyatta.com> Content-Disposition: inline; filename=tcp-input-rtt.patch Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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); }