public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Is it a process?
@ 2005-08-05 13:02 lab liscs
  2005-08-05 15:17 ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: lab liscs @ 2005-08-05 13:02 UTC (permalink / raw)
  To: linux-kernel

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!!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is it a process?
  2005-08-05 13:02 Is it a process? lab liscs
@ 2005-08-05 15:17 ` Steven Rostedt
  2005-08-08  6:39   ` Jan Engelhardt
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2005-08-05 15:17 UTC (permalink / raw)
  To: lab liscs; +Cc: linux-kernel

On Fri, 2005-08-05 at 21:02 +0800, lab liscs wrote:
> 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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is it a process?
  2005-08-05 15:17 ` Steven Rostedt
@ 2005-08-08  6:39   ` Jan Engelhardt
  2005-08-08 13:25     ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Engelhardt @ 2005-08-08  6:39 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: lab liscs, linux-kernel


>> 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?

>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
-- 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is it a process?
  2005-08-08  6:39   ` Jan Engelhardt
@ 2005-08-08 13:25     ` Steven Rostedt
  0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2005-08-08 13:25 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: lab liscs, linux-kernel

On Mon, 2005-08-08 at 08:39 +0200, Jan Engelhardt wrote:
> >> 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.

> 
> >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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-08-08 13:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-05 13:02 Is it a process? lab liscs
2005-08-05 15:17 ` Steven Rostedt
2005-08-08  6:39   ` Jan Engelhardt
2005-08-08 13:25     ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox