tcpdump mailing list archives

[PACTH] enable memory mapped access to ethernet (3rd version)


From: "Paolo Abeni" <paolo.abeni () telecomitalia it>
Date: Thu, 13 Dec 2007 10:56:41 +0100

hi list,

The attached patch is the third revision of my attempt to enable memory
mapped access to ethernet devices under Linux. I tried to address some
of the major concerns emerged in the past days.

Now the frame size is not forced to be a power of 2. To keep easy the
ring access, an array containing each frame base pointer is created
during initialization.

When a bpf is installed, and the kernel filter is used, we need to apply
the filter to all the packets currently present into the ring. To
perform this action while preserving the FIFO access to the ring, the
number of packet to be filter is stored into the handle and the filter
is applied at packet reception time, until all required packet are
processed. Hopefully this should be more efficient than manually
applying the filter until the ring is empty (depending on workload this
could never happen).

Currently the patch does not provide an interface to set the ring size,
Instead a default value of 4M is used (but is scaled down if memory is
lacking). I intentionally avoided to make the ring as big as possible,
dynamically selecting it's size, to avoid locking a large amount of
kernel memory and possibly damaging other application and/or the whole
host functionality.

The interface for changing the ring size is lacking because I didn't
understand if is preferred to add a new API for starting a live capture
with a specified ring size (which should be more portable) or adding an
API to change the ring size of a currently opened live capture (like the
existing one for win32). Any comments on this matter or on the patch are
very welcome !

cheer,

Paolo

p.s. I performed some basic tests on my host and it worked pretty well,
but obviously a more formal check do not hurt :-)
--------------------------------------------------------------------

CONFIDENTIALITY NOTICE

This message and its attachments are addressed solely to the persons above and may contain confidential information. If 
you have received the message in error, be informed that any use of the content hereof is prohibited. Please return it 
immediately to the sender and delete the message. Should you have any questions, please contact us by replying to 
webmaster () telecomitalia it.

        Thank you

                                        www.telecomitalia.it

--------------------------------------------------------------------
                        

Attachment: linux_enable_mmap_v3.patch
Description:

-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.

Current thread: