Hello,

 Thanks a lot for your answer !

Following your answer I did some reading in LDD3
I want to verify that I understood the interrupts mechanism right:

NF_IP_FORWARD

On 10/30/05, Harald Welte <[EMAIL PROTECTED]> wrote:
> On Sat, Oct 29, 2005 at 03:39:30PM +0200, John Que wrote:
> > Hello,
> >   I have written a module which uses NF_HOOKS for diverting packets to
> > a different destination.
> >
> >   My hook uses NF_IP_PRE_ROUTING.
> >
> >       I call nf_register_hook() where the hook method is called my_hook().
> >
> >   I see that indeed packets are reaching my hook method , my_hook().
> >
> >   My question is :
> >
> >   As I understand, the packets are reaching this method every
> > interrupt of the Network Card for receiving
>
> netfilter hooks are not related to interrupts.  they're called from
> whatever context they're called from, mostly network receive softirq,
> sometimes process context (LOCAL_OUT).
> >
> >   Or to be more accurate:
> >
> >   My question is : let's say that a packet sent to my machine reaches
> > my_hook() method,
> >
> >    and let's say that another packets are received on the NIC at the
> > same time while
> >
> >    the my_hook() method did not finished to process the previous
> > packet. (there is a very high
> >
> >    rate of sending packets to my machine).
> >
> >    Is there a possiblility that my_hook() will be called on a second
> > and third packets while still
>
> I suggest you do some basic reading on linux kernel development and the
> related contexts.  What you're looking for is "what happens when a
> hardirq interrupts softirq context".
>
> Short reply: my_hook() will not be called a second time on the same cpu,
> ubt will be called any number of times in parallel on multiple cpus.
>
> --
> - Harald Welte <[EMAIL PROTECTED]>                 http://netfilter.org/
> ============================================================================
>   "Fragmentation is like classful addressing -- an interesting early
>    architectural error that shows how much experimentation was going
>    on while IP was being designed."                    -- Paul Vixie
>
>
>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to