From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F12E9C04AC41; Fri, 29 Sep 2017 12:51:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F12E9C04AC41 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=maxime.coquelin@redhat.com Received: from [10.36.112.52] (ovpn-112-52.ams2.redhat.com [10.36.112.52]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AE75518533; Fri, 29 Sep 2017 12:51:42 +0000 (UTC) To: Yuanhan Liu Cc: dev@dpdk.org, remy.horton@intel.com, tiwei.bie@intel.com, mst@redhat.com, jfreiman@redhat.com, vkaplans@redhat.com, jasowang@redhat.com References: <20170924161921.30010-1-maxime.coquelin@redhat.com> <20170924161921.30010-18-maxime.coquelin@redhat.com> <20170929123432.GP2251@yliu-home> From: Maxime Coquelin Message-ID: Date: Fri, 29 Sep 2017 14:51:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170929123432.GP2251@yliu-home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 29 Sep 2017 12:51:48 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v2 17/19] vhost-user: iommu: postpone device creation until ring are mapped 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: Fri, 29 Sep 2017 12:51:48 -0000 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 >> +}