diff options
author | sam <sam@FreeBSD.org> | 2003-10-29 18:29:50 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2003-10-29 18:29:50 +0000 |
commit | 1beb7cc4f2bb410e4d3c01bc4e769d480cf7738a (patch) | |
tree | 7fb6e15080ee45b0a5df212725fad55d340e1b2b /sys | |
parent | 6a559fd9e1ca0a9c5a7afa999d84bf024ad0647f (diff) | |
download | FreeBSD-src-1beb7cc4f2bb410e4d3c01bc4e769d480cf7738a.zip FreeBSD-src-1beb7cc4f2bb410e4d3c01bc4e769d480cf7738a.tar.gz |
Add a temporary mechanism to disble INTR_MPSAFE from network interface
drivers. This is prepatory to running more parts of the network system
w/o Giant.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_bus.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 6a35313..1b3149f 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -2133,6 +2133,16 @@ bus_release_resource(device_t dev, int type, int rid, struct resource *r) return (BUS_RELEASE_RESOURCE(dev->parent, dev, type, rid, r)); } +/* + * XXX this is a temporary measure to allow folks to + * XXX disable INTR_MPSAFE in network drivers without + * XXX recompiling--in case of problems. + */ +int debug_mpsafenet = 1; +TUNABLE_INT("debug.mpsafenet", &debug_mpsafenet); +SYSCTL_INT(_debug, OID_AUTO, mpsafenet, CTLFLAG_RW, &debug_mpsafenet, 0, + "Enable/disable MPSAFE network support"); + int bus_setup_intr(device_t dev, struct resource *r, int flags, driver_intr_t handler, void *arg, void **cookiep) @@ -2140,6 +2150,9 @@ bus_setup_intr(device_t dev, struct resource *r, int flags, int error; if (dev->parent != 0) { + if ((flags &~ INTR_ENTROPY) == (INTR_TYPE_NET | INTR_MPSAFE) && + !debug_mpsafenet) + flags &= ~INTR_MPSAFE; error = BUS_SETUP_INTR(dev->parent, dev, r, flags, handler, arg, cookiep); if (error == 0) { |