From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: jgross@suse.com, lars.kurth@citrix.com, wei.liu2@citrix.com,
andrew.cooper3@citrix.com,
Stefano Stabellini <stefano@aporeto.com>,
Paul.Durrant@citrix.com, xen-devel@lists.xenproject.org,
joao.m.martins@oracle.com, boris.ostrovsky@oracle.com,
roger.pau@citrix.com
Subject: Re: [DOC v8] PV Calls protocol design
Date: Fri, 10 Feb 2017 16:30:35 -0500 [thread overview]
Message-ID: <20170210213035.GL32459@char.us.ORACLE.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1702101142300.20549@sstabellini-ThinkPad-X260>
On Fri, Feb 10, 2017 at 12:09:36PM -0800, Stefano Stabellini wrote:
> On Fri, 10 Feb 2017, Konrad Rzeszutek Wilk wrote:
> > .snip..
> > > > > Request fields:
> > > > >
> > > > > - **cmd** value: 0
> > > > > - additional fields:
> > > > > - **id**: identifies the socket
> > > > > - **addr**: address to connect to, see [Socket families and address format]
> > > >
> > > >
> > > > Hm, so what do we do if we want to support AF_UNIX which has an addr of
> > > > 108 bytes?
> > >
> > > We write a protocol extension and bump the protocol version. However, we
> >
> > Right. How would you change the protocol for this?
> >
> > I not asking to have this in this protocol but I just want us to think
> > of what we could do so that if somebody was to implement this - how
> > could we make this easier for this?
> >
> > My initial thought was to spread the request over two "old" structures.
> > And if so .. would it make sense to include an extra flag or such?
>
> That's a possibility, but I don't think we need an extra flag. It would
> be easier to introduce a new command, such as PVCALLS_CONNECT_EXTENDED
> or PVCALLS_CONNECT_V2, with the appropriate flags to say that it will
> make use of two request slots instead of one.
Fair enough. Perhaps include a section in the document about how one
could expand the protocol and include this? That would make it easier
for folks to follow an 'paved' way?
>
>
> > > could make the addr array size larger now to be more future proof, but
> > > it takes up memory and I have no use for it, given that we can use
> > > loopback for the same purpose.
> > >
> >
> > ..snip..
> > > > > #### Indexes Page Structure
> > > > >
> > > > > typedef uint32_t PVCALLS_RING_IDX;
> > > > >
> > > > > struct pvcalls_data_intf {
> > > > > PVCALLS_RING_IDX in_cons, in_prod;
> > > > > int32_t in_error;
> > > >
> > > > You don't want to perhaps include in_event?
> > > > >
> > > > > uint8_t pad[52];
> > > > >
> > > > > PVCALLS_RING_IDX out_cons, out_prod;
> > > > > int32_t out_error;
> > > >
> > > > And out_event as way to do some form of interrupt mitigation
> > > > (similar to what you had proposed?)
> > >
> > > Yes, the in_event / out_event optimization that I wrote for the 9pfs
> > > protocol could work here too. However, I thought you preferred to remove
> > > it for now as it is not required and increases complexity?
> >
> > I did. But I am coming to it by looking at the ring.h header.
> >
> > My recollection was that your optimization was a bit different than
> > what ring.h has.
>
> Right. They are similar, but different because in this protocol we have
> two rings: the `in' ring and the `out' ring. Each ring is
> mono-directional and there is no static request size: the producer
> writes opaque data to the ring. In ring.h they are combined together and
> the request size is static and well-known. In PVCalls:
>
> in -> backend to frontend only
> out-> frontend to backend only
>
> Let talk about the `in' ring, where the frontend is the consumer
> and the backend is the producer. Everything is the same but mirrored for
> the `out' ring.
>
> The producer doesn't need any notifications unless the ring is full.
> The producer, the backend in this case, never reads from the `in' ring.
> Thus, I disabled notifications to the producer by default and added an
> in_event field for the producer to ask for notifications only when
> necessary, that is when the ring is full.
>
> On the other end, the consumer always require notifications, unless the
> consumer is already actively reading from the ring. The
> producer could figure it out without any additional fields in the
> protocol. It can simply compare the indexes at the beginning and at the
> end of the function, that's similar to what the ring protocol does.
I like your description! Could you include this in a section
titled 'Why ring.h macros are not needed.' please?
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
prev parent reply other threads:[~2017-02-10 21:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-25 0:14 [DOC v8] PV Calls protocol design Stefano Stabellini
2017-01-27 7:08 ` Oleksandr Andrushchenko
2017-01-27 18:48 ` Stefano Stabellini
2017-01-30 7:33 ` Oleksandr Andrushchenko
2017-02-07 20:24 ` Konrad Rzeszutek Wilk
2017-02-10 1:29 ` Stefano Stabellini
2017-02-10 18:44 ` Konrad Rzeszutek Wilk
2017-02-10 20:09 ` Stefano Stabellini
2017-02-10 21:30 ` Konrad Rzeszutek Wilk [this message]
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=20170210213035.GL32459@char.us.ORACLE.com \
--to=konrad.wilk@oracle.com \
--cc=Paul.Durrant@citrix.com \
--cc=andrew.cooper3@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=sstabellini@kernel.org \
--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 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.