Skip to content

Commit 3d807a3

Browse files
Bob Pearsonjgunthorpe
authored andcommitted
RDMA/rxe: Don't call rxe_requester from rxe_completer
Instead of rescheduling rxe_requester from rxe_completer() just extend the duration of rxe_sender() by one pass. Setting run_requester_again forces rxe_completer() to return 0 which will cause rxe_sender() to be called at least one more time. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bob Pearson <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 4891f4f commit 3d807a3

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

drivers/infiniband/sw/rxe/rxe_comp.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ static inline enum comp_state check_ack(struct rxe_qp *qp,
325325
qp->comp.psn = pkt->psn;
326326
if (qp->req.wait_psn) {
327327
qp->req.wait_psn = 0;
328-
rxe_sched_task(&qp->send_task);
328+
qp->req.again = 1;
329329
}
330330
}
331331
return COMPST_ERROR_RETRY;
@@ -476,7 +476,7 @@ static void do_complete(struct rxe_qp *qp, struct rxe_send_wqe *wqe)
476476
*/
477477
if (qp->req.wait_fence) {
478478
qp->req.wait_fence = 0;
479-
rxe_sched_task(&qp->send_task);
479+
qp->req.again = 1;
480480
}
481481
}
482482

@@ -515,7 +515,7 @@ static inline enum comp_state complete_ack(struct rxe_qp *qp,
515515
if (qp->req.need_rd_atomic) {
516516
qp->comp.timeout_retry = 0;
517517
qp->req.need_rd_atomic = 0;
518-
rxe_sched_task(&qp->send_task);
518+
qp->req.again = 1;
519519
}
520520
}
521521

@@ -541,7 +541,7 @@ static inline enum comp_state complete_wqe(struct rxe_qp *qp,
541541

542542
if (qp->req.wait_psn) {
543543
qp->req.wait_psn = 0;
544-
rxe_sched_task(&qp->send_task);
544+
qp->req.again = 1;
545545
}
546546
}
547547

@@ -654,6 +654,8 @@ int rxe_completer(struct rxe_qp *qp)
654654
int ret;
655655
unsigned long flags;
656656

657+
qp->req.again = 0;
658+
657659
spin_lock_irqsave(&qp->state_lock, flags);
658660
if (!qp->valid || qp_state(qp) == IB_QPS_ERR ||
659661
qp_state(qp) == IB_QPS_RESET) {
@@ -737,7 +739,7 @@ int rxe_completer(struct rxe_qp *qp)
737739

738740
if (qp->req.wait_psn) {
739741
qp->req.wait_psn = 0;
740-
rxe_sched_task(&qp->send_task);
742+
qp->req.again = 1;
741743
}
742744

743745
state = COMPST_DONE;
@@ -792,7 +794,7 @@ int rxe_completer(struct rxe_qp *qp)
792794
RXE_CNT_COMP_RETRY);
793795
qp->req.need_retry = 1;
794796
qp->comp.started_retry = 1;
795-
rxe_sched_task(&qp->send_task);
797+
qp->req.again = 1;
796798
}
797799
goto done;
798800

@@ -843,8 +845,9 @@ int rxe_completer(struct rxe_qp *qp)
843845
ret = 0;
844846
goto out;
845847
exit:
846-
ret = -EAGAIN;
848+
ret = (qp->req.again) ? 0 : -EAGAIN;
847849
out:
850+
qp->req.again = 0;
848851
if (pkt)
849852
free_pkt(pkt);
850853
return ret;

drivers/infiniband/sw/rxe/rxe_verbs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ struct rxe_req_info {
113113
int need_retry;
114114
int wait_for_rnr_timer;
115115
int noack_pkts;
116+
int again;
116117
};
117118

118119
struct rxe_comp_info {

0 commit comments

Comments
 (0)