[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 <bergw...@gmail.com> --- 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/i

[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 <stefa...@redhat.com> Reviewed-by: Jorgen Hansen <jhan...@vmware.com> Signed-off-by: Peng Tao <bergw...@gmail.com> --- drivers/vhost/vsock.c | 41 + include/n

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

2017-03-14 Thread Peng Tao
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Peng Tao <bergw...@gmail.com> --- 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

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

2017-03-14 Thread Peng Tao
<jhan...@vmware.com> Signed-off-by: Peng Tao <bergw...@gmail.com> --- net/vmw_vsock/af_vsock.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 9192ead..756542a 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vm

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

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

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 <da...@davemloft.net> wrote: > From: Peng Tao <bergw...@gmail.com> > Date: Wed, 1 Mar 2017 11:56:24 +0800 > >> So that we can cancel a queued pkt later if necessary. >> >> Reviewed-by: Stefan Hajnoczi <stefa

[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 <stefa...@redhat.com> Reviewed-by: Jorgen Hansen <jhan...@vmware.com> Signed-off-by: Peng Tao <bergw...@gmail.com> --- drivers/vhost/vsock.c | 41 + include/n

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

2017-02-28 Thread Peng Tao
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Peng Tao <bergw...@gmail.com> --- 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

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

2017-02-28 Thread Peng Tao
<jhan...@vmware.com> Signed-off-by: Peng Tao <bergw...@gmail.com> --- net/vmw_vsock/af_vsock.c | 14 ++ 1 file changed, 14 insertions(+) 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/vm

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

2017-02-28 Thread Peng Tao
ken 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 drivers/vhost/v

[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 <stefa...@redhat.com> Signed-off-by: Peng Tao <bergw...@gmail.com> --- include/linux/virtio_vsock.h| 2 ++ net/vmw_vsock/virtio_transport_common.c | 7 +++ 2 files changed, 9 inserti

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 <stefa...@gmail.com> 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

[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 <stefa...@redhat.com> Signed-off-by: Peng Tao <bergw...@gmail.com> --- drivers/vhost/vsock.c | 41 + include/net/af_vsock.h | 3 +++ 2 files changed, 44 inserti

[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 <bergw...@gmail.com> --- 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

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

2016-12-12 Thread Peng Tao
<jhan...@vmware.com> Signed-off-by: Peng Tao <bergw...@gmail.com> --- net/vmw_vsock/af_vsock.c | 14 ++ 1 file changed, 14 insertions(+) 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/vm

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

2016-12-12 Thread Peng Tao
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Peng Tao <bergw...@gmail.com> --- 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

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

2016-12-12 Thread Peng Tao
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 pkt

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 <jhan...@vmware.com> wrote: > >> On Dec 8, 2016, at 6:12 PM, Peng Tao <bergw...@gmail.com> wrote: >> >> --- a/include/net/af_vsock.h >> +++ b/include/net/af_vsock.h >> @@ -100,6 +100,9 @@ struct vsock

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 <stefa...@gmail.com> 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

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

2016-12-08 Thread Peng Tao
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Peng Tao <bergw...@gmail.com> --- 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

[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 <stefa...@redhat.com> Signed-off-by: Peng Tao <bergw...@gmail.com> --- drivers/vhost/vsock.c | 41 + include/net/af_vsock.h | 3 +++ 2 files changed, 44 inserti

[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 <bergw...@gmail.com> --- 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

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

2016-12-08 Thread Peng Tao
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/vhost/v

[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 <stefa...@redhat.com> Signed-off-by: Peng Tao <bergw...@

[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 <stefa...@redhat.com> Signed-off-by: Peng Tao <bergw...@

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 <stefa...@gmail.com> 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 conne

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 <stefa...@gmail.com> 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 <bergw...@gmail.com> >&g

[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 <stefa...@redhat.com> Signed-off-by: Peng Tao <bergw...@

[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 <bergw...@gmail.com> --- 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

[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 <bergw...@gmail.com> --- drivers/vhost/vsock.c| 41 + include/linux/virtio_vsock.h | 3 +++ 2 files changed, 44 insertions(+) diff --git a/drivers/vhost/vsock.c b/d

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

2016-12-07 Thread Peng Tao
Signed-off-by: Peng Tao <bergw...@gmail.com> --- 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

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

2016-12-07 Thread Peng Tao
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 cancel

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 <stefa...@gmail.com> wrote: > On Wed, Dec 07, 2016 at 06:00:20PM +0800, Peng Tao wrote: >> Signed-off-by: Peng Tao <bergw...@gmail.com> >> --- >> net/vmw_vsock/virtio_transport.c | 36 ++

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

2016-12-07 Thread Peng Tao
Signed-off-by: Peng Tao <bergw...@gmail.com> --- 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

[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 <bergw...@gmail.com> --- include/linux/virtio_vsock.h

[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 <bergw...@gmail.com> --- 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

[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 <bergw...@gmail.com> --- 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/v

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

2016-12-07 Thread Peng Tao
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 failing

[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 <bergw...@gmail.com> --- 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/v

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

2016-12-07 Thread Peng Tao
Signed-off-by: Peng Tao <bergw...@gmail.com> --- 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 @@ stat