From owner-svn-src-projects@FreeBSD.ORG Tue Aug 11 22:26:10 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0C27106564A; Tue, 11 Aug 2009 22:26:10 +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 9DE088FC57; Tue, 11 Aug 2009 22:26:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7BMQAVO043711; Tue, 11 Aug 2009 22:26:10 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7BMQAPU043709; Tue, 11 Aug 2009 22:26:10 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <200908112226.n7BMQAPU043709@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 11 Aug 2009 22:26:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196107 - projects/tcp_ffcaia2008_8.x/sys/netinet X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2009 22:26:11 -0000 Author: lstewart Date: Tue Aug 11 22:26:10 2009 New Revision: 196107 URL: http://svn.freebsd.org/changeset/base/196107 Log: Tweak the accounting math in my previous commit so that it actually calculates the correct values. The sack_hole_bytes variable should now be ready to use to influence SACK recovery behaviour. Sponsored by: FreeBSD Foundation Modified: projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_sack.c Modified: projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_sack.c ============================================================================== --- projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_sack.c Tue Aug 11 22:09:43 2009 (r196106) +++ projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_sack.c Tue Aug 11 22:26:10 2009 (r196107) @@ -352,7 +352,7 @@ tcp_sackhole_remove(struct tcpcb *tp, st #endif */ if (TAILQ_EMPTY(&tp->snd_holes) && tp->sack_hole_bytes != 0) { - printf("tp->sack_hole_bytes is %d instead of 0", tp->sack_hole_bytes); + printf("conn (%p) tp->sack_hole_bytes is %d instead of 0\n", tp, tp->sack_hole_bytes); tp->sack_hole_bytes = 0; } } @@ -524,7 +524,7 @@ tcp_sack_doack(struct tcpcb *tp, struct /* Data acks at least the end of hole. */ if (SEQ_GEQ(sblkp->end, cur->end)) { /* Shrink hole: slide end of hole backward. */ - tp->sack_hole_bytes -= sblkp->start - cur->end; + tp->sack_hole_bytes -= cur->end - sblkp->start; cur->end = sblkp->start; cur->rxmit = SEQ_MIN(cur->rxmit, cur->end); } else { @@ -552,8 +552,6 @@ tcp_sack_doack(struct tcpcb *tp, struct * sblkp->end-sblkp->start */ tp->sack_hole_bytes -= cur->end - - sblkp->end - - sblkp->end + sblkp->start; cur->end = sblkp->start; cur->rxmit = SEQ_MIN(cur->rxmit,