Date: Mon, 22 Jul 2002 15:46:53 -0700 From: Sean Chittenden <sean@chittenden.org> To: ipfw@freebsd.org, net@freebsd.org Subject: Re: Increasing the hash table size for dummynet... Message-ID: <20020722224653.GL88755@ninja1.internal> In-Reply-To: <20020722224221.GJ88755@ninja1.internal> References: <20020722224221.GJ88755@ninja1.internal>
next in thread | previous in thread | raw e-mail | index | archive | help
--UoPmpPX/dBe4BELn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > [Sorry for the cross post: I don't know where the dummynet guru's live] > > I have a situation where I'm rate shaping a LARGE number of > concurrent TCP connections, however I've run into a slight > problem/limitation: dummynet has a max hash table size of 1024 and I'm > currently handling about 8-17K in TCP connections in a single queue. > :-/ I quickly looked over the hash algorithm and couldn't see any > reason why the max size couldn't be increased beyond 1024. Could > someone comment on the attached? -sc My bad. Pushed send too quickly. Attached. -sc -- Sean Chittenden --UoPmpPX/dBe4BELn Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch Index: sys/netinet/ip_dummynet.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_dummynet.c,v retrieving revision 1.51 diff -u -r1.51 ip_dummynet.c --- sys/netinet/ip_dummynet.c 2002/07/17 07:21:42 1.51 +++ sys/netinet/ip_dummynet.c 2002/07/22 22:35:24 @@ -1463,8 +1463,8 @@ l = dn_hash_size; if (l < 4) l = 4; - else if (l > 1024) - l = 1024; + else if (l > DN_MAX_HASH_SIZE) + l = DN_MAX_HASH_SIZE; x->rq_size = l; } else /* one is enough for null mask */ x->rq_size = 1; Index: sys/netinet/ip_dummynet.h =================================================================== RCS file: /home/ncvs/src/sys/netinet/ip_dummynet.h,v retrieving revision 1.21 diff -u -r1.21 ip_dummynet.h --- sys/netinet/ip_dummynet.h 2002/06/23 09:14:24 1.21 +++ sys/netinet/ip_dummynet.h 2002/07/22 22:35:25 @@ -77,6 +77,12 @@ #define OFFSET_OF(type, field) ((int)&( ((type *)0)->field) ) /* + * The maximum hash table size for queues. This value must be a power + * of 2. + */ +#define DN_MAX_HASH_SIZE 65536 + +/* * A heap entry is made of a key and a pointer to the actual * object stored in the heap. * The heap is an array of dn_heap_entry entries, dynamically allocated. Index: sbin/ipfw/ipfw.8 =================================================================== RCS file: /home/ncvs/src/sbin/ipfw/ipfw.8,v retrieving revision 1.103 diff -u -r1.103 ipfw.8 --- sbin/ipfw/ipfw.8 2002/07/06 19:33:15 1.103 +++ sbin/ipfw/ipfw.8 2002/07/22 22:35:26 @@ -991,7 +991,7 @@ .Xr sysctl 8 variable .Em net.inet.ip.dummynet.hash_size , -allowed range is 16 to 1024. +allowed range is 16 to 65536. .It Cm pipe Ar pipe_nr Connects a queue to the specified pipe. Multiple queues (usually --UoPmpPX/dBe4BELn-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ipfw" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020722224653.GL88755>