diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-06-01 15:03:58 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-06-01 15:03:58 +0000 |
commit | d07d0043a31847f2d486b9fe0361d797044cdb88 (patch) | |
tree | 493cd2ad0dedc382116d8d0481d155f4a87f795a /sys | |
parent | e8098c95bea5d973764758a8c31e70a7c5ac6460 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/net/netisr.c | 23 | ||||
-rw-r--r-- | sys/net/netisr.h | 24 |
2 files changed, 28 insertions, 19 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)); diff --git a/sys/net/netisr.h b/sys/net/netisr.h index f299b2e..5894d3d 100644 --- a/sys/net/netisr.h +++ b/sys/net/netisr.h @@ -39,19 +39,17 @@ * Historically, this was implemented by the BSD software ISR facility; it is * now implemented via a software ithread (SWI). */ -#define NETISR_POLL 0 /* polling callback, must be first */ -#define NETISR_IP 2 /* same as AF_INET */ -#define NETISR_IGMP 3 /* IGMPv3 output queue */ -#define NETISR_ROUTE 14 /* routing socket */ -#define NETISR_AARP 15 /* Appletalk ARP */ -#define NETISR_ATALK2 16 /* Appletalk phase 2 */ -#define NETISR_ATALK1 17 /* Appletalk phase 1 */ -#define NETISR_ARP 18 /* same as AF_LINK */ -#define NETISR_IPX 23 /* same as AF_IPX */ -#define NETISR_ETHER 24 /* ethernet input */ -#define NETISR_IPV6 27 -#define NETISR_NATM 28 -#define NETISR_POLLMORE 31 /* polling callback, must be last */ +#define NETISR_IP 1 +#define NETISR_IGMP 2 /* IGMPv3 output queue */ +#define NETISR_ROUTE 3 /* routing socket */ +#define NETISR_AARP 4 /* Appletalk ARP */ +#define NETISR_ATALK2 5 /* Appletalk phase 2 */ +#define NETISR_ATALK1 6 /* Appletalk phase 1 */ +#define NETISR_ARP 7 /* same as AF_LINK */ +#define NETISR_IPX 8 /* same as AF_IPX */ +#define NETISR_ETHER 9 /* ethernet input */ +#define NETISR_IPV6 10 +#define NETISR_NATM 11 /*- * Protocols express ordering constraints and affinity preferences by |