aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_keys.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_keys.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_keys.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_keys.c b/drivers/infiniband/hw/ipath/ipath_keys.c
index ba1b93226caa..9a6cbd05adcd 100644
--- a/drivers/infiniband/hw/ipath/ipath_keys.c
+++ b/drivers/infiniband/hw/ipath/ipath_keys.c
@@ -118,9 +118,10 @@ void ipath_free_lkey(struct ipath_lkey_table *rkt, u32 lkey)
118 * Check the IB SGE for validity and initialize our internal version 118 * Check the IB SGE for validity and initialize our internal version
119 * of it. 119 * of it.
120 */ 120 */
121int ipath_lkey_ok(struct ipath_lkey_table *rkt, struct ipath_sge *isge, 121int ipath_lkey_ok(struct ipath_qp *qp, struct ipath_sge *isge,
122 struct ib_sge *sge, int acc) 122 struct ib_sge *sge, int acc)
123{ 123{
124 struct ipath_lkey_table *rkt = &to_idev(qp->ibqp.device)->lk_table;
124 struct ipath_mregion *mr; 125 struct ipath_mregion *mr;
125 unsigned n, m; 126 unsigned n, m;
126 size_t off; 127 size_t off;
@@ -140,7 +141,8 @@ int ipath_lkey_ok(struct ipath_lkey_table *rkt, struct ipath_sge *isge,
140 goto bail; 141 goto bail;
141 } 142 }
142 mr = rkt->table[(sge->lkey >> (32 - ib_ipath_lkey_table_size))]; 143 mr = rkt->table[(sge->lkey >> (32 - ib_ipath_lkey_table_size))];
143 if (unlikely(mr == NULL || mr->lkey != sge->lkey)) { 144 if (unlikely(mr == NULL || mr->lkey != sge->lkey ||
145 qp->ibqp.pd != mr->pd)) {
144 ret = 0; 146 ret = 0;
145 goto bail; 147 goto bail;
146 } 148 }
@@ -188,9 +190,10 @@ bail:
188 * 190 *
189 * Return 1 if successful, otherwise 0. 191 * Return 1 if successful, otherwise 0.
190 */ 192 */
191int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss, 193int ipath_rkey_ok(struct ipath_qp *qp, struct ipath_sge_state *ss,
192 u32 len, u64 vaddr, u32 rkey, int acc) 194 u32 len, u64 vaddr, u32 rkey, int acc)
193{ 195{
196 struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
194 struct ipath_lkey_table *rkt = &dev->lk_table; 197 struct ipath_lkey_table *rkt = &dev->lk_table;
195 struct ipath_sge *sge = &ss->sge; 198 struct ipath_sge *sge = &ss->sge;
196 struct ipath_mregion *mr; 199 struct ipath_mregion *mr;
@@ -214,7 +217,8 @@ int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss,
214 } 217 }
215 218
216 mr = rkt->table[(rkey >> (32 - ib_ipath_lkey_table_size))]; 219 mr = rkt->table[(rkey >> (32 - ib_ipath_lkey_table_size))];
217 if (unlikely(mr == NULL || mr->lkey != rkey)) { 220 if (unlikely(mr == NULL || mr->lkey != rkey ||
221 qp->ibqp.pd != mr->pd)) {
218 ret = 0; 222 ret = 0;
219 goto bail; 223 goto bail;
220 } 224 }