aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaike Wan <kaike.wan@intel.com>2019-04-10 09:27:05 -0400
committerJason Gunthorpe <jgg@mellanox.com>2019-04-10 14:09:30 -0400
commitd737b25b1ae0540ba13cbd45ebb9b58a1d6d7f0d (patch)
tree8e81c561ee6a6793b3c2f8ec9e201c6180d67c05
parent00fb67ec6b98114a887d9ef26fc7c3e566e7f665 (diff)
IB/hfi1: Do not flush send queue in the TID RDMA second leg
When a QP is put into error state, the send queue will be flushed. This mechanism is implemented in both the first and the second leg of the send engine. Since the second leg is only responsible for data transactions in the KDETH space for the TID RDMA WRITE request, it should not perform the flushing of the send queue. This patch removes the flushing function of the second leg, but still keeps the bailing out of the QP if it is put into error state. Fixes: 70dcb2e3dc6a ("IB/hfi1: Add the TID second leg send packet builder") Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Kaike Wan <kaike.wan@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r--drivers/infiniband/hw/hfi1/tid_rdma.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/drivers/infiniband/hw/hfi1/tid_rdma.c b/drivers/infiniband/hw/hfi1/tid_rdma.c
index fdda33aca77f..43cbce7a19ea 100644
--- a/drivers/infiniband/hw/hfi1/tid_rdma.c
+++ b/drivers/infiniband/hw/hfi1/tid_rdma.c
@@ -5017,24 +5017,14 @@ int hfi1_make_tid_rdma_pkt(struct rvt_qp *qp, struct hfi1_pkt_state *ps)
5017 make_tid_rdma_ack(qp, ohdr, ps)) 5017 make_tid_rdma_ack(qp, ohdr, ps))
5018 return 1; 5018 return 1;
5019 5019
5020 if (!(ib_rvt_state_ops[qp->state] & RVT_PROCESS_SEND_OK)) { 5020 /*
5021 if (!(ib_rvt_state_ops[qp->state] & RVT_FLUSH_SEND)) 5021 * Bail out if we can't send data.
5022 goto bail; 5022 * Be reminded that this check must been done after the call to
5023 /* We are in the error state, flush the work request. */ 5023 * make_tid_rdma_ack() because the responding QP could be in
5024 if (qp->s_last == READ_ONCE(qp->s_head)) 5024 * RTR state where it can send TID RDMA ACK, not TID RDMA WRITE DATA.
5025 goto bail; 5025 */
5026 /* If DMAs are in progress, we can't flush immediately. */ 5026 if (!(ib_rvt_state_ops[qp->state] & RVT_PROCESS_SEND_OK))
5027 if (iowait_sdma_pending(&priv->s_iowait)) { 5027 goto bail;
5028 qp->s_flags |= RVT_S_WAIT_DMA;
5029 goto bail;
5030 }
5031 clear_ahg(qp);
5032 wqe = rvt_get_swqe_ptr(qp, qp->s_last);
5033 hfi1_trdma_send_complete(qp, wqe, qp->s_last != qp->s_acked ?
5034 IB_WC_SUCCESS : IB_WC_WR_FLUSH_ERR);
5035 /* will get called again */
5036 goto done_free_tx;
5037 }
5038 5028
5039 if (priv->s_flags & RVT_S_WAIT_ACK) 5029 if (priv->s_flags & RVT_S_WAIT_ACK)
5040 goto bail; 5030 goto bail;
@@ -5144,11 +5134,6 @@ int hfi1_make_tid_rdma_pkt(struct rvt_qp *qp, struct hfi1_pkt_state *ps)
5144 hfi1_make_ruc_header(qp, ohdr, (opcode << 24), bth1, bth2, 5134 hfi1_make_ruc_header(qp, ohdr, (opcode << 24), bth1, bth2,
5145 middle, ps); 5135 middle, ps);
5146 return 1; 5136 return 1;
5147done_free_tx:
5148 hfi1_put_txreq(ps->s_txreq);
5149 ps->s_txreq = NULL;
5150 return 1;
5151
5152bail: 5137bail:
5153 hfi1_put_txreq(ps->s_txreq); 5138 hfi1_put_txreq(ps->s_txreq);
5154bail_no_tx: 5139bail_no_tx: