DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: yliu@fridaylinux.org, thomas@monjalon.net, dev@dpdk.org
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: [dpdk-dev] [PATCH 2/2] vhost: fix IOTLB on NUMA realloc
Date: Thu, 12 Oct 2017 17:38:50 +0200	[thread overview]
Message-ID: <20171012153850.21837-3-maxime.coquelin@redhat.com> (raw)
In-Reply-To: <20171012153850.21837-1-maxime.coquelin@redhat.com>

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 <maxime.coquelin@redhat.com>
---
 lib/librte_vhost/iotlb.c      | 1 -
 lib/librte_vhost/vhost_user.c | 3 +++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/librte_vhost/iotlb.c b/lib/librte_vhost/iotlb.c
index 05c278040..b74cc6a78 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 9acac6125..1dfb234ca 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -314,6 +314,9 @@ numa_realloc(struct virtio_net *dev, int index)
 	dev->virtqueue[index] = vq;
 	vhost_devices[dev->vid] = dev;
 
+	if (old_vq != vq)
+		vhost_user_iotlb_init(dev, index);
+
 	return dev;
 }
 #else
-- 
2.13.6

  parent reply	other threads:[~2017-10-12 15:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20171012153850.21837-1-maxime.coquelin@redhat.com>
2017-10-12 15:38 ` [dpdk-dev] [PATCH 1/2] vhost: fix deadlock on IOTLB miss Maxime Coquelin
2017-10-13 11:32   ` Jens Freimann
2017-10-12 15:38 ` Maxime Coquelin [this message]
2017-10-13 11:23   ` [dpdk-dev] [PATCH 2/2] vhost: fix IOTLB on NUMA realloc Jens Freimann
2017-10-13 18:37 ` [dpdk-dev] [PATCH 0/2] vhost: IOTLB fixes for -rc1 Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171012153850.21837-3-maxime.coquelin@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=yliu@fridaylinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).