Add ifpoll, which support hardware TX/RX queues based polling.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 26 Apr 2009 03:04:18 +0000 (11:04 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 27 Apr 2009 12:26:17 +0000 (20:26 +0800)
commitb3a7093f50ab968ffe0b9d2663cf41b81cc5431f
treeb2b90f8e78456ff0a6d831b3f29dc735f489e17b
parentf3e607ffdb4325a0cffab3856f1b91411ed4e145
Add ifpoll, which support hardware TX/RX queues based polling.
The implementation is mainly based on the polling(4) code.

Difference to the polling(4):
- Instead of registering one polling handler for both TX/RX and status,
  drivers could register multiple polling handlers for TX/RX polling
  handler on different CPU based on its own needs.  And drivers could
  register one status check handler, which is always polled on CPU0.
- TX could be polled at lower frequency than RX; normally we don't
  need high frequency polling for TX, but for RX, we may need relative
  higher polling frequency.
- Better serializer integration.

ifnet changes:
- ifnet.if_qpoll is added, which should be implemented by driver which
  supports ifpoll.
- IFF_NPOLLING is added to indicate that the driver is using ifpoll.

ifconfig(8):
- Add 'npolling' and '-npolling'; they are used to turn on/off ifpoll
  on the specified interface.

Drivers:
- emx(4) is converted to use the ifpoll.  Coexistance of ifpoll and
  polling(4) in one driver requires extra effort in driver itself;
  drop polling(4) support in emx(4) for now.

IFPOLL_ENABLE kernel option is added, which is not enabled by default.
sbin/ifconfig/ifconfig.c
sys/conf/files
sys/conf/options
sys/dev/netif/emx/Makefile
sys/dev/netif/emx/if_emx.c
sys/kern/kern_clock.c
sys/net/if.c
sys/net/if.h
sys/net/if_poll.c [new file with mode: 0644]
sys/net/if_poll.h [new file with mode: 0644]
sys/net/if_var.h