lkml.org 
[lkml]   [2000]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: zero-copy TCP
Date
From
> read/recv block while the NIC DMAs into user space main memory.

Thats actually not always a win either. A DMA to user space flushes those pages
out of cache which isnt so ideal if the CPU wants them. Some of the results
are suprisingly counter-intuitive like this

> (Can't DMA earlier because we don't know the buffer address in advance
> when using the standard socket API).

Yes I realised the API you meant when you said. This is local store of packet
then hand to user memory when the IRQ handler names a target address.

> The NIC memory is never accessed directly. It's a cache of skbuff data
> payloads, and the only access is by DMA, in those places where the
> kernel stack normally does copy_to_user/copy_from_user.

Yep. Unfortunately to make it work you need to do a bit more than that - you
have to pin pages in memory, flush caches on some cpus, lock those pages
against being truncated by another process (on the other cpu) and you have
to deal with queue reclamation when the nic gets short of buffers.

You can do it and with some of the PC world hardware. NeXT did this with their
lance driver



-
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/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.272 / U:6.504 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site