search for: msg_control

Displaying 20 results from an estimated 247 matches for "msg_control".

2018 Sep 06
1
[PATCH net-next 08/11] tun: switch to new type of msg_control
On Thu, Sep 06, 2018 at 12:05:23PM +0800, Jason Wang wrote: > This patch introduces to a new tun/tap specific msg_control: > > #define TUN_MSG_UBUF 1 > #define TUN_MSG_PTR 2 > struct tun_msg_ctl { > int type; > void *ptr; > }; > > This allows us to pass different kinds of msg_control through > sendmsg(). The first supported type is ubuf (TUN_MSG_UBUF) which will > be u...
2018 Sep 06
0
[PATCH net-next 08/11] tun: switch to new type of msg_control
This patch introduces to a new tun/tap specific msg_control: #define TUN_MSG_UBUF 1 #define TUN_MSG_PTR 2 struct tun_msg_ctl { int type; void *ptr; }; This allows us to pass different kinds of msg_control through sendmsg(). The first supported type is ubuf (TUN_MSG_UBUF) which will be used by the existed vhost_net zerocopy code. The second...
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 Dec 01
9
[PATCH net,stable v4 0/3] vhost: fix a few skb leaks
...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 v4: - fix zero iov iterator count in tap/tap_do_read()(Jason) - don't put tun in case of EBADFD(Jason) - Replace msg->msg_control with new 'skb' when calling tun/tap_do_read() v3: - move freeing skb from vhost to tun/tap recvmsg() to not confuse the callers. v2: - add Matthew as the reporter, thanks matthew. - moving zero headcount check ahead instead of defer consuming skb due to jason and mst's comment. -...
2017 Dec 01
9
[PATCH net,stable v4 0/3] vhost: fix a few skb leaks
...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 v4: - fix zero iov iterator count in tap/tap_do_read()(Jason) - don't put tun in case of EBADFD(Jason) - Replace msg->msg_control with new 'skb' when calling tun/tap_do_read() v3: - move freeing skb from vhost to tun/tap recvmsg() to not confuse the callers. v2: - add Matthew as the reporter, thanks matthew. - moving zero headcount check ahead instead of defer consuming skb due to jason and mst's comment. -...
2013 Sep 04
2
[PATCH V3 4/6] vhost_net: determine whether or not to use zerocopy at one time
...al idea was that once we start doing zcopy, we keep using the heads ring even for short packets until no zcopy is outstanding. What's the logic behind (nvq->upend_idx + 1) % UIO_MAXIOV != nvq->done_idx here? > + && vhost_net_tx_select_zcopy(net); > > /* use msg_control to pass vhost zerocopy ubuf info to skb */ > if (zcopy_used) { > + struct ubuf_info *ubuf; > + ubuf = nvq->ubuf_info + nvq->upend_idx; > + > vq->heads[nvq->upend_idx].id = head; > - if (!vhost_net_tx_select_zcopy(net) || > - len < VHOST_GOODCOP...
2013 Sep 04
2
[PATCH V3 4/6] vhost_net: determine whether or not to use zerocopy at one time
...al idea was that once we start doing zcopy, we keep using the heads ring even for short packets until no zcopy is outstanding. What's the logic behind (nvq->upend_idx + 1) % UIO_MAXIOV != nvq->done_idx here? > + && vhost_net_tx_select_zcopy(net); > > /* use msg_control to pass vhost zerocopy ubuf info to skb */ > if (zcopy_used) { > + struct ubuf_info *ubuf; > + ubuf = nvq->ubuf_info + nvq->upend_idx; > + > vq->heads[nvq->upend_idx].id = head; > - if (!vhost_net_tx_select_zcopy(net) || > - len < VHOST_GOODCOP...
2017 Nov 29
4
[PATCH net,stable v2] vhost: fix skb leak in handle_rx()
...ers/vhost/net.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(&quo...
2017 Nov 29
4
[PATCH net,stable v2] vhost: fix skb leak in handle_rx()
...ers/vhost/net.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(&quo...
2017 Nov 30
2
[PATCH net,stable v2] vhost: fix skb leak in handle_rx()
...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,...
2017 Nov 30
2
[PATCH net,stable v2] vhost: fix skb leak in handle_rx()
...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,...
2017 Nov 28
6
[PATCH net,stable] vhost: fix skb leak in handle_rx()
...vers/vhost/net.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...
2017 Nov 28
6
[PATCH net,stable] vhost: fix skb leak in handle_rx()
...vers/vhost/net.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...
2018 Sep 06
22
[PATCH net-next 00/11] Vhost_net TX batching
Hi all: This series tries to batch submitting packets to underlayer socket through msg_control during sendmsg(). This is done by: 1) Doing userspace copy inside vhost_net 2) Build XDP buff 3) Batch at most 64 (VHOST_NET_BATCH) XDP buffs and submit them once through msg_control during sendmsg(). 4) Underlayer sockets can use XDP buffs directly when XDP is enalbed, or build skb based on...
2018 Sep 12
14
[PATCH net-next V2 00/11] vhost_net TX batching
Hi all: This series tries to batch submitting packets to underlayer socket through msg_control during sendmsg(). This is done by: 1) Doing userspace copy inside vhost_net 2) Build XDP buff 3) Batch at most 64 (VHOST_NET_BATCH) XDP buffs and submit them once through msg_control during sendmsg(). 4) Underlayer sockets can use XDP buffs directly when XDP is enalbed, or build skb based on...
2018 Sep 12
14
[PATCH net-next V2 00/11] vhost_net TX batching
Hi all: This series tries to batch submitting packets to underlayer socket through msg_control during sendmsg(). This is done by: 1) Doing userspace copy inside vhost_net 2) Build XDP buff 3) Batch at most 64 (VHOST_NET_BATCH) XDP buffs and submit them once through msg_control during sendmsg(). 4) Underlayer sockets can use XDP buffs directly when XDP is enalbed, or build skb based on...
2017 Dec 01
1
[PATCH 2/3] tun: free skb in early errors
From: Wei Xu <wexu at redhat.com> tun_recvmsg() supports accepting skb by msg_control after commit ac77cfd4258f ("tun: support receiving skb through msg_control"), the skb if presented should be freed within the function, otherwise it would be leaked. Signed-off-by: Wei Xu <wexu at redhat.com> Reported-by: Matthew Rosato <mjrosato at linux.vnet.ibm.com> --- d...
2013 Aug 30
0
[PATCH V2 4/6] vhost_net: determine whether or not to use zerocopy at one time
...= zcopy && (len >= VHOST_GOODCOPY_LEN || - nvq->upend_idx != nvq->done_idx); + + zcopy_used = zcopy && len >= VHOST_GOODCOPY_LEN + && (nvq->upend_idx + 1) % UIO_MAXIOV != nvq->done_idx + && vhost_net_tx_select_zcopy(net); /* use msg_control to pass vhost zerocopy ubuf info to skb */ if (zcopy_used) { + struct ubuf_info *ubuf; + ubuf = nvq->ubuf_info + nvq->upend_idx; + vq->heads[nvq->upend_idx].id = head; - if (!vhost_net_tx_select_zcopy(net) || - len < VHOST_GOODCOPY_LEN) { - /* copy don't nee...
2013 Sep 02
0
[PATCH V3 4/6] vhost_net: determine whether or not to use zerocopy at one time
...(len >= VHOST_GOODCOPY_LEN || - nvq->upend_idx != nvq->done_idx); + + zcopy_used = zcopy && len >= VHOST_GOODCOPY_LEN + && (nvq->upend_idx + 1) % UIO_MAXIOV != + nvq->done_idx + && vhost_net_tx_select_zcopy(net); /* use msg_control to pass vhost zerocopy ubuf info to skb */ if (zcopy_used) { + struct ubuf_info *ubuf; + ubuf = nvq->ubuf_info + nvq->upend_idx; + vq->heads[nvq->upend_idx].id = head; - if (!vhost_net_tx_select_zcopy(net) || - len < VHOST_GOODCOPY_LEN) { - /* copy don't nee...