From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
To: "Kulasek, TomaszX" <tomaszx.kulasek@intel.com>,
"yliu@fridaylinux.org" <yliu@fridaylinux.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"yuanhan.liu@linux.intel.com" <yuanhan.liu@linux.intel.com>,
"stable@dpdk.org" <stable@dpdk.org>,
"Wodkowski, PawelX" <pawelx.wodkowski@intel.com>
Subject: Re: [dpdk-dev] [PATCH] vhost: fix offset while mmaping log base address
Date: Fri, 9 Feb 2018 01:54:23 +0000 [thread overview]
Message-ID: <ED26CBA2FAD1BF48A8719AEF02201E365143668B@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <20180208165938.44860-1-tomaszx.kulasek@intel.com>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Tomasz Kulasek
> Sent: Friday, February 9, 2018 1:00 AM
> To: yliu@fridaylinux.org
> Cc: dev@dpdk.org; yuanhan.liu@linux.intel.com; stable@dpdk.org;
> Wodkowski, PawelX
> Subject: [dpdk-dev] [PATCH] vhost: fix offset while mmaping log base
> address
>
> QEMU always set offset to 0 but for sanity we should take the offset
> into account.
>
> Fixes: 54f9e32305d4 ("vhost: handle dirty pages logging request")
> Cc: yuanhan.liu@linux.intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
> Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
Thanks!
> ---
> 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 65ee33919..674f2ffe8 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -991,7 +991,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.14.1
next prev parent reply other threads:[~2018-02-09 1:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-08 16:59 Tomasz Kulasek
2018-02-09 1:54 ` Tan, Jianfeng [this message]
2018-02-19 21:03 ` Maxime Coquelin
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=ED26CBA2FAD1BF48A8719AEF02201E365143668B@SHSMSX103.ccr.corp.intel.com \
--to=jianfeng.tan@intel.com \
--cc=dev@dpdk.org \
--cc=pawelx.wodkowski@intel.com \
--cc=stable@dpdk.org \
--cc=tomaszx.kulasek@intel.com \
--cc=yliu@fridaylinux.org \
--cc=yuanhan.liu@linux.intel.com \
/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).