socsvn commit: r272201 - soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw
dpl at FreeBSD.org
dpl at FreeBSD.org
Mon Aug 11 12:35:42 UTC 2014
Author: dpl
Date: Mon Aug 11 12:35:41 2014
New Revision: 272201
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=272201
Log:
Moved JIT compilation to beggining of function.
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 Mon Aug 11 12:35:05 2014 (r272200)
+++ soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/ip_fw2.c Mon Aug 11 12:35:41 2014 (r272201)
@@ -264,6 +264,20 @@
int
ipfw_chk(struct ip_fw_args *args)
{
+ struct ip_fw_chain *chain = &V_layer3_chain;
+
+ /* If we haven't, JIT-compile the actions to be executed per-rule */
+ if (compiledfuncptr == 0) {
+ IPFW_PF_RLOCK(chain);
+ if (! V_ipfw_vnet_ready) { /* shutting down, leave NOW. */
+ IPFW_PF_RUNLOCK(chain);
+ return (IP_FW_PASS); /* accept */
+ }
+ compiledfuncptr = compile_code(args, chain);
+ IPFW_PF_RUNLOCK(chain);
+ } else
+ return compiledfuncptr(args, chain);
+
/*
* Local variables holding state while processing a packet:
*
@@ -363,19 +377,6 @@
*/
int dyn_dir = MATCH_UNKNOWN;
ipfw_dyn_rule *q = NULL;
- struct ip_fw_chain *chain = &V_layer3_chain;
-
- /* If we haven't, JIT-compile the actions to be executed per-rule */
- if (compiledfuncptr == 0) {
- IPFW_PF_RLOCK(chain);
- if (! V_ipfw_vnet_ready) { /* shutting down, leave NOW. */
- IPFW_PF_RUNLOCK(chain);
- return (IP_FW_PASS); /* accept */
- }
- compiledfuncptr = compile_code(args, chain);
- IPFW_PF_RUNLOCK(chain);
- } else
- return compiledfuncptr(args, chain);
/*
* We store in ulp a pointer to the upper layer protocol header.
More information about the svn-soc-all
mailing list