xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Vincent Hanquez <vincent.hanquez@citrix.com>
To: Ross Philipson <ross.philipson@citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [PATCH (V9) 2/2] xen: Add V4V implementation
Date: Wed, 29 May 2013 10:56:10 +0100	[thread overview]
Message-ID: <51A5D0BA.2060701@citrix.com> (raw)
In-Reply-To: <1369770211-4509-3-git-send-email-ross.philipson@citrix.com>

On 05/28/2013 08:43 PM, Ross Philipson wrote:
> +
> +typedef struct v4v_addr
> +{
> +    uint32_t port;
> +    domid_t domain;
> +    uint16_t pad;
> +} v4v_addr_t;


> +struct v4v_ring_message_header
> +{
> +    uint32_t len;
> +    uint32_t message_type;
> +    v4v_addr_t source;
> +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
> +    uint8_t data[];
> +#elif defined(__GNUC__)
> +    uint8_t data[0];
> +#endif
> +};
> +


> +/*
> + * V4VOP_sendv
> + *
> + * Sends of list of buffer contained in iov.
> + *
> + * For each iov entry send iov_len bytes of iov_base to addr.dst, giving
> + * src as the source address (xen will ignore src->domain and put your
> + * domain in the actually message), xen first looks for a ring with id.addr==dst
> + * and id.partner==sending_domain if that fails it looks for id.addr==dst and
> + * id.partner==DOMID_ANY.
> + * message_type is the 32 bit number used from the message
> + * most likely V4V_MESSAGE_DGRAM or V4V_MESSAGE_STREAM. If insufficient space exists
> + * it will return -EAGAIN and xen will twing the V4V_INTERRUPT when
> + * sufficient space becomes available
> + *
> + * do_v4v_op(V4VOP_sendv,
> + *           XEN_GUEST_HANDLE(v4v_send_addr_t) addr,
> + *           XEN_GUEST_HANDLE(v4v_iov_t) iov,
> + *           uint32_t niov,
> + *           uint32_t message_type)
> + */
> +#define V4VOP_sendv		5

Instead of having the message_type part of each ring_message_header and 
in the sendv hypercall,
I wonder if this would make more sense to register the ring with a 
message type (as a "tag"),
so that ring are addressed by a 3-tuple (domain,port,message_type) 
instead of a 2-tuple (domain,port),
which make a ring only able to receive strictly one message type.

It could have the following benefits:

* v4v_addr's .pad becomes the message type.
* the message_type become less important for the hypervisor, it's just 
the same as a port.
* the message_header is 4 byte shorter and the guest doesn't have to 
sort message type itself.
* it could be useful to handle priority on rings at guest level for 
specific message type.
* guests doesn't receive message type that it doesn't expect on a ring.
* the source automatically get a connection refused if a guest is not 
handling a specific message type.
* the firewall can filter on message type as it's part of the v4v_addr.

-- 
Vincent

  parent reply	other threads:[~2013-05-29  9:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-28 19:43 [PATCH (V9) 0/2] Add V4V to Xen Ross Philipson
2013-05-28 19:43 ` [PATCH (V9) 1/2] xen: events, exposes evtchn_alloc_unbound_domain Ross Philipson
2013-05-28 19:43 ` [PATCH (V9) 2/2] xen: Add V4V implementation Ross Philipson
2013-05-29  0:43   ` Matt Wilson
2013-05-29 19:28     ` Ross Philipson
2013-05-29  8:34   ` Jan Beulich
2013-05-29 19:26     ` Ross Philipson
2013-05-30  5:16       ` Jan Beulich
2013-05-29  9:56   ` Vincent Hanquez [this message]
2013-05-30 16:20   ` Tim Deegan
2013-06-04 18:01     ` Ross Philipson
2013-06-10 15:06   ` David Vrabel
2013-05-30 11:57 ` [PATCH (V9) 0/2] Add V4V to Xen Ian Campbell
2013-05-31  7:36   ` Vincent Hanquez
2013-05-31  7:50     ` Ian Campbell
2013-05-31  8:56       ` Vincent Hanquez
2013-05-31  9:01         ` Ian Campbell
2013-05-31  9:26           ` Vincent Hanquez
2013-05-31 16:29             ` Ross Philipson
2013-05-31 16:38               ` Ian Campbell
2013-05-30 12:07 ` Ian Campbell
2013-05-30 16:08   ` David Vrabel
2013-05-31  7:25     ` Vincent Hanquez
2013-05-31 10:21       ` David Vrabel

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=51A5D0BA.2060701@citrix.com \
    --to=vincent.hanquez@citrix.com \
    --cc=ross.philipson@citrix.com \
    --cc=xen-devel@lists.xen.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).