History

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

Pull virtio updates from Michael Tsirkin: - device feature provisioning in ifcvf, mlx5 - new SolidNET driver - support for zoned block device in virtio blk - numa support in virtio pmem - VIRTIO_F_RING_RESET support in vhost-net - more debugfs entries in mlx5 - resume support in vdpa - completion batching in virtio blk - cleanup of dma api use in vdpa - now simulating more features in vdpa-sim - documentation, features, fixes all over the place * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (64 commits) vdpa/mlx5: support device features provisioning vdpa/mlx5: make MTU/STATUS presence conditional on feature bits vdpa: validate device feature provisioning against supported class vdpa: validate provisioned device features against specified attribute vdpa: conditionally read STATUS in config space vdpa: fix improper error message when adding vdpa dev vdpa/mlx5: Initialize CVQ iotlb spinlock vdpa/mlx5: Don't clear mr struct on destroy MR vdpa/mlx5: Directly assign memory key tools/virtio: enable to build with retpoline vringh: fix a typo in comments for vringh_kiov vhost-vdpa: print warning when vhost_vdpa_alloc_domain fails scsi: virtio_scsi: fix handling of kmalloc failure vdpa: Fix a couple of spelling mistakes in some messages vhost-net: support VIRTIO_F_RING_RESET vhost-scsi: convert sysfs snprintf and sprintf to sysfs_emit vdpa: mlx5: support per virtqueue dma device vdpa: set dma mask for vDPA device virtio-vdpa: support per vq dma device vdpa: introduce get_vq_dma_device() ...

Linus Torvalds committed 3 years ago

Commit 84cc6672 parents 49d5759 deeacf347 files · +3535 −502Browse files

Showing the changes to include/uapi/linux (3 of 47 files). Show all

Unified · Split

3 files
  1. include/uapi/linux/vhost.h +8 −0
  2. include/uapi/linux/vhost_types.h +2 −0
  3. include/uapi/linux/virtio_blk.h +105 −0
include/uapi/linux/vhost.h+8−0
@@ -180,4 +180,12 @@ · 179 unmodified lines
180 */180 */
181#define VHOST_VDPA_SUSPEND _IO(VHOST_VIRTIO, 0x7D)181#define VHOST_VDPA_SUSPEND _IO(VHOST_VIRTIO, 0x7D)
182 182
183/* Resume a device so it can resume processing virtqueue requests
184 *
185 * After the return of this ioctl the device will have restored all the
186 * necessary states and it is fully operational to continue processing the
187 * virtqueue descriptors.
188 */
189#define VHOST_VDPA_RESUME _IO(VHOST_VIRTIO, 0x7E)
190
183#endif191#endif
include/uapi/linux/vhost_types.h+2−0
@@ -163,5 +163,7 @@ struct vhost_vdpa_iova_range { · 162 unmodified lines
163#define VHOST_BACKEND_F_IOTLB_ASID 0x3163#define VHOST_BACKEND_F_IOTLB_ASID 0x3
164/* Device can be suspended */164/* Device can be suspended */
165#define VHOST_BACKEND_F_SUSPEND 0x4165#define VHOST_BACKEND_F_SUSPEND 0x4
166/* Device can be resumed */
167#define VHOST_BACKEND_F_RESUME 0x5
166 168
167#endif169#endif
include/uapi/linux/virtio_blk.h+105−0
@@ -41,6 +41,7 @@ · 40 unmodified lines
41#define VIRTIO_BLK_F_DISCARD 13 /* DISCARD is supported */41#define VIRTIO_BLK_F_DISCARD 13 /* DISCARD is supported */
42#define VIRTIO_BLK_F_WRITE_ZEROES 14 /* WRITE ZEROES is supported */42#define VIRTIO_BLK_F_WRITE_ZEROES 14 /* WRITE ZEROES is supported */
43#define VIRTIO_BLK_F_SECURE_ERASE 16 /* Secure Erase is supported */43#define VIRTIO_BLK_F_SECURE_ERASE 16 /* Secure Erase is supported */
44#define VIRTIO_BLK_F_ZONED 17 /* Zoned block device */
44 45
45/* Legacy feature bits */46/* Legacy feature bits */
46#ifndef VIRTIO_BLK_NO_LEGACY47#ifndef VIRTIO_BLK_NO_LEGACY
@@ -137,6 +138,16 @@ struct virtio_blk_config { · 90 unmodified lines
137 /* Secure erase commands must be aligned to this number of sectors. */138 /* Secure erase commands must be aligned to this number of sectors. */
138 __virtio32 secure_erase_sector_alignment;139 __virtio32 secure_erase_sector_alignment;
139 140
141 /* Zoned block device characteristics (if VIRTIO_BLK_F_ZONED) */
142 struct virtio_blk_zoned_characteristics {
143 __le32 zone_sectors;
144 __le32 max_open_zones;
145 __le32 max_active_zones;
146 __le32 max_append_sectors;
147 __le32 write_granularity;
148 __u8 model;
149 __u8 unused2[3];
150 } zoned;
140} __attribute__((packed));151} __attribute__((packed));
141 152
142/*153/*
@@ -174,6 +185,27 @@ struct virtio_blk_config { · 31 unmodified lines
174/* Secure erase command */185/* Secure erase command */
175#define VIRTIO_BLK_T_SECURE_ERASE 14186#define VIRTIO_BLK_T_SECURE_ERASE 14
176 187
188/* Zone append command */
189#define VIRTIO_BLK_T_ZONE_APPEND 15
190
191/* Report zones command */
192#define VIRTIO_BLK_T_ZONE_REPORT 16
193
194/* Open zone command */
195#define VIRTIO_BLK_T_ZONE_OPEN 18
196
197/* Close zone command */
198#define VIRTIO_BLK_T_ZONE_CLOSE 20
199
200/* Finish zone command */
201#define VIRTIO_BLK_T_ZONE_FINISH 22
202
203/* Reset zone command */
204#define VIRTIO_BLK_T_ZONE_RESET 24
205
206/* Reset All zones command */
207#define VIRTIO_BLK_T_ZONE_RESET_ALL 26
208
177#ifndef VIRTIO_BLK_NO_LEGACY209#ifndef VIRTIO_BLK_NO_LEGACY
178/* Barrier before this op. */210/* Barrier before this op. */
179#define VIRTIO_BLK_T_BARRIER 0x80000000211#define VIRTIO_BLK_T_BARRIER 0x80000000
@@ -193,6 +225,72 @@ struct virtio_blk_outhdr { · 13 unmodified lines
193 __virtio64 sector;225 __virtio64 sector;
194};226};
195 227
228/*
229 * Supported zoned device models.
230 */
231
232/* Regular block device */
233#define VIRTIO_BLK_Z_NONE 0
234/* Host-managed zoned device */
235#define VIRTIO_BLK_Z_HM 1
236/* Host-aware zoned device */
237#define VIRTIO_BLK_Z_HA 2
238
239/*
240 * Zone descriptor. A part of VIRTIO_BLK_T_ZONE_REPORT command reply.
241 */
242struct virtio_blk_zone_descriptor {
243 /* Zone capacity */
244 __le64 z_cap;
245 /* The starting sector of the zone */
246 __le64 z_start;
247 /* Zone write pointer position in sectors */
248 __le64 z_wp;
249 /* Zone type */
250 __u8 z_type;
251 /* Zone state */
252 __u8 z_state;
253 __u8 reserved[38];
254};
255
256struct virtio_blk_zone_report {
257 __le64 nr_zones;
258 __u8 reserved[56];
259 struct virtio_blk_zone_descriptor zones[];
260};
261
262/*
263 * Supported zone types.
264 */
265
266/* Conventional zone */
267#define VIRTIO_BLK_ZT_CONV 1
268/* Sequential Write Required zone */
269#define VIRTIO_BLK_ZT_SWR 2
270/* Sequential Write Preferred zone */
271#define VIRTIO_BLK_ZT_SWP 3
272
273/*
274 * Zone states that are available for zones of all types.
275 */
276
277/* Not a write pointer (conventional zones only) */
278#define VIRTIO_BLK_ZS_NOT_WP 0
279/* Empty */
280#define VIRTIO_BLK_ZS_EMPTY 1
281/* Implicitly Open */
282#define VIRTIO_BLK_ZS_IOPEN 2
283/* Explicitly Open */
284#define VIRTIO_BLK_ZS_EOPEN 3
285/* Closed */
286#define VIRTIO_BLK_ZS_CLOSED 4
287/* Read-Only */
288#define VIRTIO_BLK_ZS_RDONLY 13
289/* Full */
290#define VIRTIO_BLK_ZS_FULL 14
291/* Offline */
292#define VIRTIO_BLK_ZS_OFFLINE 15
293
196/* Unmap this range (only valid for write zeroes command) */294/* Unmap this range (only valid for write zeroes command) */
197#define VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP 0x00000001295#define VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP 0x00000001
198 296
@@ -219,4 +317,11 @@ struct virtio_scsi_inhdr { · 20 unmodified lines
219#define VIRTIO_BLK_S_OK 0317#define VIRTIO_BLK_S_OK 0
220#define VIRTIO_BLK_S_IOERR 1318#define VIRTIO_BLK_S_IOERR 1
221#define VIRTIO_BLK_S_UNSUPP 2319#define VIRTIO_BLK_S_UNSUPP 2
320
321/* Error codes that are specific to zoned block devices */
322#define VIRTIO_BLK_S_ZONE_INVALID_CMD 3
323#define VIRTIO_BLK_S_ZONE_UNALIGNED_WP 4
324#define VIRTIO_BLK_S_ZONE_OPEN_RESOURCE 5
325#define VIRTIO_BLK_S_ZONE_ACTIVE_RESOURCE 6
326
222#endif /* _LINUX_VIRTIO_BLK_H */327#endif /* _LINUX_VIRTIO_BLK_H */