ebtables locking issue
Abhinav Srivastava <abhinavs_iitkgp-/[email protected]>
| Newsgroups | gmane.linux.network.bridge.ebtables.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi there,
I am new to ebtables code and looking for some help related to locking and atomicity. I am interested in looking into the packets intercepted by ebtables, extract some information, pass this information to userspace, wait for userspace response and then pass the result back to ebtable code.
Everything seemed to be working fine until i encountered locking issues. In the ebt_do_table code there is a "read_lock_bh" is used. When i try to wait inside this code path after sending info to my userspace tool and before returning NF_ACCEPT or NF_DROP, either the CPU hangs or i get an error "schedule while atomic". I tried out different methods for waiting like "wait_event_timeout" or busy while loop etc. The problem that I understood is that since read_lock_bh disables CPU preemption and do local_bh_disable, if i wait with something that try to call schedule() I get "schedule while atomic". And, if i do busy waiting it means am stuck for ever as preemption is disabled anyways.
It is like chicken and egg problem. I want to wait and let my userspace process schedule so that I could get response from it but the code path is atomic so i cannot schedule my process. After trying out everything I am clueless as what to do.
Any help in this regard would be appreciated.
Thanks,
Abhinav
---------------------------------
Why delete messages? Unlimited storage is just a click away.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Ebtables-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ebtables-devel