]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/rxe: Make tasks schedule each other
authorBob Pearson <rpearsonhpe@gmail.com>
Sat, 4 Mar 2023 17:45:33 +0000 (11:45 -0600)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 24 Mar 2023 14:21:36 +0000 (11:21 -0300)
Replace rxe_run_task() by rxe_sched_task() when tasks call each other.
These are not performance critical and mainly involve error paths but they
run the risk of causing deadlocks.

Link: https://lore.kernel.org/r/20230304174533.11296-8-rpearsonhpe@gmail.com
Signed-off-by: Ian Ziemba <ian.ziemba@hpe.com>
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe_comp.c
drivers/infiniband/sw/rxe/rxe_req.c

index 7aa8e90bdfe47eae5318d0830067793d303554e7..2c70cdcd55dceb5fa15c191b85ecb51a5b11c322 100644 (file)
@@ -322,7 +322,7 @@ static inline enum comp_state check_ack(struct rxe_qp *qp,
                                        qp->comp.psn = pkt->psn;
                                        if (qp->req.wait_psn) {
                                                qp->req.wait_psn = 0;
-                                               rxe_run_task(&qp->req.task);
+                                               rxe_sched_task(&qp->req.task);
                                        }
                                }
                                return COMPST_ERROR_RETRY;
@@ -473,7 +473,7 @@ static void do_complete(struct rxe_qp *qp, struct rxe_send_wqe *wqe)
         */
        if (qp->req.wait_fence) {
                qp->req.wait_fence = 0;
-               rxe_run_task(&qp->req.task);
+               rxe_sched_task(&qp->req.task);
        }
 }
 
@@ -487,7 +487,7 @@ static inline enum comp_state complete_ack(struct rxe_qp *qp,
                if (qp->req.need_rd_atomic) {
                        qp->comp.timeout_retry = 0;
                        qp->req.need_rd_atomic = 0;
-                       rxe_run_task(&qp->req.task);
+                       rxe_sched_task(&qp->req.task);
                }
        }
 
@@ -767,7 +767,7 @@ int rxe_completer(struct rxe_qp *qp)
                                                        RXE_CNT_COMP_RETRY);
                                        qp->req.need_retry = 1;
                                        qp->comp.started_retry = 1;
-                                       rxe_run_task(&qp->req.task);
+                                       rxe_sched_task(&qp->req.task);
                                }
                                goto done;
 
index abc65c54bfd6ffd5452e7f75d311f2bf167b8237..745731140a5464a4658f4f35dd53cbf3599f7459 100644 (file)
@@ -753,7 +753,7 @@ int rxe_requester(struct rxe_qp *qp)
                                                       qp->req.wqe_index);
                        wqe->state = wqe_state_done;
                        wqe->status = IB_WC_SUCCESS;
-                       rxe_run_task(&qp->comp.task);
+                       rxe_sched_task(&qp->comp.task);
                        goto done;
                }
                payload = mtu;
@@ -837,7 +837,7 @@ err:
        qp->req.wqe_index = queue_next_index(qp->sq.queue, qp->req.wqe_index);
        wqe->state = wqe_state_error;
        qp->req.state = QP_STATE_ERROR;
-       rxe_run_task(&qp->comp.task);
+       rxe_sched_task(&qp->comp.task);
 exit:
        ret = -EAGAIN;
 out: