vhost: forbid reallocation when running
authorTiwei Bie <tiwei.bie@intel.com>
Mon, 19 Aug 2019 11:34:55 +0000 (19:34 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 7 Oct 2019 13:00:57 +0000 (15:00 +0200)
commit37f7c1b609b67d26cbdd4c16a3ebc85e8d63e6dd
tree1602847f9847b3e8645fb76267e09a41da5e3b2b
parent61af1713d3f1bebf896aeb943fc23f58ed4f0724
vhost: forbid reallocation when running

When the device has been started, don't do the reallocation anymore.
Otherwise the pointers used in application threads can be invalidated
without proper protection. Instead of introducing a global lock to
protect the change of device pointers which will hurt the performance,
let's just do the reallocation during setup.

Fixes: af295ad4698c ("vhost: realloc device and queues to same numa node as vring desc")
Cc: stable@dpdk.org
Reported-by: Yinan Wang <yinan.wang@intel.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/vhost_user.c