From: Maxime Coquelin Date: Fri, 13 Oct 2017 09:30:21 +0000 (+0200) Subject: vhost: fetch ring address after NUMA reallocation X-Git-Tag: spdx-start~1309 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=86fe881c03cf1aa3e93c5e6534b9974f7350f823;p=dpdk.git vhost: fetch ring address after NUMA reallocation In case of NUMA reallocation, the virtqueue struct is reallocated on another socket, meaning that its address changes. In translate_ring_addresses(), addr pointer was not fetched again after the reallocation, so it pointed to freed memory. This patch just fetch again addr pointer after the reallocation. Reported-by: Lei Yao Signed-off-by: Maxime Coquelin Tested-by: Lei Yao Reviewed-by: Jens Freimann --- diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 1dfb234ca1..76c4eeca51 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -420,6 +420,7 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index) dev = numa_realloc(dev, vq_index); vq = dev->virtqueue[vq_index]; + addr = &vq->ring_addrs; vq->avail = (struct vring_avail *)(uintptr_t)ring_addr_to_vva(dev, vq, addr->avail_user_addr, sizeof(struct vring_avail));