search for: virtqueue_detach_unused_buf_pack

Displaying 20 results from an estimated 57 matches for "virtqueue_detach_unused_buf_pack".

2018 Apr 17
2
[RFC v2] virtio: support packed ring
...> > > > + desc = &vq->vring_packed.desc[i]; > > > > + vring_unmap_one_packed(vq, desc); > > > > + desc->flags = 0x0; > > > Looks like this is unnecessary. > > It's safer to zero it. If we don't zero it, after we > > call virtqueue_detach_unused_buf_packed() which calls > > this function, the desc is still available to the > > device. > > Well detach_unused_buf_packed() should be called after device is stopped, > otherwise even if you try to clear, there will still be a window that device > may use it. This is not about wh...
2018 Apr 17
2
[RFC v2] virtio: support packed ring
...> > > > + desc = &vq->vring_packed.desc[i]; > > > > + vring_unmap_one_packed(vq, desc); > > > > + desc->flags = 0x0; > > > Looks like this is unnecessary. > > It's safer to zero it. If we don't zero it, after we > > call virtqueue_detach_unused_buf_packed() which calls > > this function, the desc is still available to the > > device. > > Well detach_unused_buf_packed() should be called after device is stopped, > otherwise even if you try to clear, there will still be a window that device > may use it. This is not about wh...
2018 Apr 17
2
[RFC v2] virtio: support packed ring
...acked.desc[i]; > > > > > > + vring_unmap_one_packed(vq, desc); > > > > > > + desc->flags = 0x0; > > > > > Looks like this is unnecessary. > > > > It's safer to zero it. If we don't zero it, after we > > > > call virtqueue_detach_unused_buf_packed() which calls > > > > this function, the desc is still available to the > > > > device. > > > > > > Well detach_unused_buf_packed() should be called after device is stopped, > > > otherwise even if you try to clear, there will still be a window...
2018 Apr 17
2
[RFC v2] virtio: support packed ring
...acked.desc[i]; > > > > > > + vring_unmap_one_packed(vq, desc); > > > > > > + desc->flags = 0x0; > > > > > Looks like this is unnecessary. > > > > It's safer to zero it. If we don't zero it, after we > > > > call virtqueue_detach_unused_buf_packed() which calls > > > > this function, the desc is still available to the > > > > device. > > > > > > Well detach_unused_buf_packed() should be called after device is stopped, > > > otherwise even if you try to clear, there will still be a window...
2019 Aug 10
1
[PATCH v3 2/2] virtio: decrement avail idx with buffer detach for packed ring
...| 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index c8be1c4f5b55..7c69181113e2 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -1537,6 +1537,12 @@ static void *virtqueue_detach_unused_buf_packed(struct virtqueue *_vq) > /* detach_buf clears data, so grab it now. */ > buf = vq->packed.desc_state[i].data; > detach_buf_packed(vq, i, NULL); > + vq->packed.next_avail_idx--; > + if (vq->packed.next_avail_idx < 0) { > + vq->packed.next_avail_idx = v...
2019 Aug 12
1
[PATCH v3 2/2] virtio: decrement avail idx with buffer detach for packed ring
...| 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index c8be1c4f5b55..7c69181113e2 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -1537,6 +1537,12 @@ static void *virtqueue_detach_unused_buf_packed(struct virtqueue *_vq) > /* detach_buf clears data, so grab it now. */ > buf = vq->packed.desc_state[i].data; > detach_buf_packed(vq, i, NULL); > + vq->packed.next_avail_idx--; > + if (vq->packed.next_avail_idx < 0) { > + vq->packed.next_avail_idx...
2019 Aug 09
5
[PATCH v3 0/2] virtio_console: fix replug of virtio console port
This patch series fixes the issue with unplug/replug of a port in virtio console driver which fails with an error "Error allocating inbufs\n". Patch 1 makes use of 'virtqueue_detach_unused_buf' function to detach the unused buffers during port hotunplug time. Patch 2 updates the next avail index for packed ring code. Tested the packed ring code with the qemu virtio 1.1 device
2018 Apr 17
2
[RFC v2] virtio: support packed ring
...> + vring_unmap_one_packed(vq, desc); > > > > > > > > + desc->flags = 0x0; > > > > > > > Looks like this is unnecessary. > > > > > > It's safer to zero it. If we don't zero it, after we > > > > > > call virtqueue_detach_unused_buf_packed() which calls > > > > > > this function, the desc is still available to the > > > > > > device. > > > > > > > > > > Well detach_unused_buf_packed() should be called after device is stopped, > > > > > otherwise even...
2018 Apr 17
2
[RFC v2] virtio: support packed ring
...> + vring_unmap_one_packed(vq, desc); > > > > > > > > + desc->flags = 0x0; > > > > > > > Looks like this is unnecessary. > > > > > > It's safer to zero it. If we don't zero it, after we > > > > > > call virtqueue_detach_unused_buf_packed() which calls > > > > > > this function, the desc is still available to the > > > > > > device. > > > > > > > > > > Well detach_unused_buf_packed() should be called after device is stopped, > > > > > otherwise even...
2023 Jun 02
12
[PATCH vhost v10 00/10] virtio core prepares for AF_XDP
## About DMA APIs Now, virtio may can not work with DMA APIs when virtio features do not have VIRTIO_F_ACCESS_PLATFORM. 1. I tried to let DMA APIs return phy address by virtio-device. But DMA APIs just work with the "real" devices. 2. I tried to let xsk support callballs to get phy address from virtio-net driver as the dma address. But the maintainers of xsk may want to use
2023 Jun 02
12
[PATCH vhost v10 00/10] virtio core prepares for AF_XDP
## About DMA APIs Now, virtio may can not work with DMA APIs when virtio features do not have VIRTIO_F_ACCESS_PLATFORM. 1. I tried to let DMA APIs return phy address by virtio-device. But DMA APIs just work with the "real" devices. 2. I tried to let xsk support callballs to get phy address from virtio-net driver as the dma address. But the maintainers of xsk may want to use
2018 Apr 17
0
[RFC v2] virtio: support packed ring
...esc = &vq->vring_packed.desc[i]; > > > > > + vring_unmap_one_packed(vq, desc); > > > > > + desc->flags = 0x0; > > > > Looks like this is unnecessary. > > > It's safer to zero it. If we don't zero it, after we > > > call virtqueue_detach_unused_buf_packed() which calls > > > this function, the desc is still available to the > > > device. > > > > Well detach_unused_buf_packed() should be called after device is stopped, > > otherwise even if you try to clear, there will still be a window that device > > may...
2018 Apr 17
0
[RFC v2] virtio: support packed ring
...> > > > > + vring_unmap_one_packed(vq, desc); > > > > > > > + desc->flags = 0x0; > > > > > > Looks like this is unnecessary. > > > > > It's safer to zero it. If we don't zero it, after we > > > > > call virtqueue_detach_unused_buf_packed() which calls > > > > > this function, the desc is still available to the > > > > > device. > > > > > > > > Well detach_unused_buf_packed() should be called after device is stopped, > > > > otherwise even if you try to clear, ther...
2019 Aug 08
0
[PATCH v2 2/2] virtio_ring: packed ring: fix virtqueue_detach_unused_buf
...t; --- drivers/virtio/virtio_ring.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index c8be1c4f5b55..1b98a6777b7e 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -1534,6 +1534,11 @@ static void *virtqueue_detach_unused_buf_packed(struct virtqueue *_vq) for (i = 0; i < vq->packed.vring.num; i++) { if (!vq->packed.desc_state[i].data) continue; + vq->packed.next_avail_idx--; + if (vq->packed.next_avail_idx < 0) { + vq->packed.next_avail_idx = vq->packed.vring.num - 1; + vq->packed.av...
2019 Aug 09
0
[PATCH v3 2/2] virtio: decrement avail idx with buffer detach for packed ring
...; --- drivers/virtio/virtio_ring.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index c8be1c4f5b55..7c69181113e2 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -1537,6 +1537,12 @@ static void *virtqueue_detach_unused_buf_packed(struct virtqueue *_vq) /* detach_buf clears data, so grab it now. */ buf = vq->packed.desc_state[i].data; detach_buf_packed(vq, i, NULL); + vq->packed.next_avail_idx--; + if (vq->packed.next_avail_idx < 0) { + vq->packed.next_avail_idx = vq->packed.vring.num - 1; +...
2018 Apr 17
2
[RFC v2] virtio: support packed ring
...> > > > + desc = &vq->vring_packed.desc[i]; > > > > + vring_unmap_one_packed(vq, desc); > > > > + desc->flags = 0x0; > > > Looks like this is unnecessary. > > It's safer to zero it. If we don't zero it, after we > > call virtqueue_detach_unused_buf_packed() which calls > > this function, the desc is still available to the > > device. > > Well detach_unused_buf_packed() should be called after device is stopped, > otherwise even if you try to clear, there will still be a window that device > may use it. > > > >...
2018 Apr 17
2
[RFC v2] virtio: support packed ring
...> > > > + desc = &vq->vring_packed.desc[i]; > > > > + vring_unmap_one_packed(vq, desc); > > > > + desc->flags = 0x0; > > > Looks like this is unnecessary. > > It's safer to zero it. If we don't zero it, after we > > call virtqueue_detach_unused_buf_packed() which calls > > this function, the desc is still available to the > > device. > > Well detach_unused_buf_packed() should be called after device is stopped, > otherwise even if you try to clear, there will still be a window that device > may use it. > > > >...
2018 Apr 13
3
[RFC v2] virtio: support packed ring
...or (j = 0; j < vq->desc_state[head].num; j++) { > > + desc = &vq->vring_packed.desc[i]; > > + vring_unmap_one_packed(vq, desc); > > + desc->flags = 0x0; > > Looks like this is unnecessary. It's safer to zero it. If we don't zero it, after we call virtqueue_detach_unused_buf_packed() which calls this function, the desc is still available to the device. > > > + i++; > > + if (i >= vq->vring_packed.num) > > + i = 0; > > + } [...] > > +static unsigned virtqueue_enable_cb_prepare_packed(struct virtqueue *_vq) > > +{ > > +...
2018 Apr 13
3
[RFC v2] virtio: support packed ring
...or (j = 0; j < vq->desc_state[head].num; j++) { > > + desc = &vq->vring_packed.desc[i]; > > + vring_unmap_one_packed(vq, desc); > > + desc->flags = 0x0; > > Looks like this is unnecessary. It's safer to zero it. If we don't zero it, after we call virtqueue_detach_unused_buf_packed() which calls this function, the desc is still available to the device. > > > + i++; > > + if (i >= vq->vring_packed.num) > > + i = 0; > > + } [...] > > +static unsigned virtqueue_enable_cb_prepare_packed(struct virtqueue *_vq) > > +{ > > +...
2023 Jun 22
1
[PATCH vhost v10 05/10] virtio_ring: split-detach: support return dma info to driver
...> + virtqueue_get_buf_ctx_split(_vq, len, ctx, NULL); > } > EXPORT_SYMBOL_GPL(virtqueue_get_buf_ctx); > > @@ -2493,7 +2591,7 @@ void *virtqueue_detach_unused_buf(struct virtqueue *_vq) > struct vring_virtqueue *vq = to_vvq(_vq); > > return vq->packed_ring ? virtqueue_detach_unused_buf_packed(_vq) : > - virtqueue_detach_unused_buf_split(_vq); > + virtqueue_detach_unused_buf_split(_vq, NULL); > } > EXPORT_SYMBOL_GPL(virtqueue_detach_unused_buf); > > diff --git a/include/linux/virtio.h b/include/linux/virtio.h > index 1fc0e1023bd4..eb4a4e4329aa 100644 &g...