From: Paul Durrant <Paul.Durrant@citrix.com>
To: Juergen Gross <jgross@suse.com>,
Stefano Stabellini <stefano@aporeto.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Lars Kurth <lars.kurth@citrix.com>,
"joao.m.martins@oracle.com" <joao.m.martins@oracle.com>,
Wei Liu <wei.liu2@citrix.com>,
"boris.ostrovsky@oracle.com" <boris.ostrovsky@oracle.com>,
Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [DRAFT v2] XenSock protocol design document
Date: Fri, 15 Jul 2016 11:56:32 +0000 [thread overview]
Message-ID: <a6fa2223dbca4539b0215aa4c2af235d@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <5788CAD6.3070100@suse.com>
> -----Original Message-----
> From: Juergen Gross [mailto:jgross@suse.com]
> Sent: 15 July 2016 12:37
> To: Stefano Stabellini; xen-devel@lists.xenproject.org
> Cc: joao.m.martins@oracle.com; Wei Liu; Roger Pau Monne; Lars Kurth;
> boris.ostrovsky@oracle.com; Paul Durrant
> Subject: Re: [DRAFT v2] XenSock protocol design document
>
> On 13/07/16 17:47, Stefano Stabellini wrote:
> > Hi all,
> >
> > This is the design document of the XenSock protocol. You can find
> > prototypes of the Linux frontend and backend drivers here:
> ...
> > ### Commands Ring
> >
> > The shared ring is used by the frontend to forward socket API calls to the
> > backend. I'll refer to this ring as **commands ring** to distinguish it from
> > other rings which will be created later in the lifecycle of the protocol (data
> > rings). The ring format is defined using the familiar `DEFINE_RING_TYPES`
> macro
> > (`xen/include/public/io/ring.h`). Frontend requests are allocated on the
> ring
> > using the `RING_GET_REQUEST` macro.
> >
> > The format is defined as follows:
> >
> > #define XENSOCK_SOCKET 0
> > #define XENSOCK_CONNECT 1
> > #define XENSOCK_RELEASE 2
> > #define XENSOCK_BIND 3
> > #define XENSOCK_LISTEN 4
> > #define XENSOCK_ACCEPT 5
> > #define XENSOCK_POLL 6
> >
> > struct xen_xensock_request {
> > uint32_t id; /* private to guest, echoed in response */
> > uint32_t cmd; /* command to execute */
> > uint64_t sockid;
> > union {
> > struct xen_xensock_socket {
> > uint32_t domain;
> > uint32_t type;
> > uint32_t protocol;
> > } socket;
> > struct xen_xensock_connect {
> > uint8_t addr[28];
> > uint32_t len;
> > uint32_t flags;
> > grant_ref_t ref;
> > uint32_t evtchn;
> > } connect;
> > struct xen_xensock_bind {
> > uint8_t addr[28];
> > uint32_t len;
> > } bind;
> > struct xen_xensock_listen {
> > uint32_t backlog;
> > } listen;
> > struct xen_xensock_accept {
> > uint64_t sockid;
> > grant_ref_t ref;
> > uint32_t evtchn;
> > } accept;
> > } u;
> > };
>
> Please add padding at the end (or a dummy union member) to make sure
> 32- and 64-bit variants have the same size (I believe now the size will
> be 60 bytes on 32-bit system and 64 bytes on 64-bit).
>
Actually, rather than this bunch of structs that assume a System V ABI, maybe we need a spec. more along the lines of the (ancient) TPI doc. http://pubs.opengroup.org/onlinepubs/009618999/toc.htm. After all, like TPI, this is a message passing protocol.
Paul
>
> Juergen
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-07-15 11:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-13 15:47 [DRAFT v2] XenSock protocol design document Stefano Stabellini
2016-07-13 16:04 ` Andrew Cooper
2016-07-13 17:22 ` Stefano Stabellini
2016-07-15 11:36 ` Juergen Gross
2016-07-15 11:56 ` Paul Durrant [this message]
2016-07-19 22:38 ` Stefano Stabellini
2016-07-20 4:15 ` Juergen Gross
2016-07-20 17:43 ` Stefano Stabellini
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=a6fa2223dbca4539b0215aa4c2af235d@AMSPEX02CL03.citrite.net \
--to=paul.durrant@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=jgross@suse.com \
--cc=joao.m.martins@oracle.com \
--cc=lars.kurth@citrix.com \
--cc=roger.pau@citrix.com \
--cc=stefano@aporeto.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).