[openib-general] [PATCH] alignment check in reg_phys_mr

Michael S. Tsirkin mst at mellanox.co.il
Mon Mar 14 06:46:50 PST 2005


Apparently reg_phys_mr in mthca requires that the start
address is page aligned. Seems like a bug to me. Roland?

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: drivers/infiniband/hw/mthca/mthca_provider.c
===================================================================
--- drivers/infiniband/hw/mthca/mthca_provider.c	(revision 1983)
+++ drivers/infiniband/hw/mthca/mthca_provider.c	(working copy)
@@ -494,7 +494,7 @@ static struct ib_mr *mthca_reg_phys_mr(s
 	mask = 0;
 	total_size = 0;
 	for (i = 0; i < num_phys_buf; ++i) {
-		if (buffer_list[i].addr & ~PAGE_MASK)
+		if (i != 0 && buffer_list[i].addr & ~PAGE_MASK)
 			return ERR_PTR(-EINVAL);
 		if (i != 0 && i != num_phys_buf - 1 &&
 		    (buffer_list[i].size & ~PAGE_MASK))

-- 
MST - Michael S. Tsirkin



More information about the general mailing list