diff options
Diffstat (limited to 'drivers/infiniband/hw/qib/qib_keys.c')
-rw-r--r-- | drivers/infiniband/hw/qib/qib_keys.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/infiniband/hw/qib/qib_keys.c b/drivers/infiniband/hw/qib/qib_keys.c index 5afaa218508d..eaf139a33b2e 100644 --- a/drivers/infiniband/hw/qib/qib_keys.c +++ b/drivers/infiniband/hw/qib/qib_keys.c @@ -338,12 +338,13 @@ bail: /* * Initialize the memory region specified by the work reqeust. */ -int qib_fast_reg_mr(struct qib_qp *qp, struct ib_send_wr *wr) +int qib_fast_reg_mr(struct qib_qp *qp, struct ib_send_wr *send_wr) { + struct ib_fast_reg_wr *wr = fast_reg_wr(send_wr); struct qib_lkey_table *rkt = &to_idev(qp->ibqp.device)->lk_table; struct qib_pd *pd = to_ipd(qp->ibqp.pd); struct qib_mregion *mr; - u32 rkey = wr->wr.fast_reg.rkey; + u32 rkey = wr->rkey; unsigned i, n, m; int ret = -EINVAL; unsigned long flags; @@ -360,22 +361,22 @@ int qib_fast_reg_mr(struct qib_qp *qp, struct ib_send_wr *wr) if (unlikely(mr == NULL || qp->ibqp.pd != mr->pd)) goto bail; - if (wr->wr.fast_reg.page_list_len > mr->max_segs) + if (wr->page_list_len > mr->max_segs) goto bail; - ps = 1UL << wr->wr.fast_reg.page_shift; - if (wr->wr.fast_reg.length > ps * wr->wr.fast_reg.page_list_len) + ps = 1UL << wr->page_shift; + if (wr->length > ps * wr->page_list_len) goto bail; - mr->user_base = wr->wr.fast_reg.iova_start; - mr->iova = wr->wr.fast_reg.iova_start; + mr->user_base = wr->iova_start; + mr->iova = wr->iova_start; mr->lkey = rkey; - mr->length = wr->wr.fast_reg.length; - mr->access_flags = wr->wr.fast_reg.access_flags; - page_list = wr->wr.fast_reg.page_list->page_list; + mr->length = wr->length; + mr->access_flags = wr->access_flags; + page_list = wr->page_list->page_list; m = 0; n = 0; - for (i = 0; i < wr->wr.fast_reg.page_list_len; i++) { + for (i = 0; i < wr->page_list_len; i++) { mr->map[m]->segs[n].vaddr = (void *) page_list[i]; mr->map[m]->segs[n].length = ps; if (++n == QIB_SEGSZ) { |