summaryrefslogtreecommitdiff
path: root/drivers/infiniband/sw/rxe/rxe_req.c
diff options
context:
space:
mode:
authorBob Pearson <rpearsonhpe@gmail.com>2021-06-08 07:25:51 +0300
committerJason Gunthorpe <jgg@nvidia.com>2021-06-17 02:51:18 +0300
commit3902b429ca14f325123057f3e5cafe8d45d00263 (patch)
treeaeeae38e66025b434f960aa854b233118c0fd46c /drivers/infiniband/sw/rxe/rxe_req.c
parent32a577b4c3a9d0b5d3e47ac47ffd50774a04f82a (diff)
downloadlinux-3902b429ca14f325123057f3e5cafe8d45d00263.tar.xz
RDMA/rxe: Implement invalidate MW operations
Implement invalidate MW and cleaned up invalidate MR operations. Added code to perform remote invalidate for send with invalidate. Added code to perform local invalidation. Deleted some blank lines in rxe_loc.h. Link: https://lore.kernel.org/r/20210608042552.33275-9-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/sw/rxe/rxe_req.c')
-rw-r--r--drivers/infiniband/sw/rxe/rxe_req.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
index 6583f8ca95dc..c57699cc6578 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -487,7 +487,7 @@ static int finish_packet(struct rxe_qp *qp, struct rxe_send_wqe *wqe,
} else {
err = copy_data(qp->pd, 0, &wqe->dma,
payload_addr(pkt), paylen,
- from_mr_obj,
+ RXE_FROM_MR_OBJ,
&crc);
if (err)
return err;
@@ -581,27 +581,25 @@ static void update_state(struct rxe_qp *qp, struct rxe_send_wqe *wqe,
static int rxe_do_local_ops(struct rxe_qp *qp, struct rxe_send_wqe *wqe)
{
u8 opcode = wqe->wr.opcode;
- struct rxe_dev *rxe;
struct rxe_mr *mr;
u32 rkey;
int ret;
switch (opcode) {
case IB_WR_LOCAL_INV:
- rxe = to_rdev(qp->ibqp.device);
rkey = wqe->wr.ex.invalidate_rkey;
- mr = rxe_pool_get_index(&rxe->mr_pool, rkey >> 8);
- if (!mr) {
- pr_err("No MR for rkey %#x\n", rkey);
+ if (rkey_is_mw(rkey))
+ ret = rxe_invalidate_mw(qp, rkey);
+ else
+ ret = rxe_invalidate_mr(qp, rkey);
+
+ if (unlikely(ret)) {
wqe->status = IB_WC_LOC_QP_OP_ERR;
- return -EINVAL;
+ return ret;
}
- mr->state = RXE_MR_STATE_FREE;
- rxe_drop_ref(mr);
break;
case IB_WR_REG_MR:
mr = to_rmr(wqe->wr.wr.reg.mr);
-
rxe_add_ref(mr);
mr->state = RXE_MR_STATE_VALID;
mr->access = wqe->wr.wr.reg.access;