netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joshua Stewart <joshua.stewart@comcast.net>
To: netdev@oss.sgi.com
Subject: Following a packet from NIC to user space (and the reverse)
Date: Mon, 30 Dec 2002 22:37:32 -0500	[thread overview]
Message-ID: <1041305853.12103.7.camel@localhost.localdomain> (raw)

I was given this email address by Alan Cox.  So, if this is a mistake
please let me know.

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

I'm trying to get a really good grasp on what happens to packets from
when they arrive until they are pushed to user-space applications.  For
now I'm just assuming I am receiving a TCP packet.

I've read almost all the online docs I can find, but most don't get down
and dirty enough for what I'm trying to figure out.  For example,
http://www.gnumonks.org/ftp/pub/doc/packet-journey-2.4.html.  I also
have troubles with running into docs referring to the 2.0 or 2.2 kernels
and interrupt bottom halves, which it seems are not in the 2.4 network
code (softirqs instead).

I'd like to create a list of the functions (in order) that are called
from the time of sk_buff creation/allocation until the buffer is free'd
(kfree_skb).  I'd really like to track an sk_buff throughout it's
'lifespan' in the linux kernel.  So far I think I understand the
following, which isn't much...

Linux network drivers all register themselves with the kernel through a
register_netdev() call.  Lots of structures are allocated and
initialized.  It seems that most sk_buffs come into existence during an
interrupt routine in a NIC card driver (i.e.
/usr/src/linux/drivers/net/pci-skeleton.c, netdrv_rx_interrupt()), which
does the following...

netif_rx(skb) is called, which performs the following...

__skb_queue_tail(&queue->input_pkt_queue,skb); dev.c, line 1255

which puts the sk_buff into the incoming packet queue of one of the
processors, which is really a member of the softnet_data[] array.

>From this point on, I have no idea what happens to the packet.  I know
it has something to do with 2.4's new softirqs, but I don't really have
a good grasp on that yet.

Please help me fill in where my knowledge is lacking.  Also, PLEASE
correct any mistakes you see in my understanding so far.

Thanks,
        Joshua Stewart

joshua.stewart@comcast.net

                 reply	other threads:[~2002-12-31  3:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1041305853.12103.7.camel@localhost.localdomain \
    --to=joshua.stewart@comcast.net \
    --cc=netdev@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).