History

vhost-vdpa: change ioctl # for VDPA_GET_VRING_SIZE

VDPA_GET_VRING_SIZE by mistake uses the already occupied ioctl # 0x80 and we never noticed - it happens to work because the direction and size are different, but confuses tools such as perf which like to look at just the number, and breaks the extra robustness of the ioctl numbering macros. To fix, sort the entries and renumber the ioctl - not too late since it wasn't in any released kernels yet.

Michael S. Tsirkin committed 2 years ago

Commit 2855c2a1 parent ffe61761 file · +8 −7Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/vhost.h+8−7
@@ -179,12 +179,6 @@ · 178 unmodified lines
179/* Get the config size */179/* Get the config size */
180#define VHOST_VDPA_GET_CONFIG_SIZE _IOR(VHOST_VIRTIO, 0x79, __u32)180#define VHOST_VDPA_GET_CONFIG_SIZE _IOR(VHOST_VIRTIO, 0x79, __u32)
181 181
182/* Get the count of all virtqueues */
183#define VHOST_VDPA_GET_VQS_COUNT _IOR(VHOST_VIRTIO, 0x80, __u32)
184
185/* Get the number of virtqueue groups. */
186#define VHOST_VDPA_GET_GROUP_NUM _IOR(VHOST_VIRTIO, 0x81, __u32)
187
188/* Get the number of address spaces. */182/* Get the number of address spaces. */
189#define VHOST_VDPA_GET_AS_NUM _IOR(VHOST_VIRTIO, 0x7A, unsigned int)183#define VHOST_VDPA_GET_AS_NUM _IOR(VHOST_VIRTIO, 0x7A, unsigned int)
190 184
@@ -228,10 +222,17 @@ · 37 unmodified lines
228#define VHOST_VDPA_GET_VRING_DESC_GROUP _IOWR(VHOST_VIRTIO, 0x7F, \222#define VHOST_VDPA_GET_VRING_DESC_GROUP _IOWR(VHOST_VIRTIO, 0x7F, \
229 struct vhost_vring_state)223 struct vhost_vring_state)
230 224
225
226/* Get the count of all virtqueues */
227#define VHOST_VDPA_GET_VQS_COUNT _IOR(VHOST_VIRTIO, 0x80, __u32)
228
229/* Get the number of virtqueue groups. */
230#define VHOST_VDPA_GET_GROUP_NUM _IOR(VHOST_VIRTIO, 0x81, __u32)
231
231/* Get the queue size of a specific virtqueue.232/* Get the queue size of a specific virtqueue.
232 * userspace set the vring index in vhost_vring_state.index233 * userspace set the vring index in vhost_vring_state.index
233 * kernel set the queue size in vhost_vring_state.num234 * kernel set the queue size in vhost_vring_state.num
234 */235 */
235#define VHOST_VDPA_GET_VRING_SIZE _IOWR(VHOST_VIRTIO, 0x80, \236#define VHOST_VDPA_GET_VRING_SIZE _IOWR(VHOST_VIRTIO, 0x82, \
236 struct vhost_vring_state)237 struct vhost_vring_state)
237#endif238#endif