Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp334883ybm; Fri, 29 May 2020 01:06:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSwD46zE0xZMme4jYmnkfAfVwJZPCYhFoXjluwJ8YYqupjNYqIMyo4+yB8XAuW2XH+sbc2 X-Received: by 2002:a05:6402:22a6:: with SMTP id cx6mr7017878edb.76.1590739578421; Fri, 29 May 2020 01:06:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590739578; cv=none; d=google.com; s=arc-20160816; b=ZT69kLGRO7O22xcLUm41QgHYYj2tXGjmktpTKl1UoFN9yBtbh9T97ch6mHlhxukmUC DplS4EYnD3YyRw5tlnStHtO1cNnoKXTZux/JKIChEBDBJb3jn/5QtcablSgSm7mg7rFI izaSjhBHZg23aixDiy41FzDmrsXY9PaJr3itnH56Ja3UQGFc4mDPSLHUAZWwoVAQuERe UhUQHrx3haOPuqBFVoM2ABKXVl2ofnK4dQLLBlrOoid137YPlKUsk5pEws1GbOXCXpkT GQlfkPS6Qb/V7gvHT0GnMRQDASSkE/7UtASA2XZFmfHCJxwWeacM0R2HmB3Ie1/EGJBV Hk0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HcTPYCfr5sCNE0h8qLNyyGd6WCD8Ts7vuwtEmnD7m9Y=; b=hSZknAt/UylTf6008AfC7m6On3OneRqYfTSIZkNHKNRq/Ajil5S5f8szGvOlbrTwa5 48Ba6v590Q2Gg9By51tJ5IgCGtSKrEhG0ng7XmQF7T7+82Q5QbgCacBfp2m3P2EATs2w DNaei0sFJH8c/HXMMzoM30jUBbK8YCkre2mzmEI12/EM2gUqVwj0a/Wl12/Hhrb8k+G0 PJy2LT02uaq9NV46dbazWRqEIbgaQNWjBWnGqhD6jZfRTg3yLwb5o/TCxNUPpcnIfqPd 89zHItSpZMrGdsm2TQeKTtt7UmSmAaHqvjRl5T5cifD3C8rdVejXs9AxiCMBrmEsofMK YQTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AD6ybSye; 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 v1si4911728ejd.588.2020.05.29.01.05.55; Fri, 29 May 2020 01:06:18 -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=AD6ybSye; 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 S1726836AbgE2IDu (ORCPT + 99 others); Fri, 29 May 2020 04:03:50 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:54808 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726701AbgE2IDp (ORCPT ); Fri, 29 May 2020 04:03:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590739424; 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=HcTPYCfr5sCNE0h8qLNyyGd6WCD8Ts7vuwtEmnD7m9Y=; b=AD6ybSye3q/BG0vqcgWJir6q9uvG/yi2PFfG/n44UU16U6ShKkbbRaIHlIE7QfRRCGyv/B 6FbRlErcdy6tnGZ+v5IyByYgQYvHoTprD4n57W8vnqWfKNqoBMf/saMnEFxQn8vZc/qj6t 3Fx4ilU8U7nMN66yPRddK3dWpkGm7gM= 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-485-gUMe24RiOTij-A2w3OfVrg-1; Fri, 29 May 2020 04:03:42 -0400 X-MC-Unique: gUMe24RiOTij-A2w3OfVrg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 81F34464; Fri, 29 May 2020 08:03:40 +0000 (UTC) Received: from jason-ThinkPad-X1-Carbon-6th.redhat.com (ovpn-13-231.pek2.redhat.com [10.72.13.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F4BD99DE6; Fri, 29 May 2020 08:03:34 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@redhat.com Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, 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 Subject: [PATCH 3/6] vdpa: introduce get_vq_notification method Date: Fri, 29 May 2020 16:03:00 +0800 Message-Id: <20200529080303.15449-4-jasowang@redhat.com> In-Reply-To: <20200529080303.15449-1-jasowang@redhat.com> References: <20200529080303.15449-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch introduces a new method in the vdpa_config_ops which reports the physical address and the size of the doorbell for a specific virtqueue. This will be used by the future patches that maps doorbell to userspace. Signed-off-by: Jason Wang --- include/linux/vdpa.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index 5453af87a33e..239db794357c 100644 --- a/include/linux/vdpa.h +++ b/include/linux/vdpa.h @@ -17,6 +17,16 @@ struct vdpa_callback { void *private; }; +/** + * vDPA notification area + * @addr: base address of the notification area + * @size: size of the notification area + */ +struct vdpa_notification_area { + resource_size_t addr; + resource_size_t size; +}; + /** * vDPA device - representation of a vDPA device * @dev: underlying device @@ -73,6 +83,10 @@ struct vdpa_device { * @vdev: vdpa device * @idx: virtqueue index * Returns virtqueue state (last_avail_idx) + * @get_vq_notification: Get the notification area for a virtqueue + * @vdev: vdpa device + * @idx: virtqueue index + * Returns the notifcation area * @get_vq_align: Get the virtqueue align requirement * for the device * @vdev: vdpa device @@ -162,6 +176,8 @@ struct vdpa_config_ops { bool (*get_vq_ready)(struct vdpa_device *vdev, u16 idx); int (*set_vq_state)(struct vdpa_device *vdev, u16 idx, u64 state); u64 (*get_vq_state)(struct vdpa_device *vdev, u16 idx); + struct vdpa_notification_area + (*get_vq_notification)(struct vdpa_device *vdev, u16 idx); /* Device ops */ u32 (*get_vq_align)(struct vdpa_device *vdev); -- 2.20.1