search for: next_avail

Displaying 10 results from an estimated 10 matches for "next_avail".

2018 May 10
2
[RFC v3 3/5] virtio_ring: add packed ring support
...e're using some buffers from the free list. */ > + vq->vq.num_free -= descs_used; > + > + /* Update free pointer */ > + if (indirect) { > + n = head + 1; > + if (n >= vq->vring_packed.num) { > + n = 0; > + vq->wrap_counter ^= 1; > + } > + vq->next_avail_idx = n; > + } else > + vq->next_avail_idx = i; During testing zerocopy (out of order completion), I found driver may submit two identical buffer id to vhost. So the above code may not work well. Consider the case that driver adds 3 buffer and virtqueue size is 8. a) id = 0,count = 2...
2018 May 10
2
[RFC v3 3/5] virtio_ring: add packed ring support
...e're using some buffers from the free list. */ > + vq->vq.num_free -= descs_used; > + > + /* Update free pointer */ > + if (indirect) { > + n = head + 1; > + if (n >= vq->vring_packed.num) { > + n = 0; > + vq->wrap_counter ^= 1; > + } > + vq->next_avail_idx = n; > + } else > + vq->next_avail_idx = i; During testing zerocopy (out of order completion), I found driver may submit two identical buffer id to vhost. So the above code may not work well. Consider the case that driver adds 3 buffer and virtqueue size is 8. a) id = 0,count = 2...
2018 May 10
2
[RFC v3 3/5] virtio_ring: add packed ring support
...free pointer */ > > > +??? if (indirect) { > > > +??????? n = head + 1; > > > +??????? if (n >= vq->vring_packed.num) { > > > +??????????? n = 0; > > > +??????????? vq->wrap_counter ^= 1; > > > +??????? } > > > +??????? vq->next_avail_idx = n; > > > +??? } else > > > +??????? vq->next_avail_idx = i; > > > > During testing zerocopy (out of order completion), I found driver may > > submit two identical buffer id to vhost. So the above code may not work > > well. > > > > Co...
2018 May 10
2
[RFC v3 3/5] virtio_ring: add packed ring support
...free pointer */ > > > +??? if (indirect) { > > > +??????? n = head + 1; > > > +??????? if (n >= vq->vring_packed.num) { > > > +??????????? n = 0; > > > +??????????? vq->wrap_counter ^= 1; > > > +??????? } > > > +??????? vq->next_avail_idx = n; > > > +??? } else > > > +??????? vq->next_avail_idx = i; > > > > During testing zerocopy (out of order completion), I found driver may > > submit two identical buffer id to vhost. So the above code may not work > > well. > > > > Co...
2018 May 10
0
[RFC v3 3/5] virtio_ring: add packed ring support
...s_used; >> + >> +??? /* Update free pointer */ >> +??? if (indirect) { >> +??????? n = head + 1; >> +??????? if (n >= vq->vring_packed.num) { >> +??????????? n = 0; >> +??????????? vq->wrap_counter ^= 1; >> +??????? } >> +??????? vq->next_avail_idx = n; >> +??? } else >> +??????? vq->next_avail_idx = i; > > During testing zerocopy (out of order completion), I found driver may > submit two identical buffer id to vhost. So the above code may not > work well. > > Consider the case that driver adds 3 buffer...
2018 May 10
0
[RFC v3 3/5] virtio_ring: add packed ring support
...*/ >>>> +??? if (indirect) { >>>> +??????? n = head + 1; >>>> +??????? if (n >= vq->vring_packed.num) { >>>> +??????????? n = 0; >>>> +??????????? vq->wrap_counter ^= 1; >>>> +??????? } >>>> +??????? vq->next_avail_idx = n; >>>> +??? } else >>>> +??????? vq->next_avail_idx = i; >>> During testing zerocopy (out of order completion), I found driver may >>> submit two identical buffer id to vhost. So the above code may not work >>> well. >>> >>...
2018 Jun 07
1
[RFC v6 4/5] virtio_ring: add event idx support in packed ring
...flags bit or point the event index at the next > + * entry. Always update the event index to keep code simple. */ > + Maybe for packed ring, it's time to treat event index separately to avoid a virtio_wmb() for event idx is off. > + /* TODO: tune this threshold */ > + if (vq->next_avail_idx < vq->last_used_idx) > + bufs = (vq->vring_packed.num + vq->next_avail_idx - > + vq->last_used_idx) * 3 / 4; > + else > + bufs = (vq->next_avail_idx - vq->last_used_idx) * 3 / 4; vq->next_avail-idx could be equal to vq->last_usd_idx when the ring is...
2018 May 16
1
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...> - u16 flags; > + u16 new, old, off_wrap, flags; > bool needs_kick; > u32 snapshot; > > @@ -995,7 +995,12 @@ static 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) & 0x...
2018 Apr 25
9
[RFC v3 0/5] virtio: support packed ring
...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_add_packed() (Jason); - Some other refinements and bug fixes; Thanks! Tiwei Bie (5): virtio: add packed ring definitions virtio_ring: support creating packed ring virtio_ring: add packed ring support virtio_ring: add event idx supp...
2018 Jun 05
6
[RFC v6 0/5] virtio: support packed ring
...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_add_packed() (Jason); - Some other refinements and bug fixes; Thanks! Tiwei Bie (5): virtio: add packed ring definitions virtio_ring: support creating packed ring virtio_ring: add packed ring support virtio_ring: add event idx supp...