[openib-general] [PATCH][6/27] IB/mthca: allocate correct number of doorbell pages

Roland Dreier roland at topspin.com
Fri Apr 1 12:49:52 PST 2005


Doorbell record pages are allocated in HCA page size chunks (always
4096 bytes), so we need to divide by 4096 and not PAGE_SIZE when
figuring out how many pages we'll need space for.

Signed-off-by: Roland Dreier <roland at topspin.com>


--- linux-export.orig/drivers/infiniband/hw/mthca/mthca_memfree.c	2005-04-01 12:38:19.911638409 -0800
+++ linux-export/drivers/infiniband/hw/mthca/mthca_memfree.c	2005-04-01 12:38:22.274125578 -0800
@@ -446,7 +446,7 @@
 
 	init_MUTEX(&dev->db_tab->mutex);
 
-	dev->db_tab->npages     = dev->uar_table.uarc_size / PAGE_SIZE;
+	dev->db_tab->npages     = dev->uar_table.uarc_size / 4096;
 	dev->db_tab->max_group1 = 0;
 	dev->db_tab->min_group2 = dev->db_tab->npages - 1;
 




More information about the general mailing list