From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH v2 17/19] vhost-user: iommu: postpone device creation until ring are mapped Date: Fri, 29 Sep 2017 14:51:39 +0200 Message-ID: References: <20170924161921.30010-1-maxime.coquelin@redhat.com> <20170924161921.30010-18-maxime.coquelin@redhat.com> <20170929123432.GP2251@yliu-home> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, remy.horton@intel.com, tiwei.bie@intel.com, mst@redhat.com, jfreiman@redhat.com, vkaplans@redhat.com, jasowang@redhat.com To: Yuanhan Liu Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id A4B8EFFA for ; Fri, 29 Sep 2017 14:51:48 +0200 (CEST) In-Reply-To: <20170929123432.GP2251@yliu-home> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 09/29/2017 02:34 PM, Yuanhan Liu wrote: > On Sun, Sep 24, 2017 at 06:19:19PM +0200, Maxime Coquelin wrote: >> static int >> -vhost_user_iotlb_msg(struct virtio_net *dev, struct VhostUserMsg *msg) >> +is_vring_iotlb_update(struct vhost_virtqueue *vq, struct vhost_iotlb_msg *imsg) >> { >> + struct vhost_vring_addr *ra; >> + uint64_t start, end; >> + >> + start = imsg->iova; >> + end = start + imsg->size; >> + >> + ra = &vq->ring_addrs; >> + if (ra->desc_user_addr >= start && ra->desc_user_addr < end) >> + return 1; >> + if (ra->avail_user_addr >= start && ra->avail_user_addr < end) >> + return 1; >> + if (ra->used_user_addr >= start && ra->used_user_addr < end) >> + return 1; >> + >> + return -1; > > It should be "return 0" here. Oops, thanks for spotting this. Maxime > --yliu >> +}