freebsd-nq/sys
Marko Zec f089869fa5 Introduce a mechanism for detecting calls from outbound path of the
network stack when reentering the inbound path from netgraph, and
force queueing of mbufs at the outbound netgraph node.

The mechanism relies on two components.  First, in netgraph nodes
where outbound path of the network stack calls into netgraph, the
current thread has to be appropriately marked using the new
NG_OUTBOUND_THREAD_REF() macro before proceeding to call further
into the netgraph topology, and unmarked using the
NG_OUTBOUND_THREAD_UNREF() macro before returning to the caller.
Second, netgraph nodes which can potentially reenter the network
stack in the inbound path have to mark their inbound hooks using
NG_HOOK_SET_TO_INBOUND() macro.  The netgraph framework will then
detect when there is a danger of a call graph looping back from
outbound to inbound path via netgraph, and defer handing off the
mbufs to the "inbound" node to a worker thread with a clean stack.

In this first pass only the most obvious netgraph nodes have been
updated to ensure no outbound to inbound calls can occur.  Nodes
such as ng_ipfw, ng_gif etc. should be further examined whether a
potential for outbound to inbound call looping exists.

This commit changes the layout of struct thread, but due to
__FreeBSD_version number shortage a version bump has been omitted
at this time, nevertheless kernel and modules have to be rebuilt.

Reviewed by:	julian, rwatson, bz
Approved by:	julian (mentor)
2009-06-11 16:50:49 +00:00
..
amd64 Add alc(4), a driver for Atheros AR8131/AR8132 PCIe ethernet 2009-06-10 02:07:58 +00:00
arm Eliminate devclass_find_free_unit call here, since -1 gives the same 2009-06-10 17:39:19 +00:00
boot Add alc(4), a driver for Atheros AR8131/AR8132 PCIe ethernet 2009-06-10 02:07:58 +00:00
bsm
cam Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use 2009-06-10 20:59:32 +00:00
cddl check against prefetch_enable 2009-06-11 09:51:21 +00:00
compat Regenerate 2009-06-10 13:48:43 +00:00
conf All these Ethernet NICs depend on INET, mostly for unconditional 2009-06-11 12:56:14 +00:00
contrib All consumers of in_cksum.h have been properly #ifdefed already, 2009-06-10 11:19:34 +00:00
crypto Changed to M_NOWAIT when reallocing psc_buf in padlock_sha_update(), 2009-05-27 09:52:12 +00:00
ddb Place hostnames and similar information fully under the prison system. 2009-05-29 21:27:12 +00:00
dev - Remove unnecessary read memory barriers from atomic operations[1]. 2009-06-11 16:48:59 +00:00
fs This commit is analagous to r193952, but for the experimental nfs 2009-06-10 21:16:39 +00:00
gdb
geom As discussed in the devsummit, introduce two fields in the 2009-06-11 09:55:26 +00:00
gnu Fix r193923 by noting that type of a_fp is struct file *, not int. 2009-06-10 14:24:31 +00:00
i386 Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use 2009-06-10 20:59:32 +00:00
ia64 Import ACPICA 20090521. 2009-06-05 18:44:36 +00:00
isa
kern Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use 2009-06-10 20:59:32 +00:00
kgssapi Place hostnames and similar information fully under the prison system. 2009-05-29 21:27:12 +00:00
libkern add explanatory header license 2009-06-09 21:29:16 +00:00
mips pmap_enter() *must* set PG_WRITEABLE on the given page if it creates a 2009-05-23 22:05:14 +00:00
modules Attempt to fix parallel build. 2009-06-10 11:33:47 +00:00
net carp(4) allows people to share a set of IP addresses and can only 2009-06-11 10:26:38 +00:00
net80211 When associating to an AP we don't know if HT is negotiated until 2009-06-11 04:43:42 +00:00
netatalk Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERIC 2009-06-05 14:55:22 +00:00
netgraph Introduce a mechanism for detecting calls from outbound path of the 2009-06-11 16:50:49 +00:00
netinet Correct printf format type mismatches. 2009-06-11 14:37:18 +00:00
netinet6 Prevent integer overflow in direct pipe write code from circumventing 2009-06-10 10:31:11 +00:00
netipsec Properly hide IPv4 only variables and functions under #ifdef INET. 2009-06-10 19:25:46 +00:00
netipx Put the variable declarations for TCPDEBUG under #ifdef INET as well. 2009-06-10 09:28:50 +00:00
netnatm Reimplement the netisr framework in order to support parallel netisr 2009-06-01 10:41:38 +00:00
netncp
netsmb Rework socket upcalls to close some races with setup/teardown of upcalls. 2009-06-01 21:17:03 +00:00
nfs
nfsclient Add a test for VI_DOOMED just after nfs_upgrade_vnlock() in 2009-06-10 21:03:57 +00:00
nfsserver Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERIC 2009-06-05 14:55:22 +00:00
nlm Correct typo; errno => error. 2009-06-04 11:22:53 +00:00
opencrypto Fix cryptodev UIO creation. 2009-05-23 13:23:46 +00:00
pc98 Remove MAC kernel config files and add "options MAC" to GENERIC, with the 2009-06-02 18:31:08 +00:00
pci When user_frac in the polling subsystem is low it is going to busy the 2009-05-30 15:14:44 +00:00
powerpc Move from using devclass_find_free_unit(ata_devclass, 0) to -1 for the 2009-06-10 17:40:18 +00:00
rpc For the case where another thread was doing a connect and that 2009-06-10 19:02:09 +00:00
security Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use 2009-06-10 20:59:32 +00:00
sparc64 Remove MAC kernel config files and add "options MAC" to GENERIC, with the 2009-06-02 18:31:08 +00:00
sun4v Adjust the padding of struct pcpu to r193219. 2009-06-03 19:31:26 +00:00
sys Introduce a mechanism for detecting calls from outbound path of the 2009-06-11 16:50:49 +00:00
tools Move all sound related scripts to its own 'sound' subdir. 2009-06-10 06:49:45 +00:00
ufs Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERIC 2009-06-05 14:55:22 +00:00
vm Eliminate an unnecessary restriction on the vm object type from 2009-06-09 17:04:39 +00:00
xdr MFdevbranch 192944 2009-05-28 08:18:12 +00:00
xen Make ipi_cpu() function as intended. 2009-05-30 08:53:13 +00:00
Makefile Remove the unmaintained University of Michigan NFSv4 client from 8.x 2009-05-22 12:35:12 +00:00