[PATCH-v5 1/4] vsock: track pkt owner vsock

2017-03-14 Thread Peng Tao
So that we can cancel a queued pkt later if necessary. Signed-off-by: Peng Tao --- include/linux/virtio_vsock.h| 3 +++ net/vmw_vsock/virtio_transport_common.c | 7 +++ 2 files changed, 10 insertions(+) diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h

[PATCH-v5 2/4] vhost-vsock: add pkt cancel capability

2017-03-14 Thread Peng Tao
To allow canceling all packets of a connection. Reviewed-by: Stefan Hajnoczi Reviewed-by: Jorgen Hansen Signed-off-by: Peng Tao --- drivers/vhost/vsock.c | 41 + include/net/af_vsock.h | 3 +++ 2 files changed, 44 insertions(+) diff --git a/drivers

[PATCH-v5 3/4] vsock: add pkt cancel capability

2017-03-14 Thread Peng Tao
Reviewed-by: Stefan Hajnoczi Signed-off-by: Peng Tao --- net/vmw_vsock/virtio_transport.c | 42 1 file changed, 42 insertions(+) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 9d24c0e..bcab8f2 100644 --- a/net

[PATCH-v5 4/4] vsock: cancel packets when failing to connect

2017-03-14 Thread Peng Tao
Otherwise we'll leave the packets queued until releasing vsock device. E.g., if guest is slow to start up, resulting ETIMEDOUT on connect, guest will get the connect requests from failed host sockets. Reviewed-by: Stefan Hajnoczi Reviewed-by: Jorgen Hansen Signed-off-by: Peng Tao ---

[PATCH-v5 0/4] vsock: cancel connect packets when failing to connect

2017-03-14 Thread Peng Tao
ew 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

Re: [PATCH-v4-RESEND 1/4] vsock: track pkt owner vsock

2017-03-02 Thread Peng Tao
On Fri, Mar 3, 2017 at 5:13 AM, David Miller wrote: > From: Peng Tao > Date: Wed, 1 Mar 2017 11:56:24 +0800 > >> So that we can cancel a queued pkt later if necessary. >> >> Reviewed-by: Stefan Hajnoczi >> Signed-off-by: Peng Tao >> --- >>

[PATCH-v4-RESEND 2/4] vhost-vsock: add pkt cancel capability

2017-02-28 Thread Peng Tao
To allow canceling all packets of a connection. Reviewed-by: Stefan Hajnoczi Reviewed-by: Jorgen Hansen Signed-off-by: Peng Tao --- drivers/vhost/vsock.c | 41 + include/net/af_vsock.h | 3 +++ 2 files changed, 44 insertions(+) diff --git a/drivers

[PATCH-v4-RESEND 3/4] vsock: add pkt cancel capability

2017-02-28 Thread Peng Tao
Reviewed-by: Stefan Hajnoczi Signed-off-by: Peng Tao --- net/vmw_vsock/virtio_transport.c | 42 1 file changed, 42 insertions(+) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 6788264..f5c44b5 100644 --- a/net

[PATCH-v4-RESEND 4/4] vsock: cancel packets when failing to connect

2017-02-28 Thread Peng Tao
Otherwise we'll leave the packets queued until releasing vsock device. E.g., if guest is slow to start up, resulting ETIMEDOUT on connect, guest will get the connect requests from failed host sockets. Reviewed-by: Stefan Hajnoczi Reviewed-by: Jorgen Hansen Signed-off-by: Peng Tao ---

[PATCH-v4-RESEND 0/4] vsock: cancel connect packets when failing to connect

2017-02-28 Thread Peng Tao
;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 pkt cancel capability vsock: add pkt cancel capability vsock: cancel packets when failing to connect drive

[PATCH-v4-RESEND 1/4] vsock: track pkt owner vsock

2017-02-28 Thread Peng Tao
So that we can cancel a queued pkt later if necessary. Reviewed-by: Stefan Hajnoczi Signed-off-by: Peng Tao --- include/linux/virtio_vsock.h| 2 ++ net/vmw_vsock/virtio_transport_common.c | 7 +++ 2 files changed, 9 insertions(+) diff --git a/include/linux/virtio_vsock.h b

Re: [PATCH v4 0/4] vsock: cancel connect packets when failing to connect

2017-01-05 Thread Peng Tao
On Tue, Dec 13, 2016 at 5:50 PM, Stefan Hajnoczi wrote: > On Mon, Dec 12, 2016 at 08:21:05PM +0800, Peng Tao wrote: >> 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

[PATCH v4 2/4] vhost-vsock: add pkt cancel capability

2016-12-12 Thread Peng Tao
To allow canceling all packets of a connection. Reviewed-by: Stefan Hajnoczi Signed-off-by: Peng Tao --- drivers/vhost/vsock.c | 41 + include/net/af_vsock.h | 3 +++ 2 files changed, 44 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost

[PATCH v4 1/4] vsock: track pkt owner vsock

2016-12-12 Thread Peng Tao
So that we can cancel a queued pkt later if necessary. Signed-off-by: Peng Tao --- include/linux/virtio_vsock.h| 2 ++ net/vmw_vsock/virtio_transport_common.c | 7 +++ 2 files changed, 9 insertions(+) diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h

[PATCH v4 4/4] vsock: cancel packets when failing to connect

2016-12-12 Thread Peng Tao
Otherwise we'll leave the packets queued until releasing vsock device. E.g., if guest is slow to start up, resulting ETIMEDOUT on connect, guest will get the connect requests from failed host sockets. Reviewed-by: Stefan Hajnoczi Reviewed-by: Jorgen Hansen Signed-off-by: Peng Tao ---

[PATCH v4 3/4] vsock: add pkt cancel capability

2016-12-12 Thread Peng Tao
Reviewed-by: Stefan Hajnoczi Signed-off-by: Peng Tao --- net/vmw_vsock/virtio_transport.c | 42 1 file changed, 42 insertions(+) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 936d7ee..b7b78ce 100644 --- a/net

[PATCH v4 0/4] vsock: cancel connect packets when failing to connect

2016-12-12 Thread Peng Tao
ather 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 pkt cancel capability vsock: add

Re: [PATCH v3 2/4] vhost-vsock: add pkt cancel capability

2016-12-12 Thread Peng Tao
On Mon, Dec 12, 2016 at 6:37 PM, Jorgen S. Hansen wrote: > >> On Dec 8, 2016, at 6:12 PM, Peng Tao wrote: >> >> --- a/include/net/af_vsock.h >> +++ b/include/net/af_vsock.h >> @@ -100,6 +100,9 @@ struct vsock_transport { >> void (*destruct)(struct

Re: [PATCH v3 0/4] vsock: cancel connect packets when failing to connect

2016-12-12 Thread Peng Tao
On Fri, Dec 9, 2016 at 6:18 PM, Stefan Hajnoczi wrote: > On Fri, Dec 09, 2016 at 01:12:32AM +0800, Peng Tao wrote: >> 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

[PATCH v3 3/4] vsock: add pkt cancel capability

2016-12-08 Thread Peng Tao
Reviewed-by: Stefan Hajnoczi Signed-off-by: Peng Tao --- net/vmw_vsock/virtio_transport.c | 42 1 file changed, 42 insertions(+) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 936d7ee..95c1162 100644 --- a/net

[PATCH v3 1/4] vsock: track pkt owner vsock

2016-12-08 Thread Peng Tao
So that we can cancel a queued pkt later if necessary. Signed-off-by: Peng Tao --- include/linux/virtio_vsock.h| 2 ++ net/vmw_vsock/virtio_transport_common.c | 7 +++ 2 files changed, 9 insertions(+) diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h

[PATCH v3 2/4] vhost-vsock: add pkt cancel capability

2016-12-08 Thread Peng Tao
To allow canceling all packets of a connection. Reviewed-by: Stefan Hajnoczi Signed-off-by: Peng Tao --- drivers/vhost/vsock.c | 41 + include/net/af_vsock.h | 3 +++ 2 files changed, 44 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost

[PATCH v3 0/4] vsock: cancel connect packets when failing to connect

2016-12-08 Thread Peng Tao
sock_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 capability vsock: add pkt cancel capability vsock: cancel packets when failing to connect drivers/vh

[PATCH v3 4/4] vsock: cancel packets when failing to connect

2016-12-08 Thread Peng Tao
Otherwise we'll leave the packets queued until releasing vsock device. E.g., if guest is slow to start up, resulting ETIMEDOUT on connect, guest will get the connect requests from failed host sockets. Reviewed-by: Stefan Hajnoczi Signed-off-by: Peng Tao --- net/vmw_vsock/af_vsock.c

[PATCH-RESEND] vhost-vsock: fix orphan connection reset

2016-12-08 Thread Peng Tao
local_addr.svm_cid is host cid. We should check guest cid instead, which is remote_addr.svm_cid. Otherwise we end up resetting all connections to all guests. Cc: sta...@vger.kernel.org [4.8+] Reviewed-by: Stefan Hajnoczi Signed-off-by: Peng Tao --- resending because the last attempt looks to be

Re: [PATCH v2 4/4] vsock: cancel packets when failing to connect

2016-12-08 Thread Peng Tao
On Thu, Dec 8, 2016 at 5:24 PM, Stefan Hajnoczi wrote: > On Wed, Dec 07, 2016 at 11:14:12PM +0800, Peng Tao wrote: >> Otherwise we'll leave the packets queued until releasing vsock device. >> E.g., if guest is slow to start up, resulting ETIMEDOUT on connect, guest >

Re: [PATCH v2 1/4] vsock: track pkt owner vsock

2016-12-08 Thread Peng Tao
On Thu, Dec 8, 2016 at 5:30 PM, Stefan Hajnoczi wrote: > On Wed, Dec 07, 2016 at 11:14:09PM +0800, Peng Tao wrote: >> So that we can cancel a queued pkt later if necessary. >> >> Signed-off-by: Peng Tao >> --- >> include/linux/virtio_vsock.h

[PATCH v2 4/4] vsock: cancel packets when failing to connect

2016-12-07 Thread Peng Tao
Otherwise we'll leave the packets queued until releasing vsock device. E.g., if guest is slow to start up, resulting ETIMEDOUT on connect, guest will get the connect requests from failed host sockets. Reviewed-by: Stefan Hajnoczi Signed-off-by: Peng Tao --- include/linux/virtio_vs

[PATCH v2 1/4] vsock: track pkt owner vsock

2016-12-07 Thread Peng Tao
So that we can cancel a queued pkt later if necessary. Signed-off-by: Peng Tao --- include/linux/virtio_vsock.h| 2 ++ net/vmw_vsock/virtio_transport_common.c | 7 +++ 2 files changed, 9 insertions(+) diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h

[PATCH v2 2/4] vhost-vsock: add pkt cancel capability

2016-12-07 Thread Peng Tao
To allow canceling all packets of a connection. Signed-off-by: Peng Tao --- drivers/vhost/vsock.c| 41 + include/linux/virtio_vsock.h | 3 +++ 2 files changed, 44 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index

[PATCH v2 3/4] vsock: add pkt cancel capability

2016-12-07 Thread Peng Tao
Signed-off-by: Peng Tao --- net/vmw_vsock/virtio_transport.c | 42 1 file changed, 42 insertions(+) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 936d7ee..a5f3833 100644 --- a/net/vmw_vsock/virtio_transport.c

[PATCH v2 0/4] vsock: cancel connect packets when failing to connect

2016-12-07 Thread Peng Tao
false connect attempt. The patchset enables vsock (both host and guest) to cancel queued packets when a connect attempt is considered to fail. v2 changelog: - fix queued_replies counting and resume tx/rx when necessary Peng Tao (4): vsock: track pkt owner vsock vhost-vsock: add pkt c

Re: [PATCH 3/4] vsock: add pkt cancel capability

2016-12-07 Thread Peng Tao
On Wed, Dec 7, 2016 at 9:22 PM, Stefan Hajnoczi wrote: > On Wed, Dec 07, 2016 at 06:00:20PM +0800, Peng Tao wrote: >> Signed-off-by: Peng Tao >> --- >> net/vmw_vsock/virtio_transport.c | 36 >> 1 file changed, 36 insertion

[PATCH 3/4] vsock: add pkt cancel capability

2016-12-07 Thread Peng Tao
Signed-off-by: Peng Tao --- net/vmw_vsock/virtio_transport.c | 36 1 file changed, 36 insertions(+) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 936d7ee..f88b6ed 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b

[PATCH 4/4] vsock: cancel packets when failing to connect

2016-12-07 Thread Peng Tao
Otherwise we'll leave the packets queued until releasing vsock device. E.g., if guest is slow to start up, resulting ETIMEDOUT on connect, guest will get the connect requests from failed host sockets. Signed-off-by: Peng Tao --- include/linux/virtio_vsock.h| 7 +++ net/vmw_

[PATCH 1/4] vsock: track pkt owner vsock

2016-12-07 Thread Peng Tao
So that we can cancel a queued pkt later if necessary. Signed-off-by: Peng Tao --- include/linux/virtio_vsock.h| 2 ++ net/vmw_vsock/virtio_transport_common.c | 7 +++ 2 files changed, 9 insertions(+) diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h

[PATCH 2/4] vhost-vsock: add pkt cancel capability

2016-12-07 Thread Peng Tao
To allow canceling all packets of a connection. Signed-off-by: Peng Tao --- drivers/vhost/vsock.c| 29 + include/linux/virtio_vsock.h | 3 +++ 2 files changed, 32 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index a504e2e0

[PATCH 0/4] vsock: cancel connect packets when failing to connect

2016-12-07 Thread Peng Tao
false connect attempt. The patchset enables vsock (both host and guest) to cancel queued packets when a connect attempt is considered to fail. Peng Tao (4): vsock: track pkt owner vsock vhost-vsock: add pkt cancel capability vsock: add pkt cancel capability vsock: cancel packets when faili

[PATCH 2/2] vhost: remove unnecessary smp_mb from vhost_work_queue

2016-12-07 Thread Peng Tao
test_and_set_bit() already implies a memory barrier. Signed-off-by: Peng Tao --- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index c6f2d89..2663543 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost

[PATCH 1/2] vhost-vsock: remove unused vq variable

2016-12-07 Thread Peng Tao
Signed-off-by: Peng Tao --- drivers/vhost/vsock.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 0c23b55..3e01d58 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -195,7 +195,6 @@ static int vhost_transport_send_pkt