From owner-p4-projects@FreeBSD.ORG Fri Jul 3 10:24:46 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DB1A31065693; Fri, 3 Jul 2009 10:24:45 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96D1A106568D for ; Fri, 3 Jul 2009 10:24:45 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 849008FC19 for ; Fri, 3 Jul 2009 10:24:45 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n63AOjnH060040 for ; Fri, 3 Jul 2009 10:24:45 GMT (envelope-from andre@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n63AOjwP060038 for perforce@freebsd.org; Fri, 3 Jul 2009 10:24:45 GMT (envelope-from andre@freebsd.org) Date: Fri, 3 Jul 2009 10:24:45 GMT Message-Id: <200907031024.n63AOjwP060038@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andre@freebsd.org using -f From: Andre Oppermann To: Perforce Change Reviews Cc: Subject: PERFORCE change 165565 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jul 2009 10:24:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=165565 Change 165565 by andre@andre_t61 on 2009/07/03 10:24:02 Undo the undo of the previous integration. Affected files ... .. //depot/projects/tcp_reass/netinet/tcp_sack.c#6 edit Differences ... ==== //depot/projects/tcp_reass/netinet/tcp_sack.c#6 (text+ko) ==== @@ -148,108 +148,6 @@ "Global number of TCP SACK holes currently allocated"); /* - * This function is called upon receipt of new valid data (while not in - * header prediction mode), and it updates the ordered list of sacks. - */ -void -tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_start, tcp_seq rcv_end) -{ - /* - * First reported block MUST be the most recent one. Subsequent - * blocks SHOULD be in the order in which they arrived at the - * receiver. These two conditions make the implementation fully - * compliant with RFC 2018. - */ - struct sackblk head_blk, saved_blks[MAX_SACK_BLKS]; - int num_head, num_saved, i; - - INP_WLOCK_ASSERT(tp->t_inpcb); - - /* Check arguments. */ - KASSERT(SEQ_LT(rcv_start, rcv_end), ("rcv_start < rcv_end")); - - /* SACK block for the received segment. */ - head_blk.start = rcv_start; - head_blk.end = rcv_end; - - /* - * Merge updated SACK blocks into head_blk, and save unchanged SACK - * blocks into saved_blks[]. num_saved will have the number of the - * saved SACK blocks. - */ - num_saved = 0; - for (i = 0; i < tp->rcv_numsacks; i++) { - tcp_seq start = tp->sackblks[i].start; - tcp_seq end = tp->sackblks[i].end; - if (SEQ_GEQ(start, end) || SEQ_LEQ(start, tp->rcv_nxt)) { - /* - * Discard this SACK block. - */ - } else if (SEQ_LEQ(head_blk.start, end) && - SEQ_GEQ(head_blk.end, start)) { - /* - * Merge this SACK block into head_blk. This SACK - * block itself will be discarded. - */ - if (SEQ_GT(head_blk.start, start)) - head_blk.start = start; - if (SEQ_LT(head_blk.end, end)) - head_blk.end = end; - } else { - /* - * Save this SACK block. - */ - saved_blks[num_saved].start = start; - saved_blks[num_saved].end = end; - num_saved++; - } - } - - /* - * Update SACK list in tp->sackblks[]. - */ - num_head = 0; - if (SEQ_GT(head_blk.start, tp->rcv_nxt)) { - /* - * The received data segment is an out-of-order segment. Put - * head_blk at the top of SACK list. - */ - tp->sackblks[0] = head_blk; - num_head = 1; - /* - * If the number of saved SACK blocks exceeds its limit, - * discard the last SACK block. - */ - if (num_saved >= MAX_SACK_BLKS) - num_saved--; - } - if (num_saved > 0) { - /* - * Copy the saved SACK blocks back. - */ - bcopy(saved_blks, &tp->sackblks[num_head], - sizeof(struct sackblk) * num_saved); - } - - /* Save the number of SACK blocks. */ - tp->rcv_numsacks = num_head + num_saved; -} - -/* - * Delete all receiver-side SACK information. - */ -void -tcp_clean_sackreport(struct tcpcb *tp) -{ - int i; - - INP_WLOCK_ASSERT(tp->t_inpcb); - tp->rcv_numsacks = 0; - for (i = 0; i < MAX_SACK_BLKS; i++) - tp->sackblks[i].start = tp->sackblks[i].end=0; -} - -/* * Allocate struct sackhole. */ static struct sackhole *