From owner-svn-src-all@FreeBSD.ORG Fri Aug 17 01:49:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED6C6106564A; Fri, 17 Aug 2012 01:49:51 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE33E8FC08; Fri, 17 Aug 2012 01:49:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7H1npUT099634; Fri, 17 Aug 2012 01:49:51 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7H1np9p099632; Fri, 17 Aug 2012 01:49:51 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201208170149.q7H1np9p099632@svn.freebsd.org> From: Lawrence Stewart Date: Fri, 17 Aug 2012 01:49:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239346 - head/sys/netinet/khelp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Aug 2012 01:49:52 -0000 Author: lstewart Date: Fri Aug 17 01:49:51 2012 New Revision: 239346 URL: http://svn.freebsd.org/changeset/base/239346 Log: The TCP PAWS fix for kernels with fast tick rates (r231767) changed the TCP timestamp related stack variables to reference ms directly instead of ticks. The h_ertt(4) Khelp module relies on TCP timestamp information in order to calculate its enhanced RTT estimates, but was not updated as part of r231767. Consequently, h_ertt has not been calculating correct RTT estimates since r231767 was comitted, which in turn broke all delay-based congestion control algorithms because they rely on the h_ertt RTT estimates. Fix the breakage by switching h_ertt to use tcp_ts_getticks() in place of all previous uses of the ticks variable. This ensures all timestamp related variables in h_ertt use the same units as the TCP stack and therefore results in meaningful comparisons and RTT estimate calculations. Reported & tested by: Naeem Khademi (naeemk at ifi uio no) Discussed with: bz MFC after: 3 days Modified: head/sys/netinet/khelp/h_ertt.c Modified: head/sys/netinet/khelp/h_ertt.c ============================================================================== --- head/sys/netinet/khelp/h_ertt.c Fri Aug 17 01:05:56 2012 (r239345) +++ head/sys/netinet/khelp/h_ertt.c Fri Aug 17 01:49:51 2012 (r239346) @@ -151,11 +151,13 @@ marked_packet_rtt(struct txseginfo *txsi *prtt_bytes_adjust += *pmeasurenext_len; } else { if (mflag & FORCED_MEASUREMENT) { - e_t->markedpkt_rtt = ticks - *pmeasurenext + 1; + e_t->markedpkt_rtt = tcp_ts_getticks() - + *pmeasurenext + 1; e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt + *pmeasurenext_len - *prtt_bytes_adjust; } else { - e_t->markedpkt_rtt = ticks - txsi->tx_ts + 1; + e_t->markedpkt_rtt = tcp_ts_getticks() - + txsi->tx_ts + 1; e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt - *prtt_bytes_adjust; } @@ -349,7 +351,7 @@ ertt_packet_measurement_hook(int hhook_t */ if (!e_t->dlyack_rx || multiack || new_sacked_bytes) { /* Make an accurate new measurement. */ - e_t->rtt = ticks - txsi->tx_ts + 1; + e_t->rtt = tcp_ts_getticks() - txsi->tx_ts + 1; if (e_t->rtt < e_t->minrtt || e_t->minrtt == 0) e_t->minrtt = e_t->rtt; @@ -477,7 +479,7 @@ ertt_add_tx_segment_info_hook(int hhook_ tp->ts_offset; txsi->rx_ts = ntohl(to->to_tsecr); } else { - txsi->tx_ts = ticks; + txsi->tx_ts = tcp_ts_getticks(); txsi->rx_ts = 0; /* No received time stamp. */ } TAILQ_INSERT_TAIL(&e_t->txsegi_q, txsi, txsegi_lnk);