Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp456285pxu; Sun, 25 Oct 2020 06:25:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl9jmHch3IoAZQVWfVMqe4vONzs68MuVG8G1Shkut4h4QMkvWrNVCOUIk9z/CcC6QgQ7vt X-Received: by 2002:a17:906:95c5:: with SMTP id n5mr11616263ejy.111.1603632333813; Sun, 25 Oct 2020 06:25:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603632333; cv=none; d=google.com; s=arc-20160816; b=T7OcZfiHH1YXqfyCSKlhkknARqMx2bk93B7dXKLzz/mEwWzObXUSenLiGtithgW7Eo 8PL8w7zKx/P4r7PIGIliG5W3PUWlo7dYUeAVWj0UxJUcld4YO9p0sVL0lccwacLdYQRv 2s53C4GyrKoh7ukKuoEVf7uU1DefDl8aEWCTAFA7pDs0vb6f2uapjzB3QrFluHkdbOuA I8VeBMTIlbsBC33rjatBG+bNh+F/go3RoDINNmjofT0C29iTwhBUi85FbU9OJoROuS2i soSUwVpLRMUumj/SadKQgO6tw48epe9eXRAr2Pl7T3EGA8s2swDsUJE07GYf4ksa5BA2 rVcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=o/uG0K7rIUGrVC3mPxjGqi4veKvDNBJAsJoTCKUSR1o=; b=LYLpj8F5cWRRvlBAZwctM+R8Mhles6yZ/DwtBiaoDhCnjOrMNPwsfFT9B+/gOnRXk6 YRG0TqO4l1sQ2y8R4ccFfFoCni6SoEqkgttA95m12sGdQ4j1iLRdXn+LxnBJkPGJLJst /1k+G6k5NtaNMPW3vGsu0DeiNJfmd1IdAcODMJJAYjrPxm16dcRIVbtWBEIKo1Vxq+0y qMFhNBODfUyMTxzmVVi2JcCDlPOOeLXXrBPzLsFn2gRWgbQtDfdt0kUNvNZg/Rn6GuZ1 18ds0T6GnJXIZ7WU7wb193Vg8F/535Llu5ePv+Dd1LUxVSyG5hJB22a/iadrH1PC62U1 WZSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=T3BJ71oc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v27si4796280edx.414.2020.10.25.06.25.08; Sun, 25 Oct 2020 06:25:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=T3BJ71oc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1414831AbgJYJed (ORCPT + 99 others); Sun, 25 Oct 2020 05:34:33 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:8140 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1414827AbgJYJed (ORCPT ); Sun, 25 Oct 2020 05:34:33 -0400 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Sun, 25 Oct 2020 02:34:37 -0700 Received: from mtl-vdi-166.wap.labs.mlnx (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 25 Oct 2020 09:34:07 +0000 Date: Sun, 25 Oct 2020 11:34:04 +0200 From: Eli Cohen To: Jason Wang CC: "mst@redhat.com" , "virtualization@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "rob.miller@broadcom.com" , "lingshan.zhu@intel.com" , "eperezma@redhat.com" , "lulu@redhat.com" , Shahaf Shuler , "hanand@xilinx.com" , "mhabets@solarflare.com" , "gdawar@xilinx.com" , "saugatm@xilinx.com" , "vmireyno@marvell.com" , "zhangweining@ruijie.com.cn" , "eli@mellanox.com" Subject: Re: [PATCH V4 1/3] vdpa: introduce config op to get valid iova range Message-ID: <20201025093404.GC189473@mtl-vdi-166.wap.labs.mlnx> References: <20201023090043.14430-1-jasowang@redhat.com> <20201023090043.14430-2-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20201023090043.14430-2-jasowang@redhat.com> User-Agent: Mutt/1.9.5 (bf161cf53efb) (2018-04-13) X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1603618478; bh=o/uG0K7rIUGrVC3mPxjGqi4veKvDNBJAsJoTCKUSR1o=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To:User-Agent: X-Originating-IP:X-ClientProxiedBy; b=T3BJ71oc5UWOaDW78oYSOGiTl44kZDpJo2zRelIYRU+bG/EvQlw+4V4UPNqcDnx30 thRguF2rH4uS4O2WF2K0M3wZeikCpoBg+GIiCrT9q8GKKn7Zz4iXYdaE3ICy8Bmm2W B0WNYR7c3Tz1Q/QNqZmVVHMnAUI3lqDykGMmVoMiQ2L/pJ1Gz5H+plBhl58GuRwDh/ LqFdrW6HD06fukfHc4A/YUOv+ZeYgcb+qvrCzAYJMO/n+TVJLolRhAFFV1dIlBbSUP MUxteVsYGhGefvtU9AWDSsWosv6Jxmq7oJpVh8WIqOGmJ8BKsT5Y98Uc+NrsS8EpjR g+oHkqpwv9VTQ== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 23, 2020 at 09:00:41AM +0000, Jason Wang wrote: > This patch introduce a config op to get valid iova range from the vDPA > device. > > Signed-off-by: Jason Wang Reviewed-by: Eli Cohen > --- > include/linux/vdpa.h | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h > index eae0bfd87d91..30bc7a7223bb 100644 > --- a/include/linux/vdpa.h > +++ b/include/linux/vdpa.h > @@ -52,6 +52,16 @@ struct vdpa_device { > int nvqs; > }; > > +/** > + * vDPA IOVA range - the IOVA range support by the device > + * @first: start of the IOVA range > + * @last: end of the IOVA range > + */ > +struct vdpa_iova_range { > + u64 first; > + u64 last; > +}; > + > /** > * vDPA_config_ops - operations for configuring a vDPA device. > * Note: vDPA device drivers are required to implement all of the > @@ -151,6 +161,10 @@ struct vdpa_device { > * @get_generation: Get device config generation (optional) > * @vdev: vdpa device > * Returns u32: device generation > + * @get_iova_range: Get supported iova range (optional) > + * @vdev: vdpa device > + * Returns the iova range supported by > + * the device. > * @set_map: Set device memory mapping (optional) > * Needed for device that using device > * specific DMA translation (on-chip IOMMU) > @@ -216,6 +230,7 @@ struct vdpa_config_ops { > void (*set_config)(struct vdpa_device *vdev, unsigned int offset, > const void *buf, unsigned int len); > u32 (*get_generation)(struct vdpa_device *vdev); > + struct vdpa_iova_range (*get_iova_range)(struct vdpa_device *vdev); > > /* DMA ops */ > int (*set_map)(struct vdpa_device *vdev, struct vhost_iotlb *iotlb); > -- > 2.20.1 >