DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vhost: fix vhost user virtqueue not accessable
@ 2019-10-25 16:20 Marvin Liu
  2019-10-25 12:20 ` Adrian Moreno
  2019-10-30 11:07 ` [dpdk-dev] [PATCH v2] vhost: fix vhost user virtqueue not accessible Marvin Liu
  0 siblings, 2 replies; 16+ messages in thread
From: Marvin Liu @ 2019-10-25 16:20 UTC (permalink / raw)
  To: maxime.coquelin, tiwei.bie, zhihong.wang, amorenoz; +Cc: dev, Marvin Liu

Log feature is disabled in vhost user, so that log address was invalid
when checking. Add feature bit check can skip useless address check.

Fixes: 04cfc7fdbfca ("vhost: translate incoming log address to gpa")

Signed-off-by: Marvin Liu <yong.liu@intel.com>
---
 lib/librte_vhost/vhost_user.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 61ef699ac..0407fdc29 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -741,13 +741,15 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index)
 		vq->last_avail_idx = vq->used->idx;
 	}
 
-	vq->log_guest_addr =
-		translate_log_addr(dev, vq, addr->log_guest_addr);
-	if (vq->log_guest_addr == 0) {
-		RTE_LOG(DEBUG, VHOST_CONFIG,
-			"(%d) failed to map log_guest_addr .\n",
-			dev->vid);
-		return dev;
+	if (dev->features & (1ULL << VHOST_F_LOG_ALL)) {
+		vq->log_guest_addr =
+			translate_log_addr(dev, vq, addr->log_guest_addr);
+		if (vq->log_guest_addr == 0) {
+			RTE_LOG(DEBUG, VHOST_CONFIG,
+				"(%d) failed to map log_guest_addr .\n",
+				dev->vid);
+			return dev;
+		}
 	}
 	vq->access_ok = 1;
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-11-06 20:59 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-25 16:20 [dpdk-dev] [PATCH] vhost: fix vhost user virtqueue not accessable Marvin Liu
2019-10-25 12:20 ` Adrian Moreno
2019-10-28  2:13   ` Liu, Yong
2019-10-29 10:02     ` Adrian Moreno
2019-10-30 11:07 ` [dpdk-dev] [PATCH v2] vhost: fix vhost user virtqueue not accessible Marvin Liu
2019-10-30  6:58   ` Tiwei Bie
2019-10-30 14:56   ` [dpdk-dev] [PATCH v3] " Marvin Liu
2019-10-31 10:42     ` Tiwei Bie
2019-10-31 14:54       ` Liu, Yong
2019-10-31 17:47         ` Adrian Moreno
2019-11-01  7:16           ` Liu, Yong
2019-11-04  8:44             ` Adrian Moreno
2019-11-04 10:13     ` [dpdk-dev] [PATCH v4] " Marvin Liu
2019-11-04  8:47       ` Adrian Moreno
2019-11-06 20:16         ` Maxime Coquelin
2019-11-06 20:59       ` Maxime Coquelin

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).