DPDK patches and discussions
 help / color / mirror / Atom feed
From: "BillXiang" <xiangwencheng@dayudpu.com>
To: <chenbox@nvidia.com>
Cc: <maxime.coquelin@redhat.com>, <jianfeng.tan@intel.com>,
	 <tomaszx.kulasek@intel.com>, <pawelx.wodkowski@intel.com>,
	 <dev@dpdk.org>, "BillXiang" <xiangwencheng@dayudpu.com>
Subject: Re: [PATCH] vhost: fix offset while mmaping log base address
Date: Wed, 10 Jul 2024 11:22:58 +0800	[thread overview]
Message-ID: <20240710032258.68712-1-xiangwencheng@dayudpu.com> (raw)
In-Reply-To: <20240708065749.1131-1-xiangwencheng@dayudpu.com>

From: BillXiang <xiangwencheng@dayudpu.com>

> From: "Chenbo Xia"<chenbox@nvidia.com>
> Date: Tue, Jul 9, 2024, 20:42
> Subject: Re: [PATCH] vhost: fix offset while mmaping log base address
> To: "BillXiang"<xiangwencheng@dayudpu.com>
> Cc: "Maxime Coquelin"<maxime.coquelin@redhat.com>, "Jianfeng Tan"<jianfeng.tan@intel.com>, "Tomasz Kulasek"<tomaszx.kulasek@intel.com>, "Pawel Wodkowski"<pawelx.wodkowski@intel.com>, "dev@dpdk.org"<dev@dpdk.org>
> > On Jul 8, 2024, at 14:57, BillXiang <xiangwencheng@dayudpu.com> wrote:
> >
> > External email: Use caution opening links or attachments
> >
> >
> > From: BillXiang <xiangwencheng@dayudpu.com>
> >
> > For sanity the offset should be the last parameter of mmap.
> >
> > Fixes: fbc4d24 ("vhost: fix offset while mmaping log base address")
>
> The commit id length should be 12.
>

Thanks, I will mind it.

> Since QEMU always send offset 0, I think it's no need to backport the
> patch, so no cc-stable is fine.
>

I just think the code is confusing and I'm wondering whether the offset 
sent by QEMU or maybe other VM can be non-zero.

If it's a mistake just fix it.

> With above fixed:
>
> Reviewed-by: Chenbo Xia <chenbox@nvidia.com>
>
> > Signed-off-by: BillXiang <xiangwencheng@dayudpu.com>
> > ---
> > lib/vhost/vhost_user.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
> > index 5f470da38a..0893ae80bb 100644
> > --- a/lib/vhost/vhost_user.c
> > +++ b/lib/vhost/vhost_user.c
> > @@ -2399,7 +2399,7 @@ vhost_user_set_log_base(struct virtio_net **pdev,
> >     * mmap from 0 to workaround a hugepage mmap bug: mmap will
> >     * fail when offset is not page size aligned.
> >     */
> > -    addr = mmap(0, size + off, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
> > +    addr = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, off);
> >    alignment = get_blk_size(fd);
> >    close(fd);
> >    if (addr == MAP_FAILED) {
> > --
> > 2.30.0

      parent reply	other threads:[~2024-07-10  3:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-08  6:57 BillXiang
2024-07-09 12:42 ` Chenbo Xia
2024-07-10  3:22 ` BillXiang [this message]

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=20240710032258.68712-1-xiangwencheng@dayudpu.com \
    --to=xiangwencheng@dayudpu.com \
    --cc=chenbox@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=pawelx.wodkowski@intel.com \
    --cc=tomaszx.kulasek@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).