Rewrite the polling code. Instead of trying to do fancy polling enablement
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 25 May 2005 01:44:33 +0000 (01:44 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 25 May 2005 01:44:33 +0000 (01:44 +0000)
commit9c095379236460b62dd1fb3ef8e73e749beca27e
treeba1fe7eb0c9a46ff56f2427ff957548addb228ce
parented03f3a3f0a5c3b55c21258770b4982d1a8e3ac3
Rewrite the polling code.  Instead of trying to do fancy polling enablement
from inside the IF interrupt itself, which creates a headache in the code,
simply allow IFF_POLLING to be set and cleared via ifconfig.  This greatly
simplifies both the networking code and the polling code and allows polling
to be enabled and disabled at will on a per-network-interface basis.

* Drivers no longer have to have polling checks in the interrupt path.
* An if_poll function vector has been added.  Polling is supported if the
  driver initializes the vector.
* Registration command added to the poll function command list.
* Driver code for registration and deregistration is now greatly simplified.

The kernel polling code no longer randomly turns off the polling bit if an
interface goes down or is reset.

Remove IFCAP_POLLING, it serves no purpose.

Fix a couple of bugs in the serializer code.  Add a warning in
nexus_setup_intr if a driver tries to specify a serializer and an SPL.
A driver can specify one or the other, not both.

Convert the EM driver to use the new serializer API instead of SPLs.

Add ifconfig poll and ifconfig -poll support to ifconfig, and fix bugs
in the rtsock code that only returned the low 16 bits of the interface
flags so ifconfig properly reports when polling mode is turned on for an
interface.

NOTE to people using polling.  You must first enable polling via
kern.polling.enable, and then may specify the 'poll' directive in ifconfig
to enable it on a per interface basis.  If IFF_POLLING refuses to be set,
the device does not support polling.
22 files changed:
sbin/ifconfig/ifconfig.c
sys/cpu/i386/include/atomic.h
sys/dev/netif/dc/if_dc.c
sys/dev/netif/em/if_em.c
sys/dev/netif/em/if_em.h
sys/dev/netif/fwe/if_fwe.c
sys/dev/netif/fxp/if_fxp.c
sys/dev/netif/nge/if_nge.c
sys/dev/netif/re/if_re.c
sys/dev/netif/rl/if_rl.c
sys/dev/netif/sis/if_sis.c
sys/dev/netif/vr/if_vr.c
sys/dev/netif/wi/if_wi.c
sys/i386/i386/nexus.c
sys/i386/include/atomic.h
sys/kern/kern_poll.c
sys/kern/lwkt_serialize.c
sys/net/altq/altq_rmclass.c
sys/net/if.c
sys/net/if_var.h
sys/net/rtsock.c
sys/platform/pc32/i386/nexus.c