Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Aug 2014 12:35:41 GMT
From:      dpl@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r272201 - soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw
Message-ID:  <201408111235.s7BCZfmO052123@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408111235.s7BCZfmO052123>