Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-15 Thread Tiwei Bie
On Wed, May 16, 2018 at 01:01:04PM +0800, Jason Wang wrote: > On 2018年04月25日 13:15, Tiwei Bie wrote: [...] > > @@ -1143,10 +1160,17 @@ static unsigned > > virtqueue_enable_cb_prepare_packed(struct virtqueue *_vq) > > /* We optimistically turn back on interrupts, then check if there was > >

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-15 Thread Tiwei Bie
On Wed, May 16, 2018 at 01:01:04PM +0800, Jason Wang wrote: > On 2018年04月25日 13:15, Tiwei Bie wrote: [...] > > @@ -1143,10 +1160,17 @@ static unsigned > > virtqueue_enable_cb_prepare_packed(struct virtqueue *_vq) > > /* We optimistically turn back on interrupts, then check if there was > >

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-15 Thread Jason Wang
On 2018年04月25日 13:15, Tiwei Bie wrote: This commit introduces the event idx support in packed ring. This feature is temporarily disabled, because the implementation in this patch may not work as expected, and some further discussions on the implementation are needed, e.g. do we have to check

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-15 Thread Jason Wang
On 2018年04月25日 13:15, Tiwei Bie wrote: This commit introduces the event idx support in packed ring. This feature is temporarily disabled, because the implementation in this patch may not work as expected, and some further discussions on the implementation are needed, e.g. do we have to check

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-08 Thread Jason Wang
On 2018年05月08日 17:44, Tiwei Bie wrote: On Tue, May 08, 2018 at 05:34:40PM +0800, Jason Wang wrote: On 2018年05月08日 17:16, Tiwei Bie wrote: On Tue, May 08, 2018 at 03:16:53PM +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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-08 Thread Jason Wang
On 2018年05月08日 17:44, Tiwei Bie wrote: On Tue, May 08, 2018 at 05:34:40PM +0800, Jason Wang wrote: On 2018年05月08日 17:16, Tiwei Bie wrote: On Tue, May 08, 2018 at 03:16:53PM +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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-08 Thread Tiwei Bie
On Tue, May 08, 2018 at 05:34:40PM +0800, Jason Wang wrote: > On 2018年05月08日 17:16, Tiwei Bie wrote: > > On Tue, May 08, 2018 at 03:16:53PM +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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-08 Thread Tiwei Bie
On Tue, May 08, 2018 at 05:34:40PM +0800, Jason Wang wrote: > On 2018年05月08日 17:16, Tiwei Bie wrote: > > On Tue, May 08, 2018 at 03:16:53PM +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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-08 Thread Jason Wang
On 2018年05月08日 17:16, Tiwei Bie wrote: On Tue, May 08, 2018 at 03:16:53PM +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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-08 Thread Jason Wang
On 2018年05月08日 17:16, Tiwei Bie wrote: On Tue, May 08, 2018 at 03:16:53PM +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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-08 Thread Tiwei Bie
On Tue, May 08, 2018 at 03:16:53PM +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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-08 Thread Tiwei Bie
On Tue, May 08, 2018 at 03:16:53PM +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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-08 Thread Jason Wang
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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-08 Thread Jason Wang
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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-08 Thread Tiwei Bie
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 >

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-08 Thread Tiwei Bie
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 >

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-07 Thread Jason Wang
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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-07 Thread Jason Wang
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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-07 Thread Jason Wang
On 2018年05月03日 21:54, Tiwei Bie wrote: On Thu, May 03, 2018 at 03:25:29PM +0800, Jason Wang wrote: 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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-07 Thread Jason Wang
On 2018年05月03日 21:54, Tiwei Bie wrote: On Thu, May 03, 2018 at 03:25:29PM +0800, Jason Wang wrote: 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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-03 Thread Tiwei Bie
On Thu, May 03, 2018 at 03:25:29PM +0800, Jason Wang wrote: > 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 > > > >

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-03 Thread Tiwei Bie
On Thu, May 03, 2018 at 03:25:29PM +0800, Jason Wang wrote: > 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 > > > >

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-03 Thread Jason Wang
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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-03 Thread Jason Wang
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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Tiwei Bie
On Thu, May 03, 2018 at 04:44:39AM +0300, Michael S. Tsirkin wrote: > 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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Tiwei Bie
On Thu, May 03, 2018 at 04:44:39AM +0300, Michael S. Tsirkin wrote: > 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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Michael S. Tsirkin
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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Michael S. Tsirkin
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

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Tiwei Bie
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 02, 2018 at

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Tiwei Bie
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 02, 2018 at

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Michael S. Tsirkin
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 02, 2018 at 10:51:06AM +0800, Jason Wang wrote: > > > > On 2018年04月25日 13:15, Tiwei Bie

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Michael S. Tsirkin
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 02, 2018 at 10:51:06AM +0800, Jason Wang wrote: > > > > On 2018年04月25日 13:15, Tiwei Bie

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Tiwei Bie
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 02, 2018 at 10:51:06AM +0800, Jason Wang wrote: > > > On 2018年04月25日 13:15, Tiwei Bie wrote: > > > > This commit introduces the event idx support in

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Tiwei Bie
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 02, 2018 at 10:51:06AM +0800, Jason Wang wrote: > > > On 2018年04月25日 13:15, Tiwei Bie wrote: > > > > This commit introduces the event idx support in

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 03:28:19PM +0800, Tiwei Bie wrote: > On Wed, May 02, 2018 at 10:51:06AM +0800, Jason Wang wrote: > > On 2018年04月25日 13:15, Tiwei Bie wrote: > > > This commit introduces the event idx support in packed > > > ring. This feature is temporarily disabled, because the > > >

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Michael S. Tsirkin
On Wed, May 02, 2018 at 03:28:19PM +0800, Tiwei Bie wrote: > On Wed, May 02, 2018 at 10:51:06AM +0800, Jason Wang wrote: > > On 2018年04月25日 13:15, Tiwei Bie wrote: > > > This commit introduces the event idx support in packed > > > ring. This feature is temporarily disabled, because the > > >

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Tiwei Bie
On Wed, May 02, 2018 at 10:51:06AM +0800, Jason Wang wrote: > On 2018年04月25日 13:15, Tiwei Bie wrote: > > This commit introduces the event idx support in packed > > ring. This feature is temporarily disabled, because the > > implementation in this patch may not work as expected, > > and some

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-02 Thread Tiwei Bie
On Wed, May 02, 2018 at 10:51:06AM +0800, Jason Wang wrote: > On 2018年04月25日 13:15, Tiwei Bie wrote: > > This commit introduces the event idx support in packed > > ring. This feature is temporarily disabled, because the > > implementation in this patch may not work as expected, > > and some

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-01 Thread Jason Wang
On 2018年04月25日 13:15, Tiwei Bie wrote: This commit introduces the event idx support in packed ring. This feature is temporarily disabled, because the implementation in this patch may not work as expected, and some further discussions on the implementation are needed, e.g. do we have to check

Re: [RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-05-01 Thread Jason Wang
On 2018年04月25日 13:15, Tiwei Bie wrote: This commit introduces the event idx support in packed ring. This feature is temporarily disabled, because the implementation in this patch may not work as expected, and some further discussions on the implementation are needed, e.g. do we have to check

[RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-04-24 Thread Tiwei Bie
This commit introduces the event idx support in packed ring. This feature is temporarily disabled, because the implementation in this patch may not work as expected, and some further discussions on the implementation are needed, e.g. do we have to check the wrap counter when checking whether a

[RFC v3 4/5] virtio_ring: add event idx support in packed ring

2018-04-24 Thread Tiwei Bie
This commit introduces the event idx support in packed ring. This feature is temporarily disabled, because the implementation in this patch may not work as expected, and some further discussions on the implementation are needed, e.g. do we have to check the wrap counter when checking whether a