IB/rxe: Fix duplicate atomic request handling
When handling ack for atomic opcodes like "fetch&add"
or "cmp&swp", the method send_atomic_ack() saves the ack
before sending it, in case it gets lost and never reach the
requester. In which case the method duplicate_request()
will need to find it using the duplicated request.psn.
But send_atomic_ack() used a wrong psn value and thus
the above ack was never found.
This fix uses the ack.psn to locate the ack in case
its needed.
This fix also copies the ack packet to the skb's control buffer
since duplicate_request() will need it when calling rxe_xmit_packet()
Fixes: 8700e3e7c4
("Soft RoCE driver")
Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
dfdd6158ca
commit
908948877b
@ -972,11 +972,13 @@ static int send_atomic_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt,
|
||||
free_rd_atomic_resource(qp, res);
|
||||
rxe_advance_resp_resource(qp);
|
||||
|
||||
memcpy(SKB_TO_PKT(skb), &ack_pkt, sizeof(skb->cb));
|
||||
|
||||
res->type = RXE_ATOMIC_MASK;
|
||||
res->atomic.skb = skb;
|
||||
res->first_psn = qp->resp.psn;
|
||||
res->last_psn = qp->resp.psn;
|
||||
res->cur_psn = qp->resp.psn;
|
||||
res->first_psn = ack_pkt.psn;
|
||||
res->last_psn = ack_pkt.psn;
|
||||
res->cur_psn = ack_pkt.psn;
|
||||
|
||||
rc = rxe_xmit_packet(rxe, qp, &ack_pkt, skb_copy);
|
||||
if (rc) {
|
||||
@ -1116,8 +1118,7 @@ static enum resp_states duplicate_request(struct rxe_qp *qp,
|
||||
rc = RESPST_CLEANUP;
|
||||
goto out;
|
||||
}
|
||||
bth_set_psn(SKB_TO_PKT(skb_copy),
|
||||
qp->resp.psn - 1);
|
||||
|
||||
/* Resend the result. */
|
||||
rc = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp,
|
||||
pkt, skb_copy);
|
||||
|
Loading…
Reference in New Issue
Block a user