Re: zero-copy TCP

From: Ingo Molnar (mingo@elte.hu)
Date: Sun Sep 03 2000 - 03:18:50 EST


On 2 Sep 2000, Jes Sorensen wrote:

> You can't DMA directly from a file cache page unless you have a
> network card that does scatter/gather DMA and surprise surprise,
> 80-90% of the cards on the market don't support this. [...]

exactly. The TUX patch solves this by copying 'multi-fragment skbs' into a
temporary single-fragment skb, if the card doesnt support scatter-gather,
64-bit DMA. This way the copying is delayed as much as possible, to the
point where we queue the packet to the network device.

> Besides that you need to do copy-on-write if you want to be able to do
> zero copy on write() from user space [...]

i agree that this is hard - i'm not sure wether we want to go the pain to
enable anonymous-buffer write()s do zero-copy. My plan is to enable
sendfile() first - it should cover all the important high-performance
server cases. The point is that a write() is only used if some sort of
dynamic data is generated on the fly. If data is generated once and sent
once then there is no much win in zero-copy. If data is generated once and
reused multiple times afterwards then it should rather be written into a
temporary file and then it can be sent out via sendfile().

        Ingo

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



This archive was generated by hypermail 2b29 : Thu Sep 07 2000 - 21:00:15 EST