[ofa-general] [PATCH for-2.6.21] IB/mthca: fix thinko in init_mr_table

Michael S. Tsirkin mst at dev.mellanox.co.il
Sun Mar 25 02:17:43 PDT 2007


Patch 'IB/mthca: Merge MR and FMR space on 64-bit systems'
swapped the number of MTTs and MPTs. As a result, we get kernel
oops when the number of MTT segments allocated exceeds 0x20000.

Noted by Troy Benjegerdes <troy at scl.ameslab.gov>, and reproduced by
Dotan Barak <dotanb at mellanox.co.il>. OpenFabrics bugzilla 490.

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

---

Roland, please pull for 2.6.21.

Links:
http://article.gmane.org/gmane.linux.drivers.openib/37956
https://bugs.openfabrics.org/show_bug.cgi?id=490

diff --git a/drivers/infiniband/hw/mthca/mthca_mr.c b/drivers/infiniband/hw/mthca/mthca_mr.c
index 8e4846b..fdb576d 100644
--- a/drivers/infiniband/hw/mthca/mthca_mr.c
+++ b/drivers/infiniband/hw/mthca/mthca_mr.c
@@ -881,8 +881,8 @@ int mthca_init_mr_table(struct mthca_dev *dev)
 		}
 		mpts = mtts = 1 << i;
 	} else {
-		mpts = dev->limits.num_mtt_segs;
-		mtts = dev->limits.num_mpts;
+		mtts = dev->limits.num_mtt_segs;
+		mpts = dev->limits.num_mpts;
 	}
 
 	if (!mthca_is_memfree(dev) &&

-- 
MST



More information about the general mailing list