From patchwork Tue Oct 12 08:19:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 247171 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9C8KKAl000578 for ; Tue, 12 Oct 2010 08:20:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756795Ab0JLIUT (ORCPT ); Tue, 12 Oct 2010 04:20:19 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:58928 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756570Ab0JLIUS (ORCPT ); Tue, 12 Oct 2010 04:20:18 -0400 Received: by bwz15 with SMTP id 15so2232278bwz.19 for ; Tue, 12 Oct 2010 01:20:10 -0700 (PDT) Received: by 10.204.180.75 with SMTP id bt11mr5585755bkb.115.1286871609529; Tue, 12 Oct 2010 01:20:09 -0700 (PDT) Received: from localhost ([82.166.227.17]) by mx.google.com with ESMTPS id y19sm6330430bkw.18.2010.10.12.01.20.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 12 Oct 2010 01:20:06 -0700 (PDT) Date: Tue, 12 Oct 2010 10:19:55 +0200 From: Eli Cohen To: Or Gerlitz Cc: Roland Dreier , RDMA list Subject: Re: [PATCH] mlx4: Limit num of fast reg WRs Message-ID: <20101012081955.GB1617@mtldesk30> References: <20101007142416.GA11518@mtldesk30> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 12 Oct 2010 08:20:20 +0000 (UTC) diff --git a/drivers/infiniband/hw/mlx4/mr.c b/drivers/infiniband/hw/mlx4/mr.c index 83e3cc7..e9b2c8a 100644 --- a/drivers/infiniband/hw/mlx4/mr.c +++ b/drivers/infiniband/hw/mlx4/mr.c @@ -237,18 +237,23 @@ struct ib_fast_reg_page_list *mlx4_ib_alloc_fast_reg_page_list(struct ib_device if (!mfrpl->ibfrpl.page_list) goto err_free; - mfrpl->mapped_page_list = dma_alloc_coherent(&dev->dev->pdev->dev, - size, &mfrpl->map, - GFP_KERNEL); + mfrpl->mapped_page_list = (__be64 *)__get_free_page(GFP_KERNEL); if (!mfrpl->mapped_page_list) goto err_free; - WARN_ON(mfrpl->map & 0x3f); + mfrpl->map = dma_map_single(ibdev->dma_device, mfrpl->mapped_page_list, + PAGE_SIZE, DMA_TO_DEVICE); + if (dma_mapping_error(ibdev->dma_device, mfrpl->map)) + goto err_page; + + return &mfrpl->ibfrpl; +err_page: + free_page((unsigned long) mfrpl->mapped_page_list); + err_free: - kfree(mfrpl->ibfrpl.page_list); kfree(mfrpl); return ERR_PTR(-ENOMEM); }