summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2005-12-07 21:30:47 +0000
committerjkim <jkim@FreeBSD.org>2005-12-07 21:30:47 +0000
commit99ef252d151a0dde1dc3f64330213074bb08fd64 (patch)
treec66cee417d03fe8210d3f5e392c690ed20dee756 /sys/net
parentd12a77cb38481285a7a2411f5b64a31c10b9d89b (diff)
downloadFreeBSD-src-99ef252d151a0dde1dc3f64330213074bb08fd64.zip
FreeBSD-src-99ef252d151a0dde1dc3f64330213074bb08fd64.tar.gz
Add BPF Just-In-Time compiler support for ng_bpf(4).
The sysctl is changed from net.bpf.jitter.enable to net.bpf_jitter.enable and this controls both bpf(4) and ng_bpf(4) now.
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/bpf.c6
-rw-r--r--sys/net/bpf_jitter.c6
-rw-r--r--sys/net/bpf_jitter.h2
3 files changed, 8 insertions, 6 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 5ffcb00..a66bf69 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -129,12 +129,6 @@ SYSCTL_INT(_net_bpf, OID_AUTO, maxinsns, CTLFLAG_RW,
&bpf_maxinsns, 0, "Maximum bpf program instructions");
SYSCTL_NODE(_net_bpf, OID_AUTO, stats, CTLFLAG_RW,
bpf_stats_sysctl, "bpf statistics portal");
-#ifdef BPF_JITTER
-SYSCTL_NODE(_net_bpf, OID_AUTO, jitter, CTLFLAG_RW, 0, "bpf jitter sysctl");
-static int bpf_jitter_enable = 1;
-SYSCTL_INT(_net_bpf_jitter, OID_AUTO, enable, CTLFLAG_RW,
- &bpf_jitter_enable, 0, "bpf JIT compiler");
-#endif
static d_open_t bpfopen;
static d_close_t bpfclose;
diff --git a/sys/net/bpf_jitter.c b/sys/net/bpf_jitter.c
index 2d0ee2e1..b1a61c5 100644
--- a/sys/net/bpf_jitter.c
+++ b/sys/net/bpf_jitter.c
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
+#include <sys/sysctl.h>
#include <net/bpf.h>
#include <net/bpf_jitter.h>
@@ -46,6 +47,11 @@ MALLOC_DEFINE(M_BPFJIT, "BPF_JIT", "BPF JIT compiler");
bpf_filter_func bpf_jit_compile(struct bpf_insn *, u_int, int *);
+SYSCTL_NODE(_net, OID_AUTO, bpf_jitter, CTLFLAG_RW, 0, "BPF JIT compiler");
+int bpf_jitter_enable = 1;
+SYSCTL_INT(_net_bpf_jitter, OID_AUTO, enable, CTLFLAG_RW,
+ &bpf_jitter_enable, 0, "enable BPF JIT compiler");
+
bpf_jit_filter *
bpf_jitter(struct bpf_insn *fp, int nins)
{
diff --git a/sys/net/bpf_jitter.h b/sys/net/bpf_jitter.h
index 0ae64f9..9eed2c9 100644
--- a/sys/net/bpf_jitter.h
+++ b/sys/net/bpf_jitter.h
@@ -36,6 +36,8 @@
MALLOC_DECLARE(M_BPFJIT);
+extern int bpf_jitter_enable;
+
/*
* Prototype of a filtering function created by the jitter.
*
OpenPOWER on IntegriCloud