History

vhost-vdpa: introduce uAPI to get the number of address spaces

This patch introduces the uAPI for getting the number of address spaces supported by this vDPA device.

Gautam Dawar committed 4 years ago

Commit a0c95f21 parent 3ace88b2 files · +5 −0Browse files

Unified · Split

2 files
  1. drivers/vhost/vdpa.c +3 −0
  2. include/uapi/linux/vhost.h +2 −0
drivers/vhost/vdpa.c+3−0
@@ -563,6 +563,9 @@ static long vhost_vdpa_unlocked_ioctl(struct file *filep, · 562 unmodified lines
563 r = copy_to_user(argp, &v->vdpa->ngroups,563 r = copy_to_user(argp, &v->vdpa->ngroups,
564 sizeof(v->vdpa->ngroups));564 sizeof(v->vdpa->ngroups));
565 break;565 break;
566 case VHOST_VDPA_GET_AS_NUM:
567 r = copy_to_user(argp, &v->vdpa->nas, sizeof(v->vdpa->nas));
568 break;
566 case VHOST_SET_LOG_BASE:569 case VHOST_SET_LOG_BASE:
567 case VHOST_SET_LOG_FD:570 case VHOST_SET_LOG_FD:
568 r = -ENOIOCTLCMD;571 r = -ENOIOCTLCMD;
include/uapi/linux/vhost.h+2−0
@@ -154,4 +154,6 @@ · 153 unmodified lines
154/* Get the number of virtqueue groups. */154/* Get the number of virtqueue groups. */
155#define VHOST_VDPA_GET_GROUP_NUM _IOR(VHOST_VIRTIO, 0x81, __u32)155#define VHOST_VDPA_GET_GROUP_NUM _IOR(VHOST_VIRTIO, 0x81, __u32)
156 156
157/* Get the number of address spaces. */
158#define VHOST_VDPA_GET_AS_NUM _IOR(VHOST_VIRTIO, 0x7A, unsigned int)
157#endif159#endif