search for: vsock_for_each_connected_socket

Displaying 20 results from an estimated 48 matches for "vsock_for_each_connected_socket".

2019 May 29
2
[PATCH 3/4] vsock/virtio: fix flush of works during the .remove()
...work(&vsock->loopback_work); > - flush_work(&vsock->rx_work); > - flush_work(&vsock->tx_work); > - flush_work(&vsock->event_work); > - flush_work(&vsock->send_pkt_work); > - > /* Reset all connected sockets when the device disappear */ > vsock_for_each_connected_socket(virtio_vsock_reset_sock); > > @@ -690,6 +693,9 @@ static void virtio_vsock_remove(struct virtio_device *vdev) > vsock->event_run = false; > mutex_unlock(&vsock->event_lock); > > + /* Flush all pending works */ > + virtio_vsock_flush_works(vsock); > + &g...
2019 May 29
2
[PATCH 3/4] vsock/virtio: fix flush of works during the .remove()
...work(&vsock->loopback_work); > - flush_work(&vsock->rx_work); > - flush_work(&vsock->tx_work); > - flush_work(&vsock->event_work); > - flush_work(&vsock->send_pkt_work); > - > /* Reset all connected sockets when the device disappear */ > vsock_for_each_connected_socket(virtio_vsock_reset_sock); > > @@ -690,6 +693,9 @@ static void virtio_vsock_remove(struct virtio_device *vdev) > vsock->event_run = false; > mutex_unlock(&vsock->event_lock); > > + /* Flush all pending works */ > + virtio_vsock_flush_works(vsock); > + &g...
2019 May 30
2
[PATCH 3/4] vsock/virtio: fix flush of works during the .remove()
...ork(&vsock->rx_work); >>> - flush_work(&vsock->tx_work); >>> - flush_work(&vsock->event_work); >>> - flush_work(&vsock->send_pkt_work); >>> - >>> /* Reset all connected sockets when the device disappear */ >>> vsock_for_each_connected_socket(virtio_vsock_reset_sock); >>> @@ -690,6 +693,9 @@ static void virtio_vsock_remove(struct virtio_device *vdev) >>> vsock->event_run = false; >>> mutex_unlock(&vsock->event_lock); >>> + /* Flush all pending works */ >>> + virtio_vsock_flu...
2019 May 30
2
[PATCH 3/4] vsock/virtio: fix flush of works during the .remove()
...ork(&vsock->rx_work); >>> - flush_work(&vsock->tx_work); >>> - flush_work(&vsock->event_work); >>> - flush_work(&vsock->send_pkt_work); >>> - >>> /* Reset all connected sockets when the device disappear */ >>> vsock_for_each_connected_socket(virtio_vsock_reset_sock); >>> @@ -690,6 +693,9 @@ static void virtio_vsock_remove(struct virtio_device *vdev) >>> vsock->event_run = false; >>> mutex_unlock(&vsock->event_lock); >>> + /* Flush all pending works */ >>> + virtio_vsock_flu...
2019 May 28
8
[PATCH 0/4] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock before registering the driver", Stefan pointed out some possible issues in the .probe() and .remove() callbacks of the virtio-vsock driver. This series tries to solve these issues: - Patch 1 postpones the 'the_virtio_vsock' assignment at the end of the .probe() to avoid that some sockets queue works when
2019 May 28
8
[PATCH 0/4] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock before registering the driver", Stefan pointed out some possible issues in the .probe() and .remove() callbacks of the virtio-vsock driver. This series tries to solve these issues: - Patch 1 postpones the 'the_virtio_vsock' assignment at the end of the .probe() to avoid that some sockets queue works when
2015 May 27
0
[RFC 1/6] VSOCK: Introduce vsock_find_unbound_socket and vsock_bind_dgram_generic
...*vsk); void vsock_remove_connected(struct vsock_sock *vsk); struct sock *vsock_find_bound_socket(struct sockaddr_vm *addr); +struct sock *vsock_find_unbound_socket(struct sockaddr_vm *addr); struct sock *vsock_find_connected_socket(struct sockaddr_vm *src, struct sockaddr_vm *dst); void vsock_for_each_connected_socket(void (*fn)(struct sock *sk)); +int vsock_bind_dgram_generic(struct vsock_sock *vsk, struct sockaddr_vm *addr); #endif /* __AF_VSOCK_H__ */ diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 2ec86e6..ae3ce3d 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c...
2019 May 28
0
[PATCH 3/4] vsock/virtio: fix flush of works during the .remove()
...the_virtio_vsock = NULL; - flush_work(&vsock->loopback_work); - flush_work(&vsock->rx_work); - flush_work(&vsock->tx_work); - flush_work(&vsock->event_work); - flush_work(&vsock->send_pkt_work); - /* Reset all connected sockets when the device disappear */ vsock_for_each_connected_socket(virtio_vsock_reset_sock); @@ -690,6 +693,9 @@ static void virtio_vsock_remove(struct virtio_device *vdev) vsock->event_run = false; mutex_unlock(&vsock->event_lock); + /* Flush all pending works */ + virtio_vsock_flush_works(vsock); + /* Flush all device writes and interrupts, d...
2019 Jun 28
0
[PATCH v2 3/3] vsock/virtio: fix flush of works during the .remove()
...ULL); synchronize_rcu(); - flush_work(&vsock->loopback_work); - flush_work(&vsock->rx_work); - flush_work(&vsock->tx_work); - flush_work(&vsock->event_work); - flush_work(&vsock->send_pkt_work); - /* Reset all connected sockets when the device disappear */ vsock_for_each_connected_socket(virtio_vsock_reset_sock); @@ -740,6 +734,15 @@ static void virtio_vsock_remove(struct virtio_device *vdev) /* Delete virtqueues and flush outstanding callbacks if any */ vdev->config->del_vqs(vdev); + /* Other works can be queued before 'config->del_vqs()', so we flush + *...
2019 Jul 05
0
[PATCH v3 3/3] vsock/virtio: fix flush of works during the .remove()
...ULL); synchronize_rcu(); - flush_work(&vsock->loopback_work); - flush_work(&vsock->rx_work); - flush_work(&vsock->tx_work); - flush_work(&vsock->event_work); - flush_work(&vsock->send_pkt_work); - /* Reset all connected sockets when the device disappear */ vsock_for_each_connected_socket(virtio_vsock_reset_sock); @@ -741,6 +735,15 @@ static void virtio_vsock_remove(struct virtio_device *vdev) /* Delete virtqueues and flush outstanding callbacks if any */ vdev->config->del_vqs(vdev); + /* Other works can be queued before 'config->del_vqs()', so we flush + *...
2019 Jul 05
4
[PATCH v3 0/3] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock before registering the driver", Stefan pointed out some possible issues in the .probe() and .remove() callbacks of the virtio-vsock driver. This series tries to solve these issues: - Patch 1 adds RCU critical sections to avoid use-after-free of 'the_virtio_vsock' pointer. - Patch 2 stops workers before to
2019 May 29
0
[PATCH 3/4] vsock/virtio: fix flush of works during the .remove()
...> > - flush_work(&vsock->rx_work); > > - flush_work(&vsock->tx_work); > > - flush_work(&vsock->event_work); > > - flush_work(&vsock->send_pkt_work); > > - > > /* Reset all connected sockets when the device disappear */ > > vsock_for_each_connected_socket(virtio_vsock_reset_sock); > > @@ -690,6 +693,9 @@ static void virtio_vsock_remove(struct virtio_device *vdev) > > vsock->event_run = false; > > mutex_unlock(&vsock->event_lock); > > + /* Flush all pending works */ > > + virtio_vsock_flush_works(vsock);...
2019 Jun 28
0
[PATCH v2 2/3] vsock/virtio: stop workers during the .remove()
...ock->event_lock); virtio_vsock_event_fill(vsock); + vsock->event_run = true; mutex_unlock(&vsock->event_lock); vdev->priv = vsock; @@ -659,6 +689,24 @@ static void virtio_vsock_remove(struct virtio_device *vdev) /* Reset all connected sockets when the device disappear */ vsock_for_each_connected_socket(virtio_vsock_reset_sock); + /* Stop all work handlers to make sure no one is accessing the device, + * so we can safely call vdev->config->reset(). + */ + mutex_lock(&vsock->rx_lock); + vsock->rx_run = false; + mutex_unlock(&vsock->rx_lock); + + mutex_lock(&vsock->...
2019 Jul 05
0
[PATCH v3 2/3] vsock/virtio: stop workers during the .remove()
...ock->event_lock); virtio_vsock_event_fill(vsock); + vsock->event_run = true; mutex_unlock(&vsock->event_lock); vdev->priv = vsock; @@ -660,6 +690,24 @@ static void virtio_vsock_remove(struct virtio_device *vdev) /* Reset all connected sockets when the device disappear */ vsock_for_each_connected_socket(virtio_vsock_reset_sock); + /* Stop all work handlers to make sure no one is accessing the device, + * so we can safely call vdev->config->reset(). + */ + mutex_lock(&vsock->rx_lock); + vsock->rx_run = false; + mutex_unlock(&vsock->rx_lock); + + mutex_lock(&vsock->...
2019 May 30
0
[PATCH 3/4] vsock/virtio: fix flush of works during the .remove()
...; > - flush_work(&vsock->tx_work); > > > > - flush_work(&vsock->event_work); > > > > - flush_work(&vsock->send_pkt_work); > > > > - > > > > /* Reset all connected sockets when the device disappear */ > > > > vsock_for_each_connected_socket(virtio_vsock_reset_sock); > > > > @@ -690,6 +693,9 @@ static void virtio_vsock_remove(struct virtio_device *vdev) > > > > vsock->event_run = false; > > > > mutex_unlock(&vsock->event_lock); > > > > + /* Flush all pending works */ &gt...
2019 Feb 01
3
[PATCH v3 0/2] vsock/virtio: fix issues on device hot-unplug
These patches try to handle the hot-unplug of vsock virtio transport device in a proper way. Maybe move the vsock_core_init()/vsock_core_exit() functions in the module_init and module_exit of vsock_virtio_transport module can't be the best way, but the architecture of vsock_core forces us to this approach for now. The vsock_core proto_ops expect a valid pointer to the transport device, so we
2019 Feb 01
3
[PATCH v3 0/2] vsock/virtio: fix issues on device hot-unplug
These patches try to handle the hot-unplug of vsock virtio transport device in a proper way. Maybe move the vsock_core_init()/vsock_core_exit() functions in the module_init and module_exit of vsock_virtio_transport module can't be the best way, but the architecture of vsock_core forces us to this approach for now. The vsock_core proto_ops expect a valid pointer to the transport device, so we
2019 Jun 28
11
[PATCH v2 0/3] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock before registering the driver", Stefan pointed out some possible issues in the .probe() and .remove() callbacks of the virtio-vsock driver. This series tries to solve these issues: - Patch 1 adds RCU critical sections to avoid use-after-free of 'the_virtio_vsock' pointer. - Patch 2 stops workers before to
2019 Jun 28
11
[PATCH v2 0/3] vsock/virtio: several fixes in the .probe() and .remove()
During the review of "[PATCH] vsock/virtio: Initialize core virtio vsock before registering the driver", Stefan pointed out some possible issues in the .probe() and .remove() callbacks of the virtio-vsock driver. This series tries to solve these issues: - Patch 1 adds RCU critical sections to avoid use-after-free of 'the_virtio_vsock' pointer. - Patch 2 stops workers before to
2019 Oct 23
2
[PATCH net-next 11/14] vsock: add multi-transports support
...ruct vsock_transport *vsock_core_get_transport(struct vsock_sock *vsk); > @@ -190,6 +194,7 @@ struct sock *vsock_find_connected_socket(struct sockaddr_vm *src, > struct sockaddr_vm *dst); > void vsock_remove_sock(struct vsock_sock *vsk); > void vsock_for_each_connected_socket(void (*fn)(struct sock *sk)); > +int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk); > > /**** TAP ****/ > > diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c > index d89381166028..dddd85d9a147 100644 > --- a/net/vmw_vsock/af_vsock.c >...