[dpdk-stable] patch 'vhost: fix offset while mmaping log base address' has been queued to LTS release 17.11.2

Yuanhan Liu yliu at fridaylinux.org
Sun Apr 22 17:08:59 CEST 2018


Hi,

FYI, your patch has been queued to LTS release 17.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/29/18. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From 608a0be0c01880f30a5f7902f9a0766457c5db36 Mon Sep 17 00:00:00 2001
From: Tomasz Kulasek <tomaszx.kulasek at intel.com>
Date: Thu, 8 Feb 2018 17:59:00 +0100
Subject: [PATCH] vhost: fix offset while mmaping log base address

[ upstream commit fbc4d248b198db7f720fe31a47050a406632cc7a ]

QEMU always set offset to 0 but for sanity we should take the offset
into account.

Fixes: 54f9e32305d4 ("vhost: handle dirty pages logging request")

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski at intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek at intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan at intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 lib/librte_vhost/vhost_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 4ed18fd12..03190d64f 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -954,7 +954,7 @@ vhost_user_set_log_base(struct virtio_net *dev, struct VhostUserMsg *msg)
 	 * mmap from 0 to workaround a hugepage mmap bug: mmap will
 	 * fail when offset is not page size aligned.
 	 */
-	addr = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+	addr = mmap(0, size + off, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
 	close(fd);
 	if (addr == MAP_FAILED) {
 		RTE_LOG(ERR, VHOST_CONFIG, "mmap log base failed!\n");
-- 
2.11.0



More information about the stable mailing list