From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH v2 17/19] vhost-user: iommu: postpone device creation until ring are mapped Date: Fri, 29 Sep 2017 20:34:32 +0800 Message-ID: <20170929123432.GP2251@yliu-home> References: <20170924161921.30010-1-maxime.coquelin@redhat.com> <20170924161921.30010-18-maxime.coquelin@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Maxime Coquelin Return-path: Received: from mail-pf0-f175.google.com (mail-pf0-f175.google.com [209.85.192.175]) by dpdk.org (Postfix) with ESMTP id 9F304397D for ; Fri, 29 Sep 2017 14:34:42 +0200 (CEST) Received: by mail-pf0-f175.google.com with SMTP id e1so695280pfk.1 for ; Fri, 29 Sep 2017 05:34:42 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20170924161921.30010-18-maxime.coquelin@redhat.com> 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 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. --yliu > +}