From: Gautam Dawar <gautam.dawar@xilinx.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>, <kvm@vger.kernel.org>,
<virtualization@lists.linux-foundation.org>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <martinh@xilinx.com>, <hanand@xilinx.com>, <martinpo@xilinx.com>,
<pabloc@xilinx.com>, <dinang@xilinx.com>, <tanuj.kamde@amd.com>,
<habetsm.xilinx@gmail.com>, <ecree.xilinx@gmail.com>,
<eperezma@redhat.com>, Gautam Dawar <gdawar@xilinx.com>,
Wu Zongyong <wuzongyong@linux.alibaba.com>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Eli Cohen <elic@nvidia.com>,
Zhu Lingshan <lingshan.zhu@intel.com>,
Stefano Garzarella <sgarzare@redhat.com>,
Xie Yongji <xieyongji@bytedance.com>,
Si-Wei Liu <si-wei.liu@oracle.com>,
Parav Pandit <parav@nvidia.com>, Longpeng <longpeng2@huawei.com>,
Dan Carpenter <dan.carpenter@oracle.com>,
Zhang Min <zhang.min9@zte.com.cn>
Subject: [PATCH v2 11/19] vhost-vdpa: introduce uAPI to get the number of virtqueue groups
Date: Wed, 30 Mar 2022 23:33:51 +0530 [thread overview]
Message-ID: <20220330180436.24644-12-gdawar@xilinx.com> (raw)
In-Reply-To: <20220330180436.24644-1-gdawar@xilinx.com>
Follows the vDPA support for multiple address spaces, this patch
introduce uAPI for the userspace to know the number of virtqueue
groups supported by the vDPA device.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Gautam Dawar <gdawar@xilinx.com>
---
drivers/vhost/vdpa.c | 4 ++++
include/uapi/linux/vhost.h | 4 +++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index cd1bee536c46..92f78df0f685 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -559,6 +559,10 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep,
case VHOST_VDPA_GET_VRING_NUM:
r = vhost_vdpa_get_vring_num(v, argp);
break;
+ case VHOST_VDPA_GET_GROUP_NUM:
+ r = copy_to_user(argp, &v->vdpa->ngroups,
+ sizeof(v->vdpa->ngroups));
+ break;
case VHOST_SET_LOG_BASE:
case VHOST_SET_LOG_FD:
r = -ENOIOCTLCMD;
diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h
index 8f7b4a95d6f9..61317c61d768 100644
--- a/include/uapi/linux/vhost.h
+++ b/include/uapi/linux/vhost.h
@@ -145,11 +145,13 @@
/* Get the valid iova range */
#define VHOST_VDPA_GET_IOVA_RANGE _IOR(VHOST_VIRTIO, 0x78, \
struct vhost_vdpa_iova_range)
-
/* Get the config size */
#define VHOST_VDPA_GET_CONFIG_SIZE _IOR(VHOST_VIRTIO, 0x79, __u32)
/* Get the count of all virtqueues */
#define VHOST_VDPA_GET_VQS_COUNT _IOR(VHOST_VIRTIO, 0x80, __u32)
+/* Get the number of virtqueue groups. */
+#define VHOST_VDPA_GET_GROUP_NUM _IOR(VHOST_VIRTIO, 0x81, __u32)
+
#endif
--
2.30.1
next prev parent reply other threads:[~2022-03-30 18:14 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-30 18:03 [PATCH v2 00/19] Control VQ support in vDPA Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 01/19] vhost: move the backend feature bits to vhost_types.h Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 02/19] virtio-vdpa: don't set callback if virtio doesn't need it Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 03/19] vhost-vdpa: passing iotlb to IOMMU mapping helpers Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 04/19] vhost-vdpa: switch to use vhost-vdpa specific IOTLB Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 05/19] vdpa: introduce virtqueue groups Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 06/19] vdpa: multiple address spaces support Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 07/19] vdpa: introduce config operations for associating ASID to a virtqueue group Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 08/19] vhost_iotlb: split out IOTLB initialization Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 09/19] vhost: support ASID in IOTLB API Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 10/19] vhost-vdpa: introduce asid based IOTLB Gautam Dawar
2022-03-30 18:03 ` Gautam Dawar [this message]
2022-03-30 18:03 ` [PATCH v2 12/19] vhost-vdpa: introduce uAPI to get the number of address spaces Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 13/19] vhost-vdpa: uAPI to get virtqueue group id Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 14/19] vhost-vdpa: introduce uAPI to set group ASID Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 15/19] vhost-vdpa: support ASID based IOTLB API Gautam Dawar
2022-04-01 4:24 ` Jason Wang
2022-04-28 6:28 ` Gautam Dawar
2022-05-07 10:24 ` Jason Wang
2022-03-30 18:03 ` [PATCH v2 16/19] vdpa_sim: advertise VIRTIO_NET_F_MTU Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 17/19] vdpa_sim: factor out buffer completion logic Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 18/19] vdpa_sim: filter destination mac address Gautam Dawar
2022-03-30 18:03 ` [PATCH v2 19/19] vdpasim: control virtqueue support Gautam Dawar
2022-06-21 15:19 ` Stefano Garzarella
2022-06-22 10:21 ` Eugenio Perez Martin
2022-06-22 15:04 ` Eugenio Perez Martin
2022-06-22 15:44 ` Stefano Garzarella
2022-05-09 3:42 ` [PATCH v2 00/19] Control VQ support in vDPA Jason Wang
2022-05-09 7:07 ` Michael S. Tsirkin
2022-05-20 8:04 ` Eugenio Perez Martin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220330180436.24644-12-gdawar@xilinx.com \
--to=gautam.dawar@xilinx.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dan.carpenter@oracle.com \
--cc=dinang@xilinx.com \
--cc=ecree.xilinx@gmail.com \
--cc=elic@nvidia.com \
--cc=eperezma@redhat.com \
--cc=gdawar@xilinx.com \
--cc=habetsm.xilinx@gmail.com \
--cc=hanand@xilinx.com \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lingshan.zhu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longpeng2@huawei.com \
--cc=martinh@xilinx.com \
--cc=martinpo@xilinx.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabloc@xilinx.com \
--cc=parav@nvidia.com \
--cc=sgarzare@redhat.com \
--cc=si-wei.liu@oracle.com \
--cc=tanuj.kamde@amd.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=wuzongyong@linux.alibaba.com \
--cc=xieyongji@bytedance.com \
--cc=zhang.min9@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).