DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: dev@dpdk.org
Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 2/3] vhost: fix long stall of vhost-user negotiation
Date: Sun, 22 Jan 2017 16:46:59 +0800	[thread overview]
Message-ID: <1485074820-8956-3-git-send-email-yuanhan.liu@linux.intel.com> (raw)
In-Reply-To: <1485074820-8956-1-git-send-email-yuanhan.liu@linux.intel.com>

Setting up the mapping from GPA (guest physical address) to HPA (guest
physical address) could be very time consuming when the guest memory is
backened with small pages (4K). The bigger the guest memory, the longer
it takes. This could lead a very long vhost-user negotiation.

Since the mapping is only needed in zero copy mode so far, we could
avoid such time consuming settup when zero copy is turned off (which is
the default case).

It's actually a workaround, a right fix might be to start a new thread,
and hide the big latency there.

Fixes: e246896178e6 ("vhost: get guest/host physical address mappings")

Cc: stable@dpdk.org
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 lib/librte_vhost/vhost_user.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 7343a00..ab7f3fc 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -567,7 +567,8 @@
 		reg->host_user_addr = (uint64_t)(uintptr_t)mmap_addr +
 				      mmap_offset;
 
-		add_guest_pages(dev, reg, alignment);
+		if (dev->dequeue_zero_copy)
+			add_guest_pages(dev, reg, alignment);
 
 		RTE_LOG(INFO, VHOST_CONFIG,
 			"guest memory region %u, size: 0x%" PRIx64 "\n"
-- 
1.9.0

  parent reply	other threads:[~2017-01-22  8:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-22  8:46 [dpdk-dev] [PATCH 0/3] few virtio/vhost fixes Yuanhan Liu
2017-01-22  8:46 ` [dpdk-dev] [PATCH 1/3] vhost: fix dead loop in enqueue path Yuanhan Liu
2017-01-23  7:56   ` Maxime Coquelin
2017-01-22  8:46 ` Yuanhan Liu [this message]
2017-01-23  8:25   ` [dpdk-dev] [PATCH 2/3] vhost: fix long stall of vhost-user negotiation Maxime Coquelin
2017-01-22  8:47 ` [dpdk-dev] [PATCH 3/3] net/virtio: fix crash when number of virtio devices > 1 Yuanhan Liu
2017-01-23  7:58   ` Maxime Coquelin
2017-01-23 10:57 ` [dpdk-dev] [PATCH 0/3] few virtio/vhost fixes Yuanhan Liu

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=1485074820-8956-3-git-send-email-yuanhan.liu@linux.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.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).