Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp339776pxu; Fri, 23 Oct 2020 02:02:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3M0EYzFEatovpeFrU99NF0YSeR404bdznedDMclBtiRDKHWTXBad5JVN1w7n/sEoYmJ6P X-Received: by 2002:a17:906:a211:: with SMTP id r17mr795202ejy.0.1603443755543; Fri, 23 Oct 2020 02:02:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603443755; cv=none; d=google.com; s=arc-20160816; b=jdEdxqZOreJcbf4u712o+SAtdCDJizVM12tUez79WVOfhPyi2tOva1Dc65awh0Vqmc pJqPlYFOmCwJcRl9HrXrwWDl8wYGH35arZcdQH4iIru5C+k3aEvpCLM71wBQj6iNU5jY BiBTno8olm+3yo1hnYyAtSKaIMLLd3kEECTC4imMVVFz6dL4u12clpCTYrga8tykVa6x J8MX4hIGnDVzNKA/0mroaMrUHkFzH1KI3QiYVJOTCHngainRBlNjWI1ZysCC8Fz3bFfp xBMwqELPQzcrjoNuW0SFdN2jfSeEhxBZgXGnjIMPxzt0/7x5tFccLEHkFllrNl4mKffh T/lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=h/j69+zKcBzq6KNK0IFEIFbu1MSwgGVITvu6ksyjS0w=; b=LFByo2+GAr9rhTkVN55CGTHWt6x/twYt6aH0R+0O5NtxdXrwxIYYYLlvriUlPH+djp nriXl0gfQNzhX19uKcdl/4YgZO0IG5CtSbFGCIlTm+5B1xlBQWpy+NOoKGk/LYZudIzY 180mqfYQpEhhZ+aoW8xHMBUEfX/QF2TFCNYiF7uOMgRNLS3epTZ5kYrF7PZhgYu2DxSB cEzCVOJUoEsHj/7i4e1tzOpVNHRnWsaB5SaklWcpBkTJVCk7sC1/FiXNvoFUVwkJpF2G EkKpK66CnR5TPc6XquL+Qr8fF3wSpphW/5ACxSQYDyOddWjb2fCbNUY8NBtxs55M5jZY UT2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fagBJ87x; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f10si361969eds.576.2020.10.23.02.02.13; Fri, 23 Oct 2020 02:02:35 -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=@redhat.com header.s=mimecast20190719 header.b=fagBJ87x; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S460987AbgJWJBG (ORCPT + 99 others); Fri, 23 Oct 2020 05:01:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44008 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S460858AbgJWJBF (ORCPT ); Fri, 23 Oct 2020 05:01:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603443664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h/j69+zKcBzq6KNK0IFEIFbu1MSwgGVITvu6ksyjS0w=; b=fagBJ87x9aoOM5DwI3sHviGtHnyiBQN3C1Amyl4zHwZXEqPWBLOeOpOqnwM6/kCPnT8vT6 10chtVo95WzVcblpT/5iOh20BOYyyXuYNGZL258Pz2xAGqmq7Mr+uAp1C1B5pFa7y1K6Uz o+BZQwqnlMGBU6cIcip83giNJVDVyT8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-309-KHWZLqYTNy28NZjblBBDgQ-1; Fri, 23 Oct 2020 05:01:02 -0400 X-MC-Unique: KHWZLqYTNy28NZjblBBDgQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 77741188C129; Fri, 23 Oct 2020 09:01:00 +0000 (UTC) Received: from jason-ThinkPad-X1-Carbon-6th.redhat.com (ovpn-13-85.pek2.redhat.com [10.72.13.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id E50505B4C4; Fri, 23 Oct 2020 09:00:54 +0000 (UTC) From: Jason Wang To: mst@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Cc: rob.miller@broadcom.com, lingshan.zhu@intel.com, eperezma@redhat.com, lulu@redhat.com, shahafs@mellanox.com, hanand@xilinx.com, mhabets@solarflare.com, gdawar@xilinx.com, saugatm@xilinx.com, vmireyno@marvell.com, zhangweining@ruijie.com.cn, eli@mellanox.com, Jason Wang Subject: [PATCH V4 1/3] vdpa: introduce config op to get valid iova range Date: Fri, 23 Oct 2020 17:00:41 +0800 Message-Id: <20201023090043.14430-2-jasowang@redhat.com> In-Reply-To: <20201023090043.14430-1-jasowang@redhat.com> References: <20201023090043.14430-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch introduce a config op to get valid iova range from the vDPA device. Signed-off-by: Jason Wang --- 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