search for: sk_state

Displaying 20 results from an estimated 90 matches for "sk_state".

2017 Nov 27
2
[PATCH] VSOCK: Don't set sk_state to TCP_CLOSE before testing it
A recent commit (3b4477d2dcf2) converted the sk_state to use TCP constants. In that change, vmci_transport_handle_detach was changed such that sk->sk_state was set to TCP_CLOSE before we test whether it is TCP_SYN_SENT. This change moves the sk_state change back to the original locations in that function. Signed-off-by: Jorgen Hansen <jhansen a...
2017 Nov 27
2
[PATCH] VSOCK: Don't set sk_state to TCP_CLOSE before testing it
A recent commit (3b4477d2dcf2) converted the sk_state to use TCP constants. In that change, vmci_transport_handle_detach was changed such that sk->sk_state was set to TCP_CLOSE before we test whether it is TCP_SYN_SENT. This change moves the sk_state change back to the original locations in that function. Signed-off-by: Jorgen Hansen <jhansen a...
2015 Oct 29
1
[PATCH] VSOCK: define VSOCK_SS_LISTEN once only
....c | 4 +--- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h index db639a4..e9eb2d6 100644 --- a/include/net/af_vsock.h +++ b/include/net/af_vsock.h @@ -22,6 +22,9 @@ #include "vsock_addr.h" +/* vsock-specific sock->sk_state constants */ +#define VSOCK_SS_LISTEN 255 + #define LAST_RESERVED_PORT 1023 #define vsock_sk(__sk) ((struct vsock_sock *)__sk) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index df5fc6b..65f2c9c 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -36,1...
2015 Oct 29
1
[PATCH] VSOCK: define VSOCK_SS_LISTEN once only
....c | 4 +--- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h index db639a4..e9eb2d6 100644 --- a/include/net/af_vsock.h +++ b/include/net/af_vsock.h @@ -22,6 +22,9 @@ #include "vsock_addr.h" +/* vsock-specific sock->sk_state constants */ +#define VSOCK_SS_LISTEN 255 + #define LAST_RESERVED_PORT 1023 #define vsock_sk(__sk) ((struct vsock_sock *)__sk) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index df5fc6b..65f2c9c 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -36,1...
2016 Dec 08
2
[PATCH v3 4/4] vsock: cancel packets when failing to connect
...atic void vsock_connect_timeout(struct work_struct *work) { struct sock *sk; struct vsock_sock *vsk; + int cancel = 0; vsk = container_of(work, struct vsock_sock, dwork.work); sk = sk_vsock(vsk); @@ -1115,8 +1124,11 @@ static void vsock_connect_timeout(struct work_struct *work) sk->sk_state = SS_UNCONNECTED; sk->sk_err = ETIMEDOUT; sk->sk_error_report(sk); + cancel = 1; } release_sock(sk); + if (cancel) + vsock_transport_cancel_pkt(vsk); sock_put(sk); } @@ -1223,11 +1235,13 @@ static int vsock_stream_connect(struct socket *sock, struct sockaddr *addr, err =...
2016 Dec 08
2
[PATCH v3 4/4] vsock: cancel packets when failing to connect
...atic void vsock_connect_timeout(struct work_struct *work) { struct sock *sk; struct vsock_sock *vsk; + int cancel = 0; vsk = container_of(work, struct vsock_sock, dwork.work); sk = sk_vsock(vsk); @@ -1115,8 +1124,11 @@ static void vsock_connect_timeout(struct work_struct *work) sk->sk_state = SS_UNCONNECTED; sk->sk_err = ETIMEDOUT; sk->sk_error_report(sk); + cancel = 1; } release_sock(sk); + if (cancel) + vsock_transport_cancel_pkt(vsk); sock_put(sk); } @@ -1223,11 +1235,13 @@ static int vsock_stream_connect(struct socket *sock, struct sockaddr *addr, err =...
2017 Nov 24
1
[PATCH v2] VSOCK: Don't call vsock_stream_has_data in atomic context
...using kernel version 4.4 and later. Testing: Ran vsock tests between guest and host, and verified that with this change, the host isn't calling vsock_stream_has_data during detach. Ran mixedTest between guest and host using both guest and host as server. v2: Rebased on top of recent change to sk_state values Reviewed-by: Adit Ranadive <aditr at vmware.com> Reviewed-by: Aditya Sarwade <asarwade at vmware.com> Reviewed-by: Stefan Hajnoczi <stefanha at redhat.com> Signed-off-by: Jorgen Hansen <jhansen at vmware.com> --- net/vmw_vsock/vmci_transport.c | 10 +++++++--- 1 fi...
2017 Nov 24
1
[PATCH v2] VSOCK: Don't call vsock_stream_has_data in atomic context
...using kernel version 4.4 and later. Testing: Ran vsock tests between guest and host, and verified that with this change, the host isn't calling vsock_stream_has_data during detach. Ran mixedTest between guest and host using both guest and host as server. v2: Rebased on top of recent change to sk_state values Reviewed-by: Adit Ranadive <aditr at vmware.com> Reviewed-by: Aditya Sarwade <asarwade at vmware.com> Reviewed-by: Stefan Hajnoczi <stefanha at redhat.com> Signed-off-by: Jorgen Hansen <jhansen at vmware.com> --- net/vmw_vsock/vmci_transport.c | 10 +++++++--- 1 fi...
2016 Dec 07
0
[PATCH 4/4] vsock: cancel packets when failing to connect
...atic void vsock_connect_timeout(struct work_struct *work) { struct sock *sk; struct vsock_sock *vsk; + int cancel = 0; vsk = container_of(work, struct vsock_sock, dwork.work); sk = sk_vsock(vsk); @@ -1115,8 +1117,11 @@ static void vsock_connect_timeout(struct work_struct *work) sk->sk_state = SS_UNCONNECTED; sk->sk_err = ETIMEDOUT; sk->sk_error_report(sk); + cancel = 1; } release_sock(sk); + if (cancel) + virtio_transport_get_ops()->cancel_pkt(vsk); sock_put(sk); } @@ -1223,11 +1228,13 @@ static int vsock_stream_connect(struct socket *sock, struct sockaddr *a...
2016 Dec 07
0
[PATCH v2 4/4] vsock: cancel packets when failing to connect
...atic void vsock_connect_timeout(struct work_struct *work) { struct sock *sk; struct vsock_sock *vsk; + int cancel = 0; vsk = container_of(work, struct vsock_sock, dwork.work); sk = sk_vsock(vsk); @@ -1115,8 +1117,11 @@ static void vsock_connect_timeout(struct work_struct *work) sk->sk_state = SS_UNCONNECTED; sk->sk_err = ETIMEDOUT; sk->sk_error_report(sk); + cancel = 1; } release_sock(sk); + if (cancel) + virtio_transport_get_ops()->cancel_pkt(vsk); sock_put(sk); } @@ -1223,11 +1228,13 @@ static int vsock_stream_connect(struct socket *sock, struct sockaddr *a...
2016 Dec 08
1
[PATCH v2 4/4] vsock: cancel packets when failing to connect
...truct *work) > { > struct sock *sk; > struct vsock_sock *vsk; > + int cancel = 0; > > vsk = container_of(work, struct vsock_sock, dwork.work); > sk = sk_vsock(vsk); > @@ -1115,8 +1117,11 @@ static void vsock_connect_timeout(struct work_struct *work) > sk->sk_state = SS_UNCONNECTED; > sk->sk_err = ETIMEDOUT; > sk->sk_error_report(sk); > + cancel = 1; > } > release_sock(sk); > + if (cancel) > + virtio_transport_get_ops()->cancel_pkt(vsk); This doesn't work with the VMCI transport. Remember af_vsock.c is common co...
2016 Dec 08
1
[PATCH v2 4/4] vsock: cancel packets when failing to connect
...truct *work) > { > struct sock *sk; > struct vsock_sock *vsk; > + int cancel = 0; > > vsk = container_of(work, struct vsock_sock, dwork.work); > sk = sk_vsock(vsk); > @@ -1115,8 +1117,11 @@ static void vsock_connect_timeout(struct work_struct *work) > sk->sk_state = SS_UNCONNECTED; > sk->sk_err = ETIMEDOUT; > sk->sk_error_report(sk); > + cancel = 1; > } > release_sock(sk); > + if (cancel) > + virtio_transport_get_ops()->cancel_pkt(vsk); This doesn't work with the VMCI transport. Remember af_vsock.c is common co...
2016 Dec 07
8
[PATCH v2 0/4] vsock: cancel connect packets when failing to connect
Currently, if a connect call fails on a signal or timeout (e.g., guest is still in the process of starting up), we'll just return to caller and leave the connect packet queued and they are sent even though the connection is considered a failure, which can confuse applications with unwanted false connect attempt. The patchset enables vsock (both host and guest) to cancel queued packets when a
2016 Dec 07
8
[PATCH v2 0/4] vsock: cancel connect packets when failing to connect
Currently, if a connect call fails on a signal or timeout (e.g., guest is still in the process of starting up), we'll just return to caller and leave the connect packet queued and they are sent even though the connection is considered a failure, which can confuse applications with unwanted false connect attempt. The patchset enables vsock (both host and guest) to cancel queued packets when a
2019 Oct 23
0
[PATCH net-next 11/14] vsock: add multi-transports support
...we are connecting to. */ - memcpy(&vsk->remote_addr, remote_addr, - sizeof(vsk->remote_addr)); - err = vsock_auto_bind(vsk); if (err) goto out; @@ -1586,7 +1651,7 @@ static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg, goto out; } - if (sk->sk_state != TCP_ESTABLISHED || + if (!transport || sk->sk_state != TCP_ESTABLISHED || !vsock_addr_bound(&vsk->local_addr)) { err = -ENOTCONN; goto out; @@ -1712,7 +1777,7 @@ vsock_stream_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, lock_sock(sk); - if (sk->sk_s...
2019 Sep 27
0
[RFC PATCH 10/13] vsock: add multi-transports support
...we are connecting to. */ - memcpy(&vsk->remote_addr, remote_addr, - sizeof(vsk->remote_addr)); - err = vsock_auto_bind(vsk); if (err) goto out; @@ -1572,7 +1630,7 @@ static int vsock_stream_sendmsg(struct socket *sock, struct msghdr *msg, goto out; } - if (sk->sk_state != TCP_ESTABLISHED || + if (!transport || sk->sk_state != TCP_ESTABLISHED || !vsock_addr_bound(&vsk->local_addr)) { err = -ENOTCONN; goto out; @@ -1698,7 +1756,7 @@ vsock_stream_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, lock_sock(sk); - if (sk->sk_s...
2013 Jun 27
1
[RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko
...pkt) > +{ > + struct vsock_sock *vsk = vsock_sk(sk); > + int err; > + int skerr; > + > + pr_debug("%s: vsk=%p\n", __func__, vsk); > + switch (pkt->hdr.op) { > + case VIRTIO_VSOCK_OP_ATTACH: > + pr_debug("%s: got attach\n", __func__); > + sk->sk_state = SS_CONNECTED; > + sk->sk_socket->state = SS_CONNECTED; > + vsock_insert_connected(vsk); > + sk->sk_state_change(sk); > + break; > + case VIRTIO_VSOCK_OP_NEGOTIATE: > + pr_debug("%s: got negotiate and send_offer\n", __func__); > + err = virtio_transpor...
2013 Jun 27
1
[RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko
...pkt) > +{ > + struct vsock_sock *vsk = vsock_sk(sk); > + int err; > + int skerr; > + > + pr_debug("%s: vsk=%p\n", __func__, vsk); > + switch (pkt->hdr.op) { > + case VIRTIO_VSOCK_OP_ATTACH: > + pr_debug("%s: got attach\n", __func__); > + sk->sk_state = SS_CONNECTED; > + sk->sk_socket->state = SS_CONNECTED; > + vsock_insert_connected(vsk); > + sk->sk_state_change(sk); > + break; > + case VIRTIO_VSOCK_OP_NEGOTIATE: > + pr_debug("%s: got negotiate and send_offer\n", __func__); > + err = virtio_transpor...
2013 Jun 27
0
[RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko
...g(struct sock *sk, + struct virtio_vsock_pkt *pkt) +{ + struct vsock_sock *vsk = vsock_sk(sk); + int err; + int skerr; + + pr_debug("%s: vsk=%p\n", __func__, vsk); + switch (pkt->hdr.op) { + case VIRTIO_VSOCK_OP_ATTACH: + pr_debug("%s: got attach\n", __func__); + sk->sk_state = SS_CONNECTED; + sk->sk_socket->state = SS_CONNECTED; + vsock_insert_connected(vsk); + sk->sk_state_change(sk); + break; + case VIRTIO_VSOCK_OP_NEGOTIATE: + pr_debug("%s: got negotiate and send_offer\n", __func__); + err = virtio_transport_send_offer(vsk); + if (err <...
2013 Jan 25
4
[PATCH 0/1] VM Sockets for Linux upstreaming
From: Andy King <acking at vmware.com> ** Introduce VM Sockets *** In an effort to improve the out-of-the-box experience with Linux kernels for VMware users, VMware is working on readying the VM Sockets (VSOCK, formerly VMCI Sockets) (vmw_vsock) kernel module for inclusion in the Linux kernel. The purpose of this post is to acquire feedback on the vmw_vsock kernel module. Unlike previous