search for: msg_errqueue

Displaying 20 results from an estimated 43 matches for "msg_errqueue".

2017 Dec 01
1
[PATCH 2/3] tun: free skb in early errors
...uct tun_file *tfile = container_of(sock, struct tun_file, socket); struct tun_struct *tun = tun_get(tfile); + struct sk_buff *skb = m->msg_control; int ret; - if (!tun) - return -EBADFD; + if (!tun) { + ret = -EBADFD; + goto out_free_skb; + } if (flags & ~(MSG_DONTWAIT|MSG_TRUNC|MSG_ERRQUEUE)) { ret = -EINVAL; - goto out; + goto out_free_skb; } if (flags & MSG_ERRQUEUE) { ret = sock_recv_errqueue(sock->sk, m, total_len, @@ -2087,6 +2090,11 @@ static int tun_recvmsg(struct socket *sock, struct msghdr *m, size_t total_len, m->msg_flags |= MSG_TRUNC; ret = flag...
2023 Feb 16
0
[RFC PATCH v1 02/12] vsock: read from socket's error queue
On Mon, Feb 06, 2023 at 06:54:51AM +0000, Arseniy Krasnov wrote: >This adds handling of MSG_ERRQUEUE input flag for receive call, thus >skb from socket's error queue is read. A general tip, add a little more description in the commit messages, especially to explain why these changes are necessary. Otherwise, even review becomes difficult because one has to look at all the patches to unders...
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
0
[PATCH 2/3] tun: free skb in early errors
...ruct sk_buff *skb = m->msg_control; > int ret; > > - if (!tun) > - return -EBADFD; > + if (!tun) { > + ret = -EBADFD; > + goto out_free_skb; Unfortunately, you can't to there since tun is NULL. > + } > > if (flags & ~(MSG_DONTWAIT|MSG_TRUNC|MSG_ERRQUEUE)) { > ret = -EINVAL; > - goto out; > + goto out_free_skb; > } > if (flags & MSG_ERRQUEUE) { > ret = sock_recv_errqueue(sock->sk, m, total_len, > @@ -2087,6 +2090,11 @@ static int tun_recvmsg(struct socket *sock, struct msghdr *m, size_t total_len, >...
2017 Dec 01
0
[PATCH 2/3] tun: free skb in early errors
...cket); > struct tun_struct *tun = tun_get(tfile); > + struct sk_buff *skb = m->msg_control; > int ret; > > - if (!tun) > - return -EBADFD; > + if (!tun) { > + ret = -EBADFD; > + goto out_free_skb; > + } > > if (flags & ~(MSG_DONTWAIT|MSG_TRUNC|MSG_ERRQUEUE)) { > ret = -EINVAL; > - goto out; > + goto out_put_tun; > } > if (flags & MSG_ERRQUEUE) { > ret = sock_recv_errqueue(sock->sk, m, total_len, > SOL_PACKET, TUN_TX_TIMESTAMP); > goto out; > } > - ret = tun_do_read(tun, tfile, &m->ms...
2017 Dec 01
0
[PATCH 2/3] tun: free skb in early errors
...uct tun_file *tfile = container_of(sock, struct tun_file, socket); struct tun_struct *tun = tun_get(tfile); + struct sk_buff *skb = m->msg_control; int ret; - if (!tun) - return -EBADFD; + if (!tun) { + ret = -EBADFD; + goto out_free_skb; + } if (flags & ~(MSG_DONTWAIT|MSG_TRUNC|MSG_ERRQUEUE)) { ret = -EINVAL; - goto out; + goto out_put_tun; } if (flags & MSG_ERRQUEUE) { ret = sock_recv_errqueue(sock->sk, m, total_len, SOL_PACKET, TUN_TX_TIMESTAMP); goto out; } - ret = tun_do_read(tun, tfile, &m->msg_iter, flags & MSG_DONTWAIT, - m->msg_...
2023 Nov 07
0
[PATCH AUTOSEL 6.1 11/18] vsock: read from socket's error queue
From: Arseniy Krasnov <avkrasnov at salutedevices.com> [ Upstream commit 49dbe25adac42d3e06f65d1420946bec65896222 ] This adds handling of MSG_ERRQUEUE input flag in receive call. This flag is used to read socket's error queue instead of data queue. Possible scenario of error queue usage is receiving completions for transmission with MSG_ZEROCOPY flag. This patch also adds new defines: 'SOL_VSOCK' and 'VSOCK_RECVERR'. Signed-o...
2023 Nov 07
0
[PATCH AUTOSEL 6.6 21/31] vsock: read from socket's error queue
From: Arseniy Krasnov <avkrasnov at salutedevices.com> [ Upstream commit 49dbe25adac42d3e06f65d1420946bec65896222 ] This adds handling of MSG_ERRQUEUE input flag in receive call. This flag is used to read socket's error queue instead of data queue. Possible scenario of error queue usage is receiving completions for transmission with MSG_ZEROCOPY flag. This patch also adds new defines: 'SOL_VSOCK' and 'VSOCK_RECVERR'. Signed-o...
2023 Nov 07
0
[PATCH AUTOSEL 6.5 20/30] vsock: read from socket's error queue
From: Arseniy Krasnov <avkrasnov at salutedevices.com> [ Upstream commit 49dbe25adac42d3e06f65d1420946bec65896222 ] This adds handling of MSG_ERRQUEUE input flag in receive call. This flag is used to read socket's error queue instead of data queue. Possible scenario of error queue usage is receiving completions for transmission with MSG_ZEROCOPY flag. This patch also adds new defines: 'SOL_VSOCK' and 'VSOCK_RECVERR'. Signed-o...
2017 Dec 01
9
[PATCH net,stable v4 0/3] 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 v4: - fix zero iov iterator count in tap/tap_do_read()(Jason) - don't put tun in case of EBADFD(Jason) - Replace
2017 Dec 01
9
[PATCH net,stable v4 0/3] 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 v4: - fix zero iov iterator count in tap/tap_do_read()(Jason) - don't put tun in case of EBADFD(Jason) - Replace
2017 Nov 30
2
[PATCH net,stable v2] vhost: fix skb leak in handle_rx()
...t *sock, struct msghdr *m, size_t total_len, ??? ??? ?????? int flags) { ??? struct tun_file *tfile = container_of(sock, struct tun_file, socket); ??? struct tun_struct *tun = __tun_get(tfile); ??? int ret; ??? if (!tun) ??? ??? return -EBADFD; ??? if (flags & ~(MSG_DONTWAIT|MSG_TRUNC|MSG_ERRQUEUE)) { ??? ??? ret = -EINVAL; ??? ??? goto out; ??? } And tun_do_read() has: ??? if (!iov_iter_count(to)) ??? ??? return 0; So I think we need free skb in those cases. Thanks
2017 Nov 30
2
[PATCH net,stable v2] vhost: fix skb leak in handle_rx()
...t *sock, struct msghdr *m, size_t total_len, ??? ??? ?????? int flags) { ??? struct tun_file *tfile = container_of(sock, struct tun_file, socket); ??? struct tun_struct *tun = __tun_get(tfile); ??? int ret; ??? if (!tun) ??? ??? return -EBADFD; ??? if (flags & ~(MSG_DONTWAIT|MSG_TRUNC|MSG_ERRQUEUE)) { ??? ??? ret = -EINVAL; ??? ??? goto out; ??? } And tun_do_read() has: ??? if (!iov_iter_count(to)) ??? ??? return 0; So I think we need free skb in those cases. Thanks
2023 Feb 16
0
[RFC PATCH v1 12/12] test/vsock: MSG_ZEROCOPY support for vsock_perf
...tatic void recv_completion(int fd) >+{ >+ struct sock_extended_err *serr; >+ char cmsg_data[128]; >+ struct cmsghdr *cm; >+ struct msghdr msg; >+ int ret; >+ >+ msg.msg_control = cmsg_data; >+ msg.msg_controllen = sizeof(cmsg_data); >+ >+ ret = recvmsg(fd, &msg, MSG_ERRQUEUE); >+ if (ret == -1) >+ return; >+ >+ cm = CMSG_FIRSTHDR(&msg); >+ if (!cm) { >+ fprintf(stderr, "cmsg: no cmsg\n"); >+ return; >+ } >+ >+ if (cm->cmsg_level != SOL_VSOCK) { >+ fprintf(stderr, "cmsg: unexpected 'cmsg_level'\n");...
2010 Mar 13
1
klibc build trouble
as the next klibc release 1.5.16 looks like shaping up, I have a trouble to build that for Debian. currently I build depent on linux-libc-dev, I don't know what against I can build latest klibc, see klibc fails to build due too: make -C linux/ ARCH=x86_64 INSTALL_HDR_PATH=debian/tmp/usr/lib/klibc/ headers_install make[3]: *** No rule to make target `headers_install'. Stop. make[2]: ***
2017 Nov 29
4
[PATCH net,stable v2] vhost: fix skb leak in handle_rx()
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 Eventually we figured out that it was a skb leak in handle_rx() when sending packets to the VM. This usually happens when a guest
2017 Nov 29
4
[PATCH net,stable v2] vhost: fix skb leak in handle_rx()
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 Eventually we figured out that it was a skb leak in handle_rx() when sending packets to the VM. This usually happens when a guest
2013 Jun 27
1
[RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko
...struct msghdr *msg, > + size_t len, int flags) > +{ > + struct virtio_vsock_pkt *pkt; > + struct sk_buff *skb; > + size_t payload_len; > + int noblock; > + int err; > + > + noblock = flags & MSG_DONTWAIT; > + > + if (flags & MSG_OOB || flags & MSG_ERRQUEUE) > + return -EOPNOTSUPP; > + > + msg->msg_namelen = 0; > + > + /* Retrieve the head sk_buff from the socket's receive queue. */ > + err = 0; > + skb = skb_recv_datagram(&vsk->sk, flags, noblock, &err); > + if (err) > + return err; > + if (!skb) >...
2013 Jun 27
1
[RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko
...struct msghdr *msg, > + size_t len, int flags) > +{ > + struct virtio_vsock_pkt *pkt; > + struct sk_buff *skb; > + size_t payload_len; > + int noblock; > + int err; > + > + noblock = flags & MSG_DONTWAIT; > + > + if (flags & MSG_OOB || flags & MSG_ERRQUEUE) > + return -EOPNOTSUPP; > + > + msg->msg_namelen = 0; > + > + /* Retrieve the head sk_buff from the socket's receive queue. */ > + err = 0; > + skb = skb_recv_datagram(&vsk->sk, flags, noblock, &err); > + if (err) > + return err; > + if (!skb) >...