netdev: Fix deadlock when netdev_dump_queues() callback calls into netdev.
authorBen Pfaff <blp@nicira.com>
Wed, 28 Aug 2013 00:15:53 +0000 (17:15 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 28 Aug 2013 04:50:40 +0000 (21:50 -0700)
commit89454bf477d1dc95357792677ccbd4d483ab42d8
treec66eb9b3091ee542442f3868c0b03a941148435b
parent8037acb42c04aa50011a2b34d1fe4a715c73a4b7
netdev: Fix deadlock when netdev_dump_queues() callback calls into netdev.

We have a call chain like this:

    iface_configure_qos() calls
        netdev_dump_queues(), which calls
            netdev_linux_dump_queues(), which calls back through 'cb' to
                qos_unixctl_show_cb(), which calls
                    netdev_delete_queue(), which calls
                        netdev_linux_delete_queue().

Both netdev_dump_queues() and netdev_linux_delete_queue() take the same
mutex in the same netdev, which deadlocks.

This commit fixes the problem by getting rid of the callback.

netdev_linux_dump_queue_stats() would benefit from the same treatment but
it's less urgent because I don't see any callbacks from that function that
call back into a netdev function.

Bug #19319.
Reported-by: Scott Hendricks <shendricks@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/netdev-dummy.c
lib/netdev-linux.c
lib/netdev-provider.h
lib/netdev-vport.c
lib/netdev.c
lib/netdev.h
vswitchd/bridge.c