* [PATCH] virtio: add VIRTIO_RING_NO_LEGACY
@ 2019-09-06 12:42 Matej Genci
2019-09-06 14:06 ` Michael S. Tsirkin
0 siblings, 1 reply; 2+ messages in thread
From: Matej Genci @ 2019-09-06 12:42 UTC (permalink / raw)
To: virtualization, mst, jasowang, linux-kernel; +Cc: Matej Genci
Add macro to disable legacy functions vring_init and vring_size.
Signed-off-by: Matej Genci <matej.genci@nutanix.com>
---
include/uapi/linux/virtio_ring.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h
index 4c4e24c291a5..496db2f33830 100644
--- a/include/uapi/linux/virtio_ring.h
+++ b/include/uapi/linux/virtio_ring.h
@@ -164,6 +164,8 @@ struct vring {
#define vring_used_event(vr) ((vr)->avail->ring[(vr)->num])
#define vring_avail_event(vr) (*(__virtio16 *)&(vr)->used->ring[(vr)->num])
+#ifndef VIRTIO_RING_NO_LEGACY
+
static inline void vring_init(struct vring *vr, unsigned int num, void *p,
unsigned long align)
{
@@ -181,6 +183,8 @@ static inline unsigned vring_size(unsigned int num, unsigned long align)
+ sizeof(__virtio16) * 3 + sizeof(struct vring_used_elem) * num;
}
+#endif
+
/* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */
/* Assuming a given event_idx value from the other side, if
* we have just incremented index from old to new_idx,
--
2.22.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] virtio: add VIRTIO_RING_NO_LEGACY
2019-09-06 12:42 [PATCH] virtio: add VIRTIO_RING_NO_LEGACY Matej Genci
@ 2019-09-06 14:06 ` Michael S. Tsirkin
0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2019-09-06 14:06 UTC (permalink / raw)
To: Matej Genci; +Cc: virtualization, jasowang, linux-kernel
On Fri, Sep 06, 2019 at 12:42:14PM +0000, Matej Genci wrote:
> Add macro to disable legacy functions vring_init and vring_size.
>
> Signed-off-by: Matej Genci <matej.genci@nutanix.com>
> ---
> include/uapi/linux/virtio_ring.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h
> index 4c4e24c291a5..496db2f33830 100644
> --- a/include/uapi/linux/virtio_ring.h
> +++ b/include/uapi/linux/virtio_ring.h
> @@ -164,6 +164,8 @@ struct vring {
> #define vring_used_event(vr) ((vr)->avail->ring[(vr)->num])
> #define vring_avail_event(vr) (*(__virtio16 *)&(vr)->used->ring[(vr)->num])
>
> +#ifndef VIRTIO_RING_NO_LEGACY
> +
> static inline void vring_init(struct vring *vr, unsigned int num, void *p,
> unsigned long align)
> {
> @@ -181,6 +183,8 @@ static inline unsigned vring_size(unsigned int num, unsigned long align)
> + sizeof(__virtio16) * 3 + sizeof(struct vring_used_elem) * num;
> }
>
> +#endif
> +
> /* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */
> /* Assuming a given event_idx value from the other side, if
> * we have just incremented index from old to new_idx,
Thanks!
I am guessing vring_used_event/vring_avail_event should be within
this ifndef too? How about struct vring?
> --
> 2.22.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-06 14:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 12:42 [PATCH] virtio: add VIRTIO_RING_NO_LEGACY Matej Genci
2019-09-06 14:06 ` Michael S. Tsirkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).