[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191113163842.6byl2qul4nbjf5no@steredhat>
Date: Wed, 13 Nov 2019 17:38:42 +0100
From: Stefano Garzarella <sgarzare@...hat.com>
To: Jorgen Hansen <jhansen@...are.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"Michael S. Tsirkin" <mst@...hat.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jason Wang <jasowang@...hat.com>,
"David S. Miller" <davem@...emloft.net>,
Dexuan Cui <decui@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Sasha Levin <sashal@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Arnd Bergmann <arnd@...db.de>,
Stefan Hajnoczi <stefanha@...hat.com>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>
Subject: Re: [PATCH net-next 11/14] vsock: add multi-transports support
On Wed, Nov 13, 2019 at 02:30:24PM +0000, Jorgen Hansen wrote:
> > From: Stefano Garzarella [mailto:sgarzare@...hat.com]
> > Sent: Tuesday, November 12, 2019 11:37 AM
>
> > > > > You already mentioned that you are working on a fix for loopback
> > > > > here for the guest, but presumably a host could also do loopback.
> > > >
> > > > IIUC we don't support loopback in the host, because in this case the
> > > > application will use the CID_HOST as address, but if we are in a nested
> > > > VM environment we are in trouble.
> > >
> > > If both src and dst CID are CID_HOST, we should be fairly sure that this
> > > Is host loopback, no? If src is anything else, we would do G2H.
> > >
> >
> > The problem is that we don't know the src until we assign a transport
> > looking at the dst. (or if the user bound the socket to CID_HOST before
> > the connect(), but it is not very common)
> >
> > So if we are in a L1 and the user uses the local guest CID, it works, but if
> > it uses the HOST_CID, the packet will go to the L0.
> >
> > If we are in L0, it could be simple, because we can simply check if G2H
> > is not loaded, so any packet to CID_HOST, is host loopback.
> >
> > I think that if the user uses the IOCTL_VM_SOCKETS_GET_LOCAL_CID, to set
> > the dest CID for the loopback, it works in both cases because we return the
> > HOST_CID in L0, and always the guest CID in L1, also if a H2G is loaded to
> > handle the L2.
> >
> > Maybe we should document this in the man page.
>
> Yeah, it seems like a good idea to flesh out the routing behavior for nested
> VMs in the man page.
I'll do it.
>
> >
> > But I have a question: Does vmci support the host loopback?
> > I've tried, and it seems not.
>
> Only for datagrams - not for stream sockets.
>
Ok, I'll leave the datagram loopback as before.
> > Also vhost-vsock doesn't support it, but virtio-vsock does.
> >
> > > >
> > > > Since several people asked about this feature at the KVM Forum, I would
> > like
> > > > to add a new VMADDR_CID_LOCAL (i.e. using the reserved 1) and
> > implement
> > > > loopback in the core.
> > > >
> > > > What do you think?
> > >
> > > What kind of use cases are mentioned in the KVM forum for loopback?
> > One concern
> > > is that we have to maintain yet another interprocess communication
> > mechanism,
> > > even though other choices exist already (and those are likely to be more
> > efficient
> > > given the development time and specific focus that went into those). To
> > me, the
> > > local connections are mainly useful as a way to sanity test the protocol and
> > transports.
> > > However, if loopback is compelling, it would make sense have it in the core,
> > since it
> > > shouldn't need a specific transport.
> >
> > The common use cases is for developer point of view, and to test the
> > protocol and transports as you said.
> >
> > People that are introducing VSOCK support in their projects, would like to
> > test them on their own PC without starting a VM.
> >
> > The idea is to move the code to handle loopback from the virtio-vsock,
> > in the core, but in another series :-)
>
> OK, that makes sense.
Thanks,
Stefano
Powered by blists - more mailing lists