Date: Thu, 7 Aug 2014 18:19:10 GMT From: dpl@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r272043 - soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw Message-ID: <201408071819.s77IJAu5050725@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dpl Date: Thu Aug 7 18:19:09 2014 New Revision: 272043 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=272043 Log: Moved the JIT compiling code to a more sensible place. 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 Thu Aug 7 17:49:42 2014 (r272042) +++ soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/ip_fw2.c Thu Aug 7 18:19:09 2014 (r272043) @@ -365,6 +365,18 @@ 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. * In the ipv4 case this is easy to determine from the header, @@ -393,19 +405,6 @@ proto = args->f_id.proto = 0; /* mark f_id invalid */ /* XXX 0 is a valid proto: IP/IPv6 Hop-by-Hop Option */ - /* 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); - - /* * PULLUP_TO(len, p, T) makes sure that len + sizeof(T) is contiguous, * then it sets p to point at the offset "len" in the mbuf. WARNING: the
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408071819.s77IJAu5050725>