Re: [Devel] Re: [PATCH 2/5] net: Make rtnetlink infrastructure network namespace aware

2007-10-01 Thread Eric W. Biederman
"Denis V. Lunev" <[EMAIL PROTECTED]> writes: > The presence of the message in the queue during rtnl_unlock is quite > possible as normal user->kernel message processing path for rtnl is the > following: > > netlink_sendmsg >netlink_unicast > netlink_sendskb > skb_queue_tail >

Re: [Devel] Re: [PATCH 2/5] net: Make rtnetlink infrastructure network namespace aware

2007-10-01 Thread Denis V. Lunev
Patrick McHardy wrote: > Eric W. Biederman wrote: >> Patrick McHardy <[EMAIL PROTECTED]> writes: >> >> >>> Maybe I can save you some time: we used to do down_trylock() >>> for the rtnl mutex, so senders would simply return if someone >>> else was already processing the queue *or* the rtnl was locke

Re: [PATCH 2/5] net: Make rtnetlink infrastructure network namespace aware

2007-09-30 Thread Patrick McHardy
Eric W. Biederman wrote: > Patrick McHardy <[EMAIL PROTECTED]> writes: > > >>Maybe I can save you some time: we used to do down_trylock() >>for the rtnl mutex, so senders would simply return if someone >>else was already processing the queue *or* the rtnl was locked >>for some other reason. In th

Re: [Devel] Re: [PATCH 2/5] net: Make rtnetlink infrastructure network namespace aware

2007-09-30 Thread Denis V. Lunev
Hmm, so it looks like we do not need this queue processing at all... Regards, Den Eric W. Biederman wrote: > Patrick McHardy <[EMAIL PROTECTED]> writes: > >> Maybe I can save you some time: we used to do down_trylock() >> for the rtnl mutex, so senders would simply return if someone >> e

Re: [PATCH 2/5] net: Make rtnetlink infrastructure network namespace aware

2007-09-29 Thread Eric W. Biederman
Patrick McHardy <[EMAIL PROTECTED]> writes: > Maybe I can save you some time: we used to do down_trylock() > for the rtnl mutex, so senders would simply return if someone > else was already processing the queue *or* the rtnl was locked > for some other reason. In the first case the process already

Re: [PATCH 2/5] net: Make rtnetlink infrastructure network namespace aware

2007-09-29 Thread Patrick McHardy
Eric W. Biederman wrote: > Patrick McHardy <[EMAIL PROTECTED]> writes: > > >>I'm wondering why this receive queue processing on unlock is still >>necessary today, we don't do trylock in rtnetlink_rcv anymore, so >>all senders will simply wait until the lock is released and then >>process the queu

Re: [PATCH 2/5] net: Make rtnetlink infrastructure network namespace aware

2007-09-29 Thread Eric W. Biederman
Patrick McHardy <[EMAIL PROTECTED]> writes: > I'm wondering why this receive queue processing on unlock is still > necessary today, we don't do trylock in rtnetlink_rcv anymore, so > all senders will simply wait until the lock is released and then > process the queue. Good question, I should prob

Re: [PATCH 2/5] net: Make rtnetlink infrastructure network namespace aware

2007-09-29 Thread Patrick McHardy
Eric W. Biederman wrote: > void rtnl_unlock(void) > { > - mutex_unlock(&rtnl_mutex); > - if (rtnl && rtnl->sk_receive_queue.qlen) > + struct net *net; > + > + /* > + * Loop through all of the rtnl sockets until none of them (in > + * a live network namespace) have queue

[PATCH 2/5] net: Make rtnetlink infrastructure network namespace aware

2007-09-28 Thread Eric W. Biederman
After this patch none of the netlink callback support anything except the initial network namespace but the rtnetlink infrastructure now handles multiple network namespaces. Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]> --- include/linux/rtnetlink.h |8 ++-- include/net/net_namespac