search for: vhost_len

Displaying 20 results from an estimated 138 matches for "vhost_len".

Did you mean: vhost_hlen
2018 May 29
2
[PATCH net] vhost_net: flush batched heads before trying to busy polling
...re */ mutex_lock_nested(&vq->mutex, 1); vhost_disable_notify(&net->dev, vq); @@ -762,7 +778,7 @@ static void handle_rx(struct vhost_net *net) }; size_t total_len = 0; int err, mergeable; - s16 headcount, nheads = 0; + s16 headcount; size_t vhost_hlen, sock_hlen; size_t vhost_len, sock_len; struct socket *sock; @@ -790,8 +806,8 @@ static void handle_rx(struct vhost_net *net) while ((sock_len = vhost_net_rx_peek_head_len(net, sock->sk))) { sock_len += sock_hlen; vhost_len = sock_len + vhost_hlen; - headcount = get_rx_bufs(vq, vq->heads + nheads, vhost_len, -...
2018 Jan 09
2
[PATCH net-next] vhost_net: batch used ring update in rx
...rs/vhost/net.c index c7bdeb6..988af72 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -744,7 +744,7 @@ static void handle_rx(struct vhost_net *net) }; size_t total_len = 0; int err, mergeable; - s16 headcount; + s16 headcount, nheads = 0; size_t vhost_hlen, sock_hlen; size_t vhost_len, sock_len; struct socket *sock; @@ -772,7 +772,7 @@ static void handle_rx(struct vhost_net *net) while ((sock_len = vhost_net_rx_peek_head_len(net, sock->sk))) { sock_len += sock_hlen; vhost_len = sock_len + vhost_hlen; - headcount = get_rx_bufs(vq, vq->heads, vhost_len, + headcou...
2018 May 21
1
[RFC PATCH net-next 02/12] vhost_net: introduce vhost_exceeds_weight()
...T_PKT_WEIGHT)) { > + if (unlikely(vhost_exceeds_weight(++sent_pkts, total_len))) { > vhost_poll_queue(&vq->poll); > break; > } > @@ -887,8 +891,7 @@ static void handle_rx(struct vhost_net *net) > if (unlikely(vq_log)) > vhost_log_write(vq, vq_log, log, vhost_len); > total_len += vhost_len; > - if (unlikely(total_len >= VHOST_NET_WEIGHT) || > - unlikely(++recv_pkts >= VHOST_NET_PKT_WEIGHT)) { > + if (unlikely(vhost_exceeds_weight(++recv_pkts, total_len))) { > vhost_poll_queue(&vq->poll); > goto out; > }
2019 Apr 25
2
[PATCH net] vhost_net: fix possible infinite loop
...feature(vq, VIRTIO_NET_F_MRG_RXBUF); - while ((sock_len = vhost_net_rx_peek_head_len(net, sock->sk, - &busyloop_intr))) { + do { + sock_len = vhost_net_rx_peek_head_len(net, sock->sk, + &busyloop_intr); + if (!sock_len) + break; sock_len += sock_hlen; vhost_len = sock_len + vhost_hlen; headcount = get_rx_bufs(vq, vq->heads + nvq->done_idx, @@ -1239,12 +1243,9 @@ static void handle_rx(struct vhost_net *net) vhost_log_write(vq, vq_log, log, vhost_len, vq->iov, in); total_len += vhost_len; - if (unlikely(vhost_exceeds_weight(++recv_...
2019 Apr 25
2
[PATCH net] vhost_net: fix possible infinite loop
...feature(vq, VIRTIO_NET_F_MRG_RXBUF); - while ((sock_len = vhost_net_rx_peek_head_len(net, sock->sk, - &busyloop_intr))) { + do { + sock_len = vhost_net_rx_peek_head_len(net, sock->sk, + &busyloop_intr); + if (!sock_len) + break; sock_len += sock_hlen; vhost_len = sock_len + vhost_hlen; headcount = get_rx_bufs(vq, vq->heads + nvq->done_idx, @@ -1239,12 +1243,9 @@ static void handle_rx(struct vhost_net *net) vhost_log_write(vq, vq_log, log, vhost_len, vq->iov, in); total_len += vhost_len; - if (unlikely(vhost_exceeds_weight(++recv_...
2018 Jul 04
1
[PATCH net-next 1/8] vhost: move get_rx_bufs to vhost.c
...2010-07-27 707 size_t total_len = 0; 910a578f7 Michael S. Tsirkin 2012-10-24 708 int err, mergeable; f5a4941aa Jason Wang 2018-05-29 709 s16 headcount; 8dd014adf David Stevens 2010-07-27 710 size_t vhost_hlen, sock_hlen; 8dd014adf David Stevens 2010-07-27 711 size_t vhost_len, sock_len; 2e26af79b Asias He 2013-05-07 712 struct socket *sock; ba7438aed Al Viro 2014-12-10 713 struct iov_iter fixup; 0960b6417 Jason Wang 2015-02-15 714 __virtio16 num_buffers; db688c24e Paolo Abeni 2018-04-24 715 int recv_pkts = 0; 8dd014adf Dav...
2018 Dec 12
2
[PATCH net V2 4/4] vhost: log dirty page correctly
...00644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -1192,7 +1192,8 @@ static void handle_rx(struct vhost_net *net) > if (nvq->done_idx > VHOST_NET_BATCH) > vhost_net_signal_used(nvq); > if (unlikely(vq_log)) > - vhost_log_write(vq, vq_log, log, vhost_len); > + vhost_log_write(vq, vq_log, log, vhost_len, > + vq->iov, in); > total_len += vhost_len; > if (unlikely(vhost_exceeds_weight(++recv_pkts, total_len))) { > vhost_poll_queue(&vq->poll); > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c >...
2018 Dec 12
2
[PATCH net V2 4/4] vhost: log dirty page correctly
...00644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -1192,7 +1192,8 @@ static void handle_rx(struct vhost_net *net) > if (nvq->done_idx > VHOST_NET_BATCH) > vhost_net_signal_used(nvq); > if (unlikely(vq_log)) > - vhost_log_write(vq, vq_log, log, vhost_len); > + vhost_log_write(vq, vq_log, log, vhost_len, > + vq->iov, in); > total_len += vhost_len; > if (unlikely(vhost_exceeds_weight(++recv_pkts, total_len))) { > vhost_poll_queue(&vq->poll); > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c >...
2018 Apr 24
2
[PATCH] vhost_net: use packet weight for rx handler, too
...t) struct socket *sock; struct iov_iter fixup; __virtio16 num_buffers; + int recv_pkts = 0; mutex_lock_nested(&vq->mutex, 0); sock = vq->private_data; @@ -872,7 +875,8 @@ static void handle_rx(struct vhost_net *net) if (unlikely(vq_log)) vhost_log_write(vq, vq_log, log, vhost_len); total_len += vhost_len; - if (unlikely(total_len >= VHOST_NET_WEIGHT)) { + if (unlikely(total_len >= VHOST_NET_WEIGHT) || + unlikely(++recv_pkts >= VHOST_NET_PKT_WEIGHT)) { vhost_poll_queue(&vq->poll); goto out; } -- 2.14.3
2019 Apr 26
2
[PATCH net] vhost_net: fix possible infinite loop
...eek_head_len(net, sock->sk, >> - &busyloop_intr))) { >> + do { >> + sock_len = vhost_net_rx_peek_head_len(net, sock->sk, >> + &busyloop_intr); >> + if (!sock_len) >> + break; >> sock_len += sock_hlen; >> vhost_len = sock_len + vhost_hlen; >> headcount = get_rx_bufs(vq, vq->heads + nvq->done_idx, >> @@ -1239,12 +1243,9 @@ static void handle_rx(struct vhost_net *net) >> vhost_log_write(vq, vq_log, log, vhost_len, >> vq->iov, in); >> total_len += vhost_...
2019 Apr 26
2
[PATCH net] vhost_net: fix possible infinite loop
...eek_head_len(net, sock->sk, >> - &busyloop_intr))) { >> + do { >> + sock_len = vhost_net_rx_peek_head_len(net, sock->sk, >> + &busyloop_intr); >> + if (!sock_len) >> + break; >> sock_len += sock_hlen; >> vhost_len = sock_len + vhost_hlen; >> headcount = get_rx_bufs(vq, vq->heads + nvq->done_idx, >> @@ -1239,12 +1243,9 @@ static void handle_rx(struct vhost_net *net) >> vhost_log_write(vq, vq_log, log, vhost_len, >> vq->iov, in); >> total_len += vhost_...
2018 Dec 10
0
[PATCH net 4/4] vhost: log dirty page correctly
...index 5f272ab4d5b4..754ca22efb43 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -1196,7 +1196,8 @@ static void handle_rx(struct vhost_net *net) if (nvq->done_idx > VHOST_NET_BATCH) vhost_net_signal_used(nvq); if (unlikely(vq_log)) - vhost_log_write(vq, vq_log, log, vhost_len); + vhost_log_write(vq, vq_log, log, vhost_len, + vq->iov, in); total_len += vhost_len; if (unlikely(vhost_exceeds_weight(++recv_pkts, total_len))) { vhost_poll_queue(&vq->poll); diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 55e5aa662ad5..8ab279720a2b 10...
2019 May 12
2
[PATCH net] vhost_net: fix possible infinite loop
...???? sock_len = vhost_net_rx_peek_head_len(net, sock->sk, > > > > +????????????????????????????? &busyloop_intr); > > > > +??????? if (!sock_len) > > > > +??????????? break; > > > > ????????? sock_len += sock_hlen; > > > > ????????? vhost_len = sock_len + vhost_hlen; > > > > ????????? headcount = get_rx_bufs(vq, vq->heads + nvq->done_idx, > > > > @@ -1239,12 +1243,9 @@ static void handle_rx(struct vhost_net *net) > > > > ????????????? vhost_log_write(vq, vq_log, log, vhost_len, > > > &g...
2018 Dec 12
0
[PATCH net V2 4/4] vhost: log dirty page correctly
...index ad7a6f475a44..784df2b49628 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -1192,7 +1192,8 @@ static void handle_rx(struct vhost_net *net) if (nvq->done_idx > VHOST_NET_BATCH) vhost_net_signal_used(nvq); if (unlikely(vq_log)) - vhost_log_write(vq, vq_log, log, vhost_len); + vhost_log_write(vq, vq_log, log, vhost_len, + vq->iov, in); total_len += vhost_len; if (unlikely(vhost_exceeds_weight(++recv_pkts, total_len))) { vhost_poll_queue(&vq->poll); diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 55e5aa662ad5..3660310604fd 10...
2019 May 12
2
[PATCH net] vhost_net: fix possible infinite loop
...???? sock_len = vhost_net_rx_peek_head_len(net, sock->sk, > > > > +????????????????????????????? &busyloop_intr); > > > > +??????? if (!sock_len) > > > > +??????????? break; > > > > ????????? sock_len += sock_hlen; > > > > ????????? vhost_len = sock_len + vhost_hlen; > > > > ????????? headcount = get_rx_bufs(vq, vq->heads + nvq->done_idx, > > > > @@ -1239,12 +1243,9 @@ static void handle_rx(struct vhost_net *net) > > > > ????????????? vhost_log_write(vq, vq_log, log, vhost_len, > > > &g...
2018 Apr 23
0
[RFC V3 PATCH 1/8] vhost: move get_rx_bufs to vhost.c
...run from workqueue - which acts as * read-size critical section for our kind of RCU. */ static void handle_rx(struct vhost_net *net) @@ -790,9 +713,9 @@ static void handle_rx(struct vhost_net *net) while ((sock_len = vhost_net_rx_peek_head_len(net, sock->sk))) { sock_len += sock_hlen; vhost_len = sock_len + vhost_hlen; - headcount = get_rx_bufs(vq, vq->heads + nheads, vhost_len, - &in, vq_log, &log, - likely(mergeable) ? UIO_MAXIOV : 1); + headcount = vhost_get_bufs(vq, vq->heads + nheads, vhost_len, + &in, vq_log, &log, + likely(mergeable) ?...
2018 May 02
1
[RFC V3 PATCH 1/8] vhost: move get_rx_bufs to vhost.c
...s as > * read-size critical section for our kind of RCU. */ > static void handle_rx(struct vhost_net *net) > @@ -790,9 +713,9 @@ static void handle_rx(struct vhost_net *net) > while ((sock_len = vhost_net_rx_peek_head_len(net, sock->sk))) { > sock_len += sock_hlen; > vhost_len = sock_len + vhost_hlen; > - headcount = get_rx_bufs(vq, vq->heads + nheads, vhost_len, > - &in, vq_log, &log, > - likely(mergeable) ? UIO_MAXIOV : 1); > + headcount = vhost_get_bufs(vq, vq->heads + nheads, vhost_len, > + &in, vq_log, &log, >...
2020 Jun 03
1
[PATCH RFC 08/13] vhost/net: convert to new API: heads->bufs
...l_bufs(vq, bufs, bufcount); > return r; > } > > @@ -1113,7 +1122,7 @@ static void handle_rx(struct vhost_net *net) > }; > size_t total_len = 0; > int err, mergeable; > - s16 headcount; > + int bufcount; > size_t vhost_hlen, sock_hlen; > size_t vhost_len, sock_len; > bool busyloop_intr = false; > @@ -1147,14 +1156,14 @@ static void handle_rx(struct vhost_net *net) > break; > sock_len += sock_hlen; > vhost_len = sock_len + vhost_hlen; > - headcount = get_rx_bufs(vq, vq->heads + nvq->done_idx, > - vhost...
2014 Aug 15
2
[PATCH net-next] vhost_net: stop rx net polling when possible
...dle_rx(struct vhost_net *net) sock = vq->private_data; if (!sock) goto out; + + vhost_poll_stop(poll); vhost_disable_notify(&net->dev, vq); vhost_hlen = nvq->vhost_hlen; @@ -660,10 +674,12 @@ static void handle_rx(struct vhost_net *net) vhost_log_write(vq, vq_log, log, vhost_len); total_len += vhost_len; if (unlikely(total_len >= VHOST_NET_WEIGHT)) { - vhost_poll_queue(&vq->poll); - break; + vhost_poll_queue(poll); + goto out; } } + + vhost_poll_start(poll, sock->file); out: mutex_unlock(&vq->mutex); } -- 1.9.1
2014 Aug 15
2
[PATCH net-next] vhost_net: stop rx net polling when possible
...dle_rx(struct vhost_net *net) sock = vq->private_data; if (!sock) goto out; + + vhost_poll_stop(poll); vhost_disable_notify(&net->dev, vq); vhost_hlen = nvq->vhost_hlen; @@ -660,10 +674,12 @@ static void handle_rx(struct vhost_net *net) vhost_log_write(vq, vq_log, log, vhost_len); total_len += vhost_len; if (unlikely(total_len >= VHOST_NET_WEIGHT)) { - vhost_poll_queue(&vq->poll); - break; + vhost_poll_queue(poll); + goto out; } } + + vhost_poll_start(poll, sock->file); out: mutex_unlock(&vq->mutex); } -- 1.9.1