[openib-general] [PATCH] mthca: fix page shift calculation
Michael S. Tsirkin
mst at mellanox.co.il
Wed Jan 4 04:31:34 PST 2006
Fix page shift calculation: for all pages except possibly the last one, the byte
beyond the buffer end must be page aligned.
Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>
Index: openib/drivers/infiniband/hw/mthca/mthca_provider.c
===================================================================
--- openib/drivers/infiniband/hw/mthca/mthca_provider.c (revision 4722)
+++ openib/drivers/infiniband/hw/mthca/mthca_provider.c (working copy)
@@ -787,6 +787,8 @@ static struct ib_mr *mthca_reg_phys_mr(s
total_size += buffer_list[i].size;
if (i > 0)
mask |= buffer_list[i].addr;
+ if(i < (num_phys_buf - 1))
+ mask |= buffer_list[i].addr + buffer_list[i].size;
}
/* Find largest page shift we can use to cover buffers */
--
MST
More information about the general
mailing list