From 927a76bb5e6e90ad9aad213058227633a325debc Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Sat, 12 Oct 2002 07:45:23 +0000 Subject: [PATCH] Increase the max dummynet hash size from 1024 to 65536. Default is still 1024. Silence on: -net, -ipfw 4weeks+ Reviewed by: dd Approved by: knu (mentor) MFC after: 3 weeks --- sbin/ipfw/ipfw.8 | 2 +- sys/netinet/ip_dummynet.c | 4 ++-- sys/netinet/ip_dummynet.h | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index 4c9e1410c73a..c9e405cd132d 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -1347,7 +1347,7 @@ Default value is 64 controlled by the .Xr sysctl 8 variable .Em net.inet.ip.dummynet.hash_size , -allowed range is 16 to 1024. +allowed range is 16 to 65536. .Pp .It Cm mask Ar mask-specifier The diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c index 49f58fcd2498..3c2ee99f6b81 100644 --- a/sys/netinet/ip_dummynet.c +++ b/sys/netinet/ip_dummynet.c @@ -1463,8 +1463,8 @@ alloc_hash(struct dn_flow_set *x, struct dn_flow_set *pfs) 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; diff --git a/sys/netinet/ip_dummynet.h b/sys/netinet/ip_dummynet.h index e8ae0e9ca0fd..79c607dd4175 100644 --- a/sys/netinet/ip_dummynet.h +++ b/sys/netinet/ip_dummynet.h @@ -76,6 +76,12 @@ typedef u_int64_t dn_key ; /* sorting key */ */ #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.