History

virtio: add VIRTIO_RING_NO_LEGACY

Add macro to disable legacy vring functions.

Matej Genci committed 7 years ago

Commit e7c8cc31 parent 3d77e6a2 files · +5 −0Browse files

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

Unified · Split

include/uapi/linux/virtio_ring.h+4−0
@@ -135,6 +135,8 @@ struct vring { · 134 unmodified lines
135#define VRING_USED_ALIGN_SIZE 4135#define VRING_USED_ALIGN_SIZE 4
136#define VRING_DESC_ALIGN_SIZE 16136#define VRING_DESC_ALIGN_SIZE 16
137 137
138#ifndef VIRTIO_RING_NO_LEGACY
139
138/* The standard layout for the ring is a continuous chunk of memory which looks140/* The standard layout for the ring is a continuous chunk of memory which looks
139 * like this. We assume num is a power of 2.141 * like this. We assume num is a power of 2.
140 *142 *
@@ -181,6 +183,8 @@ static inline unsigned vring_size(unsigned int num, unsigned long align) · 40 unmodified lines
181 + sizeof(__virtio16) * 3 + sizeof(struct vring_used_elem) * num;183 + sizeof(__virtio16) * 3 + sizeof(struct vring_used_elem) * num;
182}184}
183 185
186#endif /* VIRTIO_RING_NO_LEGACY */
187
184/* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */188/* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */
185/* Assuming a given event_idx value from the other side, if189/* Assuming a given event_idx value from the other side, if
186 * we have just incremented index from old to new_idx,190 * we have just incremented index from old to new_idx,