search for: vring_packed

Displaying 20 results from an estimated 164 matches for "vring_packed".

2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...t; virtio_mb(vq->weak_barriers); > > > > > + old = vq->next_avail_idx - vq->num_added; > > > > > + new = vq->next_avail_idx; > > > > > + vq->num_added = 0; > > > > > + > > > > > snapshot = *(u32 *)vq->vring_packed.device; > > > > > + off_wrap = virtio16_to_cpu(_vq->vdev, snapshot & 0xffff); > > > > > flags = cpu_to_virtio16(_vq->vdev, snapshot >> 16) & 0x3; > > > > > #ifdef DEBUG > > > > > @@ -1006,7 +1011,10 @@ static bool...
2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...t; virtio_mb(vq->weak_barriers); > > > > > + old = vq->next_avail_idx - vq->num_added; > > > > > + new = vq->next_avail_idx; > > > > > + vq->num_added = 0; > > > > > + > > > > > snapshot = *(u32 *)vq->vring_packed.device; > > > > > + off_wrap = virtio16_to_cpu(_vq->vdev, snapshot & 0xffff); > > > > > flags = cpu_to_virtio16(_vq->vdev, snapshot >> 16) & 0x3; > > > > > #ifdef DEBUG > > > > > @@ -1006,7 +1011,10 @@ static bool...
2018 May 16
0
[RFC v4 3/5] virtio_ring: add packed ring support
...> 1 && vq->vq.num_free) + if (virtqueue_use_indirect(_vq, total_sg)) desc = alloc_indirect_split(_vq, total_sg, gfp); else { desc = NULL; @@ -741,6 +753,63 @@ static inline unsigned vring_size_packed(unsigned int num, unsigned long align) & ~(align - 1)) + sizeof(struct vring_packed_desc_event) * 2; } +static void vring_unmap_one_packed(const struct vring_virtqueue *vq, + struct vring_packed_desc *desc) +{ + u16 flags; + + if (!vring_use_dma_api(vq->vq.vdev)) + return; + + flags = virtio16_to_cpu(vq->vq.vdev, desc->flags); + + if (flags & VRING_DESC_F_IN...
2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...> > > * suppressions. */ > > > virtio_mb(vq->weak_barriers); > > > + old = vq->next_avail_idx - vq->num_added; > > > + new = vq->next_avail_idx; > > > + vq->num_added = 0; > > > + > > > snapshot = *(u32 *)vq->vring_packed.device; > > > + off_wrap = virtio16_to_cpu(_vq->vdev, snapshot & 0xffff); > > > flags = cpu_to_virtio16(_vq->vdev, snapshot >> 16) & 0x3; > > > #ifdef DEBUG > > > @@ -1006,7 +1011,10 @@ static bool virtqueue_kick_prepare_packed(struct vir...
2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...> > > * suppressions. */ > > > virtio_mb(vq->weak_barriers); > > > + old = vq->next_avail_idx - vq->num_added; > > > + new = vq->next_avail_idx; > > > + vq->num_added = 0; > > > + > > > snapshot = *(u32 *)vq->vring_packed.device; > > > + off_wrap = virtio16_to_cpu(_vq->vdev, snapshot & 0xffff); > > > flags = cpu_to_virtio16(_vq->vdev, snapshot >> 16) & 0x3; > > > #ifdef DEBUG > > > @@ -1006,7 +1011,10 @@ static bool virtqueue_kick_prepare_packed(struct vir...
2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...tic bool virtqueue_kick_prepare_packed(struct virtqueue *_vq) > * suppressions. */ > virtio_mb(vq->weak_barriers); > > + old = vq->next_avail_idx - vq->num_added; > + new = vq->next_avail_idx; > + vq->num_added = 0; > + > snapshot = *(u32 *)vq->vring_packed.device; > + off_wrap = virtio16_to_cpu(_vq->vdev, snapshot & 0xffff); > flags = cpu_to_virtio16(_vq->vdev, snapshot >> 16) & 0x3; > > #ifdef DEBUG > @@ -1006,7 +1011,10 @@ static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq) > vq->last...
2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...tic bool virtqueue_kick_prepare_packed(struct virtqueue *_vq) > * suppressions. */ > virtio_mb(vq->weak_barriers); > > + old = vq->next_avail_idx - vq->num_added; > + new = vq->next_avail_idx; > + vq->num_added = 0; > + > snapshot = *(u32 *)vq->vring_packed.device; > + off_wrap = virtio16_to_cpu(_vq->vdev, snapshot & 0xffff); > flags = cpu_to_virtio16(_vq->vdev, snapshot >> 16) & 0x3; > > #ifdef DEBUG > @@ -1006,7 +1011,10 @@ static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq) > vq->last...
2018 May 16
2
[RFC v4 3/5] virtio_ring: add packed ring support
...ee) > + if (virtqueue_use_indirect(_vq, total_sg)) > desc = alloc_indirect_split(_vq, total_sg, gfp); > else { > desc = NULL; > @@ -741,6 +753,63 @@ static inline unsigned vring_size_packed(unsigned int num, unsigned long align) > & ~(align - 1)) + sizeof(struct vring_packed_desc_event) * 2; > } > > +static void vring_unmap_one_packed(const struct vring_virtqueue *vq, > + struct vring_packed_desc *desc) > +{ > + u16 flags; > + > + if (!vring_use_dma_api(vq->vq.vdev)) > + return; > + > + flags = virtio16_to_cpu(vq->vq.v...
2018 May 16
2
[RFC v4 3/5] virtio_ring: add packed ring support
...ee) > + if (virtqueue_use_indirect(_vq, total_sg)) > desc = alloc_indirect_split(_vq, total_sg, gfp); > else { > desc = NULL; > @@ -741,6 +753,63 @@ static inline unsigned vring_size_packed(unsigned int num, unsigned long align) > & ~(align - 1)) + sizeof(struct vring_packed_desc_event) * 2; > } > > +static void vring_unmap_one_packed(const struct vring_virtqueue *vq, > + struct vring_packed_desc *desc) > +{ > + u16 flags; > + > + if (!vring_use_dma_api(vq->vq.vdev)) > + return; > + > + flags = virtio16_to_cpu(vq->vq.v...
2018 Apr 25
0
[RFC v3 3/5] virtio_ring: add packed ring support
...> 1 && vq->vq.num_free) + if (virtqueue_use_indirect(_vq, total_sg)) desc = alloc_indirect_split(_vq, total_sg, gfp); else { desc = NULL; @@ -741,6 +750,49 @@ static inline unsigned vring_size_packed(unsigned int num, unsigned long align) & ~(align - 1)) + sizeof(struct vring_packed_desc_event) * 2; } +static void vring_unmap_one_packed(const struct vring_virtqueue *vq, + struct vring_packed_desc *desc) +{ + u16 flags; + + if (!vring_use_dma_api(vq->vq.vdev)) + return; + + flags = virtio16_to_cpu(vq->vq.vdev, desc->flags); + + if (flags & VRING_DESC_F_IN...
2018 May 03
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...gt; > > > > + old = vq->next_avail_idx - vq->num_added; > > > > > > > + new = vq->next_avail_idx; > > > > > > > + vq->num_added = 0; > > > > > > > + > > > > > > > snapshot = *(u32 *)vq->vring_packed.device; > > > > > > > + off_wrap = virtio16_to_cpu(_vq->vdev, snapshot & 0xffff); > > > > > > > flags = cpu_to_virtio16(_vq->vdev, snapshot >> 16) & 0x3; > > > > > > > #ifdef DEBUG > > > > > >...
2018 May 03
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...gt; > > > > + old = vq->next_avail_idx - vq->num_added; > > > > > > > + new = vq->next_avail_idx; > > > > > > > + vq->num_added = 0; > > > > > > > + > > > > > > > snapshot = *(u32 *)vq->vring_packed.device; > > > > > > > + off_wrap = virtio16_to_cpu(_vq->vdev, snapshot & 0xffff); > > > > > > > flags = cpu_to_virtio16(_vq->vdev, snapshot >> 16) & 0x3; > > > > > > > #ifdef DEBUG > > > > > >...
2018 May 16
8
[RFC v4 0/5] virtio: support packed ring
...XXX_split/packed and wrappers (MST); - Fix the comments and API in uapi (MST); - Remove the BUG_ON() for indirect (Jason); - Some other refinements and bug fixes; RFC v1 -> RFC v2: - Add indirect descriptor support - compile test only; - Add event suppression supprt - compile test only; - Move vring_packed_init() out of uapi (Jason, MST); - Merge two loops into one in virtqueue_add_packed() (Jason); - Split vring_unmap_one() for packed ring and split ring (Jason); - Avoid using '%' operator (Jason); - Rename free_head -> next_avail_idx (Jason); - Add comments for virtio_wmb() in virtqueue_...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...tten value to avail->idx in >>> + * guest byte order */ >>> + u16 avail_idx_shadow; >>> + }; >>> + >>> + /* Available for packed ring */ >>> + struct { >>> + /* Actual memory layout for this queue */ >>> + struct vring_packed vring_packed; >>> + u8 wrap_counter : 1; >>> + bool chaining; >>> + }; >>> + }; >>> /* How to notify other side. FIXME: commonalize hcalls! */ >>> bool (*notify)(struct virtqueue *vq); >>> @@ -201,26 +218,37 @@ static dma_a...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...tten value to avail->idx in >>> + * guest byte order */ >>> + u16 avail_idx_shadow; >>> + }; >>> + >>> + /* Available for packed ring */ >>> + struct { >>> + /* Actual memory layout for this queue */ >>> + struct vring_packed vring_packed; >>> + u8 wrap_counter : 1; >>> + bool chaining; >>> + }; >>> + }; >>> /* How to notify other side. FIXME: commonalize hcalls! */ >>> bool (*notify)(struct virtqueue *vq); >>> @@ -201,26 +218,37 @@ static dma_a...
2018 May 22
0
[RFC v5 3/5] virtio_ring: add packed ring support
...rs/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index f5ef5f42a7cf..eb9fd5207a68 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -62,6 +62,12 @@ struct vring_desc_state { }; struct vring_desc_state_packed { + void *data; /* Data for callback. */ + struct vring_packed_desc *indir_desc; /* Indirect descriptor, if any. */ + int num; /* Descriptor list length. */ + dma_addr_t addr; /* Buffer DMA addr. */ + u32 len; /* Buffer length. */ + u16 flags; /* Descriptor flags. */ int next; /* The next desc state. */ }; @@ -758,6 +764,72 @@ static inline unsig...
2018 Sep 07
1
[PATCH net-next v2 4/5] virtio_ring: add event idx support in packed ring
...ol virtqueue_kick_prepare_packed(struct virtqueue *_vq) > * suppressions. */ > virtio_mb(vq->weak_barriers); > > + old = vq->next_avail_idx - vq->num_added; > + new = vq->next_avail_idx; > + vq->num_added = 0; > + > snapshot = READ_ONCE(*(u32 *)vq->vring_packed.device); > + off_wrap = virtio16_to_cpu(_vq->vdev, (__virtio16)(snapshot & 0xffff)); > flags = virtio16_to_cpu(_vq->vdev, (__virtio16)(snapshot >> 16)) & 0x3; some kind of struct union would be helpful to make this readable. > > + wrap_counter = off_wrap >&...
2018 Sep 12
1
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...> > > > Signed-off-by: Tiwei Bie <tiwei.bie at intel.com> > > [...] > > > + > > > +/* > > > + * The layout for the packed ring is a continuous chunk of memory > > > + * which looks like this. > > > + * > > > + * struct vring_packed { > > > + * // The actual descriptors (16 bytes each) > > > + * struct vring_packed_desc desc[num]; > > > + * > > > + * // Padding to the next align boundary. > > > + * char pad[]; > > > + * > > > + * // Driver Event Suppression > &g...
2018 Apr 25
9
[RFC v3 0/5] virtio: support packed ring
...XXX_split/packed and wrappers (MST); - Fix the comments and API in uapi (MST); - Remove the BUG_ON() for indirect (Jason); - Some other refinements and bug fixes; RFC v1 -> RFC v2: - Add indirect descriptor support - compile test only; - Add event suppression supprt - compile test only; - Move vring_packed_init() out of uapi (Jason, MST); - Merge two loops into one in virtqueue_add_packed() (Jason); - Split vring_unmap_one() for packed ring and split ring (Jason); - Avoid using '%' operator (Jason); - Rename free_head -> next_avail_idx (Jason); - Add comments for virtio_wmb() in virtqueue_...
2018 Jul 11
0
[PATCH net-next v2 3/5] virtio_ring: add packed ring support
...(b) << 7) +#define _VRING_DESC_F_USED(b) ((__u16)(b) << 15) + struct vring_desc_state { void *data; /* Data for callback. */ struct vring_desc *indir_desc; /* Indirect descriptor, if any. */ }; struct vring_desc_state_packed { + void *data; /* Data for callback. */ + struct vring_packed_desc *indir_desc; /* Indirect descriptor, if any. */ + int num; /* Descriptor list length. */ + dma_addr_t addr; /* Buffer DMA addr. */ + u32 len; /* Buffer length. */ + u16 flags; /* Descriptor flags. */ int next; /* The next desc state. */ }; @@ -660,7 +669,6 @@ static bool virtqueu...