search for: vhost_idx_diff

Displaying 20 results from an estimated 33 matches for "vhost_idx_diff".

2018 May 03
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...dded; > > In split ring, old is calculated via: > > old = vq->avail_idx_shadow - vq->num_added; > > In both cases, when vq->num_added is bigger, old will > be a big number. > > Best regards, > Tiwei Bie > How about 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) { ?...
2018 May 03
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...dded; > > In split ring, old is calculated via: > > old = vq->avail_idx_shadow - vq->num_added; > > In both cases, when vq->num_added is bigger, old will > be a big number. > > Best regards, > Tiwei Bie > How about 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) { ?...
2018 May 03
0
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...> old = vq->avail_idx_shadow - vq->num_added; > > > > In both cases, when vq->num_added is bigger, old will > > be a big number. > > > > Best regards, > > Tiwei Bie > > > > How about 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, &g...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...l_idx_shadow - vq->num_added; >>> >>> In both cases, when vq->num_added is bigger, old will >>> be a big number. >>> >>> Best regards, >>> Tiwei Bie >>> >> How about 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, >> ??? ??? ??? ??? ?...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...l_idx_shadow - vq->num_added; >>> >>> In both cases, when vq->num_added is bigger, old will >>> be a big number. >>> >>> Best regards, >>> Tiwei Bie >>> >> How about 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, >> ??? ??? ??? ??? ?...
2018 Mar 26
0
[RFC PATCH V2 8/8] vhost: event suppression for packed ring
...out used index updates. This is paired * with the barrier that the Guest executes when enabling * interrupts. */ @@ -2709,6 +2758,79 @@ 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_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...
2018 Apr 23
2
[RFC V3 PATCH 0/8] Packed ring for vhost
...use ADDR_USED type > > - return error on unexpected unavail descriptor in a chain > > - return false in vhost_ve_avail_empty is descriptor is available > > - track last seen avail_wrap_counter > > - correctly examine available descriptor in get_indirect_packed() > > - vhost_idx_diff should return u16 instead of bool > > > > Changes from V1: > > > > - Refactor vhost used elem code to avoid open coding on used elem > > - Event suppression support (compile test only). > > - Indirect descriptor support (compile test only). > > - Zerocopy...
2018 Apr 23
2
[RFC V3 PATCH 0/8] Packed ring for vhost
...use ADDR_USED type > > - return error on unexpected unavail descriptor in a chain > > - return false in vhost_ve_avail_empty is descriptor is available > > - track last seen avail_wrap_counter > > - correctly examine available descriptor in get_indirect_packed() > > - vhost_idx_diff should return u16 instead of bool > > > > Changes from V1: > > > > - Refactor vhost used elem code to avoid open coding on used elem > > - Event suppression support (compile test only). > > - Indirect descriptor support (compile test only). > > - Zerocopy...
2018 May 21
1
[RFC V4 PATCH 0/8] Packed ring layout for vhost
...hould use ADDR_USED type >> - return error on unexpected unavail descriptor in a chain >> - return false in vhost_ve_avail_empty is descriptor is available >> - track last seen avail_wrap_counter >> - correctly examine available descriptor in get_indirect_packed() >> - vhost_idx_diff should return u16 instead of bool >> >> Changes from V1: >> >> - Refactor vhost used elem code to avoid open coding on used elem >> - Event suppression support (compile test only). >> - Indirect descriptor support (compile test only). >> - Zerocopy support....
2018 Jul 16
3
[PATCH net-next V2 0/8] Packed virtqueue support for vhost
...hould use ADDR_USED type >> - return error on unexpected unavail descriptor in a chain >> - return false in vhost_ve_avail_empty is descriptor is available >> - track last seen avail_wrap_counter >> - correctly examine available descriptor in get_indirect_packed() >> - vhost_idx_diff should return u16 instead of bool >> >> Changes from RFC V1: >> >> - Refactor vhost used elem code to avoid open coding on used elem >> - Event suppression support (compile test only). >> - Indirect descriptor support (compile test only). >> - Zerocopy supp...
2018 Jul 16
3
[PATCH net-next V2 0/8] Packed virtqueue support for vhost
...hould use ADDR_USED type >> - return error on unexpected unavail descriptor in a chain >> - return false in vhost_ve_avail_empty is descriptor is available >> - track last seen avail_wrap_counter >> - correctly examine available descriptor in get_indirect_packed() >> - vhost_idx_diff should return u16 instead of bool >> >> Changes from RFC V1: >> >> - Refactor vhost used elem code to avoid open coding on used elem >> - Event suppression support (compile test only). >> - Indirect descriptor support (compile test only). >> - Zerocopy supp...
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 Apr 23
0
[RFC V3 PATCH 0/8] Packed ring for vhost
...ice flags updating should use ADDR_USED type > - return error on unexpected unavail descriptor in a chain > - return false in vhost_ve_avail_empty is descriptor is available > - track last seen avail_wrap_counter > - correctly examine available descriptor in get_indirect_packed() > - vhost_idx_diff should return u16 instead of bool > > Changes from V1: > > - Refactor vhost used elem code to avoid open coding on used elem > - Event suppression support (compile test only). > - Indirect descriptor support (compile test only). > - Zerocopy support. > - vIOMMU support. &g...
2018 Apr 23
0
[RFC V3 PATCH 0/8] Packed ring for vhost
...> > - return error on unexpected unavail descriptor in a chain > > > - return false in vhost_ve_avail_empty is descriptor is available > > > - track last seen avail_wrap_counter > > > - correctly examine available descriptor in get_indirect_packed() > > > - vhost_idx_diff should return u16 instead of bool > > > > > > Changes from V1: > > > > > > - Refactor vhost used elem code to avoid open coding on used elem > > > - Event suppression support (compile test only). > > > - Indirect descriptor support (compile te...
2018 May 20
0
[RFC V4 PATCH 0/8] Packed ring layout for vhost
...ice flags updating should use ADDR_USED type > - return error on unexpected unavail descriptor in a chain > - return false in vhost_ve_avail_empty is descriptor is available > - track last seen avail_wrap_counter > - correctly examine available descriptor in get_indirect_packed() > - vhost_idx_diff should return u16 instead of bool > > Changes from V1: > > - Refactor vhost used elem code to avoid open coding on used elem > - Event suppression support (compile test only). > - Indirect descriptor support (compile test only). > - Zerocopy support. > - vIOMMU support. &g...
2018 Jul 16
0
[PATCH net-next V2 0/8] Packed virtqueue support for vhost
...ice flags updating should use ADDR_USED type > - return error on unexpected unavail descriptor in a chain > - return false in vhost_ve_avail_empty is descriptor is available > - track last seen avail_wrap_counter > - correctly examine available descriptor in get_indirect_packed() > - vhost_idx_diff should return u16 instead of bool > > Changes from RFC V1: > > - Refactor vhost used elem code to avoid open coding on used elem > - Event suppression support (compile test only). > - Indirect descriptor support (compile test only). > - Zerocopy support. > - vIOMMU support...
2019 Jul 17
0
[PATCH V3 00/15] Packed virtqueue support for vhost
...ice flags updating should use ADDR_USED type > - return error on unexpected unavail descriptor in a chain > - return false in vhost_ve_avail_empty is descriptor is available > - track last seen avail_wrap_counter > - correctly examine available descriptor in get_indirect_packed() > - vhost_idx_diff should return u16 instead of bool > > Changes from RFC V1: > - Refactor vhost used elem code to avoid open coding on used elem > - Event suppression support (compile test only). > - Indirect descriptor support (compile test only). > - Zerocopy support. > - vIOMMU support. >...
2018 Jul 16
0
[PATCH net-next V2 0/8] Packed virtqueue support for vhost
...> > - return error on unexpected unavail descriptor in a chain > > > - return false in vhost_ve_avail_empty is descriptor is available > > > - track last seen avail_wrap_counter > > > - correctly examine available descriptor in get_indirect_packed() > > > - vhost_idx_diff should return u16 instead of bool > > > > > > Changes from RFC V1: > > > > > > - Refactor vhost used elem code to avoid open coding on used elem > > > - Event suppression support (compile test only). > > > - Indirect descriptor support (compil...
2018 Jul 17
1
[PATCH net-next V2 0/8] Packed virtqueue support for vhost
...; - return error on unexpected unavail descriptor in a chain >>>> - return false in vhost_ve_avail_empty is descriptor is available >>>> - track last seen avail_wrap_counter >>>> - correctly examine available descriptor in get_indirect_packed() >>>> - vhost_idx_diff should return u16 instead of bool >>>> >>>> Changes from RFC V1: >>>> >>>> - Refactor vhost used elem code to avoid open coding on used elem >>>> - Event suppression support (compile test only). >>>> - Indirect descriptor suppo...