diff options
author | Michael S. Tsirkin <mst@dev.mellanox.co.il> | 2007-04-16 10:04:55 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-04-16 17:10:55 -0400 |
commit | 608d8268be392444f825b4fc8fc7c8b509627129 (patch) | |
tree | e6e61a54f55a75ac216e4a48171dc4d6d42ac32d | |
parent | 94a05509a9e11806acd797153d03019706e466f1 (diff) |
IB/mthca: Fix data corruption after FMR unmap on Sinai
In mthca_arbel_fmr_unmap(), the high bits of the key are masked off.
This gets rid of the effect of adjust_key(), which makes sure that
bits 3 and 23 of the key are equal when the Sinai throughput
optimization is enabled, and so it may happen that an FMR will end up
with bits 3 and 23 in the key being different. This causes data
corruption, because when enabling the throughput optimization, the
driver promises the HCA firmware that bits 3 and 23 of all memory keys
will always be equal.
Fix by re-applying adjust_key() after masking the key.
Thanks to Or Gerlitz for reproducing the problem, and Ariel Shahar for
help in debug.
Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_mr.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_mr.c b/drivers/infiniband/hw/mthca/mthca_mr.c index fdb576dcfaa8..ee561c569d5f 100644 --- a/drivers/infiniband/hw/mthca/mthca_mr.c +++ b/drivers/infiniband/hw/mthca/mthca_mr.c | |||
@@ -835,6 +835,7 @@ void mthca_arbel_fmr_unmap(struct mthca_dev *dev, struct mthca_fmr *fmr) | |||
835 | 835 | ||
836 | key = arbel_key_to_hw_index(fmr->ibmr.lkey); | 836 | key = arbel_key_to_hw_index(fmr->ibmr.lkey); |
837 | key &= dev->limits.num_mpts - 1; | 837 | key &= dev->limits.num_mpts - 1; |
838 | key = adjust_key(dev, key); | ||
838 | fmr->ibmr.lkey = fmr->ibmr.rkey = arbel_hw_index_to_key(key); | 839 | fmr->ibmr.lkey = fmr->ibmr.rkey = arbel_hw_index_to_key(key); |
839 | 840 | ||
840 | fmr->maps = 0; | 841 | fmr->maps = 0; |