| From f6167331aa0f9051cce0ef388b11797270b107b9 Mon Sep 17 00:00:00 2001 |
| From: Kaike Wan <kaike.wan@intel.com> |
| Date: Fri, 25 Oct 2019 15:58:42 -0400 |
| Subject: [PATCH] IB/hfi1: TID RDMA WRITE should not return |
| IB_WC_RNR_RETRY_EXC_ERR |
| |
| commit ce8e8087cf3b5b4f19d29248bfc7deef95525490 upstream. |
| |
| Normal RDMA WRITE request never returns IB_WC_RNR_RETRY_EXC_ERR to ULPs |
| because it does not need post receive buffer on the responder side. |
| Consequently, as an enhancement to normal RDMA WRITE request inside the |
| hfi1 driver, TID RDMA WRITE request should not return such an error status |
| to ULPs, although it does receive RNR NAKs from the responder when TID |
| resources are not available. This behavior is violated when |
| qp->s_rnr_retry_cnt is set in current hfi1 implementation. |
| |
| This patch enforces these semantics by avoiding any reaction to the updates |
| of the RNR QP attributes. |
| |
| Fixes: 3c6cb20a0d17 ("IB/hfi1: Add TID RDMA WRITE functionality into RDMA verbs") |
| Link: https://lore.kernel.org/r/20191025195842.106825.71532.stgit@awfm-01.aw.intel.com |
| Cc: <stable@vger.kernel.org> |
| Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> |
| Reviewed-by: Dennis Dalessandro <dennis.dalessandro@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> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/infiniband/hw/hfi1/rc.c b/drivers/infiniband/hw/hfi1/rc.c |
| index 5c0d90418e8c..0d3e86da2784 100644 |
| --- a/drivers/infiniband/hw/hfi1/rc.c |
| +++ b/drivers/infiniband/hw/hfi1/rc.c |
| @@ -2210,15 +2210,15 @@ int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode, |
| if (qp->s_flags & RVT_S_WAIT_RNR) |
| goto bail_stop; |
| rdi = ib_to_rvt(qp->ibqp.device); |
| - if (qp->s_rnr_retry == 0 && |
| - !((rdi->post_parms[wqe->wr.opcode].flags & |
| - RVT_OPERATION_IGN_RNR_CNT) && |
| - qp->s_rnr_retry_cnt == 0)) { |
| - status = IB_WC_RNR_RETRY_EXC_ERR; |
| - goto class_b; |
| + if (!(rdi->post_parms[wqe->wr.opcode].flags & |
| + RVT_OPERATION_IGN_RNR_CNT)) { |
| + if (qp->s_rnr_retry == 0) { |
| + status = IB_WC_RNR_RETRY_EXC_ERR; |
| + goto class_b; |
| + } |
| + if (qp->s_rnr_retry_cnt < 7 && qp->s_rnr_retry_cnt > 0) |
| + qp->s_rnr_retry--; |
| } |
| - if (qp->s_rnr_retry_cnt < 7 && qp->s_rnr_retry_cnt > 0) |
| - qp->s_rnr_retry--; |
| |
| /* |
| * The last valid PSN is the previous PSN. For TID RDMA WRITE |
| -- |
| 2.7.4 |
| |