[PATCH v2 2/3] VSOCK: Add vsockmon device

2016-08-13 Thread ggarcia
From: Gerard Garcia Add vsockmon virtual network device that receives packets from the vsock transports and exposes them to user space. Based on the nlmon device. Signed-off-by: Gerard Garcia --- drivers/net/Kconfig | 8 ++ drivers/net/Makefile | 1 + drivers/net/vsockm

[PATCH v2 1/3] VSOCK: Add vsockmon tap functions

2016-08-13 Thread ggarcia
From: Gerard Garcia Add tap functions that can be used by the vsock transports to deliver packets to vsockmon virtual network devices. Signed-off-by: Gerard Garcia --- include/net/af_vsock.h | 13 + include/uapi/linux/if_arp.h | 1 + net/vmw_vsock/Makefile | 2 +- net/vmw

[PATCH v2 3/3] VSOCK: Add virtio vsock vsockmon hooks

2016-08-13 Thread ggarcia
From: Gerard Garcia Add hooks to the virtio transport host driver to deliver a copy of the received and sent messages to all vsockmon virtual network devices. Signed-off-by: Gerard Garcia --- drivers/vhost/vsock.c | 72 +++ 1 file changed, 72 ins

[PATCH v2 0/3] VSOCK: vsockmon virtual device to monitor AF_VSOCK sockets.

2016-08-13 Thread ggarcia
From: Gerard Garcia This patch applies over the mst vhost git repository: http://git.kernel.org/cgit/linux/kernel/git/mst/vhost.git v2: * Clone skb before transmitting them to vsockmon. * Use consume_skb() instead of kfree_skb(). * Pass skb lifetime responsibility to tap functions. * Remove

[PATCH v3] virtio-vsock: Fix unbound rx buffer

2016-08-12 Thread ggarcia
From: Gerard Garcia Reset connection and close rx socket when the sender is ignoring our announced available buffer. Signed-off-by: Gerard Garcia Acked-by: Stefan Hajnoczi --- Applies over mst/vhost: http://git.kernel.org/cgit/linux/kernel/git/mst/vhost.git v3: * Add subsystem prefix. v2:

[PATCH v5] virtio-vsock: Add timer to handle OOM situations

2016-08-12 Thread ggarcia
From: Gerard Garcia Set up a rx timer to avoid packets being discarded when there is no available memory in the host. Signed-off-by: Gerard Garcia Reviewed-by: Stefan Hajnoczi --- Applies over mst/vhost: http://git.kernel.org/cgit/linux/kernel/git/mst/vhost.git v5: * Add subsystem prefix.

[PATCH v2 1/1] VSOCK: remove more space available check filling TX vq

2016-08-10 Thread ggarcia
From: Gerard Garcia Remove unnecessary use of enable/disable callback notifications and the incorrect more space available check. The virtio_transport_tx_work handles when the TX virtqueue has more buffers available. Signed-off-by: Gerard Garcia Acked-by: Stefan Hajnoczi --- v2: * Comment s

[PATCH 1/3] vsockmon: Add tap functions.

2016-08-08 Thread ggarcia
From: Gerard Garcia Add tap functions that can be used by the vsock transports to deliver packets to vsockmon virtual network devices. Signed-off-by: Gerard Garcia --- include/net/af_vsock.h | 13 + include/uapi/linux/if_arp.h | 1 + net/vmw_vsock/Makefile | 2 +- net/vmw

[PATCH 0/3] vsockmon: virtual device to monitor AF_VSOCK sockets.

2016-08-08 Thread ggarcia
From: Gerard Garcia This patch applies over the mst vhost git repository: http://git.kernel.org/cgit/linux/kernel/git/mst/vhost.git This was already been sent as a RFC where several issues where fixed. This is the summary of changes from the first RFC: v2: * Do not clone skb, instead take owne

[PATCH 3/3] vsockmon: Add virtio vsock hooks

2016-08-08 Thread ggarcia
From: Gerard Garcia Add hooks to the virtio transport host driver to deliver a copy of the received and sent messages to all vsockmon virtual network devices. Signed-off-by: Gerard Garcia --- drivers/vhost/vsock.c | 72 +++ 1 file changed, 72 ins

[PATCH 2/3] vsockmon: Add vsockmon device.

2016-08-08 Thread ggarcia
From: Gerard Garcia Add vsockmon virtual network device that receives packets from the vsock transports and exposes them to user space. Based on the nlmon device. Signed-off-by: Gerard Garcia --- drivers/net/Kconfig | 8 ++ drivers/net/Makefile | 1 + drivers/net/vsockm

[PATCH 1/1] VSOCK: remove more space available check filling TX vq

2016-08-05 Thread ggarcia
From: Gerard Garcia Remove unnecessary use of enable/disable callback notifications and the incorrect more space available check. The virtio_transport_tx_work handles when the TX virtqueue has more buffers available. Signed-off-by: Gerard Garcia --- net/vmw_vsock/virtio_transport.c | 9 ++

[PATCH v4 0/1] virtio-vsock: Add timer to handle OOM situations

2016-08-04 Thread ggarcia
From: Gerard Garcia This patch applies over VSOCK RFC v6. Once the guest puts a packet in the virtqueue it is guaranteed that it will be delivered. This patch addresses the problem of packets being discarded when there is not available memory in the host. v4: * Fix style. v3: * Avoid race c

[PATCH v2 0/1] virtio-vsock: Fix unbound rx buffer

2016-08-04 Thread ggarcia
From: Gerard Garcia This patch applies over VSOCK RFC v6. Reset connection and close rx socket when the sender is ignoring our announced available buffer. This avoids a DoS. v2: * Get vvs->rx_lock lock before checking if next packet is going to overflow the rx buffer. Gerard Garcia (1):

[PATCH v2 1/1] Fix unbound rx buffer

2016-08-04 Thread ggarcia
From: Gerard Garcia Reset connection and close rx socket when the sender is ignoring our announced available buffer. Signed-off-by: Gerard Garcia --- v2: * Get vvs->rx_lock lock before checking if next packet is going to overflow the rx buffer. net/vmw_vsock/virtio_transport_common.c |

[PATCH v4 1/1] Add timer to handle OOM situations

2016-08-04 Thread ggarcia
From: Gerard Garcia Set up a rx timer to avoid packets being discarded when there is not available memory in the host. Signed-off-by: Gerard Garcia --- v4: * Fix style. v3: * Avoid race condition when freeing timer. v2: * Use of ERR_PTR/PTR_ERR/IS_ERR * Timer cleaned on device release. *

[PATCH v3 1/1] Add timer to handle OOM situations

2016-08-02 Thread ggarcia
From: Gerard Garcia v3: * Avoid race condition when freeing timer. v2: * Use of ERR_PTR/PTR_ERR/IS_ERR * Timer cleaned on device release. * Do not process more packets on error. Signed-off-by: Gerard Garcia --- drivers/vhost/vsock.c | 52 +-- 1

[PATCH v3 0/1] virtio-vsock: Add timer to handle OOM situations

2016-08-02 Thread ggarcia
From: Gerard Garcia This patch applies over VSOCK RFC v6. Once the guest puts a packet in the virtqueue it is guaranteed that it will be delivered. This patch addresses the problem of packets being discarded when there is not available memory in the host. Gerard Garcia (1): Add timer to hand

[PATCH 1/1] virtio-vsock: Fix unbound rx buffer

2016-08-01 Thread ggarcia
From: Gerard Garcia Reset connection and close rx socket when the sender is ignoring our announced available buffer. Signed-off-by: Gerard Garcia --- net/vmw_vsock/virtio_transport_common.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/net/vmw_vso

[PATCH 0/1] virtio-vsock: Fix unbound rx buffer

2016-08-01 Thread ggarcia
From: Gerard Garcia This patch applies over VSOCK RFC v6. Reset connection and close rx socket when the sender is ignoring our announced available buffer. This avoids a DoS. Gerard Garcia (1): Fix unbound rx buffer net/vmw_vsock/virtio_transport_common.c | 22 -- 1 file

[PATCH v2 1/1] Add timer to handle OOM situations

2016-07-26 Thread ggarcia
From: Gerard Garcia v2: * Use of ERR_PTR/PTR_ERR/IS_ERR * Timer cleaned on device release. * Do not process more packets on error. Signed-off-by: Gerard Garcia --- drivers/vhost/vsock.c | 55 +-- 1 file changed, 45 insertions(+), 10 deletions(-)

[PATCH v2 0/1] virtio-vsock: Add timer to handle OOM situations

2016-07-26 Thread ggarcia
From: Gerard Garcia This patch applies over the stefanha/vsock-next repository: https://github.com/stefanha/linux/tree/vsock-next Once the guest puts a packet in the virtqueue it is guaranteed that it will be delivered. This patch addresses the problem of packets being discarded when there is

[PATCH] virtio-vsock: Add timer to handle OOM situations

2016-07-18 Thread ggarcia
From: Gerard Garcia This patch applies over the stefanha/vsock-next repository: https://github.com/stefanha/linux/tree/vsock-next Once the guest puts a packet in the virtqueue it is guaranteed that it will be delivered. This patch addresses the problem of packets being discarded when there is

[PATCH] Add timer to handle OOM situations

2016-07-18 Thread ggarcia
From: Gerard Garcia Better testing support files Signed-off-by: Gerard Garcia --- drivers/vhost/vsock.c | 52 ++- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 17bfe4e..d746454

[RFC v2 0/3] vsockmon: virtual device to monitor AF_VSOCK sockets.

2016-06-22 Thread ggarcia
From: Gerard Garcia v2: * Various simple fixes from the comments received to the first RFC. * Do not clone skb, instead take ownership before transmitting. * Split tap functions from af_vsock.c. * Simplify vsockmon header to remove unnecessary padding and set little endian byte order. Addit

[RFC v2 3/3] vsockmon: Add vsock hooks

2016-06-22 Thread ggarcia
From: Gerard Garcia Signed-off-by: Gerard Garcia --- drivers/vhost/vsock.c | 73 +++ 1 file changed, 73 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 17bfe4e..e8621cc 100644 --- a/drivers/vhost/vsock.c +++ b/drive

[RFC v2 2/3] vsockmon: Add vsockmon device

2016-06-22 Thread ggarcia
From: Gerard Garcia Signed-off-by: Gerard Garcia --- drivers/net/Kconfig | 8 ++ drivers/net/Makefile | 1 + drivers/net/vsockmon.c| 167 ++ include/uapi/linux/Kbuild | 1 + include/uapi/linux/vsockmon.h | 35

[RFC v2 1/3] vsockmon: Add tap functions

2016-06-22 Thread ggarcia
From: Gerard Garcia Signed-off-by: Gerard Garcia --- include/net/af_vsock.h | 13 + include/uapi/linux/if_arp.h | 1 + net/vmw_vsock/Makefile | 2 +- net/vmw_vsock/af_vsock_tap.c | 112 +++ 4 files changed, 127 insertions(+), 1 delet

[RFC 1/3] vsockmon: Add tap functions.

2016-05-28 Thread ggarcia
From: Gerard Garcia Signed-off-by: Gerard Garcia --- include/net/af_vsock.h | 13 ++ include/uapi/linux/if_arp.h | 1 + net/vmw_vsock/af_vsock.c| 105 3 files changed, 119 insertions(+) diff --git a/include/net/af_vsock.h b/include/n

[RFC 0/3] vsockmon: virtual device to monitor AF_VSOCK sockets.

2016-05-28 Thread ggarcia
From: Gerard Garcia Virtual socket transports operate at kernel level therefore, there is no easy way to see the traffic exchanged between virtual machines and hypervisors that communicate using AF_VSOCK sockets. In addition, being able to see the control messages exchanged by the transports m

[RFC 3/3] vsockmon: Add vsock hooks

2016-05-28 Thread ggarcia
From: Gerard Garcia Signed-off-by: Gerard Garcia --- drivers/vhost/vsock.c | 71 +++ 1 file changed, 71 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 17bfe4e..8fd5125 100644 --- a/drivers/vhost/vsock.c +++ b/drive

[RFC 2/3] vsockmon: Add vsockmon device

2016-05-28 Thread ggarcia
From: Gerard Garcia Signed-off-by: Gerard Garcia --- drivers/net/Kconfig | 8 ++ drivers/net/Makefile | 1 + drivers/net/vsockmon.c| 171 ++ include/uapi/linux/Kbuild | 1 + include/uapi/linux/vsockmon.h | 37