From: Lino Sanfilippo
> Sent: 16 February 2017 16:02
...
> I was referring to the copy of tx descriptors, not the frames/fragments 
> itself.
> I wrote "tx buffers" because in this driver a descriptor is represented as
>  a struct "aq_ring_buff_s". I cannot see a reason why this descriptor copy
>  should be necessary.

Not unless the descriptor memory is on the card.

Actually it might be worse than that.
The transmit descriptor probably has an 'owner' bit.
The write of the word containing that bit must be last and
preceded by the appropriate barrier (probably dma_wmb()).
Another barrier is needed before the 'doorbell' io write that kicks
the hardware.

Using memcpy() won't have that effect at all.

If the ethernet frame is fragmented (and so uses multiple
descriptors) the owner bit of the first descriptor must be
in the last write.

        David

Reply via email to