Linux-kernel mailing list archive 1999-36,: Bottom half for network drivers

# Bottom half for network drivers

Vadim Lebedev (vlebedev@aplio.fr)
Fri, 10 Sep 1999 17:51:02 +0200

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Chuck Lever: "Re: [patch] touch_buffer in getblk"
- Previous message: Joe: "Re: Shortening the Development Cycle... [maybe OffTopic, flame-bait?]"
- Next in thread: Vadim Lebedev: "Re: Bottom half for network drivers"
- Reply: Vadim Lebedev: "Re: Bottom half for network drivers"
- Reply: Vadim Lebedev: "Re: Bottom half for network drivers"
- Reply: Donald Jeff Dionne: "Re: Bottom half for network drivers"

Hello,

I'm working on ucLinux for motorolla mc68en302 microcontroller.
This MCU has a sofisticated built-in ethernet interface and i wrote a
driver for it.
The sofistcication come from the fact that the ethernet contoller gives you
a possibility to setup recieve and transmit buffer descriptor rings where
you can simply store the pointers to you incoming/outgoing packets in your
main RAM. The controller then handles all the DMA by itself modifiying the
status bits in the buffer descriptors
as it walks them recieving/transmitting data... It also generates
interrupts at the transmission/reception of the packet or an error
condition.
My driver takes advantage of this by NOT copying data from/to SKBs to a
special packet buffer but
instead filling recieve/transmit ring pointers to pointdirectly to SKB
buffers.
When the ETH controller generates a let's say RECEIVE COMPLETE interrupt
I have to scan the receieve ring for all descriptors saying to hold a good
received packet, for each such
descriptor i find corresponding skb adjust the length, call netif_rx(skb),
then i allocate a new skb
and set the recieve ring pointer to the new skb data buffer.... If for some
reason i've missed couple if
RECEIVE COMPLETE interrupts, no problem i'll catch up all the packets on
the one which í actually handle.
The problem is that in case when i'm handling multiple packets it can take
some time, all the
netif_rx, dev_alloc_skb calls, inside the interrupt handler.
I think that it would be better that the interrupt handler would simply
position an BH bit and the packet handling
loop would be done in the bh handler... of course a can simply allocate a BH
bit and declare a bh handler for my
particular driver, but i sought that more generic solution would be
interesting... I was thinking about adding
a bh pointer to the device structure which will contain a pointer to device
specific bh routine... and modifiying
net_bh to call this pointer when it's not NULL....

Any opinions?
-----------------------------------------------------------------
Vadim Lebedev
Chief software engineer
Aplio S.A.
http://www.aplio.com
-----------------------------------------------------------------

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

- Next message: Chuck Lever: "Re: [patch] touch_buffer in getblk"
- Previous message: Joe: "Re: Shortening the Development Cycle... [maybe OffTopic, flame-bait?]"
- Next in thread: Vadim Lebedev: "Re: Bottom half for network drivers"
- Reply: Vadim Lebedev: "Re: Bottom half for network drivers"
- Reply: Vadim Lebedev: "Re: Bottom half for network drivers"
- Reply: Donald Jeff Dionne: "Re: Bottom half for network drivers"