Skip to content
  • Andra Paraschiv's avatar
    7f816984
    af_vsock: Assign the vsock transport considering the vsock address flags · 7f816984
    Andra Paraschiv authored
    
    
    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: default avatarAndra Paraschiv <andraprs@amazon.com>
    Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    7f816984
    af_vsock: Assign the vsock transport considering the vsock address flags
    Andra Paraschiv authored
    
    
    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: default avatarAndra Paraschiv <andraprs@amazon.com>
    Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Loading