Displaying 20 results from an estimated 26 matches for "vring_packed_desc_f_us".
Did you mean:
vring_packed_desc_f_used
2018 Dec 07
0
[RFC 3/3] virtio_ring: use new vring flags
...e buffers from the free list. */
vq->vq.num_free -= 1;
@@ -1047,8 +1062,8 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq,
n = 0;
vq->packed.avail_wrap_counter ^= 1;
vq->packed.avail_used_flags ^=
- 1 << VRING_PACKED_DESC_F_AVAIL |
- 1 << VRING_PACKED_DESC_F_USED;
+ BIT(VRING_PACKED_DESC_F_AVAIL) |
+ BIT(VRING_PACKED_DESC_F_USED);
}
vq->packed.next_avail_idx = n;
vq->free_head = vq->packed.desc_state[id].next;
@@ -1141,8 +1156,10 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
goto unmap_release;
flags = cp...
2018 Dec 07
7
[RFC 0/3] virtio_ring: define flags as shifts consistently
This is a follow up of the discussion in this thread:
https://patchwork.ozlabs.org/patch/1001015/#2042353
Tiwei Bie (3):
virtio_ring: define flags as shifts consistently
virtio_ring: add VIRTIO_RING_NO_LEGACY
virtio_ring: use new vring flags
drivers/virtio/virtio_ring.c | 100 ++++++++++++++++++-------------
include/uapi/linux/virtio_ring.h | 61 +++++++++++++------
2 files changed,
2018 Dec 07
7
[RFC 0/3] virtio_ring: define flags as shifts consistently
This is a follow up of the discussion in this thread:
https://patchwork.ozlabs.org/patch/1001015/#2042353
Tiwei Bie (3):
virtio_ring: define flags as shifts consistently
virtio_ring: add VIRTIO_RING_NO_LEGACY
virtio_ring: use new vring flags
drivers/virtio/virtio_ring.c | 100 ++++++++++++++++++-------------
include/uapi/linux/virtio_ring.h | 61 +++++++++++++------
2 files changed,
2018 Nov 30
4
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...ECT 4
>
> +/*
> + * Mark a descriptor as available or used in packed ring.
> + * Notice: they are defined as shifts instead of shifted values.
This looks inconsistent to previous flags, any reason for using shifts?
> + */
> +#define VRING_PACKED_DESC_F_AVAIL 7
> +#define VRING_PACKED_DESC_F_USED 15
> +
> /* The Host uses this in used->flags to advise the Guest: don't kick me when
> * you add a buffer. It's unreliable, so it's simply an optimization. Guest
> * will still kick if it's out of buffers. */
> @@ -53,6 +60,23 @@
> * optimization...
2018 Nov 30
4
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...ECT 4
>
> +/*
> + * Mark a descriptor as available or used in packed ring.
> + * Notice: they are defined as shifts instead of shifted values.
This looks inconsistent to previous flags, any reason for using shifts?
> + */
> +#define VRING_PACKED_DESC_F_AVAIL 7
> +#define VRING_PACKED_DESC_F_USED 15
> +
> /* The Host uses this in used->flags to advise the Guest: don't kick me when
> * you add a buffer. It's unreliable, so it's simply an optimization. Guest
> * will still kick if it's out of buffers. */
> @@ -53,6 +60,23 @@
> * optimization...
2018 Nov 30
2
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...DESC_F_WRITE 1
#define VRING_PACKED_DESC_F_INDIRECT 2
>
>
>
> > >
> > >
> > > > >
> > > > >
> > > > > > + */
> > > > > > +#define VRING_PACKED_DESC_F_AVAIL 7
> > > > > > +#define VRING_PACKED_DESC_F_USED 15
> > > > > > +
> > > > > > /* The Host uses this in used->flags to advise the Guest: don't kick me when
> > > > > > * you add a buffer. It's unreliable, so it's simply an optimization. Guest
> > > > > &...
2018 Nov 30
2
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...DESC_F_WRITE 1
#define VRING_PACKED_DESC_F_INDIRECT 2
>
>
>
> > >
> > >
> > > > >
> > > > >
> > > > > > + */
> > > > > > +#define VRING_PACKED_DESC_F_AVAIL 7
> > > > > > +#define VRING_PACKED_DESC_F_USED 15
> > > > > > +
> > > > > > /* The Host uses this in used->flags to advise the Guest: don't kick me when
> > > > > > * you add a buffer. It's unreliable, so it's simply an optimization. Guest
> > > > > &...
2018 Sep 07
2
[PATCH net-next v2 1/5] virtio: add packed ring definitions
On Wed, Jul 11, 2018 at 10:27:07AM +0800, Tiwei Bie wrote:
> Signed-off-by: Tiwei Bie <tiwei.bie at intel.com>
> ---
> include/uapi/linux/virtio_config.h | 3 +++
> include/uapi/linux/virtio_ring.h | 43 ++++++++++++++++++++++++++++++
> 2 files changed, 46 insertions(+)
>
> diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h
>
2018 Sep 07
2
[PATCH net-next v2 1/5] virtio: add packed ring definitions
On Wed, Jul 11, 2018 at 10:27:07AM +0800, Tiwei Bie wrote:
> Signed-off-by: Tiwei Bie <tiwei.bie at intel.com>
> ---
> include/uapi/linux/virtio_config.h | 3 +++
> include/uapi/linux/virtio_ring.h | 43 ++++++++++++++++++++++++++++++
> 2 files changed, 46 insertions(+)
>
> diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h
>
2018 Nov 30
2
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...gt;
> > > > >
> > > > >
> > > > > > >
> > > > > > >
> > > > > > > > + */
> > > > > > > > +#define VRING_PACKED_DESC_F_AVAIL 7
> > > > > > > > +#define VRING_PACKED_DESC_F_USED 15
> > > > > > > > +
> > > > > > > > /* The Host uses this in used->flags to advise the Guest: don't kick me when
> > > > > > > > * you add a buffer. It's unreliable, so it's simply an optimization. Gu...
2018 Nov 30
2
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...gt;
> > > > >
> > > > >
> > > > > > >
> > > > > > >
> > > > > > > > + */
> > > > > > > > +#define VRING_PACKED_DESC_F_AVAIL 7
> > > > > > > > +#define VRING_PACKED_DESC_F_USED 15
> > > > > > > > +
> > > > > > > > /* The Host uses this in used->flags to advise the Guest: don't kick me when
> > > > > > > > * you add a buffer. It's unreliable, so it's simply an optimization. Gu...
2018 Nov 21
0
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...-44,6 +44,13 @@
/* This means the buffer contains a list of buffer descriptors. */
#define VRING_DESC_F_INDIRECT 4
+/*
+ * Mark a descriptor as available or used in packed ring.
+ * Notice: they are defined as shifts instead of shifted values.
+ */
+#define VRING_PACKED_DESC_F_AVAIL 7
+#define VRING_PACKED_DESC_F_USED 15
+
/* The Host uses this in used->flags to advise the Guest: don't kick me when
* you add a buffer. It's unreliable, so it's simply an optimization. Guest
* will still kick if it's out of buffers. */
@@ -53,6 +60,23 @@
* optimization. */
#define VRING_AVAIL_F_NO_IN...
2018 Sep 10
0
[PATCH net-next v2 1/5] virtio: add packed ring definitions
...C 0x2
> > +
> > /* We support indirect buffer descriptors */
> > #define VIRTIO_RING_F_INDIRECT_DESC 28
> >
>
> These are for the packed ring, right? Pls prefix accordingly.
How about something like this:
#define VRING_PACKED_DESC_F_AVAIL (1u << 7)
#define VRING_PACKED_DESC_F_USED (1u << 15)
#define VRING_PACKED_EVENT_F_ENABLE 0x0
#define VRING_PACKED_EVENT_F_DISABLE 0x1
#define VRING_PACKED_EVENT_F_DESC 0x2
> Also, you likely need macros for the wrap counters.
How about something like this:
#define VRING_PACKED_EVENT_WRAP_COUNTER_SHIFT 15
#define VRING_PACKE...
2018 Nov 30
0
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...s inconsistent to previous flags, any reason for using shifts?
Yeah, it was suggested to use shifts, as _F_ should be a bit
number, not a shifted value:
https://patchwork.ozlabs.org/patch/942296/#1989390
>
>
> > + */
> > +#define VRING_PACKED_DESC_F_AVAIL 7
> > +#define VRING_PACKED_DESC_F_USED 15
> > +
> > /* The Host uses this in used->flags to advise the Guest: don't kick me when
> > * you add a buffer. It's unreliable, so it's simply an optimization. Guest
> > * will still kick if it's out of buffers. */
> > @@ -53,6 +60,23...
2023 May 26
1
[PATCH] virtio_ring: validate used buffer length
...packed(struct virtqueue *_vq,
__le16 head_flags, flags;
u16 head, id, prev, curr, avail_used_flags;
int err;
+ u32 buflen = 0;
START_USE(vq);
@@ -1498,6 +1553,8 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
1 << VRING_PACKED_DESC_F_AVAIL |
1 << VRING_PACKED_DESC_F_USED;
}
+ if (n >= out_sgs)
+ buflen += sg->length;
}
}
@@ -1518,6 +1575,10 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
vq->packed.desc_state[id].last = prev;
vq->packed.desc_state[id].premapped = premapped;
+ /* Store in buffer length if necessar...
2018 Nov 30
0
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...with _SHIFT, ergo
we need to change the above 5 to have names which are with _F_ and
have the bit number.
> >
> >
> > > >
> > > >
> > > > > + */
> > > > > +#define VRING_PACKED_DESC_F_AVAIL 7
> > > > > +#define VRING_PACKED_DESC_F_USED 15
> > > > > +
> > > > > /* The Host uses this in used->flags to advise the Guest: don't kick me when
> > > > > * you add a buffer. It's unreliable, so it's simply an optimization. Guest
> > > > > * will still...
2018 Nov 30
0
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...hink.
> >
> >
> >
> > > >
> > > >
> > > > > >
> > > > > >
> > > > > > > + */
> > > > > > > +#define VRING_PACKED_DESC_F_AVAIL 7
> > > > > > > +#define VRING_PACKED_DESC_F_USED 15
> > > > > > > +
> > > > > > > /* The Host uses this in used->flags to advise the Guest: don't kick me when
> > > > > > > * you add a buffer. It's unreliable, so it's simply an optimization. Guest
> > &...
2018 Nov 30
0
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...> > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > > + */
> > > > > > > > > +#define VRING_PACKED_DESC_F_AVAIL 7
> > > > > > > > > +#define VRING_PACKED_DESC_F_USED 15
> > > > > > > > > +
> > > > > > > > > /* The Host uses this in used->flags to advise the Guest: don't kick me when
> > > > > > > > > * you add a buffer. It's unreliable, so it's simply an op...
2023 May 31
1
[PATCH] virtio_ring: validate used buffer length
...> > > > @@ -1498,6 +1553,8 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
> > > > > > > 1 << VRING_PACKED_DESC_F_AVAIL |
> > > > > > > 1 << VRING_PACKED_DESC_F_USED;
> > > > > > > }
> > > > > > > + if (n >= out_sgs)
> > > > > > > + buflen += sg->length;
> > > > > > > }
> > > >...
2023 May 31
1
[PATCH] virtio_ring: validate used buffer length
...> > @@ -1498,6 +1553,8 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
> > > > > > > > 1 << VRING_PACKED_DESC_F_AVAIL |
> > > > > > > > 1 << VRING_PACKED_DESC_F_USED;
> > > > > > > > }
> > > > > > > > + if (n >= out_sgs)
> > > > > > > > + buflen += sg->length;
> > > > > > > >...