From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 059D41B1B7 for ; Wed, 3 Jan 2018 11:21:20 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jan 2018 02:21:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,501,1508828400"; d="scan'208";a="21018449" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 03 Jan 2018 02:21:19 -0800 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 3 Jan 2018 02:21:19 -0800 Received: from bgsmsx153.gar.corp.intel.com (10.224.23.4) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 3 Jan 2018 02:21:18 -0800 Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.245]) by BGSMSX153.gar.corp.intel.com ([10.224.23.4]) with mapi id 14.03.0319.002; Wed, 3 Jan 2018 15:51:16 +0530 From: "Yang, Zhiyong" To: Yuanhan Liu CC: "dev@dpdk.org" , "maxime.coquelin@redhat.com" Thread-Topic: [PATCH] lib/librte_vhost: remove redundant logic judgement Thread-Index: AQHTfWEKqDoIarMdUEqerqo2tCZbnaNW5zOAgAsW1EA= Date: Wed, 3 Jan 2018 10:21:15 +0000 Message-ID: References: <20171225091617.60387-1-zhiyong.yang@intel.com> <20171227142919.GG8818@yliu-mob> In-Reply-To: <20171227142919.GG8818@yliu-mob> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.223.10.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] lib/librte_vhost: remove redundant logic judgement X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jan 2018 10:21:21 -0000 > -----Original Message----- > From: Yuanhan Liu [mailto:yliu@fridaylinux.org] > Sent: Wednesday, December 27, 2017 10:29 PM > To: Yang, Zhiyong > Cc: dev@dpdk.org; maxime.coquelin@redhat.com > Subject: Re: [PATCH] lib/librte_vhost: remove redundant logic judgement >=20 > 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 > > --- > > 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 =3D sizeof(struct vring_desc) * vq->size; > > - vq->desc =3D (struct vring_desc *)(uintptr_t)vhost_iova_to_vva(dev, v= q, > > + vq->desc =3D (struct vring_desc *)(uintptr_t)__vhost_iova_to_vva(dev, > > +vq, > > vq- > >ring_addrs.desc_user_addr, > > size, VHOST_ACCESS_RW); >=20 >=20 > I don't see strong reason to bother doing the change. It's not in the dat= apath > 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 detail= s. >=20 > --yliu >=20 Ok, drop it.=20 Thanks Zhiyong