Displaying 20 results from an estimated 231 matches for "vring_need_ev".
2015 Apr 15
2
[PATCH] virtio: fix typo in vring_need_event() doc comment
.../* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */
-/* Assuming a given event_idx value from the other size, if
+/* Assuming a given event_idx value from the other side, if
* we have just incremented index from old to new_idx,
* should we trigger an event? */
static inline int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old)
--
2.1.0
2015 Apr 15
2
[PATCH] virtio: fix typo in vring_need_event() doc comment
.../* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */
-/* Assuming a given event_idx value from the other size, if
+/* Assuming a given event_idx value from the other side, if
* we have just incremented index from old to new_idx,
* should we trigger an event? */
static inline int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old)
--
2.1.0
2015 Apr 19
0
[PATCH] virtio: fix typo in vring_need_event() doc comment
...with USED_EVENT_IDX and AVAIL_EVENT_IDX */
> -/* Assuming a given event_idx value from the other size, if
> +/* Assuming a given event_idx value from the other side, if
> * we have just incremented index from old to new_idx,
> * should we trigger an event? */
> static inline int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old)
> --
> 2.1.0
2015 Apr 20
1
[PATCH] virtio: fix typo in vring_need_event() doc comment
...VAIL_EVENT_IDX */
> > -/* Assuming a given event_idx value from the other size, if
> > +/* Assuming a given event_idx value from the other side, if
> > * we have just incremented index from old to new_idx,
> > * should we trigger an event? */
> > static inline int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old)
> > --
> > 2.1.0
2015 Apr 20
1
[PATCH] virtio: fix typo in vring_need_event() doc comment
...VAIL_EVENT_IDX */
> > -/* Assuming a given event_idx value from the other size, if
> > +/* Assuming a given event_idx value from the other side, if
> > * we have just incremented index from old to new_idx,
> > * should we trigger an event? */
> > static inline int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old)
> > --
> > 2.1.0
2017 Jul 27
2
[PATCH V2 net] Revert "vhost: cache used event for better performance"
...truct vhost_dev *dev, struct vhost_virtqueue *vq)
if (unlikely(!v))
return true;
- /* We're sure if the following conditions are met, there's no
- * need to notify guest:
- * 1) cached used event is ahead of new
- * 2) old to new updating does not cross cached used event. */
- if (vring_need_event(vq->last_used_event, new + vq->num, new) &&
- !vring_need_event(vq->last_used_event, new, old))
- return false;
-
- /* Flush out used index updates. This is paired
- * with the barrier that the Guest executes when enabling
- * interrupts. */
- smp_mb();
-
if (vhost_get_...
2017 Jul 27
2
[PATCH V2 net] Revert "vhost: cache used event for better performance"
...truct vhost_dev *dev, struct vhost_virtqueue *vq)
if (unlikely(!v))
return true;
- /* We're sure if the following conditions are met, there's no
- * need to notify guest:
- * 1) cached used event is ahead of new
- * 2) old to new updating does not cross cached used event. */
- if (vring_need_event(vq->last_used_event, new + vq->num, new) &&
- !vring_need_event(vq->last_used_event, new, old))
- return false;
-
- /* Flush out used index updates. This is paired
- * with the barrier that the Guest executes when enabling
- * interrupts. */
- smp_mb();
-
if (vhost_get_...
2017 Jul 26
4
[PATCH net] Revert "vhost: cache used event for better performance"
...truct vhost_dev *dev, struct vhost_virtqueue *vq)
if (unlikely(!v))
return true;
- /* We're sure if the following conditions are met, there's no
- * need to notify guest:
- * 1) cached used event is ahead of new
- * 2) old to new updating does not cross cached used event. */
- if (vring_need_event(vq->last_used_event, new + vq->num, new) &&
- !vring_need_event(vq->last_used_event, new, old))
- return false;
-
- /* Flush out used index updates. This is paired
- * with the barrier that the Guest executes when enabling
- * interrupts. */
- smp_mb();
-
if (vhost_get_...
2017 Jul 26
4
[PATCH net] Revert "vhost: cache used event for better performance"
...truct vhost_dev *dev, struct vhost_virtqueue *vq)
if (unlikely(!v))
return true;
- /* We're sure if the following conditions are met, there's no
- * need to notify guest:
- * 1) cached used event is ahead of new
- * 2) old to new updating does not cross cached used event. */
- if (vring_need_event(vq->last_used_event, new + vq->num, new) &&
- !vring_need_event(vq->last_used_event, new, old))
- return false;
-
- /* Flush out used index updates. This is paired
- * with the barrier that the Guest executes when enabling
- * interrupts. */
- smp_mb();
-
if (vhost_get_...
2018 May 03
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...; > > vq->last_add_time_valid = false;
> > > > > > > #endif
> > > > > > > - needs_kick = (flags != VRING_EVENT_F_DISABLE);
> > > > > > > + if (flags == VRING_EVENT_F_DESC)
> > > > > > > + needs_kick = vring_need_event(off_wrap & ~(1<<15), new, old);
> > > > > >
> > > > > > I wonder whether or not the math is correct. Both new and event are in the
> > > > > > unit of descriptor ring size, but old looks not.
> > > > >
> > >...
2018 May 03
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...; > > vq->last_add_time_valid = false;
> > > > > > > #endif
> > > > > > > - needs_kick = (flags != VRING_EVENT_F_DISABLE);
> > > > > > > + if (flags == VRING_EVENT_F_DESC)
> > > > > > > + needs_kick = vring_need_event(off_wrap & ~(1<<15), new, old);
> > > > > >
> > > > > > I wonder whether or not the math is correct. Both new and event are in the
> > > > > > unit of descriptor ring size, but old looks not.
> > > > >
> > >...
2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...ked(struct virtqueue *_vq)
> > > > > vq->last_add_time_valid = false;
> > > > > #endif
> > > > > - needs_kick = (flags != VRING_EVENT_F_DISABLE);
> > > > > + if (flags == VRING_EVENT_F_DESC)
> > > > > + needs_kick = vring_need_event(off_wrap & ~(1<<15), new, old);
> > > >
> > > > I wonder whether or not the math is correct. Both new and event are in the
> > > > unit of descriptor ring size, but old looks not.
> > >
> > > What vring_need_event() cares is the d...
2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...ked(struct virtqueue *_vq)
> > > > > vq->last_add_time_valid = false;
> > > > > #endif
> > > > > - needs_kick = (flags != VRING_EVENT_F_DISABLE);
> > > > > + if (flags == VRING_EVENT_F_DESC)
> > > > > + needs_kick = vring_need_event(off_wrap & ~(1<<15), new, old);
> > > >
> > > > I wonder whether or not the math is correct. Both new and event are in the
> > > > unit of descriptor ring size, but old looks not.
> > >
> > > What vring_need_event() cares is the d...
2014 Oct 15
1
[RFC PATCH net-next 2/6] virtio: introduce virtio_enable_cb_avail()
...io_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -567,14 +567,32 @@ unsigned virtqueue_enable_cb_prepare(struct virtqueue *_vq)
* entry. Always do both to keep code simple. */
vq->vring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT;
/* Make sure used event never go backwards */
- if (!vring_need_event(vring_used_event(&vq->vring),
- vq->vring.avail->idx, last_used_idx))
+ if (vq->vring.avail->idx != vring_used_event(&vq->vring) &&
+ !vring_need_event(vring_used_event(&vq->vring),
+ vq->vring.avail->idx, last_used_idx)) {
vr...
2014 Oct 15
1
[RFC PATCH net-next 2/6] virtio: introduce virtio_enable_cb_avail()
...io_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -567,14 +567,32 @@ unsigned virtqueue_enable_cb_prepare(struct virtqueue *_vq)
* entry. Always do both to keep code simple. */
vq->vring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT;
/* Make sure used event never go backwards */
- if (!vring_need_event(vring_used_event(&vq->vring),
- vq->vring.avail->idx, last_used_idx))
+ if (vq->vring.avail->idx != vring_used_event(&vq->vring) &&
+ !vring_need_event(vring_used_event(&vq->vring),
+ vq->vring.avail->idx, last_used_idx)) {
vr...
2014 Oct 15
2
[RFC PATCH net-next 2/6] virtio: introduce virtio_enable_cb_avail()
...>> @@ -567,14 +567,32 @@ unsigned virtqueue_enable_cb_prepare(struct virtqueue *_vq)
>> * entry. Always do both to keep code simple. */
>> vq->vring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT;
>> /* Make sure used event never go backwards */
>> - if (!vring_need_event(vring_used_event(&vq->vring),
>> - vq->vring.avail->idx, last_used_idx))
>> + if (vq->vring.avail->idx != vring_used_event(&vq->vring) &&
>> + !vring_need_event(vring_used_event(&vq->vring),
>> + vq->vring.av...
2014 Oct 15
2
[RFC PATCH net-next 2/6] virtio: introduce virtio_enable_cb_avail()
...>> @@ -567,14 +567,32 @@ unsigned virtqueue_enable_cb_prepare(struct virtqueue *_vq)
>> * entry. Always do both to keep code simple. */
>> vq->vring.avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT;
>> /* Make sure used event never go backwards */
>> - if (!vring_need_event(vring_used_event(&vq->vring),
>> - vq->vring.avail->idx, last_used_idx))
>> + if (vq->vring.avail->idx != vring_used_event(&vq->vring) &&
>> + !vring_need_event(vring_used_event(&vq->vring),
>> + vq->vring.av...
2018 May 03
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
On 2018?05?03? 10:09, Tiwei Bie wrote:
>>>> So how about we use the straightforward way then?
>>> You mean we do new += vq->vring_packed.num instead
>>> of event_idx -= vq->vring_packed.num before calling
>>> vring_need_event()?
>>>
>>> The problem is that, the second param (new_idx) of
>>> vring_need_event() will be used for:
>>>
>>> (__u16)(new_idx - event_idx - 1)
>>> (__u16)(new_idx - old)
>>>
>>> So if we change new, we will need to change o...
2018 May 03
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
On 2018?05?03? 10:09, Tiwei Bie wrote:
>>>> So how about we use the straightforward way then?
>>> You mean we do new += vq->vring_packed.num instead
>>> of event_idx -= vq->vring_packed.num before calling
>>> vring_need_event()?
>>>
>>> The problem is that, the second param (new_idx) of
>>> vring_need_event() will be used for:
>>>
>>> (__u16)(new_idx - event_idx - 1)
>>> (__u16)(new_idx - old)
>>>
>>> So if we change new, we will need to change o...
2017 Oct 27
1
[PATCH] virtio/ringtest: virtio_ring: fix up need_event math
...index bbc3043..5fd3fbc 100644
--- a/tools/virtio/ringtest/virtio_ring_0_9.c
+++ b/tools/virtio/ringtest/virtio_ring_0_9.c
@@ -225,16 +225,18 @@ bool enable_call()
void kick_available(void)
{
+ bool need;
+
/* Flush in previous flags write */
/* Barrier C (for pairing) */
smp_mb();
- if (!vring_need_event(vring_avail_event(&ring),
- guest.avail_idx,
- guest.kicked_avail_idx))
- return;
+ need = vring_need_event(vring_avail_event(&ring),
+ guest.avail_idx,
+ guest.kicked_avail_idx);
guest.kicked_avail_idx = guest.avail_idx;
- kick();
+ if (need)
+ kick();
}...