search for: vhost_disable_notify

Displaying 20 results from an estimated 441 matches for "vhost_disable_notify".

2018 Jul 04
1
[PATCH net-next v5 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...t; >> + unsigned long busyloop_timeout; > >> + struct socket *sock; > >> + struct vhost_virtqueue *vq = rx ? tvq : rvq; > >> + > >> + mutex_lock_nested(&vq->mutex, rx ? VHOST_NET_VQ_TX: VHOST_NET_VQ_RX); > >> + > >> + vhost_disable_notify(&net->dev, vq); > >> + sock = rvq->private_data; > >> + busyloop_timeout = rx ? rvq->busyloop_timeout : tvq->busyloop_timeout; > >> + > >> + preempt_disable(); > >> + endtime = busy_clock() + busyloop_timeout; > >> +...
2018 Jul 04
2
[PATCH net-next v5 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...> + bool rx) > +{ > + unsigned long uninitialized_var(endtime); > + unsigned long busyloop_timeout; > + struct socket *sock; > + struct vhost_virtqueue *vq = rx ? tvq : rvq; > + > + mutex_lock_nested(&vq->mutex, rx ? VHOST_NET_VQ_TX: VHOST_NET_VQ_RX); > + > + vhost_disable_notify(&net->dev, vq); > + sock = rvq->private_data; > + busyloop_timeout = rx ? rvq->busyloop_timeout : tvq->busyloop_timeout; > + > + preempt_disable(); > + endtime = busy_clock() + busyloop_timeout; > + while (vhost_can_busy_poll(tvq->dev, endtime) && > +...
2018 Jul 04
2
[PATCH net-next v5 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...> + bool rx) > +{ > + unsigned long uninitialized_var(endtime); > + unsigned long busyloop_timeout; > + struct socket *sock; > + struct vhost_virtqueue *vq = rx ? tvq : rvq; > + > + mutex_lock_nested(&vq->mutex, rx ? VHOST_NET_VQ_TX: VHOST_NET_VQ_RX); > + > + vhost_disable_notify(&net->dev, vq); > + sock = rvq->private_data; > + busyloop_timeout = rx ? rvq->busyloop_timeout : tvq->busyloop_timeout; > + > + preempt_disable(); > + endtime = busy_clock() + busyloop_timeout; > + while (vhost_can_busy_poll(tvq->dev, endtime) && > +...
2018 Jul 03
2
[PATCH net-next v4 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...> + bool rx) > +{ > + unsigned long uninitialized_var(endtime); > + unsigned long busyloop_timeout; > + struct socket *sock; > + struct vhost_virtqueue *vq = rx ? tvq : rvq; > + > + mutex_lock_nested(&vq->mutex, rx ? VHOST_NET_VQ_TX: VHOST_NET_VQ_RX); > + > + vhost_disable_notify(&net->dev, vq); > + sock = rvq->private_data; > + busyloop_timeout = rx ? rvq->busyloop_timeout : tvq->busyloop_timeout; > + > + preempt_disable(); > + endtime = busy_clock() + busyloop_timeout; > + while (vhost_can_busy_poll(tvq->dev, endtime) && > +...
2018 Jul 03
2
[PATCH net-next v4 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...> + bool rx) > +{ > + unsigned long uninitialized_var(endtime); > + unsigned long busyloop_timeout; > + struct socket *sock; > + struct vhost_virtqueue *vq = rx ? tvq : rvq; > + > + mutex_lock_nested(&vq->mutex, rx ? VHOST_NET_VQ_TX: VHOST_NET_VQ_RX); > + > + vhost_disable_notify(&net->dev, vq); > + sock = rvq->private_data; > + busyloop_timeout = rx ? rvq->busyloop_timeout : tvq->busyloop_timeout; > + > + preempt_disable(); > + endtime = busy_clock() + busyloop_timeout; > + while (vhost_can_busy_poll(tvq->dev, endtime) && > +...
2018 Jul 03
1
[PATCH net-next v4 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...>>> + unsigned long busyloop_timeout; >>> + struct socket *sock; >>> + struct vhost_virtqueue *vq = rx ? tvq : rvq; >>> + >>> + mutex_lock_nested(&vq->mutex, rx ? VHOST_NET_VQ_TX: VHOST_NET_VQ_RX); >>> + >>> + vhost_disable_notify(&net->dev, vq); >>> + sock = rvq->private_data; >>> + busyloop_timeout = rx ? rvq->busyloop_timeout : tvq->busyloop_timeout; >>> + >>> + preempt_disable(); >>> + endtime = busy_clock() + busyloop_timeout; >>> +...
2018 Jul 02
1
[PATCH net-next v3 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...vq->busyloop_timeout : > + tvq->busyloop_timeout; As simple as vq->busyloop_timeout? > + > + mutex_lock_nested(&vq->mutex, rx ? VHOST_NET_VQ_TX: VHOST_NET_VQ_RX); We need move sock = rvq->private_data under the protection of vq mutex if rx is false. > + vhost_disable_notify(&net->dev, vq); > + > + preempt_disable(); > + endtime = busy_clock() + busyloop_timeout; > + while (vhost_can_busy_poll(tvq->dev, endtime) && > + !(sock && sk_has_rx_data(sock->sk)) && > + vhost_vq_avail_empty(tvq->dev, tvq))...
2018 Jul 24
3
[PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...>> + if (!vhost_vq_avail_empty(&net->dev, tvq)) { >>>>> + vhost_poll_queue(&tvq->poll); >>>>> + } else if (unlikely(vhost_enable_notify(&net->dev, tvq))) { >>>>> + vhost_disable_notify(&net->dev, tvq); >>>>> + vhost_poll_queue(&tvq->poll); >>>>> + } >>>>> + } else if ((sock && sk_has_rx_data(sock->sk)) && >>>>> + !vhost_vq_avail_empty(&a...
2018 Jul 24
3
[PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...>> + if (!vhost_vq_avail_empty(&net->dev, tvq)) { >>>>> + vhost_poll_queue(&tvq->poll); >>>>> + } else if (unlikely(vhost_enable_notify(&net->dev, tvq))) { >>>>> + vhost_disable_notify(&net->dev, tvq); >>>>> + vhost_poll_queue(&tvq->poll); >>>>> + } >>>>> + } else if ((sock && sk_has_rx_data(sock->sk)) && >>>>> + !vhost_vq_avail_empty(&a...
2018 Jul 23
3
[PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...*tvq, > + bool rx) > +{ > + struct socket *sock = rvq->private_data; > + > + if (rx) { > + if (!vhost_vq_avail_empty(&net->dev, tvq)) { > + vhost_poll_queue(&tvq->poll); > + } else if (unlikely(vhost_enable_notify(&net->dev, tvq))) { > + vhost_disable_notify(&net->dev, tvq); > + vhost_poll_queue(&tvq->poll); > + } > + } else if ((sock && sk_has_rx_data(sock->sk)) && > + !vhost_vq_avail_empty(&net->dev, rvq)) { > + vhost_poll_queue(&rvq->poll); Now we wait for vq_avail for rx as wel...
2018 Jul 23
3
[PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...*tvq, > + bool rx) > +{ > + struct socket *sock = rvq->private_data; > + > + if (rx) { > + if (!vhost_vq_avail_empty(&net->dev, tvq)) { > + vhost_poll_queue(&tvq->poll); > + } else if (unlikely(vhost_enable_notify(&net->dev, tvq))) { > + vhost_disable_notify(&net->dev, tvq); > + vhost_poll_queue(&tvq->poll); > + } > + } else if ((sock && sk_has_rx_data(sock->sk)) && > + !vhost_vq_avail_empty(&net->dev, rvq)) { > + vhost_poll_queue(&rvq->poll); Now we wait for vq_avail for rx as wel...
2018 Jun 29
5
[PATCH vhost] vhost_net: Fix too many vring kick on busypoll
...illed. */ if (head == vq->num) { - if (unlikely(vhost_enable_notify(&net->dev, vq))) { + if (unlikely(vq->busyloop_endtime)) { + /* Busy poll is interrupted. */ + vhost_poll_queue(&vq->poll); + } else if (unlikely(vhost_enable_notify(&net->dev, vq))) { vhost_disable_notify(&net->dev, vq); continue; } break; } + vq->busyloop_endtime = 0; if (in) { vq_err(vq, "Unexpected descriptor format for TX: " "out %d, int %d\n", out, in); @@ -642,39 +658,51 @@ static void vhost_rx_signal_used(struct vhost_net_virtqu...
2018 Jun 29
5
[PATCH vhost] vhost_net: Fix too many vring kick on busypoll
...illed. */ if (head == vq->num) { - if (unlikely(vhost_enable_notify(&net->dev, vq))) { + if (unlikely(vq->busyloop_endtime)) { + /* Busy poll is interrupted. */ + vhost_poll_queue(&vq->poll); + } else if (unlikely(vhost_enable_notify(&net->dev, vq))) { vhost_disable_notify(&net->dev, vq); continue; } break; } + vq->busyloop_endtime = 0; if (in) { vq_err(vq, "Unexpected descriptor format for TX: " "out %d, int %d\n", out, in); @@ -642,39 +658,51 @@ static void vhost_rx_signal_used(struct vhost_net_virtqu...
2018 Aug 01
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...; +static void vhost_net_busy_poll_try_queue(struct vhost_net *net, > + struct vhost_virtqueue *vq) > +{ > + if (!vhost_vq_avail_empty(&net->dev, vq)) { > + vhost_poll_queue(&vq->poll); > + } else if (unlikely(vhost_enable_notify(&net->dev, vq))) { > + vhost_disable_notify(&net->dev, vq); > + vhost_poll_queue(&vq->poll); > + } > +} > + > +static void vhost_net_busy_poll_check(struct vhost_net *net, > + struct vhost_virtqueue *rvq, > + struct vhost_virtqueue *tvq, > + bool rx) > +{ > + struct sock...
2018 Aug 01
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...; +static void vhost_net_busy_poll_try_queue(struct vhost_net *net, > + struct vhost_virtqueue *vq) > +{ > + if (!vhost_vq_avail_empty(&net->dev, vq)) { > + vhost_poll_queue(&vq->poll); > + } else if (unlikely(vhost_enable_notify(&net->dev, vq))) { > + vhost_disable_notify(&net->dev, vq); > + vhost_poll_queue(&vq->poll); > + } > +} > + > +static void vhost_net_busy_poll_check(struct vhost_net *net, > + struct vhost_virtqueue *rvq, > + struct vhost_virtqueue *tvq, > + bool rx) > +{ > + struct sock...
2018 Jul 03
0
[PATCH v2 net-next 1/4] vhost_net: Rename local variables in vhost_net_rx_peek_head_len
...sk); - if (!len && vq->busyloop_timeout) { + if (!len && tvq->busyloop_timeout) { /* Flush batched heads first */ - vhost_rx_signal_used(rvq); + vhost_rx_signal_used(rnvq); /* Both tx vq and rx socket were polled here */ - mutex_lock_nested(&vq->mutex, 1); - vhost_disable_notify(&net->dev, vq); + mutex_lock_nested(&tvq->mutex, 1); + vhost_disable_notify(&net->dev, tvq); preempt_disable(); - endtime = busy_clock() + vq->busyloop_timeout; + endtime = busy_clock() + tvq->busyloop_timeout; while (vhost_can_busy_poll(&net->dev, en...
2018 Jul 02
5
[PATCH net-next v4 0/4] net: vhost: improve performance when enable busyloop
From: Tonghao Zhang <xiangxia.m.yue at gmail.com> This patches improve the guest receive and transmit performance. On the handle_tx side, we poll the sock receive queue at the same time. handle_rx do that in the same way. For more performance report, see patch 4. v3 -> v4: fix some issues v2 -> v3: This patches are splited from previous big patch:
2019 Jul 17
17
[PATCH V3 00/15] Packed virtqueue support for vhost
.... - Zerocopy support. - vIOMMU support. - SCSI/VSOCK support (compile test only). - Fix several bugs Jason Wang (15): vhost: simplify meta data pointer accessing vhost: remove the unnecessary parameter of vhost_vq_avail_empty() vhost: remove unnecessary parameter of vhost_enable_notify()/vhost_disable_notify vhost-net: don't use vhost_add_used_n() for zerocopy vhost: introduce helpers to manipulate shadow used ring vhost_net: switch TX to use shadow used ring API vhost_net: calculate last used length once for mergeable buffer vhost_net: switch to use shadow used ring API for RX vhost: d...
2019 Jul 17
17
[PATCH V3 00/15] Packed virtqueue support for vhost
.... - Zerocopy support. - vIOMMU support. - SCSI/VSOCK support (compile test only). - Fix several bugs Jason Wang (15): vhost: simplify meta data pointer accessing vhost: remove the unnecessary parameter of vhost_vq_avail_empty() vhost: remove unnecessary parameter of vhost_enable_notify()/vhost_disable_notify vhost-net: don't use vhost_add_used_n() for zerocopy vhost: introduce helpers to manipulate shadow used ring vhost_net: switch TX to use shadow used ring API vhost_net: calculate last used length once for mergeable buffer vhost_net: switch to use shadow used ring API for RX vhost: d...
2018 Aug 01
5
[PATCH net-next v7 0/4] net: vhost: improve performance when enable busyloop
From: Tonghao Zhang <xiangxia.m.yue at gmail.com> This patches improve the guest receive performance. On the handle_tx side, we poll the sock receive queue at the same time. handle_rx do that in the same way. For more performance report, see patch 4. v6->v7: fix issue and rebase codes: 1. on tx, busypoll will vhost_net_disable/enable_vq rx vq. [This is suggested by Toshiaki Makita