search for: vring_enable_cb

Displaying 20 results from an estimated 28 matches for "vring_enable_cb".

2010 May 11
1
[PATCH RFC] vhost: fix barrier pairing
...ed index write. So we see interrupts disabled and do not interrupt, at the same time guest writes flags value to enable interrupt, reads an old used index value, thinks that used ring is empty and waits for interrupt. Note: the barrier we pair with here is in drivers/virtio/virtio_ring.c, function vring_enable_cb. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- Dave, I think this is needed in 2.6.34, I'll send a pull request after doing some more testing. Rusty, Juan, could you take a look as well please? Thanks! drivers/vhost/vhost.c | 5 ++++- 1 files changed, 4 insertions(+),...
2010 May 11
1
[PATCH RFC] vhost: fix barrier pairing
...ed index write. So we see interrupts disabled and do not interrupt, at the same time guest writes flags value to enable interrupt, reads an old used index value, thinks that used ring is empty and waits for interrupt. Note: the barrier we pair with here is in drivers/virtio/virtio_ring.c, function vring_enable_cb. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- Dave, I think this is needed in 2.6.34, I'll send a pull request after doing some more testing. Rusty, Juan, could you take a look as well please? Thanks! drivers/vhost/vhost.c | 5 ++++- 1 files changed, 4 insertions(+),...
2008 May 26
2
virtio_net: another race with virtio_net and enable_cb
...ere ]------------ kernel BUG at drivers/virtio/virtio_ring.c:230! illegal operation: 0001 [#1] SMP Modules linked in: CPU: 0 Not tainted 2.6.26-rc2-kvm-00436-gc94c08b-dirty #34 Process netserver (pid: 2582, task: 000000000fbc4c68, ksp: 000000000f42b990) Krnl PSW : 0704c00180000000 00000000002d0ec8 (vring_enable_cb+0x1c/0x60) R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 EA:3 Krnl GPRS: 0000000000000000 0000000000000000 000000000ef3d000 0000000010009800 0000000000000000 0000000000419ce0 0000000000000080 000000000000007b 000000000adb5538 000000000ef40900 000000000ef40000 0...
2008 May 26
2
virtio_net: another race with virtio_net and enable_cb
...ere ]------------ kernel BUG at drivers/virtio/virtio_ring.c:230! illegal operation: 0001 [#1] SMP Modules linked in: CPU: 0 Not tainted 2.6.26-rc2-kvm-00436-gc94c08b-dirty #34 Process netserver (pid: 2582, task: 000000000fbc4c68, ksp: 000000000f42b990) Krnl PSW : 0704c00180000000 00000000002d0ec8 (vring_enable_cb+0x1c/0x60) R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 EA:3 Krnl GPRS: 0000000000000000 0000000000000000 000000000ef3d000 0000000010009800 0000000000000000 0000000000419ce0 0000000000000080 000000000000007b 000000000adb5538 000000000ef40900 000000000ef40000 0...
2010 Jan 29
3
[PATCH 0/2] virtio net improvements
Hi Dave, Nice driver optimization from Shirley, but requires a new virtio hook. Do you want to take both? I have nothing else overlapping it. Cheers, Rusty.
2010 Jan 29
3
[PATCH 0/2] virtio net improvements
Hi Dave, Nice driver optimization from Shirley, but requires a new virtio hook. Do you want to take both? I have nothing else overlapping it. Cheers, Rusty.
2008 Apr 07
1
[PATCH] virtio: remove overzealous BUG_ON.
...000 @@ -214,10 +215,7 @@ static void vring_disable_cb(struct virt { struct vring_virtqueue *vq = to_vvq(_vq); - START_USE(vq); - BUG_ON(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT); vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT; - END_USE(vq); } static bool vring_enable_cb(struct virtqueue *_vq) diff -r 0b3e64be7696 include/linux/virtio.h --- a/include/linux/virtio.h Mon Apr 07 07:40:08 2008 +1000 +++ b/include/linux/virtio.h Mon Apr 07 13:37:03 2008 +1000 @@ -41,6 +41,8 @@ struct virtqueue * Returns NULL or the "data" token handed to add_buf. * @disabl...
2010 Jan 21
1
[PATCH] virtio: use smp_XX barriers
...t *len) } /* Only get used array entries after they have been exposed by host. */ - rmb(); + smp_rmb(); i = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].id; *len = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].len; @@ -324,7 +324,7 @@ static bool vring_enable_cb(struct virtqueue *_vq) /* We optimistically turn back on interrupts, then check if there was * more to do. */ vq->vring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT; - mb(); + smp_mb(); if (unlikely(more_used(vq))) { END_USE(vq); return false; -- 1.6.6.144.g5c3af
2008 Apr 07
1
[PATCH] virtio: remove overzealous BUG_ON.
...000 @@ -214,10 +215,7 @@ static void vring_disable_cb(struct virt { struct vring_virtqueue *vq = to_vvq(_vq); - START_USE(vq); - BUG_ON(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT); vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT; - END_USE(vq); } static bool vring_enable_cb(struct virtqueue *_vq) diff -r 0b3e64be7696 include/linux/virtio.h --- a/include/linux/virtio.h Mon Apr 07 07:40:08 2008 +1000 +++ b/include/linux/virtio.h Mon Apr 07 13:37:03 2008 +1000 @@ -41,6 +41,8 @@ struct virtqueue * Returns NULL or the "data" token handed to add_buf. * @disabl...
2010 Jan 21
1
[PATCH] virtio: use smp_XX barriers
...t *len) } /* Only get used array entries after they have been exposed by host. */ - rmb(); + smp_rmb(); i = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].id; *len = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].len; @@ -324,7 +324,7 @@ static bool vring_enable_cb(struct virtqueue *_vq) /* We optimistically turn back on interrupts, then check if there was * more to do. */ vq->vring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT; - mb(); + smp_mb(); if (unlikely(more_used(vq))) { END_USE(vq); return false; -- 1.6.6.144.g5c3af
2009 Aug 19
1
[PATCH v2 1/2] virtio: Add a can_add_buf helper
...rlist 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 +35,9 @@ struct virtqueue { * in_num: the number of sg which are writable (after readable ones) * data: the token identifying the buffer...
2008 Jan 27
1
[PATCH] virtio_net tx performance fix
...q->num_free < out + in) { pr_debug("Can't add buf len %i - avail = %i\n", out + in, vq->num_free); - /* We notify *even if* VRING_USED_F_NO_NOTIFY is set here. */ - vq->notify(&vq->vq); END_USE(vq); return -ENOSPC; } @@ -232,6 +230,7 @@ static bool vring_enable_cb(struct virtqueue *_vq) vq->vring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT; mb(); if (unlikely(more_used(vq))) { + vq->notify(&vq->vq); vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT; END_USE(vq); return false; -- 1.5.3.7 -------------- next part...
2009 Aug 19
1
[PATCH v2 1/2] virtio: Add a can_add_buf helper
...rlist 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 +35,9 @@ struct virtqueue { * in_num: the number of sg which are writable (after readable ones) * data: the token identifying the buffer...
2008 Jan 27
1
[PATCH] virtio_net tx performance fix
...q->num_free < out + in) { pr_debug("Can't add buf len %i - avail = %i\n", out + in, vq->num_free); - /* We notify *even if* VRING_USED_F_NO_NOTIFY is set here. */ - vq->notify(&vq->vq); END_USE(vq); return -ENOSPC; } @@ -232,6 +230,7 @@ static bool vring_enable_cb(struct virtqueue *_vq) vq->vring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT; mb(); if (unlikely(more_used(vq))) { + vq->notify(&vq->vq); vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT; END_USE(vq); return false; -- 1.5.3.7 -------------- next part...
2010 Jan 27
1
[PATCHv2] virtio: use smp_XX barriers on SMP
...len) } /* Only get used array entries after they have been exposed by host. */ - rmb(); + virtio_rmb(); i = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].id; *len = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].len; @@ -324,7 +342,7 @@ static bool vring_enable_cb(struct virtqueue *_vq) /* We optimistically turn back on interrupts, then check if there was * more to do. */ vq->vring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT; - mb(); + virtio_mb(); if (unlikely(more_used(vq))) { END_USE(vq); return false; -- 1.6.6.144.g5c3af
2010 Jan 27
1
[PATCHv2] virtio: use smp_XX barriers on SMP
...len) } /* Only get used array entries after they have been exposed by host. */ - rmb(); + virtio_rmb(); i = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].id; *len = vq->vring.used->ring[vq->last_used_idx%vq->vring.num].len; @@ -324,7 +342,7 @@ static bool vring_enable_cb(struct virtqueue *_vq) /* We optimistically turn back on interrupts, then check if there was * more to do. */ vq->vring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT; - mb(); + virtio_mb(); if (unlikely(more_used(vq))) { END_USE(vq); return false; -- 1.6.6.144.g5c3af
2008 Mar 14
1
[PATCH] virtio_net/virtio_ring: fix race in enable_cb
...ops->disable_cb(vi->svq); netif_start_queue(dev); goto again; } Index: kvm/drivers/virtio/virtio_ring.c =================================================================== --- kvm.orig/drivers/virtio/virtio_ring.c +++ kvm/drivers/virtio/virtio_ring.c @@ -232,7 +232,6 @@ static bool vring_enable_cb(struct virtq vq->vring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT; mb(); if (unlikely(more_used(vq))) { - vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT; END_USE(vq); return false; }
2008 Mar 14
1
[PATCH] virtio_net/virtio_ring: fix race in enable_cb
...ops->disable_cb(vi->svq); netif_start_queue(dev); goto again; } Index: kvm/drivers/virtio/virtio_ring.c =================================================================== --- kvm.orig/drivers/virtio/virtio_ring.c +++ kvm/drivers/virtio/virtio_ring.c @@ -232,7 +232,6 @@ static bool vring_enable_cb(struct virtq vq->vring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT; mb(); if (unlikely(more_used(vq))) { - vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT; END_USE(vq); return false; }
2008 Jan 05
1
[PATCH][RESEND] Relax BUG_ON()s when enabling/disabling virt_ring interrupts
...static void vring_disable_cb(struct virtqueue *_vq) struct vring_virtqueue *vq = to_vvq(_vq); START_USE(vq); - BUG_ON(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT); vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT; END_USE(vq); } @@ -237,7 +236,6 @@ static bool vring_enable_cb(struct virtqueue *_vq) struct vring_virtqueue *vq = to_vvq(_vq); START_USE(vq); - BUG_ON(!(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT)); /* We optimistically turn back on interrupts, then check if there was * more to do. */
2008 Jan 05
1
[PATCH][RESEND] Relax BUG_ON()s when enabling/disabling virt_ring interrupts
...static void vring_disable_cb(struct virtqueue *_vq) struct vring_virtqueue *vq = to_vvq(_vq); START_USE(vq); - BUG_ON(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT); vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT; END_USE(vq); } @@ -237,7 +236,6 @@ static bool vring_enable_cb(struct virtqueue *_vq) struct vring_virtqueue *vq = to_vvq(_vq); START_USE(vq); - BUG_ON(!(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT)); /* We optimistically turn back on interrupts, then check if there was * more to do. */