Re: [ovs-dev] [PATCH 5/5 v2] dpif-netdev: Avoid races on queue and port changes using seq objects.

2013-08-10 Thread Ben Pfaff
On Sat, Aug 10, 2013 at 04:39:09PM -0700, Andy Zhou wrote: > On Wed, Aug 7, 2013 at 1:31 PM, Ben Pfaff wrote: > > dpif_upcall *upcall, > > static void > > dpif_netdev_recv_wait(struct dpif *dpif) > > { > > -/* XXX In a multithreaded process, there is a race window between this > > - * f

Re: [ovs-dev] [seq 4/5] seq: New module for race-free, pollable, thread-safe sequence number.

2013-08-10 Thread Ben Pfaff
On Sat, Aug 10, 2013 at 04:32:11PM -0700, Andy Zhou wrote: > Sorry for the delay in review. It took me a while to understand the design > intent to be able to understand the logic. Thanks for the review. If the design intent is unclear, then maybe I could make the code clearer. I want my code t

Re: [ovs-dev] [netdev-linux]Deadlock is fixed; netdev_open() has a bug

2013-08-10 Thread Ben Pfaff
On Sun, Aug 11, 2013 at 11:30:10AM +0800, ZhengLingyun wrote: > netdev_open does shash_add() but no shash_delete() when error > occurs, such as device not exists. It will cause a SIGSEGV signal. Thanks for the report. I sent out a fix: http://openvswitch.org/pipermail/dev/2013-August/0305

[ovs-dev] [PATCH] netdev: Clean up on "construct" error in netdev_open().

2013-08-10 Thread Ben Pfaff
Reported-by: ZhengLingyun Signed-off-by: Ben Pfaff --- lib/netdev.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/netdev.c b/lib/netdev.c index 0e8ec58..088aea9 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -328,6 +328,9 @@ netdev_open(const char *name, const char *type, struct

Re: [ovs-dev] [PATCH] netdev-linux: Fix netdev leak in corner case.

2013-08-10 Thread Ben Pfaff
Thank you, I applied this to master. On Sat, Aug 10, 2013 at 11:03:48AM -0700, Alex Wang wrote: > Looks good to me, Thanks, > > > On Sat, Aug 10, 2013 at 9:04 AM, Ben Pfaff wrote: > > > Reported-by: Alex Wang > > Signed-off-by: Ben Pfaff > > --- > > lib/netdev-linux.c |3 +-- > > 1 file

Re: [ovs-dev] [netdev-linux]Deadlock is fixed; netdev_open() has a bug

2013-08-10 Thread ZhengLingyun
It is ok now. Another problem: netdev_open does shash_add() but no shash_delete() when error occurs, such as device not exists. It will cause a SIGSEGV signal. At 2013-08-10 21:49:30,"Ben Pfaff" wrote: >On Sat, Aug 10, 2013 at 06:33:35PM +0800, ZhengLingyun wrote: >> I just update the code.

Re: [ovs-dev] [PATCH 5/5 v2] dpif-netdev: Avoid races on queue and port changes using seq objects.

2013-08-10 Thread Andy Zhou
On Wed, Aug 7, 2013 at 1:31 PM, Ben Pfaff wrote: > Signed-off-by: Ben Pfaff > --- > v1->v2: Fix both races instead of just one. > > lib/dpif-netdev.c | 42 -- > 1 file changed, 24 insertions(+), 18 deletions(-) > > diff --git a/lib/dpif-netdev.c b/lib/d

Re: [ovs-dev] [seq 4/5] seq: New module for race-free, pollable, thread-safe sequence number.

2013-08-10 Thread Andy Zhou
Sorry for the delay in review. It took me a while to understand the design intent to be able to understand the logic. A design question: It seems 'seq' API expects seq numbers to be monotonically increasing. is this true? If yes, would it make sense to add some asserts? Acked-by: Andy Zhou

Re: [ovs-dev] [PATCH] netdev-linux: Fix netdev leak in corner case.

2013-08-10 Thread Alex Wang
Looks good to me, Thanks, On Sat, Aug 10, 2013 at 9:04 AM, Ben Pfaff wrote: > Reported-by: Alex Wang > Signed-off-by: Ben Pfaff > --- > lib/netdev-linux.c |3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c > index e569750..d1

Re: [ovs-dev] [netdev 26/27] netdev-linux: Use dedicated netlink notification socket.

2013-08-10 Thread Ben Pfaff
On Fri, Aug 09, 2013 at 10:17:47PM -0700, Alex Wang wrote: > > > +struct netdev *netdev_ = > > netdev_from_name(change.ifname); > > > > +if (netdev_ && > > > > is_netdev_linux_class(netdev_->netdev_class)) { > > > > > > > > > Want to confirm, at this if statement, is

[ovs-dev] [PATCH] netdev-linux: Fix netdev leak in corner case.

2013-08-10 Thread Ben Pfaff
Reported-by: Alex Wang Signed-off-by: Ben Pfaff --- lib/netdev-linux.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index e569750..d146ccf 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -513,9 +513,8 @@ netdev_linux

Re: [ovs-dev] [netdev-linux]Deadlock

2013-08-10 Thread Ben Pfaff
On Sat, Aug 10, 2013 at 06:33:35PM +0800, ZhengLingyun wrote: > I just update the code. It can't run (just in userspace?). > There is a recursive dead lock in netdev_linux_set_etheraddr and > netdev_linux_update_flags. Thank you for the report. You are right, this is most likely to affect the us

[ovs-dev] [PATCH] netdev-linux: Avoid deadlock in netdev_linux_update_flags() for taps.

2013-08-10 Thread Ben Pfaff
netdev_linux_set_etheraddr() would attempt to recursively acquire netdev->mutex via netdev_linux_update_flags() for tap devices. Reported-by: ZhengLingyun Signed-off-by: Ben Pfaff --- lib/netdev-linux.c | 35 ++- 1 file changed, 26 insertions(+), 9 deletions(-)

[ovs-dev] [netdev-linux]Deadlock

2013-08-10 Thread ZhengLingyun
Hi, Ben I just update the code. It can't run (just in userspace?). There is a recursive dead lock in netdev_linux_set_etheraddr and netdev_linux_update_flags. #0 0xb7fdd424 in __kernel_vsyscall () #1 0xb7dbe5a2 in __lll_lock_wait () from /lib/i386-linux-gnu/libpthread.so.0 #2 0xb7db9ead in _L