summaryrefslogtreecommitdiffstats
path: root/sys/net/netisr.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2007-07-27 11:59:57 +0000
committerrwatson <rwatson@FreeBSD.org>2007-07-27 11:59:57 +0000
commitc29e74320ba2271247571fc5ac01363963dcf016 (patch)
tree1d0bccf3909d0a0064cfcd777f148f0f6b272555 /sys/net/netisr.c
parent16ad7cce99fdefc348a2c705afbcdccf1057386f (diff)
downloadFreeBSD-src-c29e74320ba2271247571fc5ac01363963dcf016.zip
FreeBSD-src-c29e74320ba2271247571fc5ac01363963dcf016.tar.gz
First in a series of changes to remove the now-unused Giant compatibility
framework for non-MPSAFE network protocols: - Remove debug_mpsafenet variable, sysctl, and tunable. - Remove NET_NEEDS_GIANT() and associate SYSINITSs used by it to force debug.mpsafenet=0 if non-MPSAFE protocols are compiled into the kernel. - Remove logic to automatically flag interrupt handlers as non-MPSAFE if debug.mpsafenet is set for an INTR_TYPE_NET handler. - Remove logic to automatically flag netisr handlers as non-MPSAFE if debug.mpsafenet is set. - Remove references in a few subsystems, including NFS and Cronyx drivers, which keyed off debug_mpsafenet to determine various aspects of their own locking behavior. - Convert NET_LOCK_GIANT(), NET_UNLOCK_GIANT(), and NET_ASSERT_GIANT into no-op's, as their entire behavior was determined by the value in debug_mpsafenet. - Alias NET_CALLOUT_MPSAFE to CALLOUT_MPSAFE. Many remaining references to NET_.*_GIANT() and NET_CALLOUT_MPSAFE are still present in subsystems, and will be removed in followup commits. Reviewed by: bz, jhb Approved by: re (kensmith)
Diffstat (limited to 'sys/net/netisr.c')
-rw-r--r--sys/net/netisr.c92
1 files changed, 0 insertions, 92 deletions
diff --git a/sys/net/netisr.c b/sys/net/netisr.c
index b44b030..d4bf693 100644
--- a/sys/net/netisr.c
+++ b/sys/net/netisr.c
@@ -56,24 +56,6 @@
#include <net/if_var.h>
#include <net/netisr.h>
-/*
- * debug_mpsafenet controls network subsystem-wide use of the Giant lock,
- * from system calls down to interrupt handlers. It can be changed only via
- * a tunable at boot, not at run-time, due to the complexity of unwinding.
- * The compiled default is set via a kernel option; right now, the default
- * unless otherwise specified is to run the network stack without Giant.
- */
-#ifdef NET_WITH_GIANT
-int debug_mpsafenet = 0;
-#else
-int debug_mpsafenet = 1;
-#endif
-int debug_mpsafenet_toolatetotwiddle = 0;
-
-TUNABLE_INT("debug.mpsafenet", &debug_mpsafenet);
-SYSCTL_INT(_debug, OID_AUTO, mpsafenet, CTLFLAG_RD, &debug_mpsafenet, 0,
- "Enable/disable MPSAFE network support");
-
volatile unsigned int netisr; /* scheduling bits for network */
struct netisr {
@@ -84,78 +66,6 @@ struct netisr {
static void *net_ih;
-/*
- * Not all network code is currently capable of running MPSAFE; however,
- * most of it is. Since those sections that are not are generally optional
- * components not shipped with default kernels, we provide a basic way to
- * determine whether MPSAFE operation is permitted: based on a default of
- * yes, we permit non-MPSAFE components to use a registration call to
- * identify that they require Giant. If the system is early in the boot
- * process still, then we change the debug_mpsafenet setting to choose a
- * non-MPSAFE execution mode (degraded). If it's too late for that (since
- * the setting cannot be changed at run time), we generate a console warning
- * that the configuration may be unsafe.
- */
-static int mpsafe_warn_count;
-
-/*
- * Function call implementing registration of a non-MPSAFE network component.
- */
-void
-net_warn_not_mpsafe(const char *component)
-{
-
- /*
- * If we're running with Giant over the network stack, there is no
- * problem.
- */
- if (!debug_mpsafenet)
- return;
-
- /*
- * If it's not too late to change the MPSAFE setting for the network
- * stack, do so now. This effectively suppresses warnings by
- * components registering later.
- */
- if (!debug_mpsafenet_toolatetotwiddle) {
- debug_mpsafenet = 0;
- printf("WARNING: debug.mpsafenet forced to 0 as %s requires "
- "Giant\n", component);
- return;
- }
-
- /*
- * We must run without Giant, so generate a console warning with some
- * information with what to do about it. The system may be operating
- * unsafely, however.
- */
- printf("WARNING: Network stack Giant-free, but %s requires Giant.\n",
- component);
- if (mpsafe_warn_count == 0)
- printf(" Consider adding 'options NET_WITH_GIANT' or "
- "setting debug.mpsafenet=0\n");
- mpsafe_warn_count++;
-}
-
-/*
- * This sysinit is run after any pre-loaded or compiled-in components have
- * announced that they require Giant, but before any modules loaded at
- * run-time.
- */
-static void
-net_mpsafe_toolate(void *arg)
-{
-
- debug_mpsafenet_toolatetotwiddle = 1;
-
- if (!debug_mpsafenet)
- printf("WARNING: MPSAFE network stack disabled, expect "
- "reduced performance.\n");
-}
-
-SYSINIT(net_mpsafe_toolate, SI_SUB_SETTINGS, SI_ORDER_ANY, net_mpsafe_toolate,
- NULL);
-
void
legacy_setsoftnet(void)
{
@@ -170,8 +80,6 @@ netisr_register(int num, netisr_t *handler, struct ifqueue *inq, int flags)
("bad isr %d", num));
netisrs[num].ni_handler = handler;
netisrs[num].ni_queue = inq;
- if ((flags & NETISR_MPSAFE) && !debug_mpsafenet)
- flags &= ~NETISR_MPSAFE;
netisrs[num].ni_flags = flags;
}
OpenPOWER on IntegriCloud