Skip to content

Commit 00d1f54

Browse files
jasowangmstsirkin
authored andcommitted
vdpa: make get_vq_group and set_group_asid optional
This patch makes get_vq_group and set_group_asid optional. This is needed to unbreak the vDPA parent that doesn't support multiple address spaces. Cc: Gautam Dawar <gautam.dawar@xilinx.com> Fixes: aaca837 ("vhost-vdpa: support ASID based IOTLB API") Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20220609041901.2029-1-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent acb0055 commit 00d1f54

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

drivers/vhost/vdpa.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd,
499499
ops->set_vq_ready(vdpa, idx, s.num);
500500
return 0;
501501
case VHOST_VDPA_GET_VRING_GROUP:
502+
if (!ops->get_vq_group)
503+
return -EOPNOTSUPP;
502504
s.index = idx;
503505
s.num = ops->get_vq_group(vdpa, idx);
504506
if (s.num >= vdpa->ngroups)

include/linux/vdpa.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ struct vdpa_map_file {
178178
* for the device
179179
* @vdev: vdpa device
180180
* Returns virtqueue algin requirement
181-
* @get_vq_group: Get the group id for a specific virtqueue
181+
* @get_vq_group: Get the group id for a specific
182+
* virtqueue (optional)
182183
* @vdev: vdpa device
183184
* @idx: virtqueue index
184185
* Returns u32: group id for this virtqueue
@@ -243,7 +244,7 @@ struct vdpa_map_file {
243244
* Returns the iova range supported by
244245
* the device.
245246
* @set_group_asid: Set address space identifier for a
246-
* virtqueue group
247+
* virtqueue group (optional)
247248
* @vdev: vdpa device
248249
* @group: virtqueue group
249250
* @asid: address space id for this group

0 commit comments

Comments
 (0)