Re: zero copy network driver

From: Ask (ask8y_at_yahoo.com)
Date: 08/27/04


Date: 27 Aug 2004 09:20:11 -0700

Does not sound any interest on this topic.

I think I had wrong assumption about the skb. The fact seems to BE:
*After hard_start_xmit(), the driver becaoes the owner of the skb and
responsible for the release. (so there is really no need to wait until
the
HW finishes the xmit.)
*After netif_rx, the driver loses the ownership of the skb.

Based on these facts, my following plan for RX direction can NOT be
done EITHER:
*Allocate all necesary buffers at open, and use them cyclicly.
Because the fact that the driver lost the ownership of skb, it has to
reallocate new buffer eveytime if received a frame and does pci_map_
thing again and again. That part I don't like.

ask8y@yahoo.com (Ask) wrote in message news:<6a8918d.0408260639.296d6b4c@posting.google.com>...
> Implementation of transmit function.
> hard_start_xmit(struct sk_buff *skb, struct net_device *dev).
> If I do zro copy, iahve to make sure the data in the buffer has been
> transmitted by the hardware not just tell the hardware start to
> transmit.
>
> If the hardware runnning in poll mode, I can poll the buffer
> descriptor to see if the transmit has been done before the retunn. And
> this is not very good, in the sanse that even the hW does not pushed
> out the data, the driver might have idle buffer descriptor available
> to accept data. But at leat I am sure the data has been pushed out by
> HW before the function returns.
>
> However if in in interrupt mode (most likely it'b be in), how could I
> handle this? Before next interrrupt happens I could not if the data
> has been pushed out by the HW. If the function just returns after tell
> HW to start transmit, it might happens that the calling function
> release the buffer even before the HW transmits it.
>
> Thanks for your help.



Relevant Pages

  • DS31256 (HDLC Controller )buffering problems
    ... I have a DS31256 driver (basically a modified version of the Dallas ... motorola processor to the HDLC Controller via a PCI bus. ... But after a while I run out of Tx Buffer descriptors and have to wait ... If I have a timeout of like 1 ms, I'm able to transmit ...
    (comp.dcom.telecom.tech)
  • Re: Real World Significant Sources of (what we usually call) Latency
    ... CPU is twice as fast, you can reduce your buffer size to half." ... the buffer adjustment for the driver or DAW program would go down to zero. ... nothing that can distract it from processing audio. ...
    (rec.audio.pro)
  • Re: Difference between synchronous and asynchronous operation/calls (NDISPROT)
    ... The main problem with synchronous operation/calls seems to be the lack of buffers for the driver to store data into. ... Each "read call" supplies the driver with a buffer and optionally a completion routine so that the driver can inform the application when the requested operation is/was done. ... However it seems the current windows/driver design does some copies as well? ...
    (microsoft.public.development.device.drivers)
  • Re: Degradation of TCP connection
    ... Gigabit ethernet. ... D card's data buffer can only hold about 64K samples worth of data ... link you posted is for an older version of VxWorks that used a BSD- ... but a bug in the ethernet driver. ...
    (comp.os.vxworks)
  • Re: Degradation of TCP connection
    ... Gigabit ethernet. ... D card's data buffer can only hold about 64K samples worth of data ... link you posted is for an older version of VxWorks that used a BSD- ... but a bug in the ethernet driver. ...
    (comp.os.vxworks)