WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] ebtables locking issue

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] ebtables locking issue
From: Abhinav Srivastava <abhinavs_iitkgp@xxxxxxxxxxx>
Date: Tue, 14 Aug 2007 18:22:47 +0100 (BST)
Delivery-date: Tue, 14 Aug 2007 10:23:13 -0700
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=LsJDL9AeSWCgtss6dAcHOjN3h96EBSNoLx99236Ni5wwR9XAavNTFuQBMupaRqhnBhsbhdqAF0P7PFwnRBMuwtDuBvVEGOmqzvLFwHJlVahIHtq/wNK2MIM6m9evpwaVBM0TkicWX7tNE+C8qSg9cQeHnm6pjFXEADW3EWbfPR4=;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

Hi there,

I am new to ebtables code and looking for some help related to locking and atomicity. I am using Xen 3.0.4 in bridge mode and interested in looking into the packets intercepted by dom0 ebtables code, 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" error.  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 really appreciated.

Thanks,
Abhinav


Once upon a time there was 1 GB storage in your inbox. Click here for happy ending.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] ebtables locking issue, Abhinav Srivastava <=