tcpdump mailing list archives

Re: Libpcap reentrancy and PF_RING patch


From: Luca Deri <deri () ntop org>
Date: Thu, 3 Jan 2008 01:09:04 +0100

Guy

Attachment: pf_ring_patch.diff.gz
Description:



On Dec 31, 2007, at 10:21 PM, Guy Harris wrote:

Luca Deri wrote:

My patch also adds support for PF_RING (http://www.ntop.org/PF_RING.html ) that is a Linux packet acceleration technique that uses a shared ring buffer between the kernel and user-space. In addition to packet acceleration, it features also packet filtering and classification. As PF_RING code has been around for some years now and used by many users, if you include this patch into the mainstream code you will allow me to stop keeping a patched version of the library.

You might want to split the PF_RING support and the reentrancy changes into two patches.
I have enclosed the patch for PF_RING. The one for reentrancy perhaps needs another round in order to address the comments that have been made.



As PF_RING is a kernel module, if the module is not present, the library will fallback to standard libpcap.

There is at least one place where the behavior of libpcap is modified at compile time with "#ifdef HAVE_PF_RING" - the code to get the packet statistics. If you install a libpcap with HAVE_PF_RING defined on a system that doesn't have the PF_RING module installed, that means that the statistics code's behavior will be changed - will that code still work on that system?
The idea is that in order to compile the pcap library with the extension, configure checks whether the header files and library are installed. if so the patch is enabled and the pcap library is compiled with PF_RING support enabled. In case you use pcap+ PF_RING on a linux box where the pf_ring module has not been loaded, pf_ring will not be enabled and the library will work as if it were unpatched.

Regards, Luca


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

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

Current thread: