From: Stefano Stabellini <sstabellini@kernel.org>
To: xen-devel@lists.xenproject.org
Cc: jgross@suse.com, sstabellini@kernel.org, wei.liu2@citrix.com,
George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com,
ian.jackson@eu.citrix.com, tim@xen.org, jbeulich@suse.com
Subject: [PATCH v2 1/2] usbif.h: replace PAGE_SIZE with USBIF_RING_SIZE
Date: Wed, 19 Oct 2016 12:22:34 -0700 [thread overview]
Message-ID: <1476904955-16003-1-git-send-email-sstabellini@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.10.1610191123410.16441@sstabellini-ThinkPad-X260>
Do not reference PAGE_SIZE directly: it could be undefined, or it could
have different values in the frontend or in the backend.
Define USBIF_RING_SIZE as 4096, assuming all users of usbif.h have 4K
page granularity. Replace PAGE_SIZE with USBIF_RING_SIZE.
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
---
xen/include/public/io/usbif.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/xen/include/public/io/usbif.h b/xen/include/public/io/usbif.h
index 4053c24..c6a5863 100644
--- a/xen/include/public/io/usbif.h
+++ b/xen/include/public/io/usbif.h
@@ -170,6 +170,7 @@ enum usb_spec_version {
#define USBIF_MAX_SEGMENTS_PER_REQUEST (16)
#define USBIF_MAX_PORTNR 31
+#define USBIF_RING_SIZE 4096
/*
* RING for transferring urbs.
@@ -226,7 +227,7 @@ struct usbif_urb_response {
typedef struct usbif_urb_response usbif_urb_response_t;
DEFINE_RING_TYPES(usbif_urb, struct usbif_urb_request, struct usbif_urb_response);
-#define USB_URB_RING_SIZE __CONST_RING_SIZE(usbif_urb, PAGE_SIZE)
+#define USB_URB_RING_SIZE __CONST_RING_SIZE(usbif_urb, USBIF_RING_SIZE)
/*
* RING for notifying connect/disconnect events to frontend
@@ -248,6 +249,6 @@ struct usbif_conn_response {
typedef struct usbif_conn_response usbif_conn_response_t;
DEFINE_RING_TYPES(usbif_conn, struct usbif_conn_request, struct usbif_conn_response);
-#define USB_CONN_RING_SIZE __CONST_RING_SIZE(usbif_conn, PAGE_SIZE)
+#define USB_CONN_RING_SIZE __CONST_RING_SIZE(usbif_conn, USBIF_RING_SIZE)
#endif /* __XEN_PUBLIC_IO_USBIF_H__ */
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-10-19 19:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-19 19:21 [PATCH v2 0/2] Remove PAGE_SIZE from public headers stefano
2016-10-19 19:22 ` Stefano Stabellini [this message]
2016-10-19 19:22 ` [PATCH v2 2/2] vscsiif.h: replace PAGE_SIZE with VSCSIIF_PAGE_SIZE Stefano Stabellini
2016-10-20 5:10 ` [PATCH v2 0/2] Remove PAGE_SIZE from public headers Juergen Gross
2016-10-20 19:09 ` Stefano Stabellini
2016-10-20 19:42 ` Andrew Cooper
2016-10-20 20:04 ` Stefano Stabellini
2016-10-20 20:05 ` Andrew Cooper
2016-10-20 20:38 ` Stefano Stabellini
2016-10-21 9:00 ` Wei Liu
2016-10-21 20:28 ` Stefano Stabellini
2016-10-21 8:59 ` Wei Liu
2016-10-21 20:08 ` 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=1476904955-16003-1-git-send-email-sstabellini@kernel.org \
--to=sstabellini@kernel.org \
--cc=George.Dunlap@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=tim@xen.org \
--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).