All of lore.kernel.org
 help / color / mirror / Atom feed
From: Asias He <asias@redhat.com>
To: Andy King <acking@vmware.com>
Cc: kvm@vger.kernel.org, Dmitry Torokhov <dtor@vmware.com>,
	netdev@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
	Reilly Grant <grantr@vmware.com>,
	virtualization@lists.linux-foundation.org,
	Pekka Enberg <penberg@kernel.org>,
	Sasha Levin <sasha.levin@oracle.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [RFC 0/5] Introduce VM Sockets virtio transport
Date: Fri, 28 Jun 2013 13:50:19 +0800	[thread overview]
Message-ID: <20130628055019.GA30441@hj.localdomain> (raw)
In-Reply-To: <1110962459.9928554.1372386340171.JavaMail.root@vmware.com>

On Thu, Jun 27, 2013 at 07:25:40PM -0700, Andy King wrote:
> Hi Michael,
> 
> > >            __u32 guest_cid;
> > 
> > Given that cid is like an IP address, 32 bit seems too
> > limiting. I would go for a 64 bit one or maybe even 128 bit,
> > so that e.g. GUIDs can be used there.
> 
> That's likely based on what vSockets uses, which is in turn based on
> what the VMCI device exposes (which is what vSockets was originally
> built on), so unfortunately it's too late to extend that type.
> However, that still allows just under 2^32 VMs per host (there are
> three reserved values).

Yes, 32 bit cid and port are defined by vSockets, we can not go for 64 bit
for virtio transport.

> > >            __u32   dst_port;
> > 
> > Ports are 32 bit? I guess most applications can't work with >16 bit.
> 
> As with the cid, the width of the port type comes from vSockets,
> which is what this plugs into.

Yes.

> > Also, why put cid's in all packets? They are only needed
> > when you create a connection, no? Afterwards port numbers
> > can be used.
> 
> The cid is present in DGRAM packets and STREAM _control_ packets
> (connection handshake, signal read/write and so forth).  I don't
> think the intent here is for it to be in STREAM _data_ packets,
> but Asias can clarify.

Virtio transport stream data packets are a bit different from how VMCI transport
handles them. In VMCI, a dedicated queue pairs is created for each
stream. In virtio, all the streams share the single virtqueue pairs.

On the recv path, we need the cid and port information from the packet
header to figure out which socket is responsible for the packet.

> > > Virtio VM socket connection creation:
> > > 1) Client sends VIRTIO_VSOCK_OP_REQUEST to server
> > > 2) Server reponses with VIRTIO_VSOCK_OP_NEGOTIATE to client
> > > 3) Client sends VIRTIO_VSOCK_OP_OFFER to server
> > > 4) Server responses with VIRTIO_VSOCK_OP_ATTACH to client
> > 
> > What's the reason for a 4 stage setup? Most transports
> > make do with 3.
> 
> I'm guessing that's also based on the original vSockets/VMCI
> implementation, where the NEGOTIATE/OFFER stages are used to
> negotiate the underlying transport buffer size (in VMCI, the
> queuepair that underlies a STREAM socket).  The virtio
> transport can probably use 3.

Right, I wanted to follow how VMCI transport does the connection setup.

We can drop the IRTIO_VSOCK_OP_ATTACH stage, and make the client into
SS_CONNECTED state once we get the VIRTIO_VSOCK_OP_NEGOTIATE pkt.

> Thanks!
> - Andy

-- 
Asias

  reply	other threads:[~2013-06-28  5:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27  7:59 [RFC 0/5] Introduce VM Sockets virtio transport Asias He
2013-06-27  8:00 ` [RFC 1/5] VSOCK: Introduce vsock_find_unbound_socket and vsock_bind_dgram_generic Asias He
2013-06-27  8:00 ` [RFC 2/5] VSOCK: Introduce virtio-vsock-common.ko Asias He
2013-06-27 10:34   ` Michael S. Tsirkin
2013-06-28  6:28     ` Asias He
2013-06-29  4:32   ` David Miller
2013-06-29 23:45     ` Asias He
2013-06-29  4:32   ` David Miller
2013-06-27  8:00 ` [RFC 3/5] VSOCK: Introduce virtio-vsock.ko Asias He
2013-06-27  8:00 ` [RFC 4/5] VSOCK: Introduce vhost-vsock.ko Asias He
2013-06-27 10:42   ` Michael S. Tsirkin
2013-06-28  2:38     ` Andy King
2013-06-28  2:38     ` Andy King
2013-06-28  6:55     ` Asias He
2013-06-27  8:00 ` [RFC 5/5] VSOCK: Add Makefile and Kconfig Asias He
2013-06-27 10:23 ` [RFC 0/5] Introduce VM Sockets virtio transport Michael S. Tsirkin
2013-06-28  2:25   ` Andy King
2013-06-28  5:50     ` Asias He [this message]
2013-06-28  6:12   ` Asias He
2013-06-27 19:03 ` Sasha Levin
2013-06-28  6:26   ` Asias He

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130628055019.GA30441@hj.localdomain \
    --to=asias@redhat.com \
    --cc=acking@vmware.com \
    --cc=davem@davemloft.net \
    --cc=dtor@vmware.com \
    --cc=grantr@vmware.com \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=penberg@kernel.org \
    --cc=sasha.levin@oracle.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.