diff options
author | Renato Botelho <renato@netgate.com> | 2015-08-17 13:53:08 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-08-17 13:53:08 -0300 |
commit | 3138b91794b7453f936dd614d2083c13351eddbe (patch) | |
tree | 4827c2ae1e7e8201ab75de40cbfb15518a3c3918 /sys | |
parent | 309b6af17fca036e4818040aa67b13409e0ad27e (diff) | |
download | FreeBSD-src-3138b91794b7453f936dd614d2083c13351eddbe.zip FreeBSD-src-3138b91794b7453f936dd614d2083c13351eddbe.tar.gz |
Importing pfSense patch netisr_default_values.diff
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/netisr.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/sys/net/netisr.c b/sys/net/netisr.c index 0cc6bb8..ef34600 100644 --- a/sys/net/netisr.c +++ b/sys/net/netisr.c @@ -126,6 +126,13 @@ static struct rmlock netisr_rmlock; static SYSCTL_NODE(_net, OID_AUTO, isr, CTLFLAG_RW, 0, "netisr"); +#ifdef DEVICE_POLLING +static int netisr_polling = 0; /* Enable Polling. */ +TUNABLE_INT("net.isr.polling_enable", &netisr_polling); +SYSCTL_INT(_net_isr, OID_AUTO, polling_enable, CTLFLAG_RW, + &netisr_polling, 0, "Enable polling"); +#endif + /*- * Three global direct dispatch policies are supported: * @@ -168,7 +175,7 @@ SYSCTL_INT(_net_isr, OID_AUTO, maxthreads, CTLFLAG_RDTUN, &netisr_maxthreads, 0, "Use at most this many CPUs for netisr processing"); -static int netisr_bindthreads = 0; /* Bind threads to CPUs. */ +static int netisr_bindthreads = 1; /* Bind threads to CPUs. */ TUNABLE_INT("net.isr.bindthreads", &netisr_bindthreads); SYSCTL_INT(_net_isr, OID_AUTO, bindthreads, CTLFLAG_RDTUN, &netisr_bindthreads, 0, "Bind netisr threads to CPUs."); @@ -796,9 +803,11 @@ swi_net(void *arg) nwsp = arg; #ifdef DEVICE_POLLING - KASSERT(nws_count == 1, - ("%s: device_polling but nws_count != 1", __func__)); - netisr_poll(); + if (netisr_polling) { + KASSERT(nws_count == 1, + ("%s: device_polling but nws_count != 1", __func__)); + netisr_poll(); + } #endif #ifdef NETISR_LOCKING NETISR_RLOCK(&tracker); @@ -823,7 +832,8 @@ out: NETISR_RUNLOCK(&tracker); #endif #ifdef DEVICE_POLLING - netisr_pollmore(); + if (netisr_polling) + netisr_pollmore(); #endif } @@ -1078,6 +1088,9 @@ netisr_sched_poll(void) { struct netisr_workstream *nwsp; + if (!netisr_polling) + return; + nwsp = DPCPU_ID_PTR(nws_array[0], nws); NWS_SIGNAL(nwsp); } @@ -1151,7 +1164,7 @@ netisr_init(void *arg) * multiple netisr threads, so for the time being compiling in device * polling disables parallel netisr workers. */ - if (netisr_maxthreads != 1 || netisr_bindthreads != 0) { + if (netisr_polling && (netisr_maxthreads != 1 || netisr_bindthreads != 0)) { printf("netisr_init: forcing maxthreads to 1 and " "bindthreads to 0 for device polling\n"); netisr_maxthreads = 1; |