Re: network driver + replenishment



On Jul 17, 10:32 am, MB <madhu....@xxxxxxxxx> wrote:
Hi

I need a good sugestions about replenishing the buffers in network
driver wrt to performance.

I have a model in which, network driver receive a interrupt and ISR
will add a function to net job Q. Later, this netjob funtion pull the
packet from the network hw and give it to upper layer. Once upper
layer finish processing, it will again give back the buffer to driver,
now, which will be replenish back to network.

I've never seen a driver that works exactly that way -- in fact, it's
unlikely a driver *could* work exactly that way.
Typically, the ISR queues the netjob and leaves.
The netjob then takes the buffer away from the hardware, 'loans' it to
the stack, and immediately gives the hardware a new buffer.
I've always coded my drivers so that the hardware gets a new buffer
right in the ISR.
This reduces, about as much as possible, the likelihood of the
hardware not having a buffer when it needs one.
I've seen many network drivers that try to do all the ISR work at
netjob level and fail miserably when the network spikes with a big
flurry of very small packets.
More often than not, such drivers lock up so badly that the target has
to be reset.
You can defer passing the filled buffer up to the stack (do it in a
netjob) if you want, but I usually do that in the ISR too.

HTH
GV
.



Relevant Pages

  • Re: network driver + replenishment
    ... driver wrt to performance. ... packet from the network hw and give it to upper layer. ... the ISR queues the netjob and leaves. ... The netjob then takes the buffer away from the hardware, ...
    (comp.os.vxworks)
  • Re: network driver + replenishment
    ... driver wrt to performance. ... the ISR queues the netjob and leaves. ... The netjob then takes the buffer away from the hardware, ...
    (comp.os.vxworks)
  • Re: network driver + replenishment
    ... driver wrt to performance. ... the ISR queues the netjob and leaves. ... The netjob then takes the buffer away from the hardware, ...
    (comp.os.vxworks)
  • Re: Linux Firewall/LoadBalancer
    ... The bonding driver originally came from Donald Becker's beowulf patches for ... Build kernel with the bonding driver ... "Bonding driver support" in the "Network device support" section. ... so the bonding driver will automatically load when the bond0 interface is ...
    (Security-Basics)
  • Re: Xbox Extender giving network congestion errors
    ... Given the behavioral change you saw with changing your network setup, ... Regarding slow mo playback - next time you see video enter this mode, ... this doesn't sound like buffer depletion; what I would expect you to ... It corrects itself in a really ...
    (microsoft.public.windows.mediacenter)