summaryrefslogtreecommitdiffstats
path: root/sys/net/netisr.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-06-01 15:03:58 +0000
committerrwatson <rwatson@FreeBSD.org>2009-06-01 15:03:58 +0000
commitd07d0043a31847f2d486b9fe0361d797044cdb88 (patch)
tree493cd2ad0dedc382116d8d0481d155f4a87f795a /sys/net/netisr.c
parente8098c95bea5d973764758a8c31e70a7c5ac6460 (diff)
downloadFreeBSD-src-d07d0043a31847f2d486b9fe0361d797044cdb88.zip
FreeBSD-src-d07d0043a31847f2d486b9fe0361d797044cdb88.tar.gz
Garbage collect NETISR_POLL and NETISR_POLLMORE, which are no longer
required for options DEVICE_POLLING. De-fragment the NETISR_ constant space and lower NETISR_MAXPROT from 32 to 16 -- when sizing queue arrays using this compile-time constant, significant amounts of memory are saved. Warn on the console when tunable values for netisr are automatically adjusted during boot due to exceeding limits, invalid values, or as a result of DEVICE_POLLING.
Diffstat (limited to 'sys/net/netisr.c')
-rw-r--r--sys/net/netisr.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/sys/net/netisr.c b/sys/net/netisr.c
index 1a75ae8..f0b7161 100644
--- a/sys/net/netisr.c
+++ b/sys/net/netisr.c
@@ -201,7 +201,7 @@ struct netisr_proto {
u_int np_policy; /* Work placement policy. */
};
-#define NETISR_MAXPROT 32 /* Compile-time limit. */
+#define NETISR_MAXPROT 16 /* Compile-time limit. */
/*
* The np array describes all registered protocols, indexed by protocol
@@ -1045,20 +1045,31 @@ netisr_init(void *arg)
KASSERT(curcpu == 0, ("%s: not on CPU 0", __func__));
NETISR_LOCK_INIT();
- if (netisr_maxthreads < 1)
+ if (netisr_maxthreads < 1) {
+ printf("netisr2: forcing maxthreads to 1\n");
netisr_maxthreads = 1;
- if (netisr_maxthreads > MAXCPU)
+ }
+ if (netisr_maxthreads > MAXCPU) {
+ printf("netisr2: forcing maxthreads to %d\n", MAXCPU);
netisr_maxthreads = MAXCPU;
- if (netisr_defaultqlimit > netisr_maxqlimit)
+ }
+ if (netisr_defaultqlimit > netisr_maxqlimit) {
+ printf("netisr2: forcing defaultqlimit to %d\n",
+ netisr_maxqlimit);
netisr_defaultqlimit = netisr_maxqlimit;
+ }
#ifdef DEVICE_POLLING
/*
* The device polling code is not yet aware of how to deal with
* multiple netisr threads, so for the time being compiling in device
* polling disables parallel netisr workers.
*/
- netisr_maxthreads = 1;
- netisr_bindthreads = 0;
+ if (netisr_maxthreads != 1 || netisr_bindthreads != 0) {
+ printf("netisr2: forcing maxthreads to 1 and bindthreads to "
+ "0 for device polling\n");
+ netisr_maxthreads = 1;
+ netisr_bindthreads = 0;
+ }
#endif
netisr_start_swi(curcpu, pcpu_find(curcpu));
OpenPOWER on IntegriCloud