Skip to content

Commit cd8aadd

Browse files
Bob Pearsonjgunthorpe
authored andcommitted
RDMA/rxe: Remove save/rollback_state in rxe_requester
Now that req.task and comp.task are merged it is no longer necessary to call save_state() before calling rxe_xmit_pkt() and rollback_state() if rxe_xmit_pkt() fails. This was done originally to prevent races between rxe_completer() and rxe_requester() which now cannot happen. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bob Pearson <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 67f5789 commit cd8aadd

File tree

1 file changed

+2
-38
lines changed

1 file changed

+2
-38
lines changed

drivers/infiniband/sw/rxe/rxe_req.c

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -573,30 +573,6 @@ static void update_wqe_psn(struct rxe_qp *qp,
573573
qp->req.psn = (qp->req.psn + 1) & BTH_PSN_MASK;
574574
}
575575

576-
static void save_state(struct rxe_send_wqe *wqe,
577-
struct rxe_qp *qp,
578-
struct rxe_send_wqe *rollback_wqe,
579-
u32 *rollback_psn)
580-
{
581-
rollback_wqe->state = wqe->state;
582-
rollback_wqe->first_psn = wqe->first_psn;
583-
rollback_wqe->last_psn = wqe->last_psn;
584-
rollback_wqe->dma = wqe->dma;
585-
*rollback_psn = qp->req.psn;
586-
}
587-
588-
static void rollback_state(struct rxe_send_wqe *wqe,
589-
struct rxe_qp *qp,
590-
struct rxe_send_wqe *rollback_wqe,
591-
u32 rollback_psn)
592-
{
593-
wqe->state = rollback_wqe->state;
594-
wqe->first_psn = rollback_wqe->first_psn;
595-
wqe->last_psn = rollback_wqe->last_psn;
596-
wqe->dma = rollback_wqe->dma;
597-
qp->req.psn = rollback_psn;
598-
}
599-
600576
static void update_state(struct rxe_qp *qp, struct rxe_pkt_info *pkt)
601577
{
602578
qp->req.opcode = pkt->opcode;
@@ -676,8 +652,6 @@ int rxe_requester(struct rxe_qp *qp)
676652
int opcode;
677653
int err;
678654
int ret;
679-
struct rxe_send_wqe rollback_wqe;
680-
u32 rollback_psn;
681655
struct rxe_queue *q = qp->sq.queue;
682656
struct rxe_ah *ah;
683657
struct rxe_av *av;
@@ -799,9 +773,6 @@ int rxe_requester(struct rxe_qp *qp)
799773
pkt.mask = rxe_opcode[opcode].mask;
800774
pkt.wqe = wqe;
801775

802-
/* save wqe state before we build and send packet */
803-
save_state(wqe, qp, &rollback_wqe, &rollback_psn);
804-
805776
av = rxe_get_av(&pkt, &ah);
806777
if (unlikely(!av)) {
807778
rxe_dbg_qp(qp, "Failed no address vector\n");
@@ -834,22 +805,13 @@ int rxe_requester(struct rxe_qp *qp)
834805
if (ah)
835806
rxe_put(ah);
836807

837-
/* update wqe state as though we had sent it */
838-
update_wqe_state(qp, wqe, &pkt);
839-
update_wqe_psn(qp, wqe, &pkt, payload);
840-
841808
err = rxe_xmit_packet(qp, &pkt, skb);
842809
if (err) {
843810
if (err != -EAGAIN) {
844811
wqe->status = IB_WC_LOC_QP_OP_ERR;
845812
goto err;
846813
}
847814

848-
/* the packet was dropped so reset wqe to the state
849-
* before we sent it so we can try to resend
850-
*/
851-
rollback_state(wqe, qp, &rollback_wqe, rollback_psn);
852-
853815
/* force a delay until the dropped packet is freed and
854816
* the send queue is drained below the low water mark
855817
*/
@@ -859,6 +821,8 @@ int rxe_requester(struct rxe_qp *qp)
859821
goto exit;
860822
}
861823

824+
update_wqe_state(qp, wqe, &pkt);
825+
update_wqe_psn(qp, wqe, &pkt, payload);
862826
update_state(qp, &pkt);
863827

864828
/* A non-zero return value will cause rxe_do_task to

0 commit comments

Comments
 (0)