xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Stefano Stabellini <stefano@aporeto.com>, xen-devel@lists.xenproject.org
Cc: lars.kurth@citrix.com, wei.liu2@citrix.com,
	Paul.Durrant@citrix.com, joao.m.martins@oracle.com,
	boris.ostrovsky@oracle.com, roger.pau@citrix.com
Subject: Re: [DRAFT v2] XenSock protocol design document
Date: Fri, 15 Jul 2016 13:36:54 +0200	[thread overview]
Message-ID: <5788CAD6.3070100@suse.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1607131629031.26575@sstabellini-ThinkPad-X260>

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).


Juergen


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-07-15 11:36 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 [this message]
2016-07-15 11:56   ` Paul Durrant
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=5788CAD6.3070100@suse.com \
    --to=jgross@suse.com \
    --cc=Paul.Durrant@citrix.com \
    --cc=boris.ostrovsky@oracle.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).