Re: zero-copy TCP

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Sat Sep 02 2000 - 17:10:25 EST


> > Sounds like Linux - one DMA and one copy to user space.
>
> Alan, Please. I'm in your code and there are copies all over the
> place. I agree you have a "fast path" for most stuff, but there's all

There arent copies all over the case for the paths that occur. Like 99.999%
of the time. Fragmented packets dont happen except for NFS (which is a rather
broken protocol anyway).

One DMA, one copy to user space

> kinds of handles lookups, linear list searching like
>
> while (x)
> {
> x = x->next
> }

timers are constructed to be close to O(1), the tcp hash isnt a linear lookup,
the socket operations from user space use file-> dereferences not a lookup

> nothing in TCPIP except at the stream head. Why do you need to copy
> data anyway to checksum an IP packet anyway? I noticed you do the right
> thing and keep the headers and data as separate fragments during header
> construction, so why do you need to copy data for checksumming?

We dont copy for checksumming. We fold the single user space copy and the
checksum operation into one path, because on any modern CPU it costs precisely
the same to copy as to copy/checksum.

I don't think you've actually sat and instrumented the TCP code

Alan

-
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:14 EST