tcpdump mailing list archives

Re: [PATCH]: pcap and zero copy.


From: Guy Harris <guy () alum mit edu>
Date: Mon, 5 Jan 2004 11:00:05 -0800

On Sun, Jan 04, 2004 at 01:55:21PM +0100, Gisle Vanem wrote:
I didn't see any patch for pcap-win32.c, but  not sure it's possible with
a zero-copy here. Except maybe using shared memory or overlapped
I/O.

"zero-copy" is perhaps a misleading description - what Yoann's patch
removes is the copy done by applications that have to save, in memory,
packets they receive from libpcap, not the copy done from the OS kernel
to libpcap's buffer.  There does exist a memory-mapped capture mechanism
for Linux, and there exists a patch to support that in libpcap, but that
doesn't appear to be *truly* zero-copy, either, the copy just happens to
be done from skbuffs to the memory-mapped region, at least as I read
"tpacket_rcv()" in "net/packet/af_packet.c" with its "memcpy()". 
Similar mechanisms have been discussed for BSD.

pcap-win32.c is similar to pcap-bpf.c here; removing the copy would, I
think, be done in the same way.
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe


Current thread: