@@ -584,9 +584,6 @@ int rxe_completer(struct rxe_qp *qp)
enum comp_state state;
int ret;
- if (!rxe_get(qp))
- return -EAGAIN;
-
if (!qp->valid || qp->comp.state == QP_STATE_ERROR ||
qp->comp.state == QP_STATE_RESET) {
rxe_drain_resp_pkts(qp, qp->valid &&
@@ -787,7 +784,6 @@ int rxe_completer(struct rxe_qp *qp)
out:
if (pkt)
free_pkt(pkt);
- rxe_put(qp);
return ret;
}
@@ -653,9 +653,6 @@ int rxe_requester(struct rxe_qp *qp)
struct rxe_ah *ah;
struct rxe_av *av;
- if (!rxe_get(qp))
- return -EAGAIN;
-
if (unlikely(!qp->valid))
goto exit;
@@ -844,7 +841,5 @@ int rxe_requester(struct rxe_qp *qp)
exit:
ret = -EAGAIN;
out:
- rxe_put(qp);
-
return ret;
}
@@ -1450,9 +1450,6 @@ int rxe_responder(struct rxe_qp *qp)
struct rxe_pkt_info *pkt = NULL;
int ret;
- if (!rxe_get(qp))
- return -EAGAIN;
-
qp->resp.aeth_syndrome = AETH_ACK_UNLIMITED;
if (!qp->valid)
@@ -1651,6 +1648,5 @@ int rxe_responder(struct rxe_qp *qp)
exit:
ret = -EAGAIN;
out:
- rxe_put(qp);
return ret;
}
Currently each of the three tasklets requester, completer and responder in the rxe driver take and release a reference to the qp argument at the beginning and end of the subroutines. The caller passing in the qp argument should be responsible for holding a reference to qp so these are not required. Further doing so breaks the qp cleanup code in rxe_qp_do_cleanup which calls these routines after all the references have been dropped so they cannot drain the packet and work request queues as intended. In fact if these routines are deferred by calling tasklet_schedule there is no guarantee that the calling code does have a qp reference. That is a bug in rxe_task.c which will be fixed in the next patch. Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com> --- drivers/infiniband/sw/rxe/rxe_comp.c | 4 ---- drivers/infiniband/sw/rxe/rxe_req.c | 5 ----- drivers/infiniband/sw/rxe/rxe_resp.c | 4 ---- 3 files changed, 13 deletions(-)