Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: raviraj joshi <raviraj.j1991@gmail.com>
Cc: netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
	netfilter@vger.kernel.org
Subject: Re: kenel level packet capturing
Date: Wed, 19 Oct 2011 09:12:11 +0200	[thread overview]
Message-ID: <1319008331.17914.4.camel@edumazet-laptop> (raw)
In-Reply-To: <CAKj1SsOnYsOXjRBKm+=hTnEiesXrC3h0Q-KN2b61nPSQud9wMA@mail.gmail.com>

Le mercredi 19 octobre 2011 à 12:24 +0530, raviraj joshi a écrit :
> Hi,
> 
> We are making a kernel level packet capture module as a part of our BE project .
> We are finding it difficult to understand kenel networking code.
> We studied structures and functions like sk_buff, netif_rx(),dev_alloc_skb.
> 
> However we were not able to trace the actual path a simple packet follows.
> 
> Moreover we tried to count the no of times netif_rx function was
> called it was much much lower than amount of packets actually being
> received.
> 
> Can anyone please let us know the reason for this and how to approach
> the problem of writing a kernel level packet capture module ,resoruces
> we need to refer to (we are currently constrained to documents on
> kernel-networking available online).
> 

Most drivers call netif_receive_skb() from softirq handler

netif_rx() is used only on cases where we are in hard irq handler, or we
want to avoid a recursion (tunnels for example)

To install a packet capture, you should take a look at dev_add_pack()
and friends [ net/packet/af_packet.c being a good reference ]



--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-10-19  7:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKj1SsP+GE=QqN8nx7aaAxXE8BODKb=vns_=SnbyySQjZp3-pg@mail.gmail.com>
2011-10-19  6:54 ` kenel level packet capturing raviraj joshi
2011-10-19  7:12   ` Eric Dumazet [this message]
2011-10-19  7:13   ` David Miller
2011-10-19  8:52     ` Ajith Adapa
2011-10-19 12:30       ` Richard Cochran
2011-10-19 12:37   ` Benjamin Poirier
2011-12-13 12:04     ` raviraj joshi
2011-12-13 18:36       ` David Miller
2011-12-14 10:46         ` raviraj joshi
2011-12-14 13:31           ` Jan Engelhardt
2011-12-14 16:09           ` David Miller
2011-12-15 15:19             ` Eduardo Panisset

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=1319008331.17914.4.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=netfilter@vger.kernel.org \
    --cc=raviraj.j1991@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox