Where a packet goes when it arrives in Linux 2.6.x

Documented by Barath Raghavan, 5/2004 on Linux 2.6.6

The following is a guide to where packets go when received by a NIC. (In the trace below, I'm using a Intel gigabit card with the e1000 driver.) In a few cases I skip some uninteresting intermediate function calls. H and S denote hard IRQ context and soft IRQ context respectively.

Let me know if you notice any mistakes.

   NIC                      -> interrupt
H  common interrupt handler -> arch/i386/kernel/entry.S:common_interrupt
H  interrupt handoff        -> arch/i386/kernel/irq.c:do_IRQ()
H  e1000 interrupt handler  -> drivers/net/e1000/e1000_main.c:e1000_intr()
H  queue sk_buff            -> net/core/dev.c:netif_rx()
S  dequeue sk_buff          -> net/core/dev.c:net_rx_action()
S  handle sk_buff           -> net/core/dev.c:netif_receive_skb()
S  start IP processing      -> net/ipv4/ip_input.c:ip_rcv()
S  finish IP processing     -> net/ipv4/ip_input.c:ip_rcv_finish()
S  send to upper layers     -> net/ipv4/ip_input.c:ip_local_deliver()
...