PERFORCE change 165565 for review

Andre Oppermann andre at FreeBSD.org
Fri Jul 3 10:24:46 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=165565

Change 165565 by andre at 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 *


More information about the p4-projects mailing list