Lines Matching full:mr
51 struct rxe_mw *mw, struct rxe_mr *mr, int access) in rxe_check_bind_mw() argument
83 if (unlikely(!mr || wqe->wr.wr.mw.length == 0)) { in rxe_check_bind_mw()
85 "attempt to invalidate type 2 MW by binding with NULL or zero length MR\n"); in rxe_check_bind_mw()
90 /* remaining checks only apply to a nonzero MR */ in rxe_check_bind_mw()
91 if (!mr) in rxe_check_bind_mw()
94 if (unlikely(mr->access & IB_ZERO_BASED)) { in rxe_check_bind_mw()
95 rxe_dbg_mw(mw, "attempt to bind MW to zero based MR\n"); in rxe_check_bind_mw()
100 if (unlikely(!(mr->access & IB_ACCESS_MW_BIND))) { in rxe_check_bind_mw()
102 "attempt to bind an MW to an MR without bind access\n"); in rxe_check_bind_mw()
109 !(mr->access & IB_ACCESS_LOCAL_WRITE))) { in rxe_check_bind_mw()
111 "attempt to bind an Writable MW to an MR without local write access\n"); in rxe_check_bind_mw()
117 if (unlikely(wqe->wr.wr.mw.length > mr->ibmr.length)) { in rxe_check_bind_mw()
119 "attempt to bind a ZB MW outside of the MR\n"); in rxe_check_bind_mw()
123 if (unlikely((wqe->wr.wr.mw.addr < mr->ibmr.iova) || in rxe_check_bind_mw()
125 (mr->ibmr.iova + mr->ibmr.length)))) { in rxe_check_bind_mw()
127 "attempt to bind a VA MW outside of the MR\n"); in rxe_check_bind_mw()
136 struct rxe_mw *mw, struct rxe_mr *mr, int access) in rxe_do_bind_mw() argument
146 if (mw->mr) { in rxe_do_bind_mw()
147 rxe_put(mw->mr); in rxe_do_bind_mw()
148 atomic_dec(&mw->mr->num_mw); in rxe_do_bind_mw()
149 mw->mr = NULL; in rxe_do_bind_mw()
153 mw->mr = mr; in rxe_do_bind_mw()
154 atomic_inc(&mr->num_mw); in rxe_do_bind_mw()
155 rxe_get(mr); in rxe_do_bind_mw()
168 struct rxe_mr *mr; in rxe_bind_mw() local
186 mr = rxe_pool_get_index(&rxe->mr_pool, mr_lkey >> 8); in rxe_bind_mw()
187 if (unlikely(!mr)) { in rxe_bind_mw()
192 if (unlikely(mr->lkey != mr_lkey)) { in rxe_bind_mw()
197 mr = NULL; in rxe_bind_mw()
208 ret = rxe_check_bind_mw(qp, wqe, mw, mr, access); in rxe_bind_mw()
212 rxe_do_bind_mw(qp, wqe, mw, mr, access); in rxe_bind_mw()
216 if (mr) in rxe_bind_mw()
217 rxe_put(mr); in rxe_bind_mw()
239 struct rxe_mr *mr; in rxe_do_invalidate_mw() local
246 /* valid type 2 MW will always have an MR pointer */ in rxe_do_invalidate_mw()
247 mr = mw->mr; in rxe_do_invalidate_mw()
248 mw->mr = NULL; in rxe_do_invalidate_mw()
249 atomic_dec(&mr->num_mw); in rxe_do_invalidate_mw()
250 rxe_put(mr); in rxe_do_invalidate_mw()
319 if (mw->mr) { in rxe_mw_cleanup()
320 struct rxe_mr *mr = mw->mr; in rxe_mw_cleanup() local
322 mw->mr = NULL; in rxe_mw_cleanup()
323 atomic_dec(&mr->num_mw); in rxe_mw_cleanup()
324 rxe_put(mr); in rxe_mw_cleanup()