Skip to content

Commit 90fdae6

Browse files
kwan-intcdledford
authored andcommitted
IB/hfi1: Add additional checks when handling TID RDMA WRITE DATA packet
In a congested fabric with adaptive routing enabled, traces show that packets could be delivered out of order, which could cause incorrect processing of stale packets. For stale TID RDMA WRITE DATA packets that cause KDETH EFLAGS errors, this patch adds additional checks before processing the packets. Fixes: d72fe7d ("IB/hfi1: Add a function to receive TID RDMA WRITE DATA packet") Cc: <[email protected]> Reviewed-by: Mike Marciniszyn <[email protected]> Signed-off-by: Kaike Wan <[email protected]> Signed-off-by: Dennis Dalessandro <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Doug Ledford <[email protected]>
1 parent a8adbf7 commit 90fdae6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/infiniband/hw/hfi1/tid_rdma.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2945,8 +2945,15 @@ bool hfi1_handle_kdeth_eflags(struct hfi1_ctxtdata *rcd,
29452945
*/
29462946
spin_lock(&qp->s_lock);
29472947
qpriv = qp->priv;
2948+
if (qpriv->r_tid_tail == HFI1_QP_WQE_INVALID ||
2949+
qpriv->r_tid_tail == qpriv->r_tid_head)
2950+
goto unlock;
29482951
e = &qp->s_ack_queue[qpriv->r_tid_tail];
2952+
if (e->opcode != TID_OP(WRITE_REQ))
2953+
goto unlock;
29492954
req = ack_to_tid_req(e);
2955+
if (req->comp_seg == req->cur_seg)
2956+
goto unlock;
29502957
flow = &req->flows[req->clear_tail];
29512958
trace_hfi1_eflags_err_write(qp, rcv_type, rte, psn);
29522959
trace_hfi1_rsp_handle_kdeth_eflags(qp, psn);

0 commit comments

Comments
 (0)