Pull virtio updates from Michael Tsirkin: - resume support in vdpa/solidrun - structure size optimizations in virtio_pci - new pds_vdpa driver - immediate initialization mechanism for vdpa/ifcvf - interrupt bypass for vdpa/mlx5 - multiple worker support for vhost - viirtio net in Intel F2000X-PL support for vdpa/ifcvf - fixes, cleanups all over the place * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (48 commits) vhost: Make parameter name match of vhost_get_vq_desc() vduse: fix NULL pointer dereference vhost: Allow worker switching while work is queueing vhost_scsi: add support for worker ioctls vhost: allow userspace to create workers vhost: replace single worker pointer with xarray vhost: add helper to parse userspace vring state/file vhost: remove vhost_work_queue vhost_scsi: flush IO vqs then send TMF rsp vhost_scsi: convert to vhost_vq_work_queue vhost_scsi: make SCSI cmd completion per vq vhost_sock: convert to vhost_vq_work_queue vhost: convert poll work to be vq based vhost: take worker or vq for flushing vhost: take worker or vq instead of dev for queueing vhost, vhost_net: add helper to check if vq has work vhost: add vhost_worker pointer to vhost_virtqueue vhost: dynamically allocate vhost_worker vhost: create worker at end of vhost_dev_set_owner virtio_bt: call scheduler when we free unused buffs ...
Showing the changes to include/uapi/linux (2 of 42 files). Show all
Unified · Split
| @@ -45,6 +45,25 @@ · 44 unmodified lines | ||
| 45 | 45 | #define VHOST_SET_LOG_BASE _IOW(VHOST_VIRTIO, 0x04, __u64) |
| 46 | 46 | /* Specify an eventfd file descriptor to signal on log write. */ |
| 47 | 47 | #define VHOST_SET_LOG_FD _IOW(VHOST_VIRTIO, 0x07, int) |
| 48 | +/* By default, a device gets one vhost_worker that its virtqueues share. This | |
| 49 | + * command allows the owner of the device to create an additional vhost_worker | |
| 50 | + * for the device. It can later be bound to 1 or more of its virtqueues using | |
| 51 | + * the VHOST_ATTACH_VRING_WORKER command. | |
| 52 | + * | |
| 53 | + * This must be called after VHOST_SET_OWNER and the caller must be the owner | |
| 54 | + * of the device. The new thread will inherit caller's cgroups and namespaces, | |
| 55 | + * and will share the caller's memory space. The new thread will also be | |
| 56 | + * counted against the caller's RLIMIT_NPROC value. | |
| 57 | + * | |
| 58 | + * The worker's ID used in other commands will be returned in | |
| 59 | + * vhost_worker_state. | |
| 60 | + */ | |
| 61 | +#define VHOST_NEW_WORKER _IOR(VHOST_VIRTIO, 0x8, struct vhost_worker_state) | |
| 62 | +/* Free a worker created with VHOST_NEW_WORKER if it's not attached to any | |
| 63 | + * virtqueue. If userspace is not able to call this for workers its created, | |
| 64 | + * the kernel will free all the device's workers when the device is closed. | |
| 65 | + */ | |
| 66 | +#define VHOST_FREE_WORKER _IOW(VHOST_VIRTIO, 0x9, struct vhost_worker_state) | |
| 48 | 67 | |
| 49 | 68 | /* Ring setup. */ |
| 50 | 69 | /* Set number of descriptors in ring. This parameter can not |
| @@ -70,6 +89,18 @@ · 19 unmodified lines | ||
| 70 | 89 | #define VHOST_VRING_BIG_ENDIAN 1 |
| 71 | 90 | #define VHOST_SET_VRING_ENDIAN _IOW(VHOST_VIRTIO, 0x13, struct vhost_vring_state) |
| 72 | 91 | #define VHOST_GET_VRING_ENDIAN _IOW(VHOST_VIRTIO, 0x14, struct vhost_vring_state) |
| 92 | +/* Attach a vhost_worker created with VHOST_NEW_WORKER to one of the device's | |
| 93 | + * virtqueues. | |
| 94 | + * | |
| 95 | + * This will replace the virtqueue's existing worker. If the replaced worker | |
| 96 | + * is no longer attached to any virtqueues, it can be freed with | |
| 97 | + * VHOST_FREE_WORKER. | |
| 98 | + */ | |
| 99 | +#define VHOST_ATTACH_VRING_WORKER _IOW(VHOST_VIRTIO, 0x15, \ | |
| 100 | + struct vhost_vring_worker) | |
| 101 | +/* Return the vring worker's ID */ | |
| 102 | +#define VHOST_GET_VRING_WORKER _IOWR(VHOST_VIRTIO, 0x16, \ | |
| 103 | + struct vhost_vring_worker) | |
| 73 | 104 | |
| 74 | 105 | /* The following ioctls use eventfd file descriptors to signal and poll |
| 75 | 106 | * for events. */ |
| @@ -47,6 +47,22 @@ struct vhost_vring_addr { · 46 unmodified lines | ||
| 47 | 47 | __u64 log_guest_addr; |
| 48 | 48 | }; |
| 49 | 49 | |
| 50 | +struct vhost_worker_state { | |
| 51 | + /* | |
| 52 | + * For VHOST_NEW_WORKER the kernel will return the new vhost_worker id. | |
| 53 | + * For VHOST_FREE_WORKER this must be set to the id of the vhost_worker | |
| 54 | + * to free. | |
| 55 | + */ | |
| 56 | + unsigned int worker_id; | |
| 57 | +}; | |
| 58 | + | |
| 59 | +struct vhost_vring_worker { | |
| 60 | + /* vring index */ | |
| 61 | + unsigned int index; | |
| 62 | + /* The id of the vhost_worker returned from VHOST_NEW_WORKER */ | |
| 63 | + unsigned int worker_id; | |
| 64 | +}; | |
| 65 | + | |
| 50 | 66 | /* no alignment requirement */ |
| 51 | 67 | struct vhost_iotlb_msg { |
| 52 | 68 | __u64 iova; |