From: Maxime Coquelin Date: Thu, 12 Oct 2017 15:38:50 +0000 (+0200) Subject: vhost: fix IOTLB on NUMA realloc X-Git-Tag: spdx-start~1310 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b9c07b314160a91da7cf8d398dab33da179757f7;p=dpdk.git vhost: fix IOTLB on NUMA realloc In case of NUMA reallocation, virtqueue's iotlb list is broken, has its head changes but first iotlb entry in the list still points to the previous head pointer. Also, in case of reallocation, we want the IOTLB cache mempool to be on the new socket. This patch perform a full re-init of the IOTLB cache when mempool already exists, and calls the IOTLB cache init function in case the virtqueue is being reallocated on a new socket. Signed-off-by: Maxime Coquelin Reviewed-by: Jens Freimann --- diff --git a/lib/librte_vhost/iotlb.c b/lib/librte_vhost/iotlb.c index 05c278040f..b74cc6a78f 100644 --- a/lib/librte_vhost/iotlb.c +++ b/lib/librte_vhost/iotlb.c @@ -309,7 +309,6 @@ vhost_user_iotlb_init(struct virtio_net *dev, int vq_index) */ vhost_user_iotlb_cache_remove_all(vq); vhost_user_iotlb_pending_remove_all(vq); - return 0; } #ifdef RTE_LIBRTE_VHOST_NUMA diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 9acac6125b..1dfb234ca1 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -314,6 +314,9 @@ out: dev->virtqueue[index] = vq; vhost_devices[dev->vid] = dev; + if (old_vq != vq) + vhost_user_iotlb_init(dev, index); + return dev; } #else