From: "Yang, Zhiyong" <zhiyong.yang@intel.com>
To: Yuanhan Liu <yliu@fridaylinux.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>
Subject: Re: [dpdk-dev] [PATCH] lib/librte_vhost: remove redundant logic judgement
Date: Wed, 3 Jan 2018 10:21:15 +0000 [thread overview]
Message-ID: <E182254E98A5DA4EB1E657AC7CB9BD2A8B01DBF7@BGSMSX101.gar.corp.intel.com> (raw)
In-Reply-To: <20171227142919.GG8818@yliu-mob>
> -----Original Message-----
> From: Yuanhan Liu [mailto:yliu@fridaylinux.org]
> Sent: Wednesday, December 27, 2017 10:29 PM
> To: Yang, Zhiyong <zhiyong.yang@intel.com>
> Cc: dev@dpdk.org; maxime.coquelin@redhat.com
> Subject: Re: [PATCH] lib/librte_vhost: remove redundant logic judgement
>
> On Mon, Dec 25, 2017 at 05:16:17PM +0800, Zhiyong Yang wrote:
> > At the beginning of vring_translate, the code if(!(dev->features &
> > (1ULL << VIRTIO_F_IOMMU_PLATFORM))) already judges if
> IOMMU_PLATFORM
> > is supported. The function vhost_iova_to_vva always repeats the logic,
> > __vhost_iova_to_vva can be used directly to avoid it here.
> >
> > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> > ---
> > lib/librte_vhost/vhost.c | 7 ++++---
> > 1 file changed, 4 insertions(+), 3 deletions(-)
> >
> > diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index
> > 4f8b73a09..bb615fd2a 100644
> > --- a/lib/librte_vhost/vhost.c
> > +++ b/lib/librte_vhost/vhost.c
> > @@ -157,7 +157,7 @@ vring_translate(struct virtio_net *dev, struct
> vhost_virtqueue *vq)
> > goto out;
> >
> > size = sizeof(struct vring_desc) * vq->size;
> > - vq->desc = (struct vring_desc *)(uintptr_t)vhost_iova_to_vva(dev, vq,
> > + vq->desc = (struct vring_desc *)(uintptr_t)__vhost_iova_to_vva(dev,
> > +vq,
> > vq-
> >ring_addrs.desc_user_addr,
> > size, VHOST_ACCESS_RW);
>
>
> I don't see strong reason to bother doing the change. It's not in the datapath
> after all. I'd like to keep the code as it is, to keep it simpler:
> user just has to call vhost_iova_to_vva() and let it to handle the details.
>
> --yliu
>
Ok, drop it.
Thanks
Zhiyong
prev parent reply other threads:[~2018-01-03 10:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-25 9:16 Zhiyong Yang
2017-12-27 14:29 ` Yuanhan Liu
2018-01-03 10:21 ` Yang, Zhiyong [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=E182254E98A5DA4EB1E657AC7CB9BD2A8B01DBF7@BGSMSX101.gar.corp.intel.com \
--to=zhiyong.yang@intel.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=yliu@fridaylinux.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).