* Newbie Question: Locking in Netfilter hook module?
@ 2003-07-11 8:58 Ned Ren
2003-07-14 7:47 ` Harald Welte
0 siblings, 1 reply; 2+ messages in thread
From: Ned Ren @ 2003-07-11 8:58 UTC (permalink / raw)
To: netfilter-devel; +Cc: nedren
Hi,
This maybe a silly question. I'm wondering for hook modules that I write for netfilter, is it
necessary to do locking (critical section) when accessing my own global structures? This is
regarding SINGLE CPU systems, is there anything that would preempt my module while it's at it such
as interrupt etc?
Thank you!
please reply to my email addr as well: nedren@yahoo.com
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Newbie Question: Locking in Netfilter hook module?
2003-07-11 8:58 Newbie Question: Locking in Netfilter hook module? Ned Ren
@ 2003-07-14 7:47 ` Harald Welte
0 siblings, 0 replies; 2+ messages in thread
From: Harald Welte @ 2003-07-14 7:47 UTC (permalink / raw)
To: Ned Ren; +Cc: netfilter-devel
[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]
On Fri, Jul 11, 2003 at 01:58:49AM -0700, Ned Ren wrote:
> Hi,
>
> This maybe a silly question. I'm wondering for hook modules that I
> write for netfilter, is it necessary to do locking (critical section)
> when accessing my own global structures?
Yes, it is always necessarry to lock your global structures. All of
netfilter is running in softirq context.
> This is regarding SINGLE CPU systems, is there anything that would
> preempt my module while it's at it such as interrupt etc?
hard interrupts can always interrupt a softirq - but a softirq doesn't
interrupt another softirq (on single cpu).
However, all kernel code _has_ to be SMP safe.
> Thank you!
--
- Harald Welte <laforge@netfilter.org> http://www.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
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-07-14 7:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-11 8:58 Newbie Question: Locking in Netfilter hook module? Ned Ren
2003-07-14 7:47 ` Harald Welte
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.