Lines Matching refs:srq

345 	if (!attrs->send_cq || (!attrs->recv_cq && !attrs->srq)) {  in siw_create_qp()
399 if (attrs->srq) { in siw_create_qp()
405 qp->srq = to_siw_srq(attrs->srq); in siw_create_qp()
529 qp_init_attr->srq = base_qp->srq; in siw_query_qp()
966 if (qp->srq || qp->attrs.rq_size == 0) { in siw_post_receive()
1556 struct siw_srq *srq = to_siw_srq(base_srq); in siw_create_srq() local
1577 srq->max_sge = attrs->max_sge; in siw_create_srq()
1578 srq->num_rqe = roundup_pow_of_two(attrs->max_wr); in siw_create_srq()
1579 srq->limit = attrs->srq_limit; in siw_create_srq()
1580 if (srq->limit) in siw_create_srq()
1581 srq->armed = true; in siw_create_srq()
1583 srq->is_kernel_res = !udata; in siw_create_srq()
1586 srq->recvq = in siw_create_srq()
1587 vmalloc_user(srq->num_rqe * sizeof(struct siw_rqe)); in siw_create_srq()
1589 srq->recvq = vzalloc(srq->num_rqe * sizeof(struct siw_rqe)); in siw_create_srq()
1591 if (srq->recvq == NULL) { in siw_create_srq()
1597 size_t length = srq->num_rqe * sizeof(struct siw_rqe); in siw_create_srq()
1599 srq->srq_entry = in siw_create_srq()
1600 siw_mmap_entry_insert(ctx, srq->recvq, in siw_create_srq()
1602 if (!srq->srq_entry) { in siw_create_srq()
1607 uresp.num_rqe = srq->num_rqe; in siw_create_srq()
1617 spin_lock_init(&srq->lock); in siw_create_srq()
1624 if (srq->recvq) { in siw_create_srq()
1626 rdma_user_mmap_entry_remove(srq->srq_entry); in siw_create_srq()
1627 vfree(srq->recvq); in siw_create_srq()
1646 struct siw_srq *srq = to_siw_srq(base_srq); in siw_modify_srq() local
1650 spin_lock_irqsave(&srq->lock, flags); in siw_modify_srq()
1659 if (unlikely(attrs->srq_limit > srq->num_rqe)) { in siw_modify_srq()
1663 srq->armed = true; in siw_modify_srq()
1665 srq->armed = false; in siw_modify_srq()
1667 srq->limit = attrs->srq_limit; in siw_modify_srq()
1670 spin_unlock_irqrestore(&srq->lock, flags); in siw_modify_srq()
1682 struct siw_srq *srq = to_siw_srq(base_srq); in siw_query_srq() local
1685 spin_lock_irqsave(&srq->lock, flags); in siw_query_srq()
1687 attrs->max_wr = srq->num_rqe; in siw_query_srq()
1688 attrs->max_sge = srq->max_sge; in siw_query_srq()
1689 attrs->srq_limit = srq->limit; in siw_query_srq()
1691 spin_unlock_irqrestore(&srq->lock, flags); in siw_query_srq()
1706 struct siw_srq *srq = to_siw_srq(base_srq); in siw_destroy_srq() local
1713 rdma_user_mmap_entry_remove(srq->srq_entry); in siw_destroy_srq()
1714 vfree(srq->recvq); in siw_destroy_srq()
1734 struct siw_srq *srq = to_siw_srq(base_srq); in siw_post_srq_recv() local
1738 if (unlikely(!srq->is_kernel_res)) { in siw_post_srq_recv()
1749 spin_lock_irqsave(&srq->lock, flags); in siw_post_srq_recv()
1752 u32 idx = srq->rq_put % srq->num_rqe; in siw_post_srq_recv()
1753 struct siw_rqe *rqe = &srq->recvq[idx]; in siw_post_srq_recv()
1760 if (unlikely(wr->num_sge > srq->max_sge)) { in siw_post_srq_recv()
1775 srq->rq_put++; in siw_post_srq_recv()
1778 spin_unlock_irqrestore(&srq->lock, flags); in siw_post_srq_recv()
1824 void siw_srq_event(struct siw_srq *srq, enum ib_event_type etype) in siw_srq_event() argument
1827 struct ib_srq *base_srq = &srq->base_srq; in siw_srq_event()
1831 event.element.srq = base_srq; in siw_srq_event()
1834 siw_dbg_pd(srq->base_srq.pd, in siw_srq_event()