diff options
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_ruc.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_ruc.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_ruc.c b/drivers/infiniband/hw/ipath/ipath_ruc.c index 5c1da2d25e03..f7530512045d 100644 --- a/drivers/infiniband/hw/ipath/ipath_ruc.c +++ b/drivers/infiniband/hw/ipath/ipath_ruc.c | |||
@@ -108,7 +108,6 @@ void ipath_insert_rnr_queue(struct ipath_qp *qp) | |||
108 | 108 | ||
109 | static int init_sge(struct ipath_qp *qp, struct ipath_rwqe *wqe) | 109 | static int init_sge(struct ipath_qp *qp, struct ipath_rwqe *wqe) |
110 | { | 110 | { |
111 | struct ipath_ibdev *dev = to_idev(qp->ibqp.device); | ||
112 | int user = to_ipd(qp->ibqp.pd)->user; | 111 | int user = to_ipd(qp->ibqp.pd)->user; |
113 | int i, j, ret; | 112 | int i, j, ret; |
114 | struct ib_wc wc; | 113 | struct ib_wc wc; |
@@ -119,8 +118,7 @@ static int init_sge(struct ipath_qp *qp, struct ipath_rwqe *wqe) | |||
119 | continue; | 118 | continue; |
120 | /* Check LKEY */ | 119 | /* Check LKEY */ |
121 | if ((user && wqe->sg_list[i].lkey == 0) || | 120 | if ((user && wqe->sg_list[i].lkey == 0) || |
122 | !ipath_lkey_ok(&dev->lk_table, | 121 | !ipath_lkey_ok(qp, &qp->r_sg_list[j], &wqe->sg_list[i], |
123 | &qp->r_sg_list[j], &wqe->sg_list[i], | ||
124 | IB_ACCESS_LOCAL_WRITE)) | 122 | IB_ACCESS_LOCAL_WRITE)) |
125 | goto bad_lkey; | 123 | goto bad_lkey; |
126 | qp->r_len += wqe->sg_list[i].length; | 124 | qp->r_len += wqe->sg_list[i].length; |
@@ -231,6 +229,7 @@ int ipath_get_rwqe(struct ipath_qp *qp, int wr_id_only) | |||
231 | } | 229 | } |
232 | } | 230 | } |
233 | spin_unlock_irqrestore(&rq->lock, flags); | 231 | spin_unlock_irqrestore(&rq->lock, flags); |
232 | qp->r_wrid_valid = 1; | ||
234 | 233 | ||
235 | bail: | 234 | bail: |
236 | return ret; | 235 | return ret; |
@@ -326,7 +325,7 @@ again: | |||
326 | case IB_WR_RDMA_WRITE: | 325 | case IB_WR_RDMA_WRITE: |
327 | if (wqe->length == 0) | 326 | if (wqe->length == 0) |
328 | break; | 327 | break; |
329 | if (unlikely(!ipath_rkey_ok(dev, &qp->r_sge, wqe->length, | 328 | if (unlikely(!ipath_rkey_ok(qp, &qp->r_sge, wqe->length, |
330 | wqe->wr.wr.rdma.remote_addr, | 329 | wqe->wr.wr.rdma.remote_addr, |
331 | wqe->wr.wr.rdma.rkey, | 330 | wqe->wr.wr.rdma.rkey, |
332 | IB_ACCESS_REMOTE_WRITE))) { | 331 | IB_ACCESS_REMOTE_WRITE))) { |
@@ -350,7 +349,7 @@ again: | |||
350 | break; | 349 | break; |
351 | 350 | ||
352 | case IB_WR_RDMA_READ: | 351 | case IB_WR_RDMA_READ: |
353 | if (unlikely(!ipath_rkey_ok(dev, &sqp->s_sge, wqe->length, | 352 | if (unlikely(!ipath_rkey_ok(qp, &sqp->s_sge, wqe->length, |
354 | wqe->wr.wr.rdma.remote_addr, | 353 | wqe->wr.wr.rdma.remote_addr, |
355 | wqe->wr.wr.rdma.rkey, | 354 | wqe->wr.wr.rdma.rkey, |
356 | IB_ACCESS_REMOTE_READ))) | 355 | IB_ACCESS_REMOTE_READ))) |
@@ -365,7 +364,7 @@ again: | |||
365 | 364 | ||
366 | case IB_WR_ATOMIC_CMP_AND_SWP: | 365 | case IB_WR_ATOMIC_CMP_AND_SWP: |
367 | case IB_WR_ATOMIC_FETCH_AND_ADD: | 366 | case IB_WR_ATOMIC_FETCH_AND_ADD: |
368 | if (unlikely(!ipath_rkey_ok(dev, &qp->r_sge, sizeof(u64), | 367 | if (unlikely(!ipath_rkey_ok(qp, &qp->r_sge, sizeof(u64), |
369 | wqe->wr.wr.rdma.remote_addr, | 368 | wqe->wr.wr.rdma.remote_addr, |
370 | wqe->wr.wr.rdma.rkey, | 369 | wqe->wr.wr.rdma.rkey, |
371 | IB_ACCESS_REMOTE_ATOMIC))) | 370 | IB_ACCESS_REMOTE_ATOMIC))) |
@@ -575,8 +574,7 @@ int ipath_post_ruc_send(struct ipath_qp *qp, struct ib_send_wr *wr) | |||
575 | } | 574 | } |
576 | if (wr->sg_list[i].length == 0) | 575 | if (wr->sg_list[i].length == 0) |
577 | continue; | 576 | continue; |
578 | if (!ipath_lkey_ok(&to_idev(qp->ibqp.device)->lk_table, | 577 | if (!ipath_lkey_ok(qp, &wqe->sg_list[j], &wr->sg_list[i], |
579 | &wqe->sg_list[j], &wr->sg_list[i], | ||
580 | acc)) { | 578 | acc)) { |
581 | spin_unlock_irqrestore(&qp->s_lock, flags); | 579 | spin_unlock_irqrestore(&qp->s_lock, flags); |
582 | ret = -EINVAL; | 580 | ret = -EINVAL; |