From patchwork Wed Oct 19 19:22:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9385207 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 AF94D60487 for ; Wed, 19 Oct 2016 19:24:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A050129672 for ; Wed, 19 Oct 2016 19:24:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94E3D2966D; Wed, 19 Oct 2016 19:24:50 +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 2CDC82966D for ; Wed, 19 Oct 2016 19:24:50 +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 1bwwRp-0007tj-Dq; Wed, 19 Oct 2016 19:22:45 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwwRo-0007t5-2R for xen-devel@lists.xenproject.org; Wed, 19 Oct 2016 19:22:44 +0000 Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id D9/C3-16745-308C7085; Wed, 19 Oct 2016 19:22:43 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDLMWRWlGSWpSXmKPExsVybKJshy7TCfY Ig2evjCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozX7YuZCxZxVryc/4W5gfE9excjJ4eQwFRG ibdPFbsYuYDs7UwS+6Z9ZwNJsAkYSvx9sgnMFhFQkri3ajITSBGzwGVGienvXzGBJIQFvCVWP j8CVsQioCqxuGEeC4jNK+AmMfNXJ5gtISAncfLYZFYQm1PAXeLT1T2sENvaGSUe9BxjhCjKkJ jXM4cVwvaSWHTjEpStJnH13CbmCYx8CxgZVjFqFKcWlaUW6Rqa6SUVZaZnlOQmZuboGhqY6uW mFhcnpqfmJCYV6yXn525iBIYKAxDsYDx/2vMQoyQHk5IoL08fe4QQX1J+SmVGYnFGfFFpTmrx IUYZDg4lCd7WY0A5waLU9NSKtMwcYNDCpCU4eJREeL+ApHmLCxJzizPTIVKnGBWlxHlXgyQEQ BIZpXlwbbBIucQoKyXMywh0iBBPQWpRbmYJqvwrRnEORiVh3p8gU3gy80rgpr8CWswEtPhcHg vI4pJEhJRUA+OkbObX3bmMxw9NajXivNOWkua479qfI0Hv3Vfq7ha7MGWai8aqON87NxvK1W8 s+Zd1raO8b9/xHnOB97PmK8Vp9ahpnbL+JPCtZaZ2X+v7t4K5WxPt9/W7R4mxM2T++Sbf5dC9 suBnq8rDzWuWrl/9uCF53YzO2ZWhK149uN3kc1HpfUJV7i4lluKMREMt5qLiRAD6K82gjwIAA A== X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-7.tower-206.messagelabs.com!1476904961!65562735!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked Received: (qmail 8312 invoked from network); 19 Oct 2016 19:22:42 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 19 Oct 2016 19:22:42 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60B05200F3; Wed, 19 Oct 2016 19:22:40 +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 1AB142034E; Wed, 19 Oct 2016 19:22:39 +0000 (UTC) From: Stefano Stabellini To: xen-devel@lists.xenproject.org Date: Wed, 19 Oct 2016 12:22:35 -0700 Message-Id: <1476904955-16003-2-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1476904955-16003-1-git-send-email-sstabellini@kernel.org> References: <1476904955-16003-1-git-send-email-sstabellini@kernel.org> 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 2/2] vscsiif.h: replace PAGE_SIZE with VSCSIIF_PAGE_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 VSCSIIF_PAGE_SIZE as 4096, assuming all users of vscsiif.h have 4K page granularity. Replace PAGE_SIZE with VSCSIIF_PAGE_SIZE. Signed-off-by: Stefano Stabellini --- xen/include/public/io/vscsiif.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/include/public/io/vscsiif.h b/xen/include/public/io/vscsiif.h index 0a4709f..d0bd3b5 100644 --- a/xen/include/public/io/vscsiif.h +++ b/xen/include/public/io/vscsiif.h @@ -248,6 +248,7 @@ */ #define VSCSIIF_MAX_COMMAND_SIZE 16 #define VSCSIIF_SENSE_BUFFERSIZE 96 +#define VSCSIIF_PAGE_SIZE 4096 struct scsiif_request_segment { grant_ref_t gref; @@ -256,7 +257,7 @@ struct scsiif_request_segment { }; typedef struct scsiif_request_segment vscsiif_segment_t; -#define VSCSIIF_SG_PER_PAGE (PAGE_SIZE / sizeof(struct scsiif_request_segment)) +#define VSCSIIF_SG_PER_PAGE (VSCSIIF_PAGE_SIZE / sizeof(struct scsiif_request_segment)) /* Size of one request is 252 bytes */ struct vscsiif_request {