All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gianni Tedesco <gianni@ecsc.co.uk>
To: Ben Greear <greearb@candelatech.com>
Cc: "David S. Miller" <davem@redhat.com>,
	dank@kegel.com, linux-kernel@vger.kernel.org, zab@zabbo.net
Subject: Re: is CONFIG_PACKET_MMAP always a win?
Date: 22 Feb 2002 08:37:12 +0000	[thread overview]
Message-ID: <1014367033.13551.1.camel@lemsip> (raw)
In-Reply-To: <3C75E905.9000809@candelatech.com>
In-Reply-To: <3C75A418.2C848B3F@kegel.com> <20020221.215925.41634293.davem@redhat.com>  <3C75E905.9000809@candelatech.com>

On Fri, 2002-02-22 at 06:45, Ben Greear wrote:
> 
> 
> David S. Miller wrote:
> 
> >    From: Dan Kegel <dank@kegel.com>
> >    Date: Thu, 21 Feb 2002 17:51:20 -0800
> > 
> >    What's the best way to retrieve raw packets from the kernel?
> >    
> >    a) use libpcap
> >  ...   
> >    b) use af_packet
> >  ...   
> >    c) enable CONFIG_PACKET_MMAP, use PACKET_RX_RING
> >    
> >    If I understand it right, b costs one memcpy and one recv, and c costs
> >    two memcpys.  Which one wins?
> > 
> > "a" should be doing "c" when it is available in the kernel.
> > If not, get a newer copy of the libpcap sources, preferably
> > from Alexey's site:
> > 
> > ftp.inr.ac.ru:/ip-routing/
> 
> 
> And if you can figure out how to do c, and feel like
> sharing, please do let me know!  Documentation is a
> bit sparse..at least wherever I've been looking.

Yeah I found it a bit lacking too, I got there in the end though. Check
out: http://www.scaramanga.co.uk/code-fu/lincap.c

-- 
// Gianni Tedesco <gianni@ecsc.co.uk>
80% of all email is a figment of procmails imagination.


  reply	other threads:[~2002-02-22  8:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-22  1:51 is CONFIG_PACKET_MMAP always a win? Dan Kegel
2002-02-22  2:33 ` Alan Cox
2002-02-22  5:59 ` David S. Miller
2002-02-22  6:45   ` Ben Greear
2002-02-22  8:37     ` Gianni Tedesco [this message]
2002-02-22  7:04   ` Dan Kegel
2002-02-22 14:04     ` Maciej W. Rozycki
2002-02-22 18:09 ` Jamie Lokier
2002-02-22 18:40   ` Alan Cox
2002-02-22 19:04     ` Jamie Lokier
2002-02-22 19:57       ` Alan Cox
2002-02-22 21:44         ` Mike Fedyk
2002-02-23  0:24           ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1014367033.13551.1.camel@lemsip \
    --to=gianni@ecsc.co.uk \
    --cc=dank@kegel.com \
    --cc=davem@redhat.com \
    --cc=greearb@candelatech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zab@zabbo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.