DragonFly BSD
DragonFly kernel List (threaded) for 2005-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: MAXSAVEDBLOCKS in netinet/tcp_sack.c


From: Noritoshi Demizu <demizu@xxxxxxxxxxxxxx>
Date: Fri, 26 Aug 2005 19:57:24 +0900 (JST)

To control the number of SACK blocks per connection, I'd like to add a
new sysctl variable: net.inet.tcp.sack_maxblocks_perconn.  The default
value (128) is borrowed from FreeBSD (net.inet.tcp.sack.maxholes).
Note that the number of SACK blocks and the number of SACK holes are
always the same.

I'd like to commit the patch below if no objection is raised until
August 28, 2005.

Thanks.

Regards,
Noritoshi Demizu


Index: tcp_sack.c
===================================================================
RCS file: /home/cvsup/DragonFlyBSD/dcvs/src/sys/netinet/tcp_sack.c,v
retrieving revision 1.2
diff -u -r1.2 tcp_sack.c
--- tcp_sack.c	9 Mar 2005 06:54:34 -0000	1.2
+++ tcp_sack.c	26 Aug 2005 10:51:59 -0000
@@ -80,7 +80,10 @@
 	TAILQ_ENTRY(sackblock)	sblk_list;
 };
 
-#define	MAXSAVEDBLOCKS	8			/* per connection limit */
+static int tcp_sack_maxblocks_perconn = 128;
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, sack_maxblocks_perconn, CTLFLAG_RW,
+    &tcp_sack_maxblocks_perconn, 0,
+    "Maximum number of TCP SACK blocks allowed per connection");
 
 static void insert_block(struct scoreboard *scb, struct sackblock *newblock);
 static void update_lostseq(struct scoreboard *scb, tcp_seq snd_una,
@@ -311,7 +314,7 @@
 
 	KASSERT(scb->nblocks > 0, ("insert_block() called w/ no blocks"));
 
-	if (scb->nblocks == MAXSAVEDBLOCKS) {
+	if (scb->nblocks == tcp_sack_maxblocks_perconn) {
 		/*
 		 * Should try to kick out older blocks XXX JH
 		 * May be able to coalesce with existing block.
@@ -320,7 +323,7 @@
 		free_sackblock(newblock);
 		return;
 	}
-	KASSERT(scb->nblocks < MAXSAVEDBLOCKS,
+	KASSERT(scb->nblocks < tcp_sack_maxblocks_perconn,
 	    ("too many SACK blocks %d", scb->nblocks));
 
 	overlap_front = sack_block_lookup(scb, newblock->sblk_start,  &sb);



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]