Commit 90fdae66 authored by Kaike Wan's avatar Kaike Wan Committed by Doug Ledford
Browse files

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: d72fe7d5 ("IB/hfi1: Add a function to receive TID RDMA WRITE DATA packet")
Cc: <stable@vger.kernel.org>
Reviewed-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: default avatarKaike Wan <kaike.wan@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Link: https://lore.kernel.org/r/20190815192051.105923.69979.stgit@awfm-01.aw.intel.com


Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent a8adbf7d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2945,8 +2945,15 @@ bool hfi1_handle_kdeth_eflags(struct hfi1_ctxtdata *rcd,
	 */
	spin_lock(&qp->s_lock);
	qpriv = qp->priv;
	if (qpriv->r_tid_tail == HFI1_QP_WQE_INVALID ||
	    qpriv->r_tid_tail == qpriv->r_tid_head)
		goto unlock;
	e = &qp->s_ack_queue[qpriv->r_tid_tail];
	if (e->opcode != TID_OP(WRITE_REQ))
		goto unlock;
	req = ack_to_tid_req(e);
	if (req->comp_seg == req->cur_seg)
		goto unlock;
	flow = &req->flows[req->clear_tail];
	trace_hfi1_eflags_err_write(qp, rcv_type, rte, psn);
	trace_hfi1_rsp_handle_kdeth_eflags(qp, psn);