Date: Thu, 2 Feb 2006 03:13:16 +0000 (UTC) From: "Christian S.J. Peron" <csjp@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/net pfil.c pfil.h src/sys/netinet ip_fastfwd.c ip_fw2.c ip_input.c ip_output.c src/sys/netinet6 ip6_forward.c ip6_input.c ip6_output.c Message-ID: <200602020313.k123DGFl029834@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
csjp 2006-02-02 03:13:16 UTC FreeBSD src repository Modified files: sys/net pfil.c pfil.h sys/netinet ip_fastfwd.c ip_fw2.c ip_input.c ip_output.c sys/netinet6 ip6_forward.c ip6_input.c ip6_output.c Log: Somewhat re-factor the read/write locking mechanism associated with the packet filtering mechanisms to use the new rwlock(9) locking API: - Drop the variables stored in the phil_head structure which were specific to conditions and the home rolled read/write locking mechanism. - Drop some includes which were used for condition variables - Drop the inline functions, and convert them to macros. Also, move these macros into pfil.h - Move pfil list locking macros intp phil.h as well - Rename ph_busy_count to ph_nhooks. This variable will represent the number of IN/OUT hooks registered with the pfil head structure - Define PFIL_HOOKED macro which evaluates to true if there are any hooks to be ran by pfil_run_hooks - In the IP/IP6 stacks, change the ph_busy_count comparison to use the new PFIL_HOOKED macro. - Drop optimization in pfil_run_hooks which checks to see if there are any hooks to be ran, and returns if not. This check is already performed by the IP stacks when they call: if (!PFIL_HOOKED(ph)) goto skip_hooks; - Drop in assertion which makes sure that the number of hooks never drops below 0 for good measure. This in theory should never happen, and if it does than there are problems somewhere - Drop special logic around PFIL_WAITOK because rw_wlock(9) does not sleep - Drop variables which support home rolled read/write locking mechanism from the IPFW firewall chain structure. - Swap out the read/write firewall chain lock internal to use the rwlock(9) API instead of our home rolled version - Convert the inlined functions to macros Reviewed by: mlaier, andre, glebius Thanks to: jhb for the new locking API Revision Changes Path 1.14 +22 -100 src/sys/net/pfil.c 1.14 +11 -11 src/sys/net/pfil.h 1.35 +2 -2 src/sys/netinet/ip_fastfwd.c 1.125 +10 -45 src/sys/netinet/ip_fw2.c 1.314 +1 -1 src/sys/netinet/ip_input.c 1.255 +1 -1 src/sys/netinet/ip_output.c 1.31 +1 -1 src/sys/netinet6/ip6_forward.c 1.86 +1 -1 src/sys/netinet6/ip6_input.c 1.102 +1 -1 src/sys/netinet6/ip6_output.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602020313.k123DGFl029834>