[ovs-git] [openvswitch/ovs] 3f891b: netdev-dpdk: Fix deadlock in destroy_device().

GitHub noreply at github.com
Tue Aug 9 18:30:36 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 3f891bbea61dcfbc1f3cb64d179fa1913c34c6c2
      https://github.com/openvswitch/ovs/commit/3f891bbea61dcfbc1f3cb64d179fa1913c34c6c2
  Author: Daniele Di Proietto <diproiettod at vmware.com>
  Date:   2016-08-09 (Tue, 09 Aug 2016)

  Changed paths:
    M lib/netdev-dpdk.c

  Log Message:
  -----------
  netdev-dpdk: Fix deadlock in destroy_device().

netdev_dpdk_vhost_destruct() calls rte_vhost_driver_unregister(), which
can trigger the destroy_device() callback.  destroy_device() will try to
take two mutexes already held by netdev_dpdk_vhost_destruct(), causing a
deadlock.

This problem can be solved by dropping the mutexes before calling
rte_vhost_driver_unregister().  The netdev_dpdk_vhost_destruct() and
construct() call are already serialized by netdev_mutex.

This commit also makes clear that dev->vhost_id is constant and can be
accessed without taking any mutexes in the lifetime of the devices.

Fixes: 8d38823bdf8b("netdev-dpdk: fix memory leak")
Reported-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Daniele Di Proietto <diproiettod at vmware.com>
Acked-by: Ilya Maximets <i.maximets at samsung.com>
Acked-by: Mark Kavanagh <mark.b.kavanagh at intel.com>




More information about the git mailing list