Skip to contentSkip to conversation

Is it a process?

DISCUSSION lab liscs 3 participants 4 messages Aug 5, 2005 – Aug 8, 2005

lore
Share & tools
lore

lab liscs

author
#0 lore raw

when linux kernel receives a packet from the netcard and the forwards it .

the process can be viewed as a kernel process ?

and if this process can be interrupted ?

thanks a lot!!

#1 lore raw
Quoted 7 lines · lab liscs

when linux kernel receives a packet from the netcard and the forwards it .

the process can be viewed as a kernel process ?

and if this process can be interrupted ?

thanks a lot!!

When a packet is received from the kernel, this is first done by an interrupt handler to just get the packet. Then the rest (forwarding) is done by a tasklet. This tasklet can be run either by the softirqd (a kernel thread) or at certain locations in the kernel. So this is not a normal process and no it can not be preempted or scheduled out (it can be interrupted by an interrupt though).

-- Steve

#2 lore raw
Quoted 7 lines
Quoted 4 lines

when linux kernel receives a packet from the netcard and the forwards it . the process can be viewed as a kernel process ?
and if this process can be interrupted ?

When a packet is received from the kernel, this is first done by an interrupt handler to just get the packet. Then the rest (forwarding) is

Do you mean forwarding from NIC to kernel space, or already the iptables FORWARD chain? What about packets destined for the local machine that just hit INPUT?

Quoted 2 lines

done by a tasklet. This tasklet can be run either by the softirqd (a kernel thread) or at certain locations in the kernel. So this is not a

What is the name of this tasklet? ksoftirqd shows up in "ps", but no childs for it.

Jan Engelhardt

#3 lore raw
Quoted 10 lines · Jan Engelhardt
Quoted 6 lines
Quoted 3 lines

when linux kernel receives a packet from the netcard and the forwards it . the process can be viewed as a kernel process ?
and if this process can be interrupted ?

When a packet is received from the kernel, this is first done by an interrupt handler to just get the packet. Then the rest (forwarding) is

Do you mean forwarding from NIC to kernel space, or already the iptables FORWARD chain? What about packets destined for the local machine that just hit INPUT?

When the interrupt goes off upon receiving a packet. The driver "forwards" it from the NIC to the kernel space. Note, this most likely already happened via DMA but the driver manages the memory that was used. Then the driver (still in the interrupt) calls netif_rx which queues the packet on the input queue and wakes up the NET_RX_SOFTIRQ tasklet. This tasklet will handle the processing of the packet, until it can find a task that this packet belongs to and then it "forwards" the packet off to that task.

Quoted 6 lines
Quoted 3 lines

done by a tasklet. This tasklet can be run either by the softirqd (a kernel thread) or at certain locations in the kernel. So this is not a

What is the name of this tasklet? ksoftirqd shows up in "ps", but no childs for it.

The tasklet is named NET_RX_SOFTIRQ. No it is not a task, which I said that it wasn't in my last email. I said that the softirqd (ksoftirqd) may execute the code for that tasklet, or it may be handled on return from an interrupt. This is _not_ a task that would show up in ps (unless you are running Ingo Molnar's RT patch, which does things differently to this regard).

-- Steve