vsock: add multi-transports support
This patch adds the support of multiple transports in the
VSOCK core.
With the multi-transports support, we can use vsock with nested VMs
(using also different hypervisors) loading both guest->host and
host->guest transports at the same time.
Major changes:
- vsock core module can be loaded regardless of the transports
- vsock_core_init() and vsock_core_exit() are renamed to
vsock_core_register() and vsock_core_unregister()
- vsock_core_register() has a feature parameter (H2G, G2H, DGRAM)
to identify which directions the transport can handle and if it's
support DGRAM (only vmci)
- each stream socket is assigned to a transport when the remote CID
is set (during the connect() or when we receive a connection request
on a listener socket).
The remote CID is used to decide which transport to use:
- remote CID <= VMADDR_CID_HOST will use guest->host transport;
- remote CID == local_cid (guest->host transport) will use guest->host
transport for loopback (host->guest transports don't support loopback);
- remote CID > VMADDR_CID_HOST will use host->guest transport;
- listener sockets are not bound to any transports since no transport
operations are done on it. In this way we can create a listener
socket, also if the transports are not loaded or with VMADDR_CID_ANY
to listen on all transports.
- DGRAM sockets are handled as before, since only the vmci_transport
provides this feature.
Signed-off-by:
Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by:
David S. Miller <davem@davemloft.net>
-
mentioned in commit 1ac85986
-
mentioned in commit c0effb7b
-
mentioned in commit c9eb5b33
-
mentioned in commit d1892008
-
mentioned in commit 8667e8d0
-
mentioned in commit bfbc2691
-
mentioned in commit 0bab0dd7
-
mentioned in commit d4cd55a7
-
mentioned in commit 3b0d2c5f
-
mentioned in commit 8fe20b2e
-
mentioned in commit 6bb17a12
-
mentioned in commit 9427b47e
-
mentioned in commit 1e8ad034
-
mentioned in commit 18a7fc37
-
mentioned in commit 3cde51df
-
mentioned in commit daeac89c
-
mentioned in commit ae527bd2
-
mentioned in commit 62572926
-
mentioned in commit c5bc2ea4
-
mentioned in commit 6647f324
-
mentioned in commit 784ec791
-
mentioned in commit 4a17771f
-
mentioned in commit a674906b
-
mentioned in commit e707077e
-
mentioned in commit 41a92788
-
mentioned in commit ce858031
-
mentioned in commit d1ca95c3
-
mentioned in commit 6486915f
-
mentioned in commit 36a43904
-
mentioned in commit 4a68cb75
-
mentioned in commit 52d4f063
-
mentioned in commit 7213e684
-
mentioned in commit d8f4b0c1
-
mentioned in commit fe1ae586
-
mentioned in commit 7f19bd32
-
mentioned in commit f3464c74
-
mentioned in commit 77ccafa3
-
mentioned in commit 9e5fed46
-
mentioned in commit 317ab41c
-
mentioned in commit a4606b77
-
mentioned in commit 048dbd2b
-
mentioned in commit 793270a2
-
mentioned in commit ad5fe039
-
mentioned in commit 09def0a7
-
mentioned in commit 180756eb
-
mentioned in commit 9e4bf61d
-
mentioned in commit d894ec93
-
mentioned in commit 053212d5
-
mentioned in commit 0beed5fd
-
mentioned in commit a2a0ab30
-
mentioned in commit 2a0763b4
-
mentioned in commit 52920931
-
mentioned in commit 66ac26b4
-
mentioned in commit 7f11cc02
-
mentioned in commit 42b33381
-
mentioned in commit 2d9fd1b2
-
mentioned in commit fb00d6bd
-
mentioned in commit f2c9d205
-
mentioned in commit cbe3e74d
-
mentioned in commit 8b8bc0c7
-
mentioned in commit 8aa54cde
-
mentioned in commit 91335d9b
-
mentioned in commit be0bea89
-
mentioned in commit 155a75c7
-
mentioned in commit 7f72cb89
-
mentioned in commit f6f89127