search for: vhost_vq_more_avail

Displaying 20 results from an estimated 24 matches for "vhost_vq_more_avail".

2015 Dec 01
0
[PATCH net-next 2/3] vhost: introduce vhost_vq_more_avail()
...c >> index 163b365..b86c5aa 100644 >> --- a/drivers/vhost/vhost.c >> +++ b/drivers/vhost/vhost.c >> @@ -1633,10 +1633,25 @@ void vhost_add_used_and_signal_n(struct vhost_dev *dev, >> } >> EXPORT_SYMBOL_GPL(vhost_add_used_and_signal_n); >> >> +bool vhost_vq_more_avail(struct vhost_dev *dev, struct vhost_virtqueue *vq) >> +{ >> + __virtio16 avail_idx; >> + int r; >> + >> + r = __get_user(avail_idx, &vq->avail->idx); >> + if (r) { >> + vq_err(vq, "Failed to check avail idx at %p: %d\n", >> +...
2015 Dec 01
0
[PATCH net-next 2/3] vhost: introduce vhost_vq_more_avail()
...c >> index 163b365..b86c5aa 100644 >> --- a/drivers/vhost/vhost.c >> +++ b/drivers/vhost/vhost.c >> @@ -1633,10 +1633,25 @@ void vhost_add_used_and_signal_n(struct vhost_dev *dev, >> } >> EXPORT_SYMBOL_GPL(vhost_add_used_and_signal_n); >> >> +bool vhost_vq_more_avail(struct vhost_dev *dev, struct vhost_virtqueue *vq) >> +{ >> + __virtio16 avail_idx; >> + int r; >> + >> + r = __get_user(avail_idx, &vq->avail->idx); >> + if (r) { >> + vq_err(vq, "Failed to check avail idx at %p: %d\n", >> +...
2016 Jan 20
1
[PATCH V2 2/3] vhost: introduce vhost_vq_more_avail()
...st/vhost.c b/drivers/vhost/vhost.c > index 163b365..4f45a03 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -1633,6 +1633,19 @@ void vhost_add_used_and_signal_n(struct vhost_dev *dev, > } > EXPORT_SYMBOL_GPL(vhost_add_used_and_signal_n); > > +bool vhost_vq_more_avail(struct vhost_dev *dev, struct vhost_virtqueue *vq) > +{ > + __virtio16 avail_idx; > + int r; > + > + r = __get_user(avail_idx, &vq->avail->idx); > + if (r) > + return false; So the result is that if the page is not present, you return false (empty ring) and the call...
2016 Jan 20
1
[PATCH V2 2/3] vhost: introduce vhost_vq_more_avail()
...st/vhost.c b/drivers/vhost/vhost.c > index 163b365..4f45a03 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -1633,6 +1633,19 @@ void vhost_add_used_and_signal_n(struct vhost_dev *dev, > } > EXPORT_SYMBOL_GPL(vhost_add_used_and_signal_n); > > +bool vhost_vq_more_avail(struct vhost_dev *dev, struct vhost_virtqueue *vq) > +{ > + __virtio16 avail_idx; > + int r; > + > + r = __get_user(avail_idx, &vq->avail->idx); > + if (r) > + return false; So the result is that if the page is not present, you return false (empty ring) and the call...
2015 Dec 01
0
[PATCH V2 2/3] vhost: introduce vhost_vq_more_avail()
...insertions(+) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 163b365..4f45a03 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1633,6 +1633,19 @@ void vhost_add_used_and_signal_n(struct vhost_dev *dev, } EXPORT_SYMBOL_GPL(vhost_add_used_and_signal_n); +bool vhost_vq_more_avail(struct vhost_dev *dev, struct vhost_virtqueue *vq) +{ + __virtio16 avail_idx; + int r; + + r = __get_user(avail_idx, &vq->avail->idx); + if (r) + return false; + + return vhost16_to_cpu(vq, avail_idx) != vq->avail_idx; +} +EXPORT_SYMBOL_GPL(vhost_vq_more_avail); + /* OK, now we need...
2015 Dec 01
5
[PATCH V2 0/3] basic busy polling support for vhost_net
.../ 16384/+0.00%/ Guest RX: size /-+% / 1 /-5.11%/ 64 /-0.55%/ 256 /-2.35%/ 512 /-3.39%/ 1024 /+6.8% / 4096 /-0.01%/ 16384/+0.00%/ TCP_RR: size /-+% / 1 /+9.79% / 64 /+4.51% / 256 /+6.47% / 512 /-3.37% / 1024 /+6.15% / 4096 /+14.88%/ 16384/-2.23% / Changes from V1: - Remove the buggy vq_error() in vhost_vq_more_avail(). - Leave vhost_enable_notify() untouched. Changes from RFC V3: - small tweak on the code to avoid multiple duplicate conditions in critical path when busy loop is not enabled. - Add the test result of multiple VMs Changes from RFC V2: - poll also at the end of rx handling - factor out the polli...
2015 Dec 01
5
[PATCH V2 0/3] basic busy polling support for vhost_net
.../ 16384/+0.00%/ Guest RX: size /-+% / 1 /-5.11%/ 64 /-0.55%/ 256 /-2.35%/ 512 /-3.39%/ 1024 /+6.8% / 4096 /-0.01%/ 16384/+0.00%/ TCP_RR: size /-+% / 1 /+9.79% / 64 /+4.51% / 256 /+6.47% / 512 /-3.37% / 1024 /+6.15% / 4096 /+14.88%/ 16384/-2.23% / Changes from V1: - Remove the buggy vq_error() in vhost_vq_more_avail(). - Leave vhost_enable_notify() untouched. Changes from RFC V3: - small tweak on the code to avoid multiple duplicate conditions in critical path when busy loop is not enabled. - Add the test result of multiple VMs Changes from RFC V2: - poll also at the end of rx handling - factor out the polli...
2015 Nov 12
5
[PATCH net-next RFC V3 0/3] basic busy polling support for vhost_net
...tion for busyloop_timeout - Split out the busy polling logic into a new helper - Check and exit the loop when there's a pending signal - Disable preemption during busy looping to make sure lock_clock() was correctly used. Jason Wang (3): vhost: introduce vhost_has_work() vhost: introduce vhost_vq_more_avail() vhost_net: basic polling support drivers/vhost/net.c | 77 +++++++++++++++++++++++++++++++++++++++++++--- drivers/vhost/vhost.c | 48 +++++++++++++++++++++++------ drivers/vhost/vhost.h | 3 ++ include/uapi/linux/vhost.h | 11 +++++++ 4 files changed, 125 insertions(+), 14 d...
2015 Nov 12
5
[PATCH net-next RFC V3 0/3] basic busy polling support for vhost_net
...tion for busyloop_timeout - Split out the busy polling logic into a new helper - Check and exit the loop when there's a pending signal - Disable preemption during busy looping to make sure lock_clock() was correctly used. Jason Wang (3): vhost: introduce vhost_has_work() vhost: introduce vhost_vq_more_avail() vhost_net: basic polling support drivers/vhost/net.c | 77 +++++++++++++++++++++++++++++++++++++++++++--- drivers/vhost/vhost.c | 48 +++++++++++++++++++++++------ drivers/vhost/vhost.h | 3 ++ include/uapi/linux/vhost.h | 11 +++++++ 4 files changed, 125 insertions(+), 14 d...
2016 Jan 20
3
[PATCH V2 3/3] vhost_net: basic polling support
...ut_num, unsigned int *in_num) > +{ > + unsigned long uninitialized_var(endtime); > + > + if (vq->busyloop_timeout) { > + preempt_disable(); > + endtime = busy_clock() + vq->busyloop_timeout; > + while (vhost_can_busy_poll(vq->dev, endtime) && > + !vhost_vq_more_avail(vq->dev, vq)) > + cpu_relax(); > + preempt_enable(); > + } Isn't there a way to call all this after vhost_get_vq_desc? First, this will reduce the good path overhead as you won't have to play with timers and preemption. Second, this will reduce the chance of a pagefault on...
2016 Jan 20
3
[PATCH V2 3/3] vhost_net: basic polling support
...ut_num, unsigned int *in_num) > +{ > + unsigned long uninitialized_var(endtime); > + > + if (vq->busyloop_timeout) { > + preempt_disable(); > + endtime = busy_clock() + vq->busyloop_timeout; > + while (vhost_can_busy_poll(vq->dev, endtime) && > + !vhost_vq_more_avail(vq->dev, vq)) > + cpu_relax(); > + preempt_enable(); > + } Isn't there a way to call all this after vhost_get_vq_desc? First, this will reduce the good path overhead as you won't have to play with timers and preemption. Second, this will reduce the chance of a pagefault on...
2016 Jan 21
1
[PATCH V2 3/3] vhost_net: basic polling support
...igned long uninitialized_var(endtime); > >>+ > >>+ if (vq->busyloop_timeout) { > >>+ preempt_disable(); > >>+ endtime = busy_clock() + vq->busyloop_timeout; > >>+ while (vhost_can_busy_poll(vq->dev, endtime) && > >>+ !vhost_vq_more_avail(vq->dev, vq)) > >>+ cpu_relax(); > >>+ preempt_enable(); > >>+ } > > > >Isn't there a way to call all this after vhost_get_vq_desc? > >First, this will reduce the good path overhead as you > >won't have to play with timers and preempt...
2016 Jan 21
1
[PATCH V2 3/3] vhost_net: basic polling support
...igned long uninitialized_var(endtime); > >>+ > >>+ if (vq->busyloop_timeout) { > >>+ preempt_disable(); > >>+ endtime = busy_clock() + vq->busyloop_timeout; > >>+ while (vhost_can_busy_poll(vq->dev, endtime) && > >>+ !vhost_vq_more_avail(vq->dev, vq)) > >>+ cpu_relax(); > >>+ preempt_enable(); > >>+ } > > > >Isn't there a way to call all this after vhost_get_vq_desc? > >First, this will reduce the good path overhead as you > >won't have to play with timers and preempt...
2016 Mar 04
6
[PATCH V4 0/3] basic busy polling support for vhost_net
...%/ 0%/ -1%/ -3%/ +32% 65535/ 1/ +1%/ 0%/ +2%/ 0%/ +66% 65535/ 4/ -1%/ -1%/ 0%/ +4%/ +492% 65535/ 8/ 0%/ -1%/ -1%/ +4%/ +38% Changes from V3: - drop single_task_running() - use cpu_relax_lowlatency() instead of cpu_relax() Changes from V2: - rename vhost_vq_more_avail() to vhost_vq_avail_empty(). And return false we __get_user() fails. - do not bother premmptions/timers for good path. - use vhost_vring_state as ioctl parameter instead of reinveting a new one. - add the unit of timeout (us) to the comment of new added ioctls Changes from V1: - remove the buggy v...
2016 Mar 04
6
[PATCH V4 0/3] basic busy polling support for vhost_net
...%/ 0%/ -1%/ -3%/ +32% 65535/ 1/ +1%/ 0%/ +2%/ 0%/ +66% 65535/ 4/ -1%/ -1%/ 0%/ +4%/ +492% 65535/ 8/ 0%/ -1%/ -1%/ +4%/ +38% Changes from V3: - drop single_task_running() - use cpu_relax_lowlatency() instead of cpu_relax() Changes from V2: - rename vhost_vq_more_avail() to vhost_vq_avail_empty(). And return false we __get_user() fails. - do not bother premmptions/timers for good path. - use vhost_vring_state as ioctl parameter instead of reinveting a new one. - add the unit of timeout (us) to the comment of new added ioctls Changes from V1: - remove the buggy v...
2016 Jan 21
0
[PATCH V2 3/3] vhost_net: basic polling support
...t;> +{ >> + unsigned long uninitialized_var(endtime); >> + >> + if (vq->busyloop_timeout) { >> + preempt_disable(); >> + endtime = busy_clock() + vq->busyloop_timeout; >> + while (vhost_can_busy_poll(vq->dev, endtime) && >> + !vhost_vq_more_avail(vq->dev, vq)) >> + cpu_relax(); >> + preempt_enable(); >> + } > > Isn't there a way to call all this after vhost_get_vq_desc? > First, this will reduce the good path overhead as you > won't have to play with timers and preemption. > > Second, this w...
2016 Mar 09
0
[PATCH V4 0/3] basic busy polling support for vhost_net
...+1%/ 0%/ +2%/ 0%/ +66% > 65535/ 4/ -1%/ -1%/ 0%/ +4%/ +492% > 65535/ 8/ 0%/ -1%/ -1%/ +4%/ +38% > > Changes from V3: > - drop single_task_running() > - use cpu_relax_lowlatency() instead of cpu_relax() > > Changes from V2: > - rename vhost_vq_more_avail() to vhost_vq_avail_empty(). And return > false we __get_user() fails. > - do not bother premmptions/timers for good path. > - use vhost_vring_state as ioctl parameter instead of reinveting a new > one. > - add the unit of timeout (us) to the comment of new added ioctls > > Ch...
2015 Dec 01
0
[PATCH V2 3/3] vhost_net: basic polling support
...d int iov_size, + unsigned int *out_num, unsigned int *in_num) +{ + unsigned long uninitialized_var(endtime); + + if (vq->busyloop_timeout) { + preempt_disable(); + endtime = busy_clock() + vq->busyloop_timeout; + while (vhost_can_busy_poll(vq->dev, endtime) && + !vhost_vq_more_avail(vq->dev, vq)) + cpu_relax(); + preempt_enable(); + } + + return vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), + out_num, in_num, NULL, NULL); +} + /* Expects to be always run from workqueue - which acts as * read-size critical section for our kind of RCU. */ static void ha...
2015 Nov 12
2
[PATCH net-next RFC V3 0/3] basic busy polling support for vhost_net
...nto a new helper >> - Check and exit the loop when there's a pending signal >> - Disable preemption during busy looping to make sure lock_clock() was >> correctly used. >> >> Jason Wang (3): >> vhost: introduce vhost_has_work() >> vhost: introduce vhost_vq_more_avail() >> vhost_net: basic polling support >> >> drivers/vhost/net.c | 77 +++++++++++++++++++++++++++++++++++++++++++--- >> drivers/vhost/vhost.c | 48 +++++++++++++++++++++++------ >> drivers/vhost/vhost.h | 3 ++ >> include/uapi/linux/vhost.h |...
2015 Nov 12
2
[PATCH net-next RFC V3 0/3] basic busy polling support for vhost_net
...nto a new helper >> - Check and exit the loop when there's a pending signal >> - Disable preemption during busy looping to make sure lock_clock() was >> correctly used. >> >> Jason Wang (3): >> vhost: introduce vhost_has_work() >> vhost: introduce vhost_vq_more_avail() >> vhost_net: basic polling support >> >> drivers/vhost/net.c | 77 +++++++++++++++++++++++++++++++++++++++++++--- >> drivers/vhost/vhost.c | 48 +++++++++++++++++++++++------ >> drivers/vhost/vhost.h | 3 ++ >> include/uapi/linux/vhost.h |...