From patchwork Wed Oct 19 19:22:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9385205 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 79DD260487 for ; Wed, 19 Oct 2016 19:24:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A9B629672 for ; Wed, 19 Oct 2016 19:24:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E3FD296B5; Wed, 19 Oct 2016 19:24:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E4EEA29672 for ; Wed, 19 Oct 2016 19:24:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwwRn-0007sq-6E; Wed, 19 Oct 2016 19:22:43 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwwRm-0007sf-SJ for xen-devel@lists.xenproject.org; Wed, 19 Oct 2016 19:22:42 +0000 Received: from [193.109.254.147] by server-5.bemta-6.messagelabs.com id 3A/A4-29563-208C7085; Wed, 19 Oct 2016 19:22:42 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFLMWRWlGSWpSXmKPExsVybKJshy7jCfY IgzuNUhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8biR3dYChbxVDzdLdjA+Jqri5GLQ0hgKqPE +9l32LoYOYGc7UwS75Y6g9hsAoYSf59sAouLCChJ3Fs1mQmkgVngMqPE9PevmEASwgLuErsXd bOD2CwCqhI/109hAbF5Bdwkjm+eDdYsISAncfLYZFYQm1PAR+LXo3nMEMu8Je4emcgEUZMhMa 9nDiuE7SWx6MYlKFtN4uq5TcwTGPkWMDKsYtQoTi0qSy3SNTLRSyrKTM8oyU3MzNE1NDDTy00 tLk5MT81JTCrWS87P3cQIDBMGINjBuHJd4CFGSQ4mJVFenj72CCG+pPyUyozE4oz4otKc1OJD jDIcHEoSvNbHgXKCRanpqRVpmTnAgIVJS3DwKInwfjkGlOYtLkjMLc5Mh0idYlSUEueVBukTA ElklObBtcGi5BKjrJQwLyPQIUI8BalFuZklqPKvGMU5GJWEeX+CjOfJzCuBm/4KaDET0OJzeS wgi0sSEVJSDYzsFUeT/r2try6JULzC5eE2a4oU1781tpwS/KnXPUpfMkpKZbRqR7/wurfr/J2 Nb8SqPu1oDq7Nq1r34fPizQEdMgesPI87NuU7Ptj9rmZD5pWdSyesnsH/lfdPqsvXqS/yDk4w +vBSdCXbW62T51kFxdtsv12OYf+/VdW80bz1+0yv7aq8a2KVWIozEg21mIuKEwHDBWWdjQIAA A== X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-14.tower-27.messagelabs.com!1476904960!53868557!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50 X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked Received: (qmail 40465 invoked from network); 19 Oct 2016 19:22:41 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-14.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 19 Oct 2016 19:22:41 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EFFA42020F; Wed, 19 Oct 2016 19:22:38 +0000 (UTC) Received: from sstabellini-ThinkPad-X260.hsd1.ca.comcast.net (96-82-76-110-static.hfc.comcastbusiness.net [96.82.76.110]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9091E200F3; Wed, 19 Oct 2016 19:22:37 +0000 (UTC) From: Stefano Stabellini To: xen-devel@lists.xenproject.org Date: Wed, 19 Oct 2016 12:22:34 -0700 Message-Id: <1476904955-16003-1-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-Virus-Scanned: ClamAV using ClamSMTP 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: [Xen-devel] [PATCH v2 1/2] usbif.h: replace PAGE_SIZE with USBIF_RING_SIZE X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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__ */