linux/net/vmw_vsock
Andra Paraschiv 7f816984f4 af_vsock: Assign the vsock transport considering the vsock address flags
The vsock flags field can be set in the connect path (user space app)
and the (listen) receive path (kernel space logic).

When the vsock transport is assigned, the remote CID is used to
distinguish between types of connection.

Use the vsock flags value (in addition to the CID) from the remote
address to decide which vsock transport to assign. For the sibling VMs
use case, all the vsock packets need to be forwarded to the host, so
always assign the guest->host transport if the VMADDR_FLAG_TO_HOST flag
is set. For the other use cases, the vsock transport assignment logic is
not changed.

Changelog

v3 -> v4

* Update the "remote_flags" local variable type to reflect the change of
  the "svm_flags" field to be 1 byte in size.

v2 -> v3

* Update bitwise check logic to not compare result to the flag value.

v1 -> v2

* Use bitwise operator to check the vsock flag.
* Use the updated "VMADDR_FLAG_TO_HOST" flag naming.
* Merge the checks for the g2h transport assignment in one "if" block.

Signed-off-by: Andra Paraschiv <andraprs@amazon.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-12-14 19:33:39 -08:00
..
af_vsock.c af_vsock: Assign the vsock transport considering the vsock address flags 2020-12-14 19:33:39 -08:00
af_vsock_tap.c
diag.c
hyperv_transport.c
Kconfig
Makefile
virtio_transport.c
virtio_transport_common.c
vmci_transport.c
vmci_transport.h
vmci_transport_notify.c
vmci_transport_notify.h
vmci_transport_notify_qstate.c
vsock_addr.c vsock_addr: Check for supported flag values 2020-12-14 19:33:39 -08:00
vsock_loopback.c