Displaying 20 results from an estimated 37 matches for "event_off".
2018 May 03
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...out just do something like vhost:
static u16 vhost_idx_diff(struct vhost_virtqueue *vq, u16 old, u16 new)
{
??? if (new > old)
??? ??? return new - old;
??? return? (new + vq->num - old);
}
static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq,
??? ??? ??? ??? ??? ? __u16 event_off, __u16 new,
??? ??? ??? ??? ??? ? __u16 old)
{
??? return (__u16)(vhost_idx_diff(vq, new, event_off) - 1) <
??? ?????? (__u16)vhost_idx_diff(vq, new, old);
}
?
2018 May 03
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...out just do something like vhost:
static u16 vhost_idx_diff(struct vhost_virtqueue *vq, u16 old, u16 new)
{
??? if (new > old)
??? ??? return new - old;
??? return? (new + vq->num - old);
}
static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq,
??? ??? ??? ??? ??? ? __u16 event_off, __u16 new,
??? ??? ??? ??? ??? ? __u16 old)
{
??? return (__u16)(vhost_idx_diff(vq, new, event_off) - 1) <
??? ?????? (__u16)vhost_idx_diff(vq, new, old);
}
?
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...st_virtqueue *vq, u16 old, u16 new)
>> {
>> ??? if (new > old)
>> ??? ??? return new - old;
>> ??? return? (new + vq->num - old);
>> }
>>
>> static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq,
>> ??? ??? ??? ??? ??? ? __u16 event_off, __u16 new,
>> ??? ??? ??? ??? ??? ? __u16 old)
>> {
>> ??? return (__u16)(vhost_idx_diff(vq, new, event_off) - 1) <
>> ??? ?????? (__u16)vhost_idx_diff(vq, new, old);
>> }
>>
>> ?
> It seems that there is a typo in above code. The second
> para...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...st_virtqueue *vq, u16 old, u16 new)
>> {
>> ??? if (new > old)
>> ??? ??? return new - old;
>> ??? return? (new + vq->num - old);
>> }
>>
>> static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq,
>> ??? ??? ??? ??? ??? ? __u16 event_off, __u16 new,
>> ??? ??? ??? ??? ??? ? __u16 old)
>> {
>> ??? return (__u16)(vhost_idx_diff(vq, new, event_off) - 1) <
>> ??? ?????? (__u16)vhost_idx_diff(vq, new, old);
>> }
>>
>> ?
> It seems that there is a typo in above code. The second
> para...
2018 May 03
0
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...tatic u16 vhost_idx_diff(struct vhost_virtqueue *vq, u16 old, u16 new)
> {
> ??? if (new > old)
> ??? ??? return new - old;
> ??? return? (new + vq->num - old);
> }
>
> static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq,
> ??? ??? ??? ??? ??? ? __u16 event_off, __u16 new,
> ??? ??? ??? ??? ??? ? __u16 old)
> {
> ??? return (__u16)(vhost_idx_diff(vq, new, event_off) - 1) <
> ??? ?????? (__u16)vhost_idx_diff(vq, new, old);
> }
>
> ?
It seems that there is a typo in above code. The second
param of vhost_idx_diff() is `old`, but whe...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
On Tue, May 08, 2018 at 01:40:40PM +0800, Jason Wang wrote:
> On 2018?05?08? 11:05, Jason Wang wrote:
> > >
> > > Because in virtqueue_enable_cb_delayed(), we may set an
> > > event_off which is bigger than new and both of them have
> > > wrapped. And in this case, although new is smaller than
> > > event_off (i.e. the third param -- old), new shouldn't
> > > add vq->num, and actually we are expecting a very big
> > > idx diff.
> >...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
On Tue, May 08, 2018 at 01:40:40PM +0800, Jason Wang wrote:
> On 2018?05?08? 11:05, Jason Wang wrote:
> > >
> > > Because in virtqueue_enable_cb_delayed(), we may set an
> > > event_off which is bigger than new and both of them have
> > > wrapped. And in this case, although new is smaller than
> > > event_off (i.e. the third param -- old), new shouldn't
> > > add vq->num, and actually we are expecting a very big
> > > idx diff.
> >...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...+0800, Jason Wang wrote:
> On 2018?05?08? 14:44, Tiwei Bie wrote:
> > On Tue, May 08, 2018 at 01:40:40PM +0800, Jason Wang wrote:
> > > On 2018?05?08? 11:05, Jason Wang wrote:
> > > > > Because in virtqueue_enable_cb_delayed(), we may set an
> > > > > event_off which is bigger than new and both of them have
> > > > > wrapped. And in this case, although new is smaller than
> > > > > event_off (i.e. the third param -- old), new shouldn't
> > > > > add vq->num, and actually we are expecting a very big
>...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...+0800, Jason Wang wrote:
> On 2018?05?08? 14:44, Tiwei Bie wrote:
> > On Tue, May 08, 2018 at 01:40:40PM +0800, Jason Wang wrote:
> > > On 2018?05?08? 11:05, Jason Wang wrote:
> > > > > Because in virtqueue_enable_cb_delayed(), we may set an
> > > > > event_off which is bigger than new and both of them have
> > > > > wrapped. And in this case, although new is smaller than
> > > > > event_off (i.e. the third param -- old), new shouldn't
> > > > > add vq->num, and actually we are expecting a very big
>...
2018 May 08
1
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...?08? 14:44, Tiwei Bie wrote:
> > > > On Tue, May 08, 2018 at 01:40:40PM +0800, Jason Wang wrote:
> > > > > On 2018?05?08? 11:05, Jason Wang wrote:
> > > > > > > Because in virtqueue_enable_cb_delayed(), we may set an
> > > > > > > event_off which is bigger than new and both of them have
> > > > > > > wrapped. And in this case, although new is smaller than
> > > > > > > event_off (i.e. the third param -- old), new shouldn't
> > > > > > > add vq->num, and actually we...
2018 May 08
0
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
On 2018?05?08? 11:05, Jason Wang wrote:
>>
>> Because in virtqueue_enable_cb_delayed(), we may set an
>> event_off which is bigger than new and both of them have
>> wrapped. And in this case, although new is smaller than
>> event_off (i.e. the third param -- old), new shouldn't
>> add vq->num, and actually we are expecting a very big
>> idx diff.
>
> Yes, so to calculate dis...
2018 May 08
0
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
On 2018?05?08? 14:44, Tiwei Bie wrote:
> On Tue, May 08, 2018 at 01:40:40PM +0800, Jason Wang wrote:
>> On 2018?05?08? 11:05, Jason Wang wrote:
>>>> Because in virtqueue_enable_cb_delayed(), we may set an
>>>> event_off which is bigger than new and both of them have
>>>> wrapped. And in this case, although new is smaller than
>>>> event_off (i.e. the third param -- old), new shouldn't
>>>> add vq->num, and actually we are expecting a very big
>>>> idx diff.
&g...
2018 Mar 26
0
[RFC PATCH V2 8/8] vhost: event suppression for packed ring
...g_need_event(vhost16_to_cpu(vq, event), new, old);
}
+static bool vhost_idx_diff(struct vhost_virtqueue *vq, u16 old, u16 new)
+{
+ if (new > old)
+ return new - old;
+ return (new + vq->num - old);
+}
+
+static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq,
+ __u16 event_off, __u16 new,
+ __u16 old)
+{
+ return (__u16)(vhost_idx_diff(vq, new, event_off) - 1) <
+ (__u16)vhost_idx_diff(vq, new, old);
+}
+
+static bool vhost_notify_packed(struct vhost_dev *dev,
+ struct vhost_virtqueue *vq)
+{
+ __virtio16 event_off_wrap, event_flags;
+ __u16 old, new;...
2018 May 08
0
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...son Wang wrote:
>> On 2018?05?08? 14:44, Tiwei Bie wrote:
>>> On Tue, May 08, 2018 at 01:40:40PM +0800, Jason Wang wrote:
>>>> On 2018?05?08? 11:05, Jason Wang wrote:
>>>>>> Because in virtqueue_enable_cb_delayed(), we may set an
>>>>>> event_off which is bigger than new and both of them have
>>>>>> wrapped. And in this case, although new is smaller than
>>>>>> event_off (i.e. the third param -- old), new shouldn't
>>>>>> add vq->num, and actually we are expecting a very big
>&...
2018 Mar 30
1
[RFC PATCH V2 8/8] vhost: event suppression for packed ring
...support for event suppression aka driver
> and device area. Compile tested only.
>
> Signed-off-by: Jason Wang <jasowang at redhat.com>
> ---
[...]
> +
> +static bool vhost_notify_packed(struct vhost_dev *dev,
> + struct vhost_virtqueue *vq)
> +{
> + __virtio16 event_off_wrap, event_flags;
> + __u16 old, new;
> + bool v, wrap;
> + int off;
> +
> + /* Flush out used descriptors updates. This is paired
> + * with the barrier that the Guest executes when enabling
> + * interrupts.
> + */
> + smp_mb();
> +
> + if (vhost_get_avail(vq,...
2018 May 03
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
On Thu, May 03, 2018 at 09:11:16AM +0800, Tiwei Bie wrote:
> On Wed, May 02, 2018 at 06:42:57PM +0300, Michael S. Tsirkin wrote:
> > On Wed, May 02, 2018 at 11:12:55PM +0800, Tiwei Bie wrote:
> > > On Wed, May 02, 2018 at 04:51:01PM +0300, Michael S. Tsirkin wrote:
> > > > On Wed, May 02, 2018 at 03:28:19PM +0800, Tiwei Bie wrote:
> > > > > On Wed, May
2018 May 03
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
On Thu, May 03, 2018 at 09:11:16AM +0800, Tiwei Bie wrote:
> On Wed, May 02, 2018 at 06:42:57PM +0300, Michael S. Tsirkin wrote:
> > On Wed, May 02, 2018 at 11:12:55PM +0800, Tiwei Bie wrote:
> > > On Wed, May 02, 2018 at 04:51:01PM +0300, Michael S. Tsirkin wrote:
> > > > On Wed, May 02, 2018 at 03:28:19PM +0800, Tiwei Bie wrote:
> > > > > On Wed, May
2018 May 16
0
[RFC V4 PATCH 8/8] vhost: event suppression for packed ring
...+
+ if (new < old) {
+ new += vq->num;
+ wrap ^= 1;
+ }
+
+ if (wrap != off_wrap >> 15)
+ off += vq->num;
+
+ return vring_need_event(off, new, old);
+}
+
+static bool vhost_notify_packed(struct vhost_dev *dev,
+ struct vhost_virtqueue *vq)
+{
+ __virtio16 event_off_wrap, event_flags;
+ __u16 old, new, off_wrap;
+ bool v;
+
+ /* Flush out used descriptors updates. This is paired
+ * with the barrier that the Guest executes when enabling
+ * interrupts.
+ */
+ smp_mb();
+
+ if (vhost_get_avail(vq, event_flags,
+ &vq->driver_event->flags) <...
2018 Jul 03
0
[PATCH net-next 8/8] vhost: event suppression for packed ring
...abling
* interrupts. */
@@ -2798,6 +2868,64 @@ static bool vhost_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq)
return vring_need_event(vhost16_to_cpu(vq, event), new, old);
}
+static bool vhost_notify_packed(struct vhost_dev *dev,
+ struct vhost_virtqueue *vq)
+{
+ __virtio16 event_off_wrap, event_flags;
+ __u16 old, new, off_wrap;
+ bool v;
+
+ /* Flush out used descriptors updates. This is paired
+ * with the barrier that the Guest executes when enabling
+ * interrupts.
+ */
+ smp_mb();
+
+ if (vhost_get_avail(vq, event_flags,
+ &vq->driver_event->flags) <...
2018 May 29
0
[RFC V5 PATCH 8/8] vhost: event suppression for packed ring
...abling
* interrupts. */
@@ -2725,6 +2795,64 @@ static bool vhost_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq)
return vring_need_event(vhost16_to_cpu(vq, event), new, old);
}
+static bool vhost_notify_packed(struct vhost_dev *dev,
+ struct vhost_virtqueue *vq)
+{
+ __virtio16 event_off_wrap, event_flags;
+ __u16 old, new, off_wrap;
+ bool v;
+
+ /* Flush out used descriptors updates. This is paired
+ * with the barrier that the Guest executes when enabling
+ * interrupts.
+ */
+ smp_mb();
+
+ if (vhost_get_avail(vq, event_flags,
+ &vq->driver_event->flags) <...