Pull virtio updates from Michael Tsirkin: - A huge patchset supporting vq resize using the new vq reset capability - Features, fixes, and cleanups all over the place * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (88 commits) vdpa/mlx5: Fix possible uninitialized return value vdpa_sim_blk: add support for discard and write-zeroes vdpa_sim_blk: add support for VIRTIO_BLK_T_FLUSH vdpa_sim_blk: make vdpasim_blk_check_range usable by other requests vdpa_sim_blk: check if sector is 0 for commands other than read or write vdpa_sim: Implement suspend vdpa op vhost-vdpa: uAPI to suspend the device vhost-vdpa: introduce SUSPEND backend feature bit vdpa: Add suspend operation virtio-blk: Avoid use-after-free on suspend/resume virtio_vdpa: support the arg sizes of find_vqs() vhost-vdpa: Call ida_simple_remove() when failed vDPA: fix 'cast to restricted le16' warnings in vdpa.c vDPA: !FEATURES_OK should not block querying device config space vDPA/ifcvf: support userspace to query features and MQ of a management device vDPA/ifcvf: get_config_size should return a value no greater than dev implementation vhost scsi: Allow user to control num virtqueues vhost-scsi: Fix max number of virtqueues vdpa/mlx5: Support different address spaces for control and data vdpa/mlx5: Implement susupend virtqueue callback ...
Showing the changes to include/uapi/linux (6 of 51 files). Show all
Unified · Split
| @@ -210,6 +210,53 @@ struct vduse_vq_eventfd { · 209 unmodified lines | ||
| 210 | 210 | */ |
| 211 | 211 | #define VDUSE_VQ_INJECT_IRQ _IOW(VDUSE_BASE, 0x17, __u32) |
| 212 | 212 | |
| 213 | +/** | |
| 214 | + * struct vduse_iova_umem - userspace memory configuration for one IOVA region | |
| 215 | + * @uaddr: start address of userspace memory, it must be aligned to page size | |
| 216 | + * @iova: start of the IOVA region | |
| 217 | + * @size: size of the IOVA region | |
| 218 | + * @reserved: for future use, needs to be initialized to zero | |
| 219 | + * | |
| 220 | + * Structure used by VDUSE_IOTLB_REG_UMEM and VDUSE_IOTLB_DEREG_UMEM | |
| 221 | + * ioctls to register/de-register userspace memory for IOVA regions | |
| 222 | + */ | |
| 223 | +struct vduse_iova_umem { | |
| 224 | + __u64 uaddr; | |
| 225 | + __u64 iova; | |
| 226 | + __u64 size; | |
| 227 | + __u64 reserved[3]; | |
| 228 | +}; | |
| 229 | + | |
| 230 | +/* Register userspace memory for IOVA regions */ | |
| 231 | +#define VDUSE_IOTLB_REG_UMEM _IOW(VDUSE_BASE, 0x18, struct vduse_iova_umem) | |
| 232 | + | |
| 233 | +/* De-register the userspace memory. Caller should set iova and size field. */ | |
| 234 | +#define VDUSE_IOTLB_DEREG_UMEM _IOW(VDUSE_BASE, 0x19, struct vduse_iova_umem) | |
| 235 | + | |
| 236 | +/** | |
| 237 | + * struct vduse_iova_info - information of one IOVA region | |
| 238 | + * @start: start of the IOVA region | |
| 239 | + * @last: last of the IOVA region | |
| 240 | + * @capability: capability of the IOVA regsion | |
| 241 | + * @reserved: for future use, needs to be initialized to zero | |
| 242 | + * | |
| 243 | + * Structure used by VDUSE_IOTLB_GET_INFO ioctl to get information of | |
| 244 | + * one IOVA region. | |
| 245 | + */ | |
| 246 | +struct vduse_iova_info { | |
| 247 | + __u64 start; | |
| 248 | + __u64 last; | |
| 249 | +#define VDUSE_IOVA_CAP_UMEM (1 << 0) | |
| 250 | + __u64 capability; | |
| 251 | + __u64 reserved[3]; | |
| 252 | +}; | |
| 253 | + | |
| 254 | +/* | |
| 255 | + * Find the first IOVA region that overlaps with the range [start, last] | |
| 256 | + * and return some information on it. Caller should set start and last fields. | |
| 257 | + */ | |
| 258 | +#define VDUSE_IOTLB_GET_INFO _IOWR(VDUSE_BASE, 0x1a, struct vduse_iova_info) | |
| 259 | + | |
| 213 | 260 | /* The control messages definition for read(2)/write(2) on /dev/vduse/$NAME */ |
| 214 | 261 | |
| 215 | 262 | /** |
| @@ -171,4 +171,13 @@ · 170 unmodified lines | ||
| 171 | 171 | #define VHOST_VDPA_SET_GROUP_ASID _IOW(VHOST_VIRTIO, 0x7C, \ |
| 172 | 172 | struct vhost_vring_state) |
| 173 | 173 | |
| 174 | +/* Suspend a device so it does not process virtqueue requests anymore | |
| 175 | + * | |
| 176 | + * After the return of ioctl the device must preserve all the necessary state | |
| 177 | + * (the virtqueue vring base plus the possible device specific states) that is | |
| 178 | + * required for restoring in the future. The device must not change its | |
| 179 | + * configuration after that point. | |
| 180 | + */ | |
| 181 | +#define VHOST_VDPA_SUSPEND _IO(VHOST_VIRTIO, 0x7D) | |
| 182 | + | |
| 174 | 183 | #endif |
| @@ -161,5 +161,7 @@ struct vhost_vdpa_iova_range { · 160 unmodified lines | ||
| 161 | 161 | * message |
| 162 | 162 | */ |
| 163 | 163 | #define VHOST_BACKEND_F_IOTLB_ASID 0x3 |
| 164 | +/* Device can be suspended */ | |
| 165 | +#define VHOST_BACKEND_F_SUSPEND 0x4 | |
| 164 | 166 | |
| 165 | 167 | #endif |
| @@ -52,7 +52,7 @@ · 51 unmodified lines | ||
| 52 | 52 | * rest are per-device feature bits. |
| 53 | 53 | */ |
| 54 | 54 | #define VIRTIO_TRANSPORT_F_START 28 |
| 55 | −#define VIRTIO_TRANSPORT_F_END 38 | |
| 55 | +#define VIRTIO_TRANSPORT_F_END 41 | |
| 56 | 56 | |
| 57 | 57 | #ifndef VIRTIO_CONFIG_NO_LEGACY |
| 58 | 58 | /* Do we get callbacks when the ring is completely used, even if we've |
| @@ -98,4 +98,9 @@ · 39 unmodified lines | ||
| 98 | 98 | * Does the device support Single Root I/O Virtualization? |
| 99 | 99 | */ |
| 100 | 100 | #define VIRTIO_F_SR_IOV 37 |
| 101 | + | |
| 102 | +/* | |
| 103 | + * This feature indicates that the driver can reset a queue individually. | |
| 104 | + */ | |
| 105 | +#define VIRTIO_F_RING_RESET 40 | |
| 101 | 106 | #endif /* _UAPI_LINUX_VIRTIO_CONFIG_H */ |
| @@ -56,7 +56,7 @@ · 55 unmodified lines | ||
| 56 | 56 | #define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow |
| 57 | 57 | * Steering */ |
| 58 | 58 | #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ |
| 59 | − | |
| 59 | +#define VIRTIO_NET_F_NOTF_COAL 53 /* Guest can handle notifications coalescing */ | |
| 60 | 60 | #define VIRTIO_NET_F_HASH_REPORT 57 /* Supports hash report */ |
| 61 | 61 | #define VIRTIO_NET_F_RSS 60 /* Supports RSS RX steering */ |
| 62 | 62 | #define VIRTIO_NET_F_RSC_EXT 61 /* extended coalescing info */ |
| @@ -355,4 +355,36 @@ struct virtio_net_hash_config { · 292 unmodified lines | ||
| 355 | 355 | #define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5 |
| 356 | 356 | #define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET 0 |
| 357 | 357 | |
| 358 | +/* | |
| 359 | + * Control notifications coalescing. | |
| 360 | + * | |
| 361 | + * Request the device to change the notifications coalescing parameters. | |
| 362 | + * | |
| 363 | + * Available with the VIRTIO_NET_F_NOTF_COAL feature bit. | |
| 364 | + */ | |
| 365 | +#define VIRTIO_NET_CTRL_NOTF_COAL 6 | |
| 366 | +/* | |
| 367 | + * Set the tx-usecs/tx-max-packets patameters. | |
| 368 | + * tx-usecs - Maximum number of usecs to delay a TX notification. | |
| 369 | + * tx-max-packets - Maximum number of packets to send before a TX notification. | |
| 370 | + */ | |
| 371 | +struct virtio_net_ctrl_coal_tx { | |
| 372 | + __le32 tx_max_packets; | |
| 373 | + __le32 tx_usecs; | |
| 374 | +}; | |
| 375 | + | |
| 376 | +#define VIRTIO_NET_CTRL_NOTF_COAL_TX_SET 0 | |
| 377 | + | |
| 378 | +/* | |
| 379 | + * Set the rx-usecs/rx-max-packets patameters. | |
| 380 | + * rx-usecs - Maximum number of usecs to delay a RX notification. | |
| 381 | + * rx-max-frames - Maximum number of packets to receive before a RX notification. | |
| 382 | + */ | |
| 383 | +struct virtio_net_ctrl_coal_rx { | |
| 384 | + __le32 rx_max_packets; | |
| 385 | + __le32 rx_usecs; | |
| 386 | +}; | |
| 387 | + | |
| 388 | +#define VIRTIO_NET_CTRL_NOTF_COAL_RX_SET 1 | |
| 389 | + | |
| 358 | 390 | #endif /* _UAPI_LINUX_VIRTIO_NET_H */ |
| @@ -202,6 +202,8 @@ struct virtio_pci_cfg_cap { · 201 unmodified lines | ||
| 202 | 202 | #define VIRTIO_PCI_COMMON_Q_AVAILHI 44 |
| 203 | 203 | #define VIRTIO_PCI_COMMON_Q_USEDLO 48 |
| 204 | 204 | #define VIRTIO_PCI_COMMON_Q_USEDHI 52 |
| 205 | +#define VIRTIO_PCI_COMMON_Q_NDATA 56 | |
| 206 | +#define VIRTIO_PCI_COMMON_Q_RESET 58 | |
| 205 | 207 | |
| 206 | 208 | #endif /* VIRTIO_PCI_NO_MODERN */ |
| 207 | 209 | |