From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=p8mHWEmXBtANrpoZdwQN/GSZabMrm1F04Lee+P2Al9k=; b=0psd478OT7XOCXL0Q8UflcrFrdmiHn1HFZsS9mh7l8ZPYY7ZZ7qnEPfoCD28Ow47Pr RIzsWphg7fzvx+QtijccdMWwV8WnYgN/L8Pzg6uBWSXEzcuByPsMB1Su05Xj1wcdBoTn dUqtpjp5g0B2U/QY6EC7s3csi9QzJ8Tq6zXVzQjLevDb1lasenxBBymi3ff+bUrmdrwx AYx2v2RMTg28sQdJO538XSjJt2zEofxt2tAsjHUunL7vaYy/yaHhQflAL8Tk/pOAIiSU x4Imq1k3h7d3cQEqGgyxdyT0usrwEJ7baE64O0zw6SBx2YJJasWK1TRutQ85ZnpavLGN 7aqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=p8mHWEmXBtANrpoZdwQN/GSZabMrm1F04Lee+P2Al9k=; b=Sijiei+ToJ+WXEADB6VW+L2SpXqO4hH1JPJdrRRb2/iaKdvE45gj766vk8VFNRscqp YjtbX+3L5Zpd+TBBZPHy4CgFDgJo0rBGyGof26zN9c8GvG1/I1aHFFpfcG1hKPCsma08 IJ4odq6c1aoTlM5mcMDm4AblplSUDDTqLvy0ZCgFjHxFKUGtCbt0PkAEBeT6I0jibII7 qc6bHbETiMkFn+RiAWLQO8JB0fgvXSdw0CKNSpkNNdtOgWuF930XKhGbNyJCcERKssk3 MyeT3sXWJJSmpE3Y6hr7Zf5mZGBnOaHRIO5OwuHZvSwlMOUjRg/iHGbPRzZzhHS2FFVO DvxA== X-Gm-Message-State: AHPjjUilLctS68fn1wql05sGJFJZvRVTuF1p1vorEdIFHSgvkTqKKapZ 7OBtVjfbB9ZE/gEaAtL88vDUzg== X-Google-Smtp-Source: AOwi7QDUzSZ9VmSWkpHviJxDgbnOQf4ODu14qdaOaBHpo+DVSfS/yFFAjIqtn4ftYZjB+4EDtW4viw== X-Received: by 10.98.79.23 with SMTP id d23mr7361320pfb.105.1506688481458; Fri, 29 Sep 2017 05:34:41 -0700 (PDT) Received: from yliu-home ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id k78sm8173538pfb.157.2017.09.29.05.34.38 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Sep 2017 05:34:40 -0700 (PDT) Date: Fri, 29 Sep 2017 20:34:32 +0800 From: Yuanhan Liu To: Maxime Coquelin Cc: dev@dpdk.org, remy.horton@intel.com, tiwei.bie@intel.com, mst@redhat.com, jfreiman@redhat.com, vkaplans@redhat.com, jasowang@redhat.com 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 Content-Disposition: inline In-Reply-To: <20170924161921.30010-18-maxime.coquelin@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) 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:34:42 -0000 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 > +}