freebsd-dev/sys/net
Luigi Rizzo e4fc250c15 Device Polling code for -current.
Non-SMP, i386-only, no polling in the idle loop at the moment.

To use this code you must compile a kernel with

        options DEVICE_POLLING

and at runtime enable polling with

        sysctl kern.polling.enable=1

The percentage of CPU reserved to userland can be set with

        sysctl kern.polling.user_frac=NN (default is 50)

while the remainder is used by polling device drivers and netisr's.
These are the only two variables that you should need to touch. There
are a few more parameters in kern.polling but the default values
are adequate for all purposes. See the code in kern_poll.c for
more details on them.

Polling in the idle loop will be implemented shortly by introducing
a kernel thread which does the job. Until then, the amount of CPU
dedicated to polling will never exceed (100-user_frac).
The equivalent (actually, better) code for -stable is at

	http://info.iet.unipi.it/~luigi/polling/

and also supports polling in the idle loop.

NOTE to Alpha developers:
There is really nothing in this code that is i386-specific.
If you move the 2 lines supporting the new option from
sys/conf/{files,options}.i386 to sys/conf/{files,options} I am
pretty sure that this should work on the Alpha as well, just that
I do not have a suitable test box to try it. If someone feels like
trying it, I would appreciate it.

NOTE to other developers:
sure some things could be done better, and as always I am open to
constructive criticism, which a few of you have already given and
I greatly appreciated.
However, before proposing radical architectural changes, please
take some time to possibly try out this code, or at the very least
read the comments in kern_poll.c, especially re. the reason why I
am using a soft netisr and cannot (I believe) replace it with a
simple timeout.

Quick description of files touched by this commit:

sys/conf/files.i386
        new file kern/kern_poll.c
sys/conf/options.i386
        new option
sys/i386/i386/trap.c
        poll in trap (disabled by default)
sys/kern/kern_clock.c
        initialization and hardclock hooks.
sys/kern/kern_intr.c
        minor swi_net changes
sys/kern/kern_poll.c
        the bulk of the code.
sys/net/if.h
        new flag
sys/net/if_var.h
        declaration for functions used in device drivers.
sys/net/netisr.h
        NETISR_POLL
sys/dev/fxp/if_fxp.c
sys/dev/fxp/if_fxpvar.h
sys/pci/if_dc.c
sys/pci/if_dcreg.h
sys/pci/if_sis.c
sys/pci/if_sisreg.h
        device driver modifications
2001-12-14 17:56:12 +00:00
..
bpf_compat.h
bpf_filter.c Add ia64 to the list of machines which don't do unaligned reads. 2001-10-05 19:04:23 +00:00
bpf.c - M_ZERO already sets bif_dlist to zero; there is no need to 2001-11-18 03:41:20 +00:00
bpf.h Update our bpf.h with tcpdump.org's new DLT_ types. 2001-07-31 23:27:06 +00:00
bpfdesc.h KSE Milestone 2 2001-09-12 08:38:13 +00:00
bridge.c Whitespace change - replace leading spaces with tabs. 2001-11-24 01:47:50 +00:00
bridge.h MFS: sync the ipfw/dummynet/bridge code with the one recently merged 2001-11-04 22:56:25 +00:00
bsd_comp.c
ethernet.h Don't pass an interface pointer to VLAN_INPUT{,_TAG}. Get it from the 2001-12-03 17:28:27 +00:00
fddi.h
if_arc.h bring in ARP support for variable length link level addresses 2001-10-14 20:17:53 +00:00
if_arp.h bring in ARP support for variable length link level addresses 2001-10-14 20:17:53 +00:00
if_atm.h
if_atmsubr.c Fix warning; remove unused variable 2001-06-15 07:32:25 +00:00
if_disc.c Pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2. 2001-10-17 18:07:05 +00:00
if_dl.h
if_ef.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
if_ethersubr.c Moved the updating of if_ibytes from ether_demux() to ether_input() to fix 2001-12-14 04:41:07 +00:00
if_faith.c Pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2. 2001-10-17 18:07:05 +00:00
if_fddisubr.c bring in ARP support for variable length link level addresses 2001-10-14 20:17:53 +00:00
if_gif.c /home/brooks/ng_gif.message 2001-09-26 23:50:17 +00:00
if_gif.h /home/brooks/ng_gif.message 2001-09-26 23:50:17 +00:00
if_ieee80211.h
if_iso88025subr.c bring in ARP support for variable length link level addresses 2001-10-14 20:17:53 +00:00
if_llc.h
if_loop.c Pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2. 2001-10-17 18:07:05 +00:00
if_media.c
if_media.h
if_mib.c The interface index space may be sparsely populated (e.g. when an 2001-10-17 04:12:29 +00:00
if_mib.h
if_ppp.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
if_ppp.h
if_pppvar.h KSE Milestone 2 2001-09-12 08:38:13 +00:00
if_sl.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
if_slvar.h sc_lasttime and sc_starttime are time_t's, not long's. 2001-10-27 20:31:24 +00:00
if_sppp.h Sync with recent KAME. 2001-06-11 12:39:29 +00:00
if_spppsubr.c Update the hash table when sppp mucks directly with the interface address. 2001-10-01 18:14:49 +00:00
if_stf.c - malloc should be passed M_WAITOK, not M_WAIT (a mbuf flag) 2001-12-07 01:32:40 +00:00
if_stf.h Patches from KAME to remove usage of Varargs in existing 2001-09-07 07:19:12 +00:00
if_tap.c Use the passed in thread to selrecord() instead of curthread. 2001-09-21 22:46:54 +00:00
if_tap.h
if_tapvar.h Add cloning support for the tap(4) device similar to that in the tun(4) 2001-09-05 01:06:21 +00:00
if_tun.c Use the passed in thread to selrecord() instead of curthread. 2001-09-21 22:46:54 +00:00
if_tun.h
if_tunvar.h Support /dev/tun cloning. Ansify if_tun.c while I'm there. 2001-06-01 15:51:10 +00:00
if_types.h
if_var.h Device Polling code for -current. 2001-12-14 17:56:12 +00:00
if_vlan_var.h Make vlan(4) loadable, unloadable, and clonable. As a side effect, 2001-09-05 21:10:28 +00:00
if_vlan.c - Utilize the great M_ZERO flag rather than allocating memory then do 2001-11-21 20:29:08 +00:00
if.c Add a SIOCGIFINDEX ioctl, which returns the index of a named interface. 2001-10-17 19:40:44 +00:00
if.h Device Polling code for -current. 2001-12-14 17:56:12 +00:00
intrq.c
intrq.h
iso88025.h
net_osdep.c incorrect bounds-check on snprintf. 2001-07-26 19:14:52 +00:00
net_osdep.h Sync with recent KAME. 2001-06-11 12:39:29 +00:00
netisr.h Device Polling code for -current. 2001-12-14 17:56:12 +00:00
pfil.c
pfil.h Remove extra memory region kept by "struct pfil_head pfil_head_t;". 2001-10-22 08:46:23 +00:00
pfkeyv2.h printed current sequence number of the SA. accordingly, changed 2001-08-06 19:40:01 +00:00
ppp_comp.h
ppp_deflate.c
ppp_defs.h Sync with recent KAME. 2001-06-11 12:39:29 +00:00
ppp_tty.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
radix.c
radix.h
raw_cb.c Give struct socket structures a ref counting interface similar to 2001-11-17 03:07:11 +00:00
raw_cb.h KSE Milestone 2 2001-09-12 08:38:13 +00:00
raw_usrreq.c Give struct socket structures a ref counting interface similar to 2001-11-17 03:07:11 +00:00
route.c Fix a typo in a comment 2001-11-28 16:15:52 +00:00
route.h Introduce a syncache, which enables FreeBSD to withstand a SYN flood 2001-11-22 04:50:44 +00:00
rtsock.c Pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2. 2001-10-17 18:07:05 +00:00
slcompress.c
slcompress.h
slip.h
zlib.c
zlib.h