search for: vhost_net_vq_rx

Displaying 20 results from an estimated 197 matches for "vhost_net_vq_rx".

2018 Dec 11
2
[PATCH net 2/4] vhost_net: rework on the lock ordering for busy polling
...--- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -513,7 +513,6 @@ static void vhost_net_busy_poll(struct vhost_net *net, > struct socket *sock; > struct vhost_virtqueue *vq = poll_rx ? tvq : rvq; > > - mutex_lock_nested(&vq->mutex, poll_rx ? VHOST_NET_VQ_TX: VHOST_NET_VQ_RX); > vhost_disable_notify(&net->dev, vq); > sock = rvq->private_data; > > @@ -543,8 +542,6 @@ static void vhost_net_busy_poll(struct vhost_net *net, > vhost_net_busy_poll_try_queue(net, vq); > else if (!poll_rx) /* On tx here, sock has no rx data. */ > vh...
2018 Dec 11
2
[PATCH net 2/4] vhost_net: rework on the lock ordering for busy polling
...--- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -513,7 +513,6 @@ static void vhost_net_busy_poll(struct vhost_net *net, > struct socket *sock; > struct vhost_virtqueue *vq = poll_rx ? tvq : rvq; > > - mutex_lock_nested(&vq->mutex, poll_rx ? VHOST_NET_VQ_TX: VHOST_NET_VQ_RX); > vhost_disable_notify(&net->dev, vq); > sock = rvq->private_data; > > @@ -543,8 +542,6 @@ static void vhost_net_busy_poll(struct vhost_net *net, > vhost_net_busy_poll_try_queue(net, vq); > else if (!poll_rx) /* On tx here, sock has no rx data. */ > vh...
2018 Dec 10
0
[PATCH net 2/4] vhost_net: rework on the lock ordering for busy polling
...b2bee273..5f272ab4d5b4 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -513,7 +513,6 @@ static void vhost_net_busy_poll(struct vhost_net *net, struct socket *sock; struct vhost_virtqueue *vq = poll_rx ? tvq : rvq; - mutex_lock_nested(&vq->mutex, poll_rx ? VHOST_NET_VQ_TX: VHOST_NET_VQ_RX); vhost_disable_notify(&net->dev, vq); sock = rvq->private_data; @@ -543,8 +542,6 @@ static void vhost_net_busy_poll(struct vhost_net *net, vhost_net_busy_poll_try_queue(net, vq); else if (!poll_rx) /* On tx here, sock has no rx data. */ vhost_enable_notify(&net->dev,...
2018 Jul 03
2
[PATCH net-next v4 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...struct vhost_virtqueue *tvq, > + 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(tv...
2018 Jul 03
2
[PATCH net-next v4 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...struct vhost_virtqueue *tvq, > + 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(tv...
2014 Aug 15
2
[PATCH net-next] vhost_net: stop rx net polling when possible
...st/net.c +++ b/drivers/vhost/net.c @@ -334,6 +334,8 @@ static void vhost_zerocopy_callback(struct ubuf_info *ubuf, bool success) static void handle_tx(struct vhost_net *net) { struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_TX]; + struct vhost_virtqueue *rx_vq = &net->vqs[VHOST_NET_VQ_RX].vq; + struct vhost_poll *rx_poll = &net->poll[VHOST_NET_VQ_RX]; struct vhost_virtqueue *vq = &nvq->vq; unsigned out, in, s; int head; @@ -348,15 +350,18 @@ static void handle_tx(struct vhost_net *net) size_t len, total_len = 0; int err; size_t hdr_size; - struct socket *s...
2014 Aug 15
2
[PATCH net-next] vhost_net: stop rx net polling when possible
...st/net.c +++ b/drivers/vhost/net.c @@ -334,6 +334,8 @@ static void vhost_zerocopy_callback(struct ubuf_info *ubuf, bool success) static void handle_tx(struct vhost_net *net) { struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_TX]; + struct vhost_virtqueue *rx_vq = &net->vqs[VHOST_NET_VQ_RX].vq; + struct vhost_poll *rx_poll = &net->poll[VHOST_NET_VQ_RX]; struct vhost_virtqueue *vq = &nvq->vq; unsigned out, in, s; int head; @@ -348,15 +350,18 @@ static void handle_tx(struct vhost_net *net) size_t len, total_len = 0; int err; size_t hdr_size; - struct socket *s...
2018 Dec 11
2
[PATCH net 2/4] vhost_net: rework on the lock ordering for busy polling
...b/drivers/vhost/net.c > > > @@ -513,7 +513,6 @@ static void vhost_net_busy_poll(struct vhost_net *net, > > > struct socket *sock; > > > struct vhost_virtqueue *vq = poll_rx ? tvq : rvq; > > > - mutex_lock_nested(&vq->mutex, poll_rx ? VHOST_NET_VQ_TX: VHOST_NET_VQ_RX); > > > vhost_disable_notify(&net->dev, vq); > > > sock = rvq->private_data; > > > @@ -543,8 +542,6 @@ static void vhost_net_busy_poll(struct vhost_net *net, > > > vhost_net_busy_poll_try_queue(net, vq); > > > else if (!poll_rx) /*...
2018 Dec 11
2
[PATCH net 2/4] vhost_net: rework on the lock ordering for busy polling
...b/drivers/vhost/net.c > > > @@ -513,7 +513,6 @@ static void vhost_net_busy_poll(struct vhost_net *net, > > > struct socket *sock; > > > struct vhost_virtqueue *vq = poll_rx ? tvq : rvq; > > > - mutex_lock_nested(&vq->mutex, poll_rx ? VHOST_NET_VQ_TX: VHOST_NET_VQ_RX); > > > vhost_disable_notify(&net->dev, vq); > > > sock = rvq->private_data; > > > @@ -543,8 +542,6 @@ static void vhost_net_busy_poll(struct vhost_net *net, > > > vhost_net_busy_poll_try_queue(net, vq); > > > else if (!poll_rx) /*...
2018 Jul 02
1
[PATCH net-next v3 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...q->private_data; > + struct vhost_virtqueue *vq = rx ? tvq : rvq; > + unsigned long busyloop_timeout = rx ? rvq->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) && &gt...
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:
2013 Mar 07
3
[PATCH] vhost_net: remove tx polling state
...tx_poll_start(net, sock); + vhost_poll_start(poll, sock->file); break; } if (err != len) @@ -627,7 +596,6 @@ static int vhost_net_open(struct inode *inode, struct file *f) vhost_poll_init(n->poll + VHOST_NET_VQ_TX, handle_tx_net, POLLOUT, dev); vhost_poll_init(n->poll + VHOST_NET_VQ_RX, handle_rx_net, POLLIN, dev); - n->tx_poll_state = VHOST_NET_POLL_DISABLED; f->private_data = n; @@ -637,32 +605,24 @@ static int vhost_net_open(struct inode *inode, struct file *f) static void vhost_net_disable_vq(struct vhost_net *n, struct vhost_virtqueue *vq) { + struct vhos...
2013 Mar 07
3
[PATCH] vhost_net: remove tx polling state
...tx_poll_start(net, sock); + vhost_poll_start(poll, sock->file); break; } if (err != len) @@ -627,7 +596,6 @@ static int vhost_net_open(struct inode *inode, struct file *f) vhost_poll_init(n->poll + VHOST_NET_VQ_TX, handle_tx_net, POLLOUT, dev); vhost_poll_init(n->poll + VHOST_NET_VQ_RX, handle_rx_net, POLLIN, dev); - n->tx_poll_state = VHOST_NET_POLL_DISABLED; f->private_data = n; @@ -637,32 +605,24 @@ static int vhost_net_open(struct inode *inode, struct file *f) static void vhost_net_disable_vq(struct vhost_net *n, struct vhost_virtqueue *vq) { + struct vhos...
2018 Jul 03
1
[PATCH net-next v4 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...gt; + 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(); >>> + end...
2018 Jul 04
1
[PATCH net-next v5 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...gt; + 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(); > >> + e...
2018 Jul 04
2
[PATCH net-next v5 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...struct vhost_virtqueue *tvq, > + 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(tv...
2018 Jul 04
2
[PATCH net-next v5 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...struct vhost_virtqueue *tvq, > + 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(tv...
2014 Aug 17
0
[PATCH net-next] vhost_net: stop rx net polling when possible
...ost/net.c > @@ -334,6 +334,8 @@ static void vhost_zerocopy_callback(struct ubuf_info *ubuf, bool success) > static void handle_tx(struct vhost_net *net) > { > struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_TX]; > + struct vhost_virtqueue *rx_vq = &net->vqs[VHOST_NET_VQ_RX].vq; > + struct vhost_poll *rx_poll = &net->poll[VHOST_NET_VQ_RX]; > struct vhost_virtqueue *vq = &nvq->vq; > unsigned out, in, s; > int head; > @@ -348,15 +350,18 @@ static void handle_tx(struct vhost_net *net) > size_t len, total_len = 0; > int err; &g...
2018 Jun 30
9
[PATCH net-next v3 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. This patches are splited from previous big patch: http://patchwork.ozlabs.org/patch/934673/ For more performance report, see patch 4. Tonghao Zhang (4): net: vhost:
2013 Apr 11
1
[PATCH] vhost_net: remove tx polling state
...if (err == -EAGAIN || err == -ENOBUFS) - tx_poll_start(net, sock); break; } if (err != len) @@ -628,7 +575,6 @@ static int vhost_net_open(struct inode *inode, struct file *f) vhost_poll_init(n->poll + VHOST_NET_VQ_TX, handle_tx_net, POLLOUT, dev); vhost_poll_init(n->poll + VHOST_NET_VQ_RX, handle_rx_net, POLLIN, dev); - n->tx_poll_state = VHOST_NET_POLL_DISABLED; f->private_data = n; @@ -638,32 +584,24 @@ static int vhost_net_open(struct inode *inode, struct file *f) static void vhost_net_disable_vq(struct vhost_net *n, struct vhost_virtqueue *vq) { + struct vhos...