From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Paul Durrant <paul.durrant@citrix.com>, xen-devel@lists.xenproject.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
Keir Fraser <keir@xen.org>,
Ian Campbell <ian.campbell@citrix.com>,
Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH 2/3] public/io/netif.h: document control ring and toeplitz hashing
Date: Wed, 23 Dec 2015 11:45:13 +0000 [thread overview]
Message-ID: <567A8949.2090909@citrix.com> (raw)
In-Reply-To: <1450865195-12883-3-git-send-email-paul.durrant@citrix.com>
On 23/12/2015 10:06, Paul Durrant wrote:
> +#define NETIF_CTRL_RING_SIZE 1024
> +
> +struct netif_ctrl_ring {
> + RING_IDX req_cons;
> + RING_IDX req_prod;
> + RING_IDX rsp_cons;
> + RING_IDX rsp_prod;
> + uint8_t req[NETIF_CTRL_RING_SIZE];
> + uint8_t rsp[NETIF_CTRL_RING_SIZE];
To avoid making the same mistake as the xenstore ring, this at the very
minimum needs a defined reset protocol. It should also at least have a
version number (currently expected to be zero) which is used to
delineate the use of the remaining space in the page.
> +};
> +
> +struct xen_netif_ctrl_msg_hdr {
> + uint16_t type;
> + uint16_t len;
These don't match your documentation above. uint32_t's ?
> +};
> +
> +#define NETIF_CTRL_MSG_ACK 1
> +#define NETIF_CTRL_MSG_GET_TOEPLITZ_FLAGS 2
> +#define NETIF_CTRL_MSG_SET_TOEPLITZ_FLAGS 3
> +#define NETIF_CTRL_MSG_SET_TOEPLITZ_KEY 4
> +#define NETIF_CTRL_MSG_SET_TOEPLITZ_MAPPING 5
What about 0? Again learning from the xenstore case, can we define 0 as
explicitly an invalid value, so a page of zeroes doesn't appear to be a
valid sequence of messages.
> +
> +/* Control messages: */
> +
> +/*
> + * NETIF_CTRL_MSG_ACK:
> + *
> + * This is the only valid type of message sent by the backend to the
> + * frontend. It carries a payload of the following format:
> + *
> + * 0 1 2 3 4 5 6 7 octet
> + * +-----+-----+-----+-----+-----+-----+-----+-----+
Can I recommend that all ack packets contain the control type they are
responding to. In the normal case, it indeed shouldn't be needed, but
if the front and back ever get out of sync, it will make debugging far
easier.
~Andrew
next prev parent reply other threads:[~2015-12-23 11:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 10:06 [PATCH 0/3] public/io/netif.h: support for toeplitz hashing Paul Durrant
2015-12-23 10:06 ` [PATCH 1/3] public/io/netif.h: document transmit and receive wire formats separately Paul Durrant
2015-12-23 10:06 ` [PATCH 2/3] public/io/netif.h: document control ring and toeplitz hashing Paul Durrant
2015-12-23 11:45 ` Andrew Cooper [this message]
2015-12-23 11:56 ` Paul Durrant
2015-12-23 13:27 ` David Vrabel
2016-01-04 9:37 ` Paul Durrant
2016-01-04 10:55 ` David Vrabel
2016-01-04 11:14 ` Paul Durrant
2016-01-04 11:18 ` David Vrabel
2016-01-04 11:21 ` Paul Durrant
2016-01-04 11:28 ` David Vrabel
2016-01-04 11:34 ` Paul Durrant
2016-01-04 20:19 ` Konrad Rzeszutek Wilk
2016-01-05 9:40 ` Paul Durrant
2015-12-23 10:06 ` [PATCH 3/3] public/io/netif.h: document new extra info for passing hash values Paul Durrant
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=567A8949.2090909@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=paul.durrant@citrix.com \
--cc=tim@xen.org \
--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.