Re: which context is this code in

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

On Sat, Aug 2, 2008 at 10:03 AM, c.j <c.james.cj@xxxxxxxxx> wrote:
> Hi list,
>
> I'm having trouble about NF_HOOK() call.
> I intent to add a netfilter hook with nf_register_hook.
> THe hook point is NF_ARP_IN. But I'm not sure the caller's context.
>
> In kernel code, dev.c I found the caller:
>  netif_receive_skb -> arp_rcv -> NF_HOOK -> my_hook_cb
>
> When my_hook_cb is invoked, what's the context?  And how can I detect it?

Most likely interrupt context. Although it's not 100% accurate, try to
use functions/macros like in_atomic(), in_interrupt(), in_softirq() to
get an idea in which you're currently in.

See http://lxr.linux.no/linux/include/linux/hardirq.h for more...

regards,

Mulyadi.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux