From owner-cvs-src@FreeBSD.ORG Mon May 23 19:22:49 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3C36116A41C; Mon, 23 May 2005 19:22:49 +0000 (GMT) (envelope-from ps@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CF7A43D4C; Mon, 23 May 2005 19:22:49 +0000 (GMT) (envelope-from ps@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j4NJMnNi082447; Mon, 23 May 2005 19:22:49 GMT (envelope-from ps@repoman.freebsd.org) Received: (from ps@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4NJMmJs082446; Mon, 23 May 2005 19:22:48 GMT (envelope-from ps) Message-Id: <200505231922.j4NJMmJs082446@repoman.freebsd.org> From: Paul Saab Date: Mon, 23 May 2005 19:22:48 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/netinet tcp.h tcp_sack.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2005 19:22:49 -0000 ps 2005-05-23 19:22:48 UTC FreeBSD src repository Modified files: sys/netinet tcp.h tcp_sack.c Log: Rewrite of tcp_sack_option(). Kentaro Kurahone (NetBSD) pointed out that if we sort the incoming SACK blocks, we can update the scoreboard in one pass of the scoreboard. The added overhead of sorting upto 4 sack blocks is much lower than traversing (potentially) large scoreboards multiple times. The code was updating the scoreboard with multiple passes over it (once for each sack option). The rewrite fixes that, reducing the complexity of the main loop from O(n^2) to O(n). Submitted by: Mohan Srinivasan, Noritoshi Demizu. Reviewed by: Raja Mukerji. Revision Changes Path 1.31 +1 -1 src/sys/netinet/tcp.h 1.19 +108 -63 src/sys/netinet/tcp_sack.c