Re: [Qemu-devel] [PATCH v5 3/6] libvhost-user: Support tracking inflight I/O in shared memory

2019-02-04 Thread Yongji Xie
On Fri, 1 Feb 2019 at 10:28, Jason Wang wrote: > > > On 2019/1/30 下午1:48, Yongji Xie wrote: > > On Wed, 30 Jan 2019 at 10:32, Jason Wang wrote: > >> > >> On 2019/1/22 下午4:31, elohi...@gmail.com wrote: > >>> +static int > >>> +vu_queue_inflight_get(VuDev *dev, VuVirtq *vq, int desc_idx) > >>> +{ >

Re: [Qemu-devel] [PATCH v5 3/6] libvhost-user: Support tracking inflight I/O in shared memory

2019-01-31 Thread Jason Wang
On 2019/1/30 下午1:48, Yongji Xie wrote: On Wed, 30 Jan 2019 at 10:32, Jason Wang wrote: On 2019/1/22 下午4:31, elohi...@gmail.com wrote: +static int +vu_queue_inflight_get(VuDev *dev, VuVirtq *vq, int desc_idx) +{ +if (!has_feature(dev->protocol_features, +VHOST_USER_PROTOCOL_F_INF

Re: [Qemu-devel] [PATCH v5 3/6] libvhost-user: Support tracking inflight I/O in shared memory

2019-01-31 Thread Jason Wang
On 2019/1/30 上午11:58, Yongji Xie wrote: On Wed, 30 Jan 2019 at 10:32, Jason Wang wrote: On 2019/1/22 下午4:31, elohi...@gmail.com wrote: +static int +vu_queue_inflight_get(VuDev *dev, VuVirtq *vq, int desc_idx) +{ +if (!has_feature(dev->protocol_features, +VHOST_USER_PROTOCOL_F_IN

Re: [Qemu-devel] [PATCH v5 3/6] libvhost-user: Support tracking inflight I/O in shared memory

2019-01-30 Thread Jason Wang
On 2019/1/30 上午11:14, Michael S. Tsirkin wrote: On Wed, Jan 30, 2019 at 10:31:49AM +0800, Jason Wang wrote: On 2019/1/22 下午4:31, elohi...@gmail.com wrote: +static int +vu_queue_inflight_get(VuDev *dev, VuVirtq *vq, int desc_idx) +{ +if (!has_feature(dev->protocol_features, +VHOST_

Re: [Qemu-devel] [PATCH v5 3/6] libvhost-user: Support tracking inflight I/O in shared memory

2019-01-29 Thread Yongji Xie
On Wed, 30 Jan 2019 at 10:32, Jason Wang wrote: > > > On 2019/1/22 下午4:31, elohi...@gmail.com wrote: > > +static int > > +vu_queue_inflight_get(VuDev *dev, VuVirtq *vq, int desc_idx) > > +{ > > +if (!has_feature(dev->protocol_features, > > +VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD)) { > >

Re: [Qemu-devel] [PATCH v5 3/6] libvhost-user: Support tracking inflight I/O in shared memory

2019-01-29 Thread Yongji Xie
On Wed, 30 Jan 2019 at 10:32, Jason Wang wrote: > > > On 2019/1/22 下午4:31, elohi...@gmail.com wrote: > > +static int > > +vu_queue_inflight_get(VuDev *dev, VuVirtq *vq, int desc_idx) > > +{ > > +if (!has_feature(dev->protocol_features, > > +VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD)) { > >

Re: [Qemu-devel] [PATCH v5 3/6] libvhost-user: Support tracking inflight I/O in shared memory

2019-01-29 Thread Michael S. Tsirkin
On Wed, Jan 30, 2019 at 10:31:49AM +0800, Jason Wang wrote: > > On 2019/1/22 下午4:31, elohi...@gmail.com wrote: > > +static int > > +vu_queue_inflight_get(VuDev *dev, VuVirtq *vq, int desc_idx) > > +{ > > +if (!has_feature(dev->protocol_features, > > +VHOST_USER_PROTOCOL_F_INFLIGHT_SHMF

Re: [Qemu-devel] [PATCH v5 3/6] libvhost-user: Support tracking inflight I/O in shared memory

2019-01-29 Thread Jason Wang
On 2019/1/22 下午4:31, elohi...@gmail.com wrote: +static int +vu_queue_inflight_get(VuDev *dev, VuVirtq *vq, int desc_idx) +{ +if (!has_feature(dev->protocol_features, +VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD)) { +return 0; +} + +if (unlikely(!vq->inflight)) { +re