Re: [RFC PATCH v4 02/17] af_vsock: separate wait data loop

2021-02-11 Thread Jorgen Hansen
> On 7 Feb 2021, at 16:14, Arseny Krasnov wrote: > > This moves wait loop for data to dedicated function, because later > it will be used by SEQPACKET data receive loop. > > Signed-off-by: Arseny Krasnov > --- > net/vmw_vsock/af_vsock.c | 158 +-- > 1 file

[PATCH v2 3/3] VMCI: Enforce queuepair max size for IOCTL_VMCI_QUEUEPAIR_ALLOC

2021-01-20 Thread Jorgen Hansen
. The check in qp_host_alloc_queue has also been updated to enforce the maximum queue pair size as defined by VMCI_MAX_GUEST_QP_MEMORY. The fix has been verified using sample code supplied by nslusa...@gmx.net. Reported-by: nslusa...@gmx.net Reviewed-by: Vishnu Dasa Signed-off-by: Jorgen Hansen

[PATCH v2 2/3] VMCI: Use set_page_dirty_lock() when unregistering guest memory

2021-01-20 Thread Jorgen Hansen
. With this fix, no warning was observed. Ran various vSocket tests without issues. Fixes: 06164d2b72aa ("VMCI: queue pairs implementation.") Reviewed-by: Vishnu Dasa Signed-off-by: Jorgen Hansen --- drivers/misc/vmw_vmci/vmci_queue_pair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH v2 1/3] VMCI: Stop log spew when qp allocation isn't possible

2021-01-20 Thread Jorgen Hansen
Signed-off-by: Jorgen Hansen --- drivers/misc/vmw_vmci/vmci_queue_pair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/vmw_vmci/vmci_queue_pair.c b/drivers/misc/vmw_vmci/vmci_queue_pair.c index c490658..a3691c1 100644 --- a/drivers/misc/vmw_vmci/vmci_queue_pair.c

[PATCH v2 0/3] VMCI: Queue pair bug fixes

2021-01-20 Thread Jorgen Hansen
This series contains three bug fixes for the queue pair implementation in the VMCI driver. v1 -> v2: - format patches as a series - use min_t instead of min to ensure size_t comparison (issue pointed out by kernel test robot ) Jorgen Hansen (3): VMCI: Stop log spew when qp allocat

Re: [PATCH] VMCI: Enforce queuepair max size for IOCTL_VMCI_QUEUEPAIR_ALLOC

2021-01-11 Thread Jorgen Hansen
On 11 Jan 2021, at 13:46, Greg KH wrote: > > On Mon, Jan 11, 2021 at 04:18:53AM -0800, Jorgen Hansen wrote: >> When create the VMCI queue pair tracking data structures on the host >> side, the IOCTL for creating the VMCI queue pair didn't validate >> the queue pair size

[PATCH] VMCI: Use set_page_dirty_lock() when unregistering guest memory

2021-01-11 Thread Jorgen Hansen
. With this fix, no warning was observed. Ran various vSocket tests without issues. Fixes: 06164d2b72aa ("VMCI: queue pairs implementation.") Reviewed-by: Vishnu Dasa Signed-off-by: Jorgen Hansen --- drivers/misc/vmw_vmci/vmci_queue_pair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH] VMCI: Stop log spew when qp allocation isn't possible

2021-01-11 Thread Jorgen Hansen
Signed-off-by: Jorgen Hansen --- drivers/misc/vmw_vmci/vmci_queue_pair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/vmw_vmci/vmci_queue_pair.c b/drivers/misc/vmw_vmci/vmci_queue_pair.c index c490658..a3691c1 100644 --- a/drivers/misc/vmw_vmci/vmci_queue_pair.c

[PATCH] VMCI: Enforce queuepair max size for IOCTL_VMCI_QUEUEPAIR_ALLOC

2021-01-11 Thread Jorgen Hansen
. The check in qp_host_alloc_queue has also been updated to enforce the maximum queue pair size as defined by VMCI_MAX_GUEST_QP_MEMORY. The fix has been verified using sample code supplied by nslusa...@gmx.net. Reported-by: nslusa...@gmx.net Reviewed-by: Vishnu Dasa Signed-off-by: Jorgen Hansen

RE: [PATCH net-next 3/6] vsock: add local transport support in the vsock core

2019-11-21 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Thursday, November 21, 2019 5:13 PM > > On Thu, Nov 21, 2019 at 03:53:47PM +0000, Jorgen Hansen wrote: > > > From: Stefano Garzarella [mailto:sgarz...@redhat.com] > > > Sent: Thursday, November 21, 2

RE: [PATCH net-next 3/6] vsock: add local transport support in the vsock core

2019-11-21 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Thursday, November 21, 2019 4:22 PM > > On Thu, Nov 21, 2019 at 03:04:18PM +0000, Jorgen Hansen wrote: > > > From: Stefano Garzarella [mailto:sgarz...@redhat.com] > > > Sent: Tuesday, November 1

RE: [PATCH net-next 2/6] vsock: add VMADDR_CID_LOCAL definition

2019-11-21 Thread Jorgen Hansen via Virtualization
CID_LOCAL. > > Cc: Jorgen Hansen > Signed-off-by: Stefano Garzarella > --- > include/uapi/linux/vm_sockets.h | 8 +--- > net/vmw_vsock/vmci_transport.c | 2 +- > 2 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/include/uapi/linux/vm_sockets.

RE: [PATCH net-next 0/6] vsock: add local transport support

2019-11-21 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Tuesday, November 19, 2019 12:01 PM > This series introduces a new transport (vsock_loopback) to handle > local communication. > This could be useful to test vsock core itself and to allow developers > to test their applications

RE: [PATCH net-next 3/6] vsock: add local transport support in the vsock core

2019-11-21 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Tuesday, November 19, 2019 12:01 PM > To: net...@vger.kernel.org > > This patch allows to register a transport able to handle > local communication (loopback). > > Signed-off-by: Stefano Garzarella > --- > include/net/af_vsock.h

RE: [PATCH net-next 11/14] vsock: add multi-transports support

2019-11-13 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Tuesday, November 12, 2019 11:37 AM > > > > You already mentioned that you are working on a fix for loopback > > > > here for the guest, but presumably a host could also do loopback. > > > > > > IIUC we don't support loopback in the

RE: [PATCH net-next 12/14] vsock/vmci: register vmci_transport only when VMCI guest/host are active

2019-11-12 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Monday, November 11, 2019 6:31 PM > On Mon, Nov 11, 2019 at 04:27:28PM +0000, Jorgen Hansen wrote: > > > From: Stefano Garzarella [mailto:sgarz...@redhat.com] > > > Sent: Wednesday, October 23, 2019 11:56 AM

RE: [PATCH net-next 11/14] vsock: add multi-transports support

2019-11-12 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Monday, November 11, 2019 6:18 PM > To: Jorgen Hansen > Subject: Re: [PATCH net-next 11/14] vsock: add multi-transports support > > On Mon, Nov 11, 2019 at 01:53:39PM +0000, Jorgen Hansen wrote: > > &g

RE: [PATCH net-next 14/14] vsock: fix bind() behaviour taking care of CID

2019-11-11 Thread Jorgen Hansen via Virtualization
++-- > 1 file changed, 8 insertions(+), 2 deletions(-) Reviewed-by: Jorgen Hansen ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

RE: [PATCH net-next 13/14] vsock: prevent transport modules unloading

2019-11-11 Thread Jorgen Hansen via Virtualization
> net/vmw_vsock/vmci_transport.c | 1 + > 6 files changed, 25 insertions(+), 4 deletions(-) Reviewed-by: Jorgen Hansen ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

RE: [PATCH net-next 12/14] vsock/vmci: register vmci_transport only when VMCI guest/host are active

2019-11-11 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Wednesday, October 23, 2019 11:56 AM > > To allow other transports to be loaded with vmci_transport, > we register the vmci_transport as G2H or H2G only when a VMCI guest > or host is active. > > To do that, this patch adds a

RE: [PATCH net-next 11/14] vsock: add multi-transports support

2019-11-11 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > Sent: Wednesday, October 23, 2019 11:56 AM Thanks a lot for working on this! > With the multi-transports support, we can use vsock with nested VMs (using > also different hypervisors) loading both guest->host and > host->guest transports

RE: [PATCH net-next 11/14] vsock: add multi-transports support

2019-10-30 Thread Jorgen Hansen via Virtualization
> From: Stefano Garzarella [mailto:sgarz...@redhat.com] > > +/* Assign a transport to a socket and call the .init transport callback. > > + * > > + * Note: for stream socket this must be called when vsk->remote_addr > > +is set > > + * (e.g. during the connect() or when a connection request on a >

RE: [PATCH net-next 09/14] vsock: move vsock_insert_unbound() in the vsock_create()

2019-10-30 Thread Jorgen Hansen via Virtualization
noczi > Signed-off-by: Stefano Garzarella > --- > net/vmw_vsock/af_vsock.c | 13 + Reviewed-by: Jorgen Hansen ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

RE: [PATCH net-next 08/14] vsock: add vsock_create_connected() called by transports

2019-10-30 Thread Jorgen Hansen via Virtualization
sport_common.c | 3 +-- > net/vmw_vsock/vmci_transport.c | 3 +-- > 5 files changed, 17 insertions(+), 17 deletions(-) Reviewed-by: Jorgen Hansen ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

RE: [PATCH net-next 07/14] vsock: handle buffer_size sockopts in the core

2019-10-30 Thread Jorgen Hansen via Virtualization
-static void vmci_transport_set_buffer_size(struct vsock_sock *vsk, u64 val) > -{ > - if (val < vmci_trans(vsk)->queue_pair_min_size) > - vmci_trans(vsk)->queue_pair_min_size = val; > - if (val > vmci_trans(vsk)->queue_pair_max_size) > - vmci_trans(vsk)->queue_pair_max_size = val; > - vmci_trans(vsk)->queue_pair_size = val; > -} > - > -static void vmci_transport_set_min_buffer_size(struct vsock_sock *vsk, > -u64 val) > -{ > - if (val > vmci_trans(vsk)->queue_pair_size) > - vmci_trans(vsk)->queue_pair_size = val; > - vmci_trans(vsk)->queue_pair_min_size = val; > -} > - > -static void vmci_transport_set_max_buffer_size(struct vsock_sock *vsk, > -u64 val) > -{ > - if (val < vmci_trans(vsk)->queue_pair_size) > - vmci_trans(vsk)->queue_pair_size = val; > - vmci_trans(vsk)->queue_pair_max_size = val; > -} > - > static int vmci_transport_notify_poll_in( > struct vsock_sock *vsk, > size_t target, > @@ -2098,12 +2036,6 @@ static const struct vsock_transport vmci_transport > = { > .notify_send_pre_enqueue = > vmci_transport_notify_send_pre_enqueue, > .notify_send_post_enqueue = > vmci_transport_notify_send_post_enqueue, > .shutdown = vmci_transport_shutdown, > - .set_buffer_size = vmci_transport_set_buffer_size, > - .set_min_buffer_size = vmci_transport_set_min_buffer_size, > - .set_max_buffer_size = vmci_transport_set_max_buffer_size, > - .get_buffer_size = vmci_transport_get_buffer_size, > - .get_min_buffer_size = vmci_transport_get_min_buffer_size, > - .get_max_buffer_size = vmci_transport_get_max_buffer_size, > .get_local_cid = vmci_transport_get_local_cid, }; > > diff --git a/net/vmw_vsock/vmci_transport.h > b/net/vmw_vsock/vmci_transport.h index 1ca1e8640b31..b7b072194282 > 100644 > --- a/net/vmw_vsock/vmci_transport.h > +++ b/net/vmw_vsock/vmci_transport.h > @@ -108,9 +108,6 @@ struct vmci_transport { > struct vmci_qp *qpair; > u64 produce_size; > u64 consume_size; > - u64 queue_pair_size; > - u64 queue_pair_min_size; > - u64 queue_pair_max_size; > u32 detach_sub_id; > union vmci_transport_notify notify; > const struct vmci_transport_notify_ops *notify_ops; > -- > 2.21.0 Reviewed-by: Jorgen Hansen ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

RE: [PATCH net-next 06/14] vsock: add 'struct vsock_sock *' param to vsock_core_get_transport()

2019-10-30 Thread Jorgen Hansen via Virtualization
= vsk->remote_addr.svm_cid; > @@ -201,7 +202,7 @@ static int virtio_transport_send_pkt_info(struct > vsock_sock *vsk, > > virtio_transport_inc_tx_pkt(vvs, pkt); > > - return virtio_transport_get_ops()->send_pkt(pkt); > + return virtio_transport_get_ops(vsk)-

RE: [PATCH net-next 04/14] vsock: add 'transport' member in the struct vsock_sock

2019-10-30 Thread Jorgen Hansen via Virtualization
busy; > } > @@ -1928,7 +1948,7 @@ int __vsock_core_init(const struct vsock_transport > *t, struct module *owner) >* unload while there are open sockets. >*/ > vsock_proto.owner = owner; > - transport = t; > + transport_single = t;

RE: [PATCH net-next 02/14] vsock: remove vm_sockets_get_local_cid()

2019-10-30 Thread Jorgen Hansen via Virtualization
t_common.c > @@ -168,7 +168,7 @@ static int virtio_transport_send_pkt_info(struct > vsock_sock *vsk, > struct virtio_vsock_pkt *pkt; > u32 pkt_len = info->pkt_len; > > - src_cid = vm_sockets_get_local_cid(); > + src_cid = virtio_transport_get_ops()->

RE: [PATCH net-next 03/14] vsock: remove include/linux/vm_sockets.h file

2019-10-30 Thread Jorgen Hansen via Virtualization
h > b/net/vmw_vsock/vmci_transport_notify.h > index 7843f08d4290..a1aa5a998c0e 100644 > --- a/net/vmw_vsock/vmci_transport_notify.h > +++ b/net/vmw_vsock/vmci_transport_notify.h > @@ -11,7 +11,6 @@ > #include > #include > #include > -#include > > #include "vmci_transport.h" > > -- > 2.21.0 Reviewed-by: Jorgen Hansen ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

RE: [PATCH net-next 01/14] vsock/vmci: remove unused VSOCK_DEFAULT_CONNECT_TIMEOUT

2019-10-30 Thread Jorgen Hansen via Virtualization
d021c344051af ("VSOCK: Introduce VM Sockets"), but it is never used > in the net/vmw_vsock/vmci_transport.c. > > VSOCK_DEFAULT_CONNECT_TIMEOUT is used and defined in > net/vmw_vsock/af_vsock.c > > Cc: Jorgen Hansen > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Stef

[PATCH] VMCI/VSOCK: Add maintainers for VMCI, AF_VSOCK and VMCI transport

2019-03-21 Thread Jorgen Hansen via Virtualization
Update the maintainers file to include maintainers for the VMware vmci driver, af_vsock, and the vsock vmci transport. Signed-off-by: Jorgen Hansen --- MAINTAINERS | 20 1 file changed, 20 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index e17ebf7..b9714fc 100644

[PATCH] VMCI: Verify PPNs before sending to device

2019-01-16 Thread Jorgen Hansen via Virtualization
and observed that failure was reported. Fixes: 1f166439917b ("VMCI: guest side driver implementation.") Fixes: 06164d2b72aa ("VMCI: queue pairs implementation.") Signed-off-by: Jorgen Hansen Reviewed-by: Adit Ranadive Reviewed-by: Vishnu Dasa --- drivers/misc/vmw_vmci/vm

[PATCH v2] VSOCK: Send reset control packet when socket is partially bound

2018-12-19 Thread Jorgen Hansen
Signed-off-by: Jorgen Hansen --- v1 -> v2: - Changed order of local variables net/vmw_vsock/vmci_transport.c | 67 +++--- 1 file changed, 50 insertions(+), 17 deletions(-) diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c index 0ae

[PATCH] VSOCK: Send reset control packet when socket is partially bound

2018-12-13 Thread Jorgen Hansen
Signed-off-by: Jorgen Hansen --- net/vmw_vsock/vmci_transport.c | 67 +++--- 1 file changed, 50 insertions(+), 17 deletions(-) diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c index 0ae3614..402d84e 100644 --- a/net/vmw_vsock/vmci_transpo

[PATCH] VSOCK: Don't set sk_state to TCP_CLOSE before testing it

2017-11-27 Thread Jorgen Hansen
ons in that function. Signed-off-by: Jorgen Hansen <jhan...@vmware.com> --- net/vmw_vsock/vmci_transport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c index 56573dc..a7a73ff 100644 --- a/net/vmw_vsock/vmci_tr

[PATCH v2] VSOCK: Don't call vsock_stream_has_data in atomic context

2017-11-24 Thread Jorgen Hansen
noczi <stefa...@redhat.com> Signed-off-by: Jorgen Hansen <jhan...@vmware.com> --- net/vmw_vsock/vmci_transport.c | 10 +++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c index 391775e..56573dc 10

[PATCH] VSOCK: Don't call vsock_stream_has_data in atomic context

2017-11-21 Thread Jorgen Hansen
vsock_stream_has_data during detach. Ran mixedTest between guest and host using both guest and host as server. Reviewed-by: Adit Ranadive <ad...@vmware.com> Reviewed-by: Aditya Sarwade <asarw...@vmware.com> Signed-off-by: Jorgen Hansen <jhan...@vmware.com> --- net/vmw_vsock/vmci_

[PATCH] VMCI: Doorbell create and destroy fixes

2016-10-06 Thread Jorgen Hansen
-by: Adit Ranadive <ad...@vmware.com> Signed-off-by: Jorgen Hansen <jhan...@vmware.com> --- drivers/misc/vmw_vmci/vmci_doorbell.c |8 +++- drivers/misc/vmw_vmci/vmci_driver.c |2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/misc/vmw_vmci/vmci_d

[PATCH] VSOCK: Don't dec ack backlog twice for rejected connections

2016-09-27 Thread Jorgen Hansen
ed-off-by: Jorgen Hansen <jhan...@vmware.com> Reviewed-by: Adit Ranadive <ad...@vmware.com> Reviewed-by: Aditya Sarwade <asarw...@vmware.com> --- net/vmw_vsock/af_vsock.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/vmw_vsock/af_vsock.c b/net/vm

[PATCH] VSOCK: Only check error on skb_recv_datagram when skb is NULL

2016-04-19 Thread Jorgen Hansen
If skb_recv_datagram returns an skb, we should ignore the err value returned. Otherwise, datagram receives will return EAGAIN when they have to wait for a datagram. Acked-by: Adit Ranadive <ad...@vmware.com> Signed-off-by: Jorgen Hansen <jhan...@vmware.com> --- net/vmw_vsock/vmci

[PATCH] VSOCK: Detach QP check should filter out non matching QPs.

2016-04-05 Thread Jorgen Hansen
Zhang <georgezh...@vmware.com> Signed-off-by: Jorgen Hansen <jhan...@vmware.com> --- net/vmw_vsock/vmci_transport.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c index 0a369bb..662bdd2 1006

[PATCH] VMCI: Use 32bit atomics for queue headers on X86_32

2015-11-12 Thread Jorgen Hansen
Signed-off-by: Jorgen Hansen <jhan...@vmware.com> --- drivers/misc/vmw_vmci/vmci_driver.c |2 +- include/linux/vmw_vmci_defs.h | 43 +++--- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/drivers/misc/vmw_vmci/vmci_driver.c b/drivers/m

[PATCH] VSOCK: sock_put wasn't safe to call in interrupt context

2015-10-21 Thread Jorgen Hansen
1.0.2.0-k since up until now it appears that this module was sharing version with vsock that is currently at 1.0.1.0-k). Reviewed-by: Aditya Asarwade <asarw...@vmware.com> Reviewed-by: Thomas Hellstrom <thellst...@vmware.com> Signed-off-by: Jorgen Hansen <jhan...@vmware.com>