search for: vhost_net_buf_consume

Displaying 20 results from an estimated 51 matches for "vhost_net_buf_consume".

2017 Nov 28
6
[PATCH net,stable] vhost: fix skb leak in handle_rx()
....c index 8d626d7..e76535e 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -778,8 +778,6 @@ static void handle_rx(struct vhost_net *net) /* On error, stop handling until the next kick. */ if (unlikely(headcount < 0)) goto out; - if (nvq->rx_array) - msg.msg_control = vhost_net_buf_consume(&nvq->rxq); /* On overrun, truncate and discard */ if (unlikely(headcount > UIO_MAXIOV)) { iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); @@ -809,6 +807,8 @@ static void handle_rx(struct vhost_net *net) */ iov_iter_advance(&msg.msg_iter, vhost_hlen); }...
2017 Nov 28
6
[PATCH net,stable] vhost: fix skb leak in handle_rx()
....c index 8d626d7..e76535e 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -778,8 +778,6 @@ static void handle_rx(struct vhost_net *net) /* On error, stop handling until the next kick. */ if (unlikely(headcount < 0)) goto out; - if (nvq->rx_array) - msg.msg_control = vhost_net_buf_consume(&nvq->rxq); /* On overrun, truncate and discard */ if (unlikely(headcount > UIO_MAXIOV)) { iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); @@ -809,6 +807,8 @@ static void handle_rx(struct vhost_net *net) */ iov_iter_advance(&msg.msg_iter, vhost_hlen); }...
2017 Nov 29
4
[PATCH net,stable v2] vhost: fix skb leak in handle_rx()
...c index 8d626d7..e302e08 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -778,16 +778,6 @@ static void handle_rx(struct vhost_net *net) /* On error, stop handling until the next kick. */ if (unlikely(headcount < 0)) goto out; - if (nvq->rx_array) - msg.msg_control = vhost_net_buf_consume(&nvq->rxq); - /* On overrun, truncate and discard */ - if (unlikely(headcount > UIO_MAXIOV)) { - iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); - err = sock->ops->recvmsg(sock, &msg, - 1, MSG_DONTWAIT | MSG_TRUNC); - pr_debug("Discarded rx packet: l...
2017 Nov 29
4
[PATCH net,stable v2] vhost: fix skb leak in handle_rx()
...c index 8d626d7..e302e08 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -778,16 +778,6 @@ static void handle_rx(struct vhost_net *net) /* On error, stop handling until the next kick. */ if (unlikely(headcount < 0)) goto out; - if (nvq->rx_array) - msg.msg_control = vhost_net_buf_consume(&nvq->rxq); - /* On overrun, truncate and discard */ - if (unlikely(headcount > UIO_MAXIOV)) { - iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); - err = sock->ops->recvmsg(sock, &msg, - 1, MSG_DONTWAIT | MSG_TRUNC); - pr_debug("Discarded rx packet: l...
2017 Nov 29
1
[PATCH net,stable] vhost: fix skb leak in handle_rx()
...@@ -778,8 +778,6 @@ static void handle_rx(struct vhost_net *net) >> ????????? /* On error, stop handling until the next kick. */ >> ????????? if (unlikely(headcount < 0)) >> ????????????? goto out; >> -??????? if (nvq->rx_array) >> -??????????? msg.msg_control = vhost_net_buf_consume(&nvq->rxq); >> ????????? /* On overrun, truncate and discard */ >> ????????? if (unlikely(headcount > UIO_MAXIOV)) { > > You need do msg.msg_control = vhost_net_buf_consume() here too, > otherwise we may still get it leaked. > > Thanks Not a leak actually, bu...
2017 Nov 29
1
[PATCH net,stable] vhost: fix skb leak in handle_rx()
...@@ -778,8 +778,6 @@ static void handle_rx(struct vhost_net *net) >> ????????? /* On error, stop handling until the next kick. */ >> ????????? if (unlikely(headcount < 0)) >> ????????????? goto out; >> -??????? if (nvq->rx_array) >> -??????????? msg.msg_control = vhost_net_buf_consume(&nvq->rxq); >> ????????? /* On overrun, truncate and discard */ >> ????????? if (unlikely(headcount > UIO_MAXIOV)) { > > You need do msg.msg_control = vhost_net_buf_consume() here too, > otherwise we may still get it leaked. > > Thanks Not a leak actually, bu...
2017 Dec 01
1
[PATCH 1/3] vhost: fix skb leak in handle_rx()
...c index 8d626d7..c7bdeb6 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -778,16 +778,6 @@ static void handle_rx(struct vhost_net *net) /* On error, stop handling until the next kick. */ if (unlikely(headcount < 0)) goto out; - if (nvq->rx_array) - msg.msg_control = vhost_net_buf_consume(&nvq->rxq); - /* On overrun, truncate and discard */ - if (unlikely(headcount > UIO_MAXIOV)) { - iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); - err = sock->ops->recvmsg(sock, &msg, - 1, MSG_DONTWAIT | MSG_TRUNC); - pr_debug("Discarded rx packet: l...
2017 Nov 29
0
[PATCH net,stable] vhost: fix skb leak in handle_rx()
.../drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -778,8 +778,6 @@ static void handle_rx(struct vhost_net *net) > /* On error, stop handling until the next kick. */ > if (unlikely(headcount < 0)) > goto out; > - if (nvq->rx_array) > - msg.msg_control = vhost_net_buf_consume(&nvq->rxq); > /* On overrun, truncate and discard */ > if (unlikely(headcount > UIO_MAXIOV)) { You need do msg.msg_control = vhost_net_buf_consume() here too, otherwise we may still get it leaked. Thanks > iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1);...
2017 Dec 01
1
[PATCH 1/3] vhost: fix skb leak in handle_rx()
.../drivers/vhost/net.c > > @@ -778,16 +778,6 @@ static void handle_rx(struct vhost_net *net) > > /* On error, stop handling until the next kick. */ > > if (unlikely(headcount < 0)) > > goto out; > > - if (nvq->rx_array) > > - msg.msg_control = vhost_net_buf_consume(&nvq->rxq); > > - /* On overrun, truncate and discard */ > > - if (unlikely(headcount > UIO_MAXIOV)) { > > - iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); > > - err = sock->ops->recvmsg(sock, &msg, > > - 1, MSG_DONTWAIT | MSG...
2017 Dec 01
1
[PATCH 1/3] vhost: fix skb leak in handle_rx()
.../drivers/vhost/net.c > > @@ -778,16 +778,6 @@ static void handle_rx(struct vhost_net *net) > > /* On error, stop handling until the next kick. */ > > if (unlikely(headcount < 0)) > > goto out; > > - if (nvq->rx_array) > > - msg.msg_control = vhost_net_buf_consume(&nvq->rxq); > > - /* On overrun, truncate and discard */ > > - if (unlikely(headcount > UIO_MAXIOV)) { > > - iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); > > - err = sock->ops->recvmsg(sock, &msg, > > - 1, MSG_DONTWAIT | MSG...
2017 Nov 30
2
[PATCH net,stable v2] vhost: fix skb leak in handle_rx()
...+++ b/drivers/vhost/net.c >> @@ -778,16 +778,6 @@ static void handle_rx(struct vhost_net *net) >> /* On error, stop handling until the next kick. */ >> if (unlikely(headcount < 0)) >> goto out; >> - if (nvq->rx_array) >> - msg.msg_control = vhost_net_buf_consume(&nvq->rxq); >> - /* On overrun, truncate and discard */ >> - if (unlikely(headcount > UIO_MAXIOV)) { >> - iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); >> - err = sock->ops->recvmsg(sock, &msg, >> - 1, MSG_DONTWAIT | MSG_TRUN...
2017 Nov 30
2
[PATCH net,stable v2] vhost: fix skb leak in handle_rx()
...+++ b/drivers/vhost/net.c >> @@ -778,16 +778,6 @@ static void handle_rx(struct vhost_net *net) >> /* On error, stop handling until the next kick. */ >> if (unlikely(headcount < 0)) >> goto out; >> - if (nvq->rx_array) >> - msg.msg_control = vhost_net_buf_consume(&nvq->rxq); >> - /* On overrun, truncate and discard */ >> - if (unlikely(headcount > UIO_MAXIOV)) { >> - iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); >> - err = sock->ops->recvmsg(sock, &msg, >> - 1, MSG_DONTWAIT | MSG_TRUN...
2017 Dec 01
6
[PATCH net,stable v3] vhost: fix a few skb leaks
From: Wei Xu <wexu at redhat.com> Matthew found a roughly 40% tcp throughput regression with commit c67df11f(vhost_net: try batch dequing from skb array) as discussed in the following thread: https://www.mail-archive.com/netdev at vger.kernel.org/msg187936.html This is v3. v3: - move freeing skb from vhost to tun/tap recvmsg() to not confuse the callers. v2: - add Matthew as the
2017 Dec 01
6
[PATCH net,stable v3] vhost: fix a few skb leaks
From: Wei Xu <wexu at redhat.com> Matthew found a roughly 40% tcp throughput regression with commit c67df11f(vhost_net: try batch dequing from skb array) as discussed in the following thread: https://www.mail-archive.com/netdev at vger.kernel.org/msg187936.html This is v3. v3: - move freeing skb from vhost to tun/tap recvmsg() to not confuse the callers. v2: - add Matthew as the
2017 Nov 28
0
[PATCH net,stable] vhost: fix skb leak in handle_rx()
...- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -778,8 +778,6 @@ static void handle_rx(struct vhost_net *net) > /* On error, stop handling until the next kick. */ > if (unlikely(headcount < 0)) > goto out; > - if (nvq->rx_array) > - msg.msg_control = vhost_net_buf_consume(&nvq->rxq); > /* On overrun, truncate and discard */ > if (unlikely(headcount > UIO_MAXIOV)) { > iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); > @@ -809,6 +807,8 @@ static void handle_rx(struct vhost_net *net) > */ > iov_iter_advance(&m...
2017 Nov 28
0
[PATCH net,stable] vhost: fix skb leak in handle_rx()
...- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -778,8 +778,6 @@ static void handle_rx(struct vhost_net *net) > /* On error, stop handling until the next kick. */ > if (unlikely(headcount < 0)) > goto out; > - if (nvq->rx_array) > - msg.msg_control = vhost_net_buf_consume(&nvq->rxq); > /* On overrun, truncate and discard */ > if (unlikely(headcount > UIO_MAXIOV)) { > iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); > @@ -809,6 +807,8 @@ static void handle_rx(struct vhost_net *net) > */ > iov_iter_advance(&m...
2017 Dec 01
0
[PATCH 1/3] vhost: fix skb leak in handle_rx()
...drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -778,16 +778,6 @@ static void handle_rx(struct vhost_net *net) > /* On error, stop handling until the next kick. */ > if (unlikely(headcount < 0)) > goto out; > - if (nvq->rx_array) > - msg.msg_control = vhost_net_buf_consume(&nvq->rxq); > - /* On overrun, truncate and discard */ > - if (unlikely(headcount > UIO_MAXIOV)) { > - iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); > - err = sock->ops->recvmsg(sock, &msg, > - 1, MSG_DONTWAIT | MSG_TRUNC); > - pr_debu...
2017 Dec 01
0
[PATCH 1/3] vhost: fix skb leak in handle_rx()
...a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -778,16 +778,6 @@ static void handle_rx(struct vhost_net *net) > /* On error, stop handling until the next kick. */ > if (unlikely(headcount < 0)) > goto out; > - if (nvq->rx_array) > - msg.msg_control = vhost_net_buf_consume(&nvq->rxq); > - /* On overrun, truncate and discard */ > - if (unlikely(headcount > UIO_MAXIOV)) { > - iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); > - err = sock->ops->recvmsg(sock, &msg, > - 1, MSG_DONTWAIT | MSG_TRUNC); > - pr_debu...
2017 Dec 01
0
[PATCH 1/3] vhost: fix skb leak in handle_rx()
...c index 8d626d7..c7bdeb6 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -778,16 +778,6 @@ static void handle_rx(struct vhost_net *net) /* On error, stop handling until the next kick. */ if (unlikely(headcount < 0)) goto out; - if (nvq->rx_array) - msg.msg_control = vhost_net_buf_consume(&nvq->rxq); - /* On overrun, truncate and discard */ - if (unlikely(headcount > UIO_MAXIOV)) { - iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); - err = sock->ops->recvmsg(sock, &msg, - 1, MSG_DONTWAIT | MSG_TRUNC); - pr_debug("Discarded rx packet: l...
2018 Jul 03
2
[PATCH v2 net-next 4/4] vhost_net: Avoid rx vring kicks during busyloop
...g that: check again. */ > vhost_disable_notify(&net->dev, vq); > @@ -848,6 +851,7 @@ static void handle_rx(struct vhost_net *net) > * they refilled. */ > goto out; > } > + busyloop_intr = false; > if (nvq->rx_ring) > msg.msg_control = vhost_net_buf_consume(&nvq->rxq); > /* On overrun, truncate and discard */