IB/{rdmavt, hfi1, qib}: Remove AH refcount for UD QPs
authorMichael J. Ruhl <michael.j.ruhl@intel.com>
Fri, 28 Jun 2019 18:22:04 +0000 (14:22 -0400)
committerJason Gunthorpe <jgg@mellanox.com>
Sat, 29 Jun 2019 01:34:26 +0000 (22:34 -0300)
commitd310c4bf8aeacc0256091feb6a0337b8fef763ac
treea9dd155f469d37fc696e2ebf8a1570a2dc30f582
parentfe2ac04712cdc6e93d32e9c82c73bfb225554309
IB/{rdmavt, hfi1, qib}: Remove AH refcount for UD QPs

Historically rdmavt destroy_ah() has returned an -EBUSY when the AH has a
non-zero reference count.  IBTA 11.2.2 notes no such return value or error
case:

Output Modifiers:
- Verb results:
- Operation completed successfully.
- Invalid HCA handle.
- Invalid address handle.

ULPs never test for this error and this will leak memory.

The reference count exists to allow for driver independent progress
mechanisms to process UD SWQEs in parallel with post sends.  The SWQE will
hold a reference count until the UD SWQE completes and then drops the
reference.

Fix by removing need to reference count the AH.  Add a UD specific
allocation to each SWQE entry to cache the necessary information for
independent progress.  Copy the information during the post send
processing.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hfi1/qp.c
drivers/infiniband/hw/hfi1/ud.c
drivers/infiniband/hw/qib/qib_qp.c
drivers/infiniband/hw/qib/qib_ud.c
drivers/infiniband/sw/rdmavt/ah.c
drivers/infiniband/sw/rdmavt/qp.c
include/rdma/rdma_vt.h
include/rdma/rdmavt_qp.h