IB/{qib, hfi1}: Avoid flow control testing for RDMA write operation
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Tue, 22 Aug 2017 01:26:20 +0000 (18:26 -0700)
committerDoug Ledford <dledford@redhat.com>
Mon, 28 Aug 2017 23:12:16 +0000 (19:12 -0400)
commit5b0ef650bd0f820e922fcc42f1985d4621ae19cf
tree834d5c89337244dc39c868e2cb41fe2fc4e63bcb
parent3aaee8ab47a2485ad53c0a2d94945f0105d9feab
IB/{qib, hfi1}: Avoid flow control testing for RDMA write operation

Section 9.7.7.2.5 of the 1.3 IBTA spec clearly says that receive
credits should never apply to RDMA write.

qib and hfi1 were doing that.  The following situation will result
in a QP hang:
- A prior SEND or RDMA_WRITE with immmediate consumed the last
  credit for a QP using RC receive buffer credits
- The prior op is acked so there are no more acks
- The peer ULP fails to post receive for some reason
- An RDMA write sees that the credits are exhausted and waits
- The peer ULP posts receive buffers
- The ULP posts a send or RDMA write that will be hung

The fix is to avoid the credit test for the RDMA write operation.

Cc: <stable@vger.kernel.org>
Reviewed-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/rc.c
drivers/infiniband/hw/qib/qib_rc.c