/* This function must be called with IRQs disabled.  */
void mthca_free_srq_wqe(struct mthca_srq *srq, u32 wqe_addr)
/* This function must be called with IRQs disabled.  */
void mthca_free_srq_wqe(struct mthca_srq *srq, u32 wqe_addr)
{
	int ind;
	struct mthca_next_seg *last_free;
	ind = wqe_addr >> srq->wqe_shift;
	spin_lock(&srq->lock);
	last_free = get_wqe(srq, srq->last_free);
	*wqe_to_link(last_free) = ind;
	last_free->nda_op = htonl((ind << srq->wqe_shift) | 1);
	*wqe_to_link(get_wqe(srq, ind)) = -1;
	srq->last_free = ind;
	spin_unlock(&srq->lock);
}