History

Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost

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 ...

Linus Torvalds committed 4 years ago

Commit 7a53e172 parents 999324f 93e530d51 files · +2148 −533Browse files

Showing the changes to include/uapi/linux (6 of 51 files). Show all

Unified · Split

6 files
  1. include/uapi/linux/vduse.h +47 −0
  2. include/uapi/linux/vhost.h +9 −0
  3. include/uapi/linux/vhost_types.h +2 −0
  4. include/uapi/linux/virtio_config.h +6 −1
  5. include/uapi/linux/virtio_net.h +33 −1
  6. include/uapi/linux/virtio_pci.h +2 −0
include/uapi/linux/vduse.h+47−0
@@ -210,6 +210,53 @@ struct vduse_vq_eventfd { · 209 unmodified lines
210 */210 */
211#define VDUSE_VQ_INJECT_IRQ _IOW(VDUSE_BASE, 0x17, __u32)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 */
223struct 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 */
246struct 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/* The control messages definition for read(2)/write(2) on /dev/vduse/$NAME */260/* The control messages definition for read(2)/write(2) on /dev/vduse/$NAME */
214 261
215/**262/**
include/uapi/linux/vhost.h+9−0
@@ -171,4 +171,13 @@ · 170 unmodified lines
171#define VHOST_VDPA_SET_GROUP_ASID _IOW(VHOST_VIRTIO, 0x7C, \171#define VHOST_VDPA_SET_GROUP_ASID _IOW(VHOST_VIRTIO, 0x7C, \
172 struct vhost_vring_state)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#endif183#endif
include/uapi/linux/vhost_types.h+2−0
@@ -161,5 +161,7 @@ struct vhost_vdpa_iova_range { · 160 unmodified lines
161 * message161 * message
162 */162 */
163#define VHOST_BACKEND_F_IOTLB_ASID 0x3163#define VHOST_BACKEND_F_IOTLB_ASID 0x3
164/* Device can be suspended */
165#define VHOST_BACKEND_F_SUSPEND 0x4
164 166
165#endif167#endif
include/uapi/linux/virtio_config.h+6−1
@@ -52,7 +52,7 @@ · 51 unmodified lines
52 * rest are per-device feature bits.52 * rest are per-device feature bits.
53 */53 */
54#define VIRTIO_TRANSPORT_F_START 2854#define VIRTIO_TRANSPORT_F_START 28
55#define VIRTIO_TRANSPORT_F_END 3855#define VIRTIO_TRANSPORT_F_END 41
56 56
57#ifndef VIRTIO_CONFIG_NO_LEGACY57#ifndef VIRTIO_CONFIG_NO_LEGACY
58/* Do we get callbacks when the ring is completely used, even if we've58/* Do we get callbacks when the ring is completely used, even if we've
@@ -98,4 +98,9 @@ · 39 unmodified lines
98 * Does the device support Single Root I/O Virtualization?98 * Does the device support Single Root I/O Virtualization?
99 */99 */
100#define VIRTIO_F_SR_IOV 37100#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#endif /* _UAPI_LINUX_VIRTIO_CONFIG_H */106#endif /* _UAPI_LINUX_VIRTIO_CONFIG_H */
include/uapi/linux/virtio_net.h+33−1
@@ -56,7 +56,7 @@ · 55 unmodified lines
56#define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow56#define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow
57 * Steering */57 * Steering */
58#define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */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#define VIRTIO_NET_F_HASH_REPORT 57 /* Supports hash report */60#define VIRTIO_NET_F_HASH_REPORT 57 /* Supports hash report */
61#define VIRTIO_NET_F_RSS 60 /* Supports RSS RX steering */61#define VIRTIO_NET_F_RSS 60 /* Supports RSS RX steering */
62#define VIRTIO_NET_F_RSC_EXT 61 /* extended coalescing info */62#define VIRTIO_NET_F_RSC_EXT 61 /* extended coalescing info */
@@ -355,4 +355,36 @@ struct virtio_net_hash_config { · 292 unmodified lines
355#define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5355#define VIRTIO_NET_CTRL_GUEST_OFFLOADS 5
356#define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET 0356#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 */
371struct 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 */
383struct 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#endif /* _UAPI_LINUX_VIRTIO_NET_H */390#endif /* _UAPI_LINUX_VIRTIO_NET_H */
include/uapi/linux/virtio_pci.h+2−0
@@ -202,6 +202,8 @@ struct virtio_pci_cfg_cap { · 201 unmodified lines
202#define VIRTIO_PCI_COMMON_Q_AVAILHI 44202#define VIRTIO_PCI_COMMON_Q_AVAILHI 44
203#define VIRTIO_PCI_COMMON_Q_USEDLO 48203#define VIRTIO_PCI_COMMON_Q_USEDLO 48
204#define VIRTIO_PCI_COMMON_Q_USEDHI 52204#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#endif /* VIRTIO_PCI_NO_MODERN */208#endif /* VIRTIO_PCI_NO_MODERN */
207 209