Date: Wed, 23 Jul 2014 16:27:03 GMT From: dpl@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r271283 - soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw Message-ID: <201407231627.s6NGR3dY066247@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dpl Date: Wed Jul 23 16:27:02 2014 New Revision: 271283 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=271283 Log: Added more JIT compiling code. Modified: soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/ip_fw2.c Modified: soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/ip_fw2.c Wed Jul 23 16:26:29 2014 (r271282) +++ soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/ip_fw2.c Wed Jul 23 16:27:02 2014 (r271283) @@ -232,7 +232,13 @@ static inline void rule_reass(struct ip_fw *, int, struct ip_fw_chain *, int, struct ip *, struct ip_fw_args *, struct mbuf *, int *, int *, int *); /* JIT compiling API */ +typedef int (*funcptr)(); + void ipfw_jit_init(); +funcptr compile_code(); + +/* Pointer to the actual compiled code */ +int (*compiledfuncptr)() = 0; /* * Each rule belongs to one of 32 different sets (0..31). @@ -365,6 +371,12 @@ int ipfw_chk(struct ip_fw_args *args) { + if (compiledfuncptr == 0) + compiledfuncptr = compile_code(); + + if ((int)compiledfuncptr != 0) { + return compiledfuncptr(); + } /* * Local variables holding state while processing a packet: @@ -1323,6 +1335,8 @@ default_fw_tables = IPFW_TABLES_MAX; ipfw_log_bpf(1); /* init */ + + /* Start JIT */ ipfw_jit_init(); return (error);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407231627.s6NGR3dY066247>