All of lore.kernel.org
 help / color / mirror / Atom feed
* AF_VSOCK loopback
@ 2016-11-10 14:43 Stefan Hajnoczi
  2016-11-10 16:17 ` Cathy Avery
  2016-11-11 14:14 ` Jorgen S. Hansen
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2016-11-10 14:43 UTC (permalink / raw)
  To: Jorgen Hansen; +Cc: cavery, netdev

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

Hi Jorgen,
Cathy Avery found that the AF_VSOCK VMCI transport does loopback inside
the guest (but not on the host?).  The virtio transport currently does
no loopback.

The loopback scenario I'm thinking of is where process A listens on port
1234 and process B on the same machine connects to port 1234 both with
the same CID.

I'd like to make the virtio transport compatible with VMCI transport
semantics so AF_VSOCK behaves the same regardless of the transport.
This means loopback must be added to virtio-vsock.

The core net/vmware/af_vsock.c code does not implement loopback.  How
does VMCI do loopback?  Are the loopback packets reflected back from the
host?  Or does the guest driver notice the loopback and avoid passing
packets to the host in the first place?

Maybe we can make the loopback code common in af_vsock.c if that avoids
code duplication.

Thanks,
Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: AF_VSOCK loopback
  2016-11-10 14:43 AF_VSOCK loopback Stefan Hajnoczi
@ 2016-11-10 16:17 ` Cathy Avery
  2016-11-11 14:14 ` Jorgen S. Hansen
  1 sibling, 0 replies; 4+ messages in thread
From: Cathy Avery @ 2016-11-10 16:17 UTC (permalink / raw)
  To: Stefan Hajnoczi, Jorgen Hansen; +Cc: netdev

I had trouble with loopback on the esx host. Using the nc-vsock ( 
AF_VSOCK 56 ) the server and the client connected but they both 
terminated without error when I attempted to send characters over. It 
might be due to something other than vsock. I haven't pursued it yet.

On 11/10/2016 09:43 AM, Stefan Hajnoczi wrote:
> Hi Jorgen,
> Cathy Avery found that the AF_VSOCK VMCI transport does loopback inside
> the guest (but not on the host?).  The virtio transport currently does
> no loopback.
>
> The loopback scenario I'm thinking of is where process A listens on port
> 1234 and process B on the same machine connects to port 1234 both with
> the same CID.
>
> I'd like to make the virtio transport compatible with VMCI transport
> semantics so AF_VSOCK behaves the same regardless of the transport.
> This means loopback must be added to virtio-vsock.
>
> The core net/vmware/af_vsock.c code does not implement loopback.  How
> does VMCI do loopback?  Are the loopback packets reflected back from the
> host?  Or does the guest driver notice the loopback and avoid passing
> packets to the host in the first place?
>
> Maybe we can make the loopback code common in af_vsock.c if that avoids
> code duplication.
>
> Thanks,
> Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: AF_VSOCK loopback
  2016-11-10 14:43 AF_VSOCK loopback Stefan Hajnoczi
  2016-11-10 16:17 ` Cathy Avery
@ 2016-11-11 14:14 ` Jorgen S. Hansen
  2016-11-14 19:14   ` Stefan Hajnoczi
  1 sibling, 1 reply; 4+ messages in thread
From: Jorgen S. Hansen @ 2016-11-11 14:14 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: cavery, netdev

Hi Stefan,

All datagram communication in VMCI based AF_VSOCK is going through the host - also for loopback communication. The only difference wrt loopback is that the VMCI queue pairs implementing the shared queues for the stream protocols aren't registered with the hypervisor - they are created specifying the VMCI_QPFLAG_LOCAL flag, and exist only as local guest memory.

So in the current form, there isn't much loopback code in the vmci AF_VSOCK implementation, so it doesn't seem like there would be much to share either.

Thanks,
Jørgen

________________________________________
From: Stefan Hajnoczi <stefanha@redhat.com>
Sent: Thursday, November 10, 2016 3:43 PM
To: Jorgen S. Hansen
Cc: cavery@redhat.com; netdev@vger.kernel.org
Subject: AF_VSOCK loopback

Hi Jorgen,
Cathy Avery found that the AF_VSOCK VMCI transport does loopback inside
the guest (but not on the host?).  The virtio transport currently does
no loopback.

The loopback scenario I'm thinking of is where process A listens on port
1234 and process B on the same machine connects to port 1234 both with
the same CID.

I'd like to make the virtio transport compatible with VMCI transport
semantics so AF_VSOCK behaves the same regardless of the transport.
This means loopback must be added to virtio-vsock.

The core net/vmware/af_vsock.c code does not implement loopback.  How
does VMCI do loopback?  Are the loopback packets reflected back from the
host?  Or does the guest driver notice the loopback and avoid passing
packets to the host in the first place?

Maybe we can make the loopback code common in af_vsock.c if that avoids
code duplication.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: AF_VSOCK loopback
  2016-11-11 14:14 ` Jorgen S. Hansen
@ 2016-11-14 19:14   ` Stefan Hajnoczi
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2016-11-14 19:14 UTC (permalink / raw)
  To: Jorgen S. Hansen; +Cc: cavery, netdev

[-- Attachment #1: Type: text/plain, Size: 749 bytes --]

On Fri, Nov 11, 2016 at 02:14:44PM +0000, Jorgen S. Hansen wrote:
> Hi Stefan,
> 
> All datagram communication in VMCI based AF_VSOCK is going through the host - also for loopback communication. The only difference wrt loopback is that the VMCI queue pairs implementing the shared queues for the stream protocols aren't registered with the hypervisor - they are created specifying the VMCI_QPFLAG_LOCAL flag, and exist only as local guest memory.
> 
> So in the current form, there isn't much loopback code in the vmci AF_VSOCK implementation, so it doesn't seem like there would be much to share either.

Thanks for clarifying.  I'm playing with a virtio-vsock implementation
of loopback and expect send patches later this week.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-14 19:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-10 14:43 AF_VSOCK loopback Stefan Hajnoczi
2016-11-10 16:17 ` Cathy Avery
2016-11-11 14:14 ` Jorgen S. Hansen
2016-11-14 19:14   ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.