From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH v3] io/ring.h: new macro to detect whether there are too many requests on the ring
Date: Tue, 11 Jun 2013 11:10:05 +0100 [thread overview]
Message-ID: <CDDCB60D.29204%keir.xen@gmail.com> (raw)
In-Reply-To: <51B6FA9702000078000DCFE8@nat28.tlf.novell.com>
On 11/06/2013 09:23, "Jan Beulich" <JBeulich@suse.com> wrote:
> Backends may need to protect themselves against an insane number of
> produced requests stored by a frontend, in case they iterate over
> requests until reaching the req_prod value. There can't be more
> requests on the ring than the difference between produced requests
> and produced (but possibly not yet published) responses.
>
> This is a more strict alternative to a patch previously posted by
> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
> --- a/xen/include/public/io/ring.h
> +++ b/xen/include/public/io/ring.h
> @@ -234,6 +234,10 @@ typedef struct __name##_back_ring __name
> #define RING_REQUEST_CONS_OVERFLOW(_r, _cons) \
> (((_cons) - (_r)->rsp_prod_pvt) >= RING_SIZE(_r))
>
> +/* Ill-behaved frontend determination: Can there be this many requests? */
> +#define RING_REQUEST_PROD_OVERFLOW(_r, _prod) \
> + (((_prod) - (_r)->rsp_prod_pvt) > RING_SIZE(_r))
> +
> #define RING_PUSH_REQUESTS(_r) do { \
> xen_wmb(); /* back sees requests /before/ updated producer index */ \
> (_r)->sring->req_prod = (_r)->req_prod_pvt; \
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
prev parent reply other threads:[~2013-06-11 10:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-10 16:02 [PATCH] Macro for checking insance amounts of data on the ring (Xen patch) Konrad Rzeszutek Wilk
2013-06-10 16:02 ` [v2] ring/macro: Add a new macro to detect whether there is an overflow in requests and response Konrad Rzeszutek Wilk
2013-06-11 8:23 ` [PATCH v3] io/ring.h: new macro to detect whether there are too many requests on the ring Jan Beulich
2013-06-11 10:10 ` Keir Fraser [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=CDDCB60D.29204%keir.xen@gmail.com \
--to=keir.xen@gmail.com \
--cc=JBeulich@suse.com \
--cc=konrad.wilk@oracle.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).