diff mbox

mlx4: Limit num of fast reg WRs

Message ID 20101012081955.GB1617@mtldesk30 (mailing list archive)
State New, archived
Headers show

Commit Message

Eli Cohen Oct. 12, 2010, 8:19 a.m. UTC
None
diff mbox

Patch

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);
 }