IB/{rdmavt, qib, hfi1}: Use new routine to release reference counts

The reference count adjustments on reference count completion
are open coded throughout.

Add a routine to do all reference count adjustments and use.

Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Mike Marciniszyn 2019-04-12 06:41:42 -07:00 committed by Jason Gunthorpe
parent 52cdbcc2b1
commit d40f69c9b9
4 changed files with 20 additions and 11 deletions

View file

@ -723,6 +723,20 @@ static inline void rvt_mod_retry_timer(struct rvt_qp *qp)
return rvt_mod_retry_timer_ext(qp, 0);
}
/**
* rvt_put_qp_swqe - drop refs held by swqe
* @qp: the send qp
* @wqe: the send wqe
*
* This drops any references held by the swqe
*/
static inline void rvt_put_qp_swqe(struct rvt_qp *qp, struct rvt_swqe *wqe)
{
rvt_put_swqe(wqe);
if (qp->allowed_ops == IB_OPCODE_UD)
atomic_dec(&ibah_to_rvtah(wqe->ud_wr.ah)->refcount);
}
extern const int ib_rvt_state_ops[];
struct rvt_dev_info;