On Tue, Nov 08, 2005 at 04:37:24PM +0200, John Que wrote:
> Hello,
> 
> Sorry; I did not completed my message; here is the full one:
> 
>  Thanks a lot for your answer !
> 
> Following your answer I did some reading in LDD3 and
> "Undersatnding the linux kernel" and I want to
> verify if I may that I understood the interrupts mechanism right
> regarding my nethooks question:
> 
> Suppose I will add another hook , of type NF_IP_FORWARD, with a callback
> method named fw_hook(), to my exsiting NF_IP_PRE_ROUTING hook in my module.
> 
> As I understand, I can be sure that my_hook() and also fw_hook()
> will not be called a second time when an
> interrupt on the NIC arrives (when working on a single  CPU)
> because they both are run under the same context (softirq context probably).

Yes.  This is _not_ true for LOCAL_OUT hooks, though (since they're
called from the process context of the sending userspace process.

> So in fact, I do not have to worry about shared data structures
> which may appear in both hook methods (my_hook() and fw_hook())

If you ever want your code to get merged into the mainline kernel, you
have to worry. otherwise not.

-- 
- Harald Welte <[EMAIL PROTECTED]>                      http://gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)

Attachment: pgpt4lVdzU9kB.pgp
Description: PGP signature

Reply via email to