summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw/ipfw2.c
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2008-02-27 13:52:33 +0000
committerdwmalone <dwmalone@FreeBSD.org>2008-02-27 13:52:33 +0000
commitf8898784849d458af8c05d246a4f5d131ae9fa45 (patch)
treeb1105715418f1a9b9ce229ae138ba7e4599e9a8c /sbin/ipfw/ipfw2.c
parentc2ad246bff38cedab4e5cacbbfedbc3547fffb70 (diff)
downloadFreeBSD-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 'sbin/ipfw/ipfw2.c')
-rw-r--r--sbin/ipfw/ipfw2.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index 91e7932..d937599 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -4341,11 +4341,25 @@ end_mask:
errx(EX_DATAERR, "weight must be <= 100");
}
if (p.fs.flags_fs & DN_QSIZE_IS_BYTES) {
- if (p.fs.qsize > 1024*1024)
- errx(EX_DATAERR, "queue size must be < 1MB");
+ size_t len;
+ long limit;
+
+ len = sizeof(limit);
+ if (sysctlbyname("net.inet.ip.dummynet.pipe_byte_limit",
+ &limit, &len, NULL, 0) == -1)
+ limit = 1024*1024;
+ if (p.fs.qsize > limit)
+ errx(EX_DATAERR, "queue size must be < %ldB", limit);
} else {
- if (p.fs.qsize > 100)
- errx(EX_DATAERR, "2 <= queue size <= 100");
+ size_t len;
+ long limit;
+
+ len = sizeof(limit);
+ if (sysctlbyname("net.inet.ip.dummynet.pipe_slot_limit",
+ &limit, &len, NULL, 0) == -1)
+ limit = 100;
+ if (p.fs.qsize > limit)
+ errx(EX_DATAERR, "2 <= queue size <= %ld", limit);
}
if (p.fs.flags_fs & DN_IS_RED) {
size_t len;
@@ -4363,7 +4377,6 @@ end_mask:
len = sizeof(int);
if (sysctlbyname("net.inet.ip.dummynet.red_lookup_depth",
&lookup_depth, &len, NULL, 0) == -1)
-
errx(1, "sysctlbyname(\"%s\")",
"net.inet.ip.dummynet.red_lookup_depth");
if (lookup_depth == 0)
OpenPOWER on IntegriCloud