* nf_unregister_hook problem
@ 2009-06-23 18:47 gmoliveira
2009-06-23 19:49 ` Jan Engelhardt
0 siblings, 1 reply; 5+ messages in thread
From: gmoliveira @ 2009-06-23 18:47 UTC (permalink / raw)
To: netfilter-devel
hi all,
im trying to develop a software to emulate network partitioning to
evaluate distributed applications. in the code i need to specify some
temporal triggers like:
init_timer(&foo);
start_trigger.function = some_function;
start_trigger.data = arguments;
start_trigger.expires = jiffies + msecs_to_jiffies(HZ * 1000);
add_timer(&foo);
im using it to register a netfilter hook and it works perfectly.
however, when i need to set up a trigger do unregister the netfilter
hook, the system gets itself slow, dmesg returns lots of information
about BUG SCHEDULING and stuff like that.
im using this:
init_timer(&foo2);
stop_trigger.function = nf_unregister_hook;
stop_trigger.data = &nf_hook;
stop_trigger.expires = jiffies + msecs_to_jiffies(HZ * 5000);
add_timer(&foo2);
it works to every function until now, unless nf_unregister_hook.
best regards,
Gustavo.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: nf_unregister_hook problem
2009-06-23 18:47 gmoliveira
@ 2009-06-23 19:49 ` Jan Engelhardt
2009-06-23 22:45 ` gmoliveira
0 siblings, 1 reply; 5+ messages in thread
From: Jan Engelhardt @ 2009-06-23 19:49 UTC (permalink / raw)
To: gmoliveira; +Cc: netfilter-devel
On Tuesday 2009-06-23 20:47, gmoliveira@inf.ufrgs.br wrote:
>
>im using this:
>
>init_timer(&foo2);
>stop_trigger.function = nf_unregister_hook;
>stop_trigger.data = &nf_hook;
>stop_trigger.expires = jiffies + msecs_to_jiffies(HZ * 5000);
>add_timer(&foo2);
>
>it works to every function until now, unless nf_unregister_hook.
Does the problem go away if you call it indirectly? Like:
stop_trigger.function = myfunc;
...
myfunc(void)
{
nf_unregister_hook(&nf_hook);
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: nf_unregister_hook problem
@ 2009-06-23 21:02 Bruno Fiss
0 siblings, 0 replies; 5+ messages in thread
From: Bruno Fiss @ 2009-06-23 21:02 UTC (permalink / raw)
To: netfilter-devel
--- Em ter, 23/6/09, Jan Engelhardt <jengelh@medozas.de> escreveu:
>
> Does the problem go away if you call it indirectly? Like:
>
>
> stop_trigger.function = myfunc;
> ...
>
> myfunc(void)
> {
> nf_unregister_hook(&nf_hook);
> }
>
Hi,
I've got a very similar question, about scheduling nf_register_hook, and since I'm already calling it indirectly, I think this could prove useful to both of us. I'd appreciate if anybody could help.
This is what I'm trying to do:
void foo () {
unsigned long parameter;
...
DEFINE_TIMER( timer, secfoo, jiffies + 250, parameter);
...
add_timer(timer);
}
void secfoo( unsigned long param ) {
...
nf_register_hook(...);
...
}
If I comment the "add_timer(timer);" and put "secfoo( parameter );" instead, it works out, though it doesn't help me, because I wanted to schedule it. The way it is, I get a kernel panic.
Good day,
Bruno Fiss
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: nf_unregister_hook problem
@ 2009-06-23 21:12 bcfiss
0 siblings, 0 replies; 5+ messages in thread
From: bcfiss @ 2009-06-23 21:12 UTC (permalink / raw)
To: netfilter-devel
Sorry for duplicates.
--- Em ter, 23/6/09, Jan Engelhardt <jengelh@medozas.de> escreveu:
>
> Does the problem go away if you call it indirectly? Like:
>
>
> stop_trigger.function = myfunc;
> ...
>
> myfunc(void)
> {
> nf_unregister_hook(&nf_hook);
> }
>
Hi,
I've got a very similar question, about scheduling nf_register_hook,
and since I'm already calling it indirectly, I think this could prove
useful to both of us. I'd appreciate if anybody could help.
This is what I'm trying to do:
void foo () {
unsigned long parameter;
...
DEFINE_TIMER( timer, secfoo, jiffies + 250, parameter);
...
add_timer(timer);
}
void secfoo( unsigned long param ) {
...
nf_register_hook(...);
...
}
If I comment the "add_timer(timer);" and put "secfoo( parameter );"
instead, it works out, though it doesn't help me, because I wanted to
schedule it. The way it is, I get a kernel panic.
Good day,
Bruno Fiss
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: nf_unregister_hook problem
2009-06-23 19:49 ` Jan Engelhardt
@ 2009-06-23 22:45 ` gmoliveira
0 siblings, 0 replies; 5+ messages in thread
From: gmoliveira @ 2009-06-23 22:45 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: netfilter-devel
Hi Jan, thanks for your attention..
yes, i've already tried this way you said but the problem remains the same.
declaring nf_unregister_hook(&nf_hook) in __module_exit function worked well,
but requires user intervention. The problem consists in unregister the
hook by timers...misunderstandable.
here goes and print screen with the "infinite loop error"
when occurs the BUG caused by nf_unregister_hook handled by a timer.
http://inf.ufrgs.br/~gmoliveira/screen.png
if anyone had a similar problem, pleasa contact me.
Citando Jan Engelhardt <jengelh@medozas.de>:
>
> On Tuesday 2009-06-23 20:47, gmoliveira@inf.ufrgs.br wrote:
>>
>> im using this:
>>
>> init_timer(&foo2);
>> stop_trigger.function = nf_unregister_hook;
>> stop_trigger.data = &nf_hook;
>> stop_trigger.expires = jiffies + msecs_to_jiffies(HZ * 5000);
>> add_timer(&foo2);
>>
>> it works to every function until now, unless nf_unregister_hook.
>
> Does the problem go away if you call it indirectly? Like:
>
>
> stop_trigger.function = myfunc;
> ...
>
> myfunc(void)
> {
> nf_unregister_hook(&nf_hook);
> }
>
>
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-06-23 22:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-23 21:02 nf_unregister_hook problem Bruno Fiss
-- strict thread matches above, loose matches on Subject: below --
2009-06-23 21:12 bcfiss
2009-06-23 18:47 gmoliveira
2009-06-23 19:49 ` Jan Engelhardt
2009-06-23 22:45 ` gmoliveira
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).