search for: get_buf

Displaying 20 results from an estimated 221 matches for "get_buf".

2023 Mar 28
2
9p regression (Was: [PATCH v2] virtio_ring: don't update event idx on get_buf)
...n we triger a tx interrupt, > the vq->event_triggered will be set to true. It will no longer be set to > false. Unless we explicitly call virtqueue_enable_cb_delayed or > virtqueue_enable_cb_prepare. This patch (commited as 35395770f803 ("virtio_ring: don't update event idx on get_buf") in next-20230327 apparently breaks 9p, as reported by Luis in https://lkml.kernel.org/r/ZCI+7Wg5OclSlE8c at bombadil.infradead.org I've just hit had a look at recent patches[1] and reverted this to test and I can mount again, so I'm pretty sure this is the culprit, but I didn't...
2023 Mar 27
0
[PATCH v2] virtio_ring: don't update event idx on get_buf
...er is relatively small. > > Because event_triggered is true. Therefore, VRING_AVAIL_F_NO_INTERRUPT or > VRING_PACKED_EVENT_FLAG_DISABLE will not be set. So we update > vring_used_event(&vq->split.vring) or vq->packed.vring.driver->off_wrap > every time we call virtqueue_get_buf_ctx. This will bring more interruptions. > > To summarize: > 1) event_triggered was set to true in vring_interrupt() > 2) after this nothing will happen for virtqueue_disable_cb() so > VRING_AVAIL_F_NO_INTERRUPT is not set in avail_flags_shadow > 3) virtqueue_get_buf_ctx_split...
2010 Apr 12
10
[PATCH 0/6] virtio: virtqueue ops cleanup
virtqueue ops were introduced in the hope that we'll have multiple implementations besides virtio_ring, but none have surfaced so far, and given that existing virtio ring is deployed in production we are likely stuck with it now, so this layer just adds complexity and overhead. Further, the need to pass vq twice to each call (as in dev->vq->vq_ops->kick(dev->vq) ) adds potential
2010 Apr 12
10
[PATCH 0/6] virtio: virtqueue ops cleanup
virtqueue ops were introduced in the hope that we'll have multiple implementations besides virtio_ring, but none have surfaced so far, and given that existing virtio ring is deployed in production we are likely stuck with it now, so this layer just adds complexity and overhead. Further, the need to pass vq twice to each call (as in dev->vq->vq_ops->kick(dev->vq) ) adds potential
2010 Mar 30
1
[PATCH 3/4] virtio: console makes incorrect assumption about virtio API
The get_buf() API sets the second arg to the number of bytes *written* by the other side; in this case it should be zero as these are output buffers. lguest gets this right (obviously kvm's console doesn't), resulting in continual buildup of console writes. Signed-off-by: Rusty Russell <rusty at r...
2010 Mar 30
1
[PATCH 3/4] virtio: console makes incorrect assumption about virtio API
The get_buf() API sets the second arg to the number of bytes *written* by the other side; in this case it should be zero as these are output buffers. lguest gets this right (obviously kvm's console doesn't), resulting in continual buildup of console writes. Signed-off-by: Rusty Russell <rusty at r...
2008 Jan 14
1
[PATCH] fix bug in virtio-rng
Rusty, I have seen an oops triggered by the following bug statement in virtio-rng: if (vq->vq_ops->add_buf(vq, &sg, 0, 1, &random_data) != 0) BUG(); The problem is that we never called get_buf for complete buffers. The fix is simple: We have to free the buffer on interrupt to avoid a virtqueue "overflow". Christian Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> --- drivers/char/hw_random/virtio-rng.c | 3 +++ 1 file changed, 3 insertions(+) Index...
2008 Jan 14
1
[PATCH] fix bug in virtio-rng
Rusty, I have seen an oops triggered by the following bug statement in virtio-rng: if (vq->vq_ops->add_buf(vq, &sg, 0, 1, &random_data) != 0) BUG(); The problem is that we never called get_buf for complete buffers. The fix is simple: We have to free the buffer on interrupt to avoid a virtqueue "overflow". Christian Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> --- drivers/char/hw_random/virtio-rng.c | 3 +++ 1 file changed, 3 insertions(+) Index...
2023 Mar 24
1
[External] Re: [PATCH] virtio_ring: Suppress tx interrupt when napi_tx disable
...; > Because event_triggered is true.Therefore, VRING_AVAIL_F_NO_INTERRUPT or > > > VRING_PACKED_EVENT_FLAG_DISABLE will not be set.So we update > > > vring_used_event(&vq->split.vring) or vq->packed.vring.driver->off_wrap > > > every time we call virtqueue_get_buf_ctx.This will bring more interruptions. > > > > Can you please post how to test with the performance numbers? > > > > iperf3 tcp stream: > vm1 -----------------> vm2 > vm2 just receive tcp data stream from vm1, and send the ack to vm1, > there are so > many tx...
2016 May 24
0
[PATCH] tools/virtio: add noring tool
...ful for measuring overhead */ +void alloc_ring(void) +{ +} + +/* guest side */ +int add_inbuf(unsigned len, void *buf, void *datap) +{ + return 0; +} + +/* + * skb_array API provides no way for producer to find out whether a given + * buffer was consumed. Our tests merely require that a successful get_buf + * implies that add_inbuf succeed in the past, and that add_inbuf will succeed, + * fake it accordingly. + */ +void *get_buf(unsigned *lenp, void **bufp) +{ + return "Buffer"; +} + +void poll_used(void) +{ +} + +void disable_call() +{ + assert(0); +} + +bool enable_call() +{ + assert(0);...
2016 May 24
0
[PATCH] tools/virtio: add noring tool
...ful for measuring overhead */ +void alloc_ring(void) +{ +} + +/* guest side */ +int add_inbuf(unsigned len, void *buf, void *datap) +{ + return 0; +} + +/* + * skb_array API provides no way for producer to find out whether a given + * buffer was consumed. Our tests merely require that a successful get_buf + * implies that add_inbuf succeed in the past, and that add_inbuf will succeed, + * fake it accordingly. + */ +void *get_buf(unsigned *lenp, void **bufp) +{ + return "Buffer"; +} + +void poll_used(void) +{ +} + +void disable_call() +{ + assert(0); +} + +bool enable_call() +{ + assert(0);...
2009 Aug 19
1
[PATCH v2 1/2] virtio: Add a can_add_buf helper
...q = to_vvq(_vq); + + return vq->num_free ? true : false; +} + static int vring_add_buf(struct virtqueue *_vq, struct scatterlist sg[], unsigned int out, @@ -350,6 +357,7 @@ EXPORT_SYMBOL_GPL(vring_interrupt); static struct virtqueue_ops vring_vq_ops = { .add_buf = vring_add_buf, .get_buf = vring_get_buf, + .can_add_buf = vring_can_add_buf, .kick = vring_kick, .disable_cb = vring_disable_cb, .enable_cb = vring_enable_cb, diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 4fca4f5..cc0e3aa 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -35,6...
2009 Aug 19
1
[PATCH v2 1/2] virtio: Add a can_add_buf helper
...q = to_vvq(_vq); + + return vq->num_free ? true : false; +} + static int vring_add_buf(struct virtqueue *_vq, struct scatterlist sg[], unsigned int out, @@ -350,6 +357,7 @@ EXPORT_SYMBOL_GPL(vring_interrupt); static struct virtqueue_ops vring_vq_ops = { .add_buf = vring_add_buf, .get_buf = vring_get_buf, + .can_add_buf = vring_can_add_buf, .kick = vring_kick, .disable_cb = vring_disable_cb, .enable_cb = vring_enable_cb, diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 4fca4f5..cc0e3aa 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -35,6...
2023 Mar 22
0
[PATCH] virtio_ring: Suppress tx interrupt when napi_tx disable
...} > } > Because event_triggered is true.Therefore, VRING_AVAIL_F_NO_INTERRUPT or > VRING_PACKED_EVENT_FLAG_DISABLE will not be set.So we update > vring_used_event(&vq->split.vring) or vq->packed.vring.driver->off_wrap > every time we call virtqueue_get_buf_ctx.This will bring more interruptions. Can you please post how to test with the performance numbers? > > if event_triggered is set to true, do not update vring_used_event(&vq->split.vring) > or vq->packed.vring.driver->off_wrap > > Signed-off-by: huangjie.albert <h...
2010 Jan 29
3
virtio: console: Return -EFAULT on copy_xx_user errors, allow larger writes
...gt;len = 0; + len = 0; goto fail; } @@ -444,13 +421,11 @@ static ssize_t send_buf(struct port *port, const char *in_buf, size_t in_count, * sent. Also ensure we return to userspace the number of * bytes that were successfully consumed by the host. */ - while (!out_vq->vq_ops->get_buf(out_vq, &tmplen)) + while (!out_vq->vq_ops->get_buf(out_vq, &len)) cpu_relax(); - - buf->len = tmplen; fail: /* We're expected to return the amount of data we wrote */ - return buf->len; + return len; } /* @@ -461,26 +436,25 @@ static ssize_t fill_readbuf(struct po...
2010 Jan 29
3
virtio: console: Return -EFAULT on copy_xx_user errors, allow larger writes
...gt;len = 0; + len = 0; goto fail; } @@ -444,13 +421,11 @@ static ssize_t send_buf(struct port *port, const char *in_buf, size_t in_count, * sent. Also ensure we return to userspace the number of * bytes that were successfully consumed by the host. */ - while (!out_vq->vq_ops->get_buf(out_vq, &tmplen)) + while (!out_vq->vq_ops->get_buf(out_vq, &len)) cpu_relax(); - - buf->len = tmplen; fail: /* We're expected to return the amount of data we wrote */ - return buf->len; + return len; } /* @@ -461,26 +436,25 @@ static ssize_t fill_readbuf(struct po...
2009 Sep 11
1
Multiple ports support for virtio_console; major number for dev
Hello, This is the patch that I have for adding support for multiple ports to virtio_console. It's pretty stable in my testing so far and the memory corruption that I had earlier has been resolved in linux-next so I'm proposing this for inclusion. This currently uses device major number 60 from the experimental range; Alan could you please reserve a new major number for virtio_console?
2009 Sep 11
1
Multiple ports support for virtio_console; major number for dev
Hello, This is the patch that I have for adding support for multiple ports to virtio_console. It's pretty stable in my testing so far and the memory corruption that I had earlier has been resolved in linux-next so I'm proposing this for inclusion. This currently uses device major number 60 from the experimental range; Alan could you please reserve a new major number for virtio_console?
2009 Sep 29
0
[PATCH] virtio_console: Add support for multiple ports for generic guest and host communication
...any - * non-NULL pointer, since there's only ever one buffer. */ - if (out_vq->vq_ops->add_buf(out_vq, sg, 1, 0, (void *)1) >= 0) { - /* Tell Host to go! */ - out_vq->vq_ops->kick(out_vq); - /* Chill out until it's done with the buffer. */ - while (!out_vq->vq_ops->get_buf(out_vq, &len)) - cpu_relax(); + struct virtio_console_port *port; + + list_for_each_entry(port, &virtconsole.port_head, next) { + if (port->dev->devt == devt) + return port; } + return NULL; +} + +static struct virtio_console_port *get_port_from_id(u32 id) +{ + struct virtio_co...
2009 Sep 29
0
[PATCH] virtio_console: Add support for multiple ports for generic guest and host communication
...any - * non-NULL pointer, since there's only ever one buffer. */ - if (out_vq->vq_ops->add_buf(out_vq, sg, 1, 0, (void *)1) >= 0) { - /* Tell Host to go! */ - out_vq->vq_ops->kick(out_vq); - /* Chill out until it's done with the buffer. */ - while (!out_vq->vq_ops->get_buf(out_vq, &len)) - cpu_relax(); + struct virtio_console_port *port; + + list_for_each_entry(port, &virtconsole.port_head, next) { + if (port->dev->devt == devt) + return port; } + return NULL; +} + +static struct virtio_console_port *get_port_from_id(u32 id) +{ + struct virtio_co...