diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2008-02-27 13:52:33 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2008-02-27 13:52:33 +0000 |
commit | f8898784849d458af8c05d246a4f5d131ae9fa45 (patch) | |
tree | b1105715418f1a9b9ce229ae138ba7e4599e9a8c /sys/netinet/ip_dummynet.c | |
parent | c2ad246bff38cedab4e5cacbbfedbc3547fffb70 (diff) | |
download | FreeBSD-src-f8898784849d458af8c05d246a4f5d131ae9fa45.zip FreeBSD-src-f8898784849d458af8c05d246a4f5d131ae9fa45.tar.gz |
Dummynet has a limit of 100 slots queue size (or 1MB, if you give
the limit in bytes) hard coded into both the kernel and userland.
Make both these limits a sysctl, so it is easy to change the limit.
If the userland part of ipfw finds that the sysctls don't exist,
it will just fall back to the traditional limits.
(100 packets is quite a small limit these days. If you want to test
TCP at 100Mbps, 100 packets can only accommodate a DBP of 12ms.)
Note these sysctls in the man page and warn against increasing them
without thinking first.
MFC after: 3 weeks
Diffstat (limited to 'sys/netinet/ip_dummynet.c')
-rw-r--r-- | sys/netinet/ip_dummynet.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c index b1a0788..fc10349 100644 --- a/sys/netinet/ip_dummynet.c +++ b/sys/netinet/ip_dummynet.c @@ -98,6 +98,9 @@ static long searches, search_steps ; static int pipe_expire = 1 ; /* expire queue if empty */ static int dn_max_ratio = 16 ; /* max queues/buckets ratio */ +static long pipe_slot_limit = 100; /* Foot shooting limit for pipe queues. */ +static long pipe_byte_limit = 1024 * 1024; + static int red_lookup_depth = 256; /* RED - default lookup table depth */ static int red_avg_pkt_size = 512; /* RED - default medium packet size */ static int red_max_pkt_size = 1500; /* RED - default max packet size */ @@ -198,6 +201,10 @@ SYSCTL_ULONG(_net_inet_ip_dummynet, OID_AUTO, io_pkt_fast, SYSCTL_ULONG(_net_inet_ip_dummynet, OID_AUTO, io_pkt_drop, CTLFLAG_RD, &io_pkt_drop, 0, "Number of packets dropped by dummynet."); +SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, pipe_slot_limit, + CTLFLAG_RW, &pipe_slot_limit, 0, "Upper limit in slots for pipe queue."); +SYSCTL_LONG(_net_inet_ip_dummynet, OID_AUTO, pipe_byte_limit, + CTLFLAG_RW, &pipe_byte_limit, 0, "Upper limit in bytes for pipe queue."); #endif #ifdef DUMMYNET_DEBUG @@ -1692,12 +1699,12 @@ set_fs_parms(struct dn_flow_set *x, struct dn_flow_set *src) x->plr = src->plr; x->flow_mask = src->flow_mask; if (x->flags_fs & DN_QSIZE_IS_BYTES) { - if (x->qsize > 1024 * 1024) + if (x->qsize > pipe_byte_limit) x->qsize = 1024 * 1024; } else { if (x->qsize == 0) x->qsize = 50; - if (x->qsize > 100) + if (x->qsize > pipe_slot_limit) x->qsize = 50; } /* Configuring RED. */ |