search for: cancel_pkt

Displaying 20 results from an estimated 44 matches for "cancel_pkt".

2016 Dec 08
1
[PATCH v2 4/4] vsock: cancel packets when failing to connect
...,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 code shared by all transports. You need to add a struct vsock_transport->cancel_pkt() callback instead os a struct virtio_transport->cancel_pkt() callback. And you need to handle the case where cancel_pkt =...
2016 Dec 08
1
[PATCH v2 4/4] vsock: cancel packets when failing to connect
...,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 code shared by all transports. You need to add a struct vsock_transport->cancel_pkt() callback instead os a struct virtio_transport->cancel_pkt() callback. And you need to handle the case where cancel_pkt =...
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
2016 Dec 12
3
[PATCH v4 2/4] vhost-vsock: add pkt cancel capability
...es changed, 44 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index a504e2e0..fef8808 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -218,6 +218,46 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) return len; } +static int +vhost_transport_cancel_pkt(struct vsock_sock *vsk) +{ + struct vhost_vsock *vsock; + struct virtio_vsock_pkt *pkt, *n; + int cnt = 0; + LIST_HEAD(freeme); + + /* Find the vhost_vsock according to guest context id */ + vsock = vhost_vsock_get(vsk->remote_addr.svm_cid); + if (!vsock) + return -ENODEV; + + spin_lock_bh(&am...
2016 Dec 12
3
[PATCH v4 2/4] vhost-vsock: add pkt cancel capability
...es changed, 44 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index a504e2e0..fef8808 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -218,6 +218,46 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) return len; } +static int +vhost_transport_cancel_pkt(struct vsock_sock *vsk) +{ + struct vhost_vsock *vsock; + struct virtio_vsock_pkt *pkt, *n; + int cnt = 0; + LIST_HEAD(freeme); + + /* Find the vhost_vsock according to guest context id */ + vsock = vhost_vsock_get(vsk->remote_addr.svm_cid); + if (!vsock) + return -ENODEV; + + spin_lock_bh(&am...
2016 Dec 08
6
[PATCH v3 2/4] vhost-vsock: add pkt cancel capability
...es changed, 44 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index a504e2e0..db64d51 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -218,6 +218,46 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) return len; } +static int +vhost_transport_cancel_pkt(struct vsock_sock *vsk) +{ + struct vhost_vsock *vsock; + struct virtio_vsock_pkt *pkt, *n; + int cnt = 0; + LIST_HEAD(freeme); + + /* Find the vhost_vsock according to guest context id */ + vsock = vhost_vsock_get(vsk->remote_addr.svm_cid); + if (!vsock) + return -ENODEV; + + spin_lock_bh(&am...
2017 Mar 15
6
[PATCH-v5 0/4] vsock: cancel connect packets when failing to connect
...vsock (both host and guest) to cancel queued packets when a connect attempt is considered to fail. v5 changelog: - change virtio_vsock_pkt->cancel_token back to virtio_vsock_pkt->vsk v4 changelog: - drop two unnecessary void * cast - update new callback comment v3 changelog: - define cancel_pkt callback in struct vsock_transport rather than struct virtio_transport - rename virtio_vsock_pkt->vsk to virtio_vsock_pkt->cancel_token v2 changelog: - fix queued_replies counting and resume tx/rx when necessary Cheers, Tao Peng Tao (4): vsock: track pkt owner vsock vhost-vsock: add...
2016 Dec 08
6
[PATCH v3 2/4] vhost-vsock: add pkt cancel capability
...es changed, 44 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index a504e2e0..db64d51 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -218,6 +218,46 @@ vhost_transport_send_pkt(struct virtio_vsock_pkt *pkt) return len; } +static int +vhost_transport_cancel_pkt(struct vsock_sock *vsk) +{ + struct vhost_vsock *vsock; + struct virtio_vsock_pkt *pkt, *n; + int cnt = 0; + LIST_HEAD(freeme); + + /* Find the vhost_vsock according to guest context id */ + vsock = vhost_vsock_get(vsk->remote_addr.svm_cid); + if (!vsock) + return -ENODEV; + + spin_lock_bh(&am...
2017 Mar 15
6
[PATCH-v5 0/4] vsock: cancel connect packets when failing to connect
...vsock (both host and guest) to cancel queued packets when a connect attempt is considered to fail. v5 changelog: - change virtio_vsock_pkt->cancel_token back to virtio_vsock_pkt->vsk v4 changelog: - drop two unnecessary void * cast - update new callback comment v3 changelog: - define cancel_pkt callback in struct vsock_transport rather than struct virtio_transport - rename virtio_vsock_pkt->vsk to virtio_vsock_pkt->cancel_token v2 changelog: - fix queued_replies counting and resume tx/rx when necessary Cheers, Tao Peng Tao (4): vsock: track pkt owner vsock vhost-vsock: add...
2016 Dec 08
2
[PATCH v3 4/4] vsock: cancel packets when failing to connect
...) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 8a398b3..c73b03a 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1101,10 +1101,19 @@ static const struct proto_ops vsock_dgram_ops = { .sendpage = sock_no_sendpage, }; +static int vsock_transport_cancel_pkt(struct vsock_sock *vsk) +{ + if (!transport->cancel_pkt) + return -EOPNOTSUPP; + + return transport->cancel_pkt(vsk); +} + static void vsock_connect_timeout(struct work_struct *work) { struct sock *sk; struct vsock_sock *vsk; + int cancel = 0; vsk = container_of(work, struct vsock_...
2016 Dec 08
2
[PATCH v3 4/4] vsock: cancel packets when failing to connect
...) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 8a398b3..c73b03a 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1101,10 +1101,19 @@ static const struct proto_ops vsock_dgram_ops = { .sendpage = sock_no_sendpage, }; +static int vsock_transport_cancel_pkt(struct vsock_sock *vsk) +{ + if (!transport->cancel_pkt) + return -EOPNOTSUPP; + + return transport->cancel_pkt(vsk); +} + static void vsock_connect_timeout(struct work_struct *work) { struct sock *sk; struct vsock_sock *vsk; + int cancel = 0; vsk = container_of(work, struct vsock_...
2017 Mar 01
5
[PATCH-v4-RESEND 0/4] vsock: cancel connect packets when failing to connect
..., which can confuse applications with unwanted false connect attempt. The patchset enables vsock (both host and guest) to cancel queued packets when a connect attempt is considered to fail. v4 changelog: - drop two unnecessary void * cast - update new callback comment v3 changelog: - define cancel_pkt callback in struct vsock_transport rather than struct virtio_transport - rename virtio_vsock_pkt->vsk to virtio_vsock_pkt->cancel_token v2 changelog: - fix queued_replies counting and resume tx/rx when necessary Cheers, Tao Peng Tao (4): vsock: track pkt owner vsock vhost-vsock: add...
2017 Mar 01
5
[PATCH-v4-RESEND 0/4] vsock: cancel connect packets when failing to connect
..., which can confuse applications with unwanted false connect attempt. The patchset enables vsock (both host and guest) to cancel queued packets when a connect attempt is considered to fail. v4 changelog: - drop two unnecessary void * cast - update new callback comment v3 changelog: - define cancel_pkt callback in struct vsock_transport rather than struct virtio_transport - rename virtio_vsock_pkt->vsk to virtio_vsock_pkt->cancel_token v2 changelog: - fix queued_replies counting and resume tx/rx when necessary Cheers, Tao Peng Tao (4): vsock: track pkt owner vsock vhost-vsock: add...
2016 Dec 07
0
[PATCH 4/4] vsock: cancel packets when failing to connect
...rk.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 *addr, err = sock_intr_errno(timeout); sk->sk_state = SS_UNCONNECTED; sock->state = SS_UNCONNECTED; + virtio_transport_get_ops()->cancel_pkt(vsk); goto...
2016 Dec 08
4
[PATCH v3 0/4] vsock: cancel connect packets when failing to 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 connect attempt is considered to fail. v3 changelog: - define cancel_pkt callback in struct vsock_transport rather than struct virtio_transport - rename virtio_vsock_pkt->vsk to virtio_vsock_pkt->cancel_token v2 changelog: - fix queued_replies counting and resume tx/rx when necessary Peng Tao (4): vsock: track pkt owner vsock vhost-vsock: add pkt cancel...
2016 Dec 08
4
[PATCH v3 0/4] vsock: cancel connect packets when failing to 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 connect attempt is considered to fail. v3 changelog: - define cancel_pkt callback in struct vsock_transport rather than struct virtio_transport - rename virtio_vsock_pkt->vsk to virtio_vsock_pkt->cancel_token v2 changelog: - fix queued_replies counting and resume tx/rx when necessary Peng Tao (4): vsock: track pkt owner vsock vhost-vsock: add pkt cancel...
2016 Dec 07
0
[PATCH v2 4/4] vsock: cancel packets when failing to connect
...rk.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 *addr, err = sock_intr_errno(timeout); sk->sk_state = SS_UNCONNECTED; sock->state = SS_UNCONNECTED; + virtio_transport_get_ops()->cancel_pkt(vsk); goto...
2016 Dec 12
4
[PATCH v4 0/4] vsock: cancel connect packets when failing to connect
..., which can confuse applications with unwanted false connect attempt. The patchset enables vsock (both host and guest) to cancel queued packets when a connect attempt is considered to fail. v4 changelog: - drop two unnecessary void * cast - update new callback commnet v3 changelog: - define cancel_pkt callback in struct vsock_transport rather than struct virtio_transport - rename virtio_vsock_pkt->vsk to virtio_vsock_pkt->cancel_token v2 changelog: - fix queued_replies counting and resume tx/rx when necessary Cheers, Tao Peng Tao (4): vsock: track pkt owner vsock vhost-vsock: add...
2016 Dec 12
4
[PATCH v4 0/4] vsock: cancel connect packets when failing to connect
..., which can confuse applications with unwanted false connect attempt. The patchset enables vsock (both host and guest) to cancel queued packets when a connect attempt is considered to fail. v4 changelog: - drop two unnecessary void * cast - update new callback commnet v3 changelog: - define cancel_pkt callback in struct vsock_transport rather than struct virtio_transport - rename virtio_vsock_pkt->vsk to virtio_vsock_pkt->cancel_token v2 changelog: - fix queued_replies counting and resume tx/rx when necessary Cheers, Tao Peng Tao (4): vsock: track pkt owner vsock vhost-vsock: add...