Ariane Keller wrote:
Thanks for your comments!

Patrick McHardy wrote:

But with this we would need the tcm_handle, tcm_parent arguments etc. which are not known in q_netem.c Therefore we would have to change the parse_qopt() function prototype in order to pass the whole "req" and not only the nlmsghdr.

I assume you mean netem_init, parse_qopt is userspace. But I don't
see how that is related, emptying the buffer happens during packet
processing, right?
>
Actually I meant parse_qopt from user space.
If we would change that function prototype we would have the whole message header available in netem_parse_opt() and could pass this to the process which is responsible for sending the data to the kernel. This process would use this header every time it has to send new values to the netem_change() function in the kernel module.


You don't actually want to parse tc output in your program?
Just open a netlink socket and do the necessary processing
yourself, libnl makes this really easy.

I thought about this because I was not aware of the qdisc_notify function.
Anyway I've got some troubles with calling qdisc_notify.
1. I have to do a EXPORT_SYMBOL(qdisc_notify) (currently it is declared static in sch_api.c)

This is fine.

2. I'd like to call it from netem_enqueue(), which leads to a "sleeping function called from invalid context", since we are still in interrupt context. Therefore I think I have to put it in a workqueue.

Just change it to use gfp_any().
--
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