From patchwork Wed May 28 14:34:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 4256041 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 40BB5BF90B for ; Wed, 28 May 2014 14:34:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2AAAF202E5 for ; Wed, 28 May 2014 14:34:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1309B202DD for ; Wed, 28 May 2014 14:34:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932129AbaE1Oe0 (ORCPT ); Wed, 28 May 2014 10:34:26 -0400 Received: from mail-ie0-f175.google.com ([209.85.223.175]:34103 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932144AbaE1Oe0 (ORCPT ); Wed, 28 May 2014 10:34:26 -0400 Received: by mail-ie0-f175.google.com with SMTP id y20so10398077ier.34 for ; Wed, 28 May 2014 07:34:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=167In3IHI/NRV3cW5PnwnXrlxwOzKaZUyKoE4F5nOaY=; b=Byj/c/o7HwVXrTIAswTcogVB7b97hTSdbbH24b99/g/YHPF6MKLskC0xBYrlQyzsN1 jzu3pCxL6nGE1xCrVm0BIgMd8n0k8RxkoDzicM0VQkLn3zUy7qSAfXHCMiiPH3vFLugo Xv1IrRbt7c6NAGi4rNFG/BrSa23XOEBb2c6nytc7CZS1raDp+6tn16gi3G/VtufwJoLt jtWNpVT7aklI8/rIkK+aTcgvPTVt+L+WqjK0vIsloWvjqYQE1siY8uwsUPaAbto9xVxg FEjzW2LmFLNLlKUR9pkzz10oMUFmBIzhdwnLLnNj1F31ZRHyoSBCwpDX9u2HVEBtCtwt CrCA== X-Received: by 10.50.147.101 with SMTP id tj5mr44352376igb.27.1401287665649; Wed, 28 May 2014 07:34:25 -0700 (PDT) Received: from manet.1015granger.net ([2604:8800:100:81fc:82ee:73ff:fe43:d64f]) by mx.google.com with ESMTPSA id l5sm16237102igt.0.2014.05.28.07.34.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 May 2014 07:34:25 -0700 (PDT) From: Chuck Lever Subject: [PATCH v5 18/24] xprtrdma: Allocate missing pagelist To: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Cc: Anna.Schumaker@netapp.com Date: Wed, 28 May 2014 10:34:24 -0400 Message-ID: <20140528143424.23214.59578.stgit@manet.1015granger.net> In-Reply-To: <20140528142521.23214.39655.stgit@manet.1015granger.net> References: <20140528142521.23214.39655.stgit@manet.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shirley Ma GETACL relies on transport layer to alloc memory for reply buffer. However xprtrdma assumes that the reply buffer (pagelist) has been pre-allocated in upper layer. This problem was reported by IOL OFA lab test on PPC. Signed-off-by: Shirley Ma Reviewed-by: Chuck Lever Tested-by: Edward Mossman --- net/sunrpc/xprtrdma/rpc_rdma.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c index 436d229..dc4a826 100644 --- a/net/sunrpc/xprtrdma/rpc_rdma.c +++ b/net/sunrpc/xprtrdma/rpc_rdma.c @@ -99,6 +99,12 @@ rpcrdma_convert_iovs(struct xdr_buf *xdrbuf, unsigned int pos, page_base = xdrbuf->page_base & ~PAGE_MASK; p = 0; while (len && n < nsegs) { + if (!ppages[p]) { + /* alloc the pagelist for receiving buffer */ + ppages[p] = alloc_page(GFP_ATOMIC); + if (!ppages[p]) + return 0; + } seg[n].mr_page = ppages[p]; seg[n].mr_offset = (void *)(unsigned long) page_base; seg[n].mr_len = min_t(u32, PAGE_SIZE - page_base, len);