BUSDMA for en(4)
This has been commited to -CURRENT
en1.diff patch to busdma-ify the driver for
Efficient networks and Adaptec ATM cards.
This patch is rather large because I had to re-arrange the code
for busdma. While doing this I also decided to bring it to KNF.
It does the following things:
- use busdma for DMA.
- try to correct locking. There may still be problems with this mainly
because the locking rules for major kernel interfaces (malloc and mbuf) and
not yet clear. There should be no problems as long as the driver is not declared
MPSAFE.
- remove all NetBSD compatibility cruft. It was not possible to keep
NetBSD non-busdma and FreeBSD busdma together in one source. NetBSD
busdma is somewhat different, but it should be simple to do the
necessary changes.
- remove a lot of options (ENI_ONLY, ADP_ONLY, USE_DMA, ...).
- implement a sysctl to set the debugging level at runtime (given that
debugging is compiled in).
- stylify the source. The original style was too hard to read to make
such a big change in the original style.
- re-arrange the code.
- add building as a module (not connected to the build yet).
The driver has been tested with ENI client and server cards and an Adaptec
card (thanks to Kenjiro for this card) on both i386 and sparc64. Performance
is as expected: TCP througput between a Sparc Ultra 10 and an 900MHz i386
is around 8 and 14MBit/s depending on the direction.
Old versions of the patch:
- en0.diff. This one had two problems: a uma_zalloc
with M_WAITOK in en_start. Also we need to wait a little bit in the
dmaprobe routine before releasing the memory we have allocated: the
card doesn't reset so fast and will modify the memory after we have released
it.