Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp109889pxa; Fri, 21 Aug 2020 02:33:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx31XsC1s+FE6ZjIYhY9j1Lj6y0wbl09rMmLDxbhsOWLEyUn8FMIbDKFgJWWPGqNjg3T5mQ X-Received: by 2002:a17:906:f0cc:: with SMTP id dk12mr1927856ejb.97.1598002397629; Fri, 21 Aug 2020 02:33:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598002397; cv=none; d=google.com; s=arc-20160816; b=rNt5QNL/+MDFXlG6GZyQZlpAFfAqsUbx9guybDcFfDGvh53EE3ikWA48QiJd/Ka8Xs GqZfbyH6UjDA3S2RaMOc4qJJVMQ4RnOEYVcPtgiOcC6ChVZzhi9Cp5+UskZNK9K8fK0s Ha3/2RGnXocCxhO+yWEtzKnqzO1XX59J0Bf2aL7JfwYtOTgN6qYsCSK495BpUxe06UBt tCB+pG4Uz2iYoRUVGIwMvkAvHC7m7YREtdddEZgWEq+ayIKo0jHsSsSKiUWnpBDpww0x kx1LnNJ0FU146RuPZlpMpELxHPSgFBAHMCKl0v10fAD//maysY2eWTloFqKOEL7a4lUN /uZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=EfuSz9sq7bu7KMXpjENGk8A6GgtVjh1dqr2JFHwc5Pc=; b=ryJ/bKU7qTUaL6rqzIaU7Cdp2d6+hJ72+761rqXpi8Ng0Nk/4xr8WSskd44cLq/p73 MnN+zcUKAxx/3JdUrkPlLLlARImxjyJLPTaD11HtrV6zVAe4R4gGLBchIGqsO3t8Clg0 Xfm7vnAZD4H/94RPUsznp+7dqH34b0+0z6MsJCStE2GsDTk7jAO5DdFKH0tkWF8F1j2e 4KEv4F8dK3i/1iq+APUhQVDKuIBxEGePHUhg98ubq+pwwcJY7gu7Flj61NUZzRGI+EIq dyYpYzdD8lP1Lt3vOk9LdDBrneoh1uEjhDctVvwiwfn2jtiiEySK3OGtg9m49Xbw9QpG 36sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gwYQStTY; 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 f19si810127eds.21.2020.08.21.02.32.54; Fri, 21 Aug 2020 02:33:17 -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=gwYQStTY; 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 S1728427AbgHUJ2e (ORCPT + 99 others); Fri, 21 Aug 2020 05:28:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33067 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725806AbgHUJ2d (ORCPT ); Fri, 21 Aug 2020 05:28:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598002112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=EfuSz9sq7bu7KMXpjENGk8A6GgtVjh1dqr2JFHwc5Pc=; b=gwYQStTY8UthG34pFZCcCGBtFpCYX4E07q1luOhypqM2+OsxKtrulLl5oZ9yMsdBztQxd4 7zNRhj+dXDX00OFpI1nenkkBjsf2YIMHdAZxnX/a6w3Ps0JiUl2e76BbCN8Yd699DBabBZ /fVj8WvKoVSX7W8/rnkcmmwgsSdvk4Q= 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-323-lOsv2HXYPVScwGHlISun5A-1; Fri, 21 Aug 2020 05:28:30 -0400 X-MC-Unique: lOsv2HXYPVScwGHlISun5A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A0AC6100CF71; Fri, 21 Aug 2020 09:28:28 +0000 (UTC) Received: from hp-dl380pg8-01.lab.eng.pek2.redhat.com (hp-dl380pg8-01.lab.eng.pek2.redhat.com [10.73.8.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id E5A5A71780; Fri, 21 Aug 2020 09:28:23 +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 V2 1/3] vdpa: introduce config op to get valid iova range Date: Fri, 21 Aug 2020 05:28:11 -0400 Message-Id: <20200821092813.8952-2-jasowang@redhat.com> In-Reply-To: <20200821092813.8952-1-jasowang@redhat.com> References: <20200821092813.8952-1-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org 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.18.1