diff options
Diffstat (limited to 'drivers/infiniband/hw/qib/qib_verbs.c')
-rw-r--r-- | drivers/infiniband/hw/qib/qib_verbs.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c index 3dcc4985b60f..de6cb6fcda8d 100644 --- a/drivers/infiniband/hw/qib/qib_verbs.c +++ b/drivers/infiniband/hw/qib/qib_verbs.c | |||
@@ -362,8 +362,8 @@ static int qib_post_one_send(struct qib_qp *qp, struct ib_send_wr *wr, | |||
362 | * undefined operations. | 362 | * undefined operations. |
363 | * Make sure buffer is large enough to hold the result for atomics. | 363 | * Make sure buffer is large enough to hold the result for atomics. |
364 | */ | 364 | */ |
365 | if (wr->opcode == IB_WR_FAST_REG_MR) { | 365 | if (wr->opcode == IB_WR_REG_MR) { |
366 | if (qib_fast_reg_mr(qp, wr)) | 366 | if (qib_reg_mr(qp, reg_wr(wr))) |
367 | goto bail_inval; | 367 | goto bail_inval; |
368 | } else if (qp->ibqp.qp_type == IB_QPT_UC) { | 368 | } else if (qp->ibqp.qp_type == IB_QPT_UC) { |
369 | if ((unsigned) wr->opcode >= IB_WR_RDMA_READ) | 369 | if ((unsigned) wr->opcode >= IB_WR_RDMA_READ) |
@@ -374,7 +374,7 @@ static int qib_post_one_send(struct qib_qp *qp, struct ib_send_wr *wr, | |||
374 | wr->opcode != IB_WR_SEND_WITH_IMM) | 374 | wr->opcode != IB_WR_SEND_WITH_IMM) |
375 | goto bail_inval; | 375 | goto bail_inval; |
376 | /* Check UD destination address PD */ | 376 | /* Check UD destination address PD */ |
377 | if (qp->ibqp.pd != wr->wr.ud.ah->pd) | 377 | if (qp->ibqp.pd != ud_wr(wr)->ah->pd) |
378 | goto bail_inval; | 378 | goto bail_inval; |
379 | } else if ((unsigned) wr->opcode > IB_WR_ATOMIC_FETCH_AND_ADD) | 379 | } else if ((unsigned) wr->opcode > IB_WR_ATOMIC_FETCH_AND_ADD) |
380 | goto bail_inval; | 380 | goto bail_inval; |
@@ -397,7 +397,23 @@ static int qib_post_one_send(struct qib_qp *qp, struct ib_send_wr *wr, | |||
397 | rkt = &to_idev(qp->ibqp.device)->lk_table; | 397 | rkt = &to_idev(qp->ibqp.device)->lk_table; |
398 | pd = to_ipd(qp->ibqp.pd); | 398 | pd = to_ipd(qp->ibqp.pd); |
399 | wqe = get_swqe_ptr(qp, qp->s_head); | 399 | wqe = get_swqe_ptr(qp, qp->s_head); |
400 | wqe->wr = *wr; | 400 | |
401 | if (qp->ibqp.qp_type != IB_QPT_UC && | ||
402 | qp->ibqp.qp_type != IB_QPT_RC) | ||
403 | memcpy(&wqe->ud_wr, ud_wr(wr), sizeof(wqe->ud_wr)); | ||
404 | else if (wr->opcode == IB_WR_REG_MR) | ||
405 | memcpy(&wqe->reg_wr, reg_wr(wr), | ||
406 | sizeof(wqe->reg_wr)); | ||
407 | else if (wr->opcode == IB_WR_RDMA_WRITE_WITH_IMM || | ||
408 | wr->opcode == IB_WR_RDMA_WRITE || | ||
409 | wr->opcode == IB_WR_RDMA_READ) | ||
410 | memcpy(&wqe->rdma_wr, rdma_wr(wr), sizeof(wqe->rdma_wr)); | ||
411 | else if (wr->opcode == IB_WR_ATOMIC_CMP_AND_SWP || | ||
412 | wr->opcode == IB_WR_ATOMIC_FETCH_AND_ADD) | ||
413 | memcpy(&wqe->atomic_wr, atomic_wr(wr), sizeof(wqe->atomic_wr)); | ||
414 | else | ||
415 | memcpy(&wqe->wr, wr, sizeof(wqe->wr)); | ||
416 | |||
401 | wqe->length = 0; | 417 | wqe->length = 0; |
402 | j = 0; | 418 | j = 0; |
403 | if (wr->num_sge) { | 419 | if (wr->num_sge) { |
@@ -426,7 +442,7 @@ static int qib_post_one_send(struct qib_qp *qp, struct ib_send_wr *wr, | |||
426 | qp->port_num - 1)->ibmtu) | 442 | qp->port_num - 1)->ibmtu) |
427 | goto bail_inval_free; | 443 | goto bail_inval_free; |
428 | else | 444 | else |
429 | atomic_inc(&to_iah(wr->wr.ud.ah)->refcount); | 445 | atomic_inc(&to_iah(ud_wr(wr)->ah)->refcount); |
430 | wqe->ssn = qp->s_ssn++; | 446 | wqe->ssn = qp->s_ssn++; |
431 | qp->s_head = next; | 447 | qp->s_head = next; |
432 | 448 | ||
@@ -2244,8 +2260,7 @@ int qib_register_ib_device(struct qib_devdata *dd) | |||
2244 | ibdev->reg_user_mr = qib_reg_user_mr; | 2260 | ibdev->reg_user_mr = qib_reg_user_mr; |
2245 | ibdev->dereg_mr = qib_dereg_mr; | 2261 | ibdev->dereg_mr = qib_dereg_mr; |
2246 | ibdev->alloc_mr = qib_alloc_mr; | 2262 | ibdev->alloc_mr = qib_alloc_mr; |
2247 | ibdev->alloc_fast_reg_page_list = qib_alloc_fast_reg_page_list; | 2263 | ibdev->map_mr_sg = qib_map_mr_sg; |
2248 | ibdev->free_fast_reg_page_list = qib_free_fast_reg_page_list; | ||
2249 | ibdev->alloc_fmr = qib_alloc_fmr; | 2264 | ibdev->alloc_fmr = qib_alloc_fmr; |
2250 | ibdev->map_phys_fmr = qib_map_phys_fmr; | 2265 | ibdev->map_phys_fmr = qib_map_phys_fmr; |
2251 | ibdev->unmap_fmr = qib_unmap_fmr; | 2266 | ibdev->unmap_fmr = qib_unmap_fmr; |