Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit abb6e9ba authored by Dotan Barak's avatar Dotan Barak Committed by Roland Dreier
Browse files

IB/mthca: Return actual capacity from create_srq



Have mthca's create_srq method return the actual capacity of the SRQ
that gets created.  Also update comments in <rdma/ib_verbs.h> to
clarify that this is what is expected from ib_create_srq().

Signed-off-by: default avatarDotan Barak <dotanb@mellanox.co.il>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 44af79f9
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -271,6 +271,9 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd,
	srq->first_free = 0;
	srq->first_free = 0;
	srq->last_free  = srq->max - 1;
	srq->last_free  = srq->max - 1;


	attr->max_wr    = srq->max;
	attr->max_sge   = srq->max_gs;

	return 0;
	return 0;


err_out_free_srq:
err_out_free_srq:
+6 −2
Original line number Original line Diff line number Diff line
@@ -1100,7 +1100,9 @@ int ib_destroy_ah(struct ib_ah *ah);
 * ib_create_srq - Creates a SRQ associated with the specified protection
 * ib_create_srq - Creates a SRQ associated with the specified protection
 *   domain.
 *   domain.
 * @pd: The protection domain associated with the SRQ.
 * @pd: The protection domain associated with the SRQ.
 * @srq_init_attr: A list of initial attributes required to create the SRQ.
 * @srq_init_attr: A list of initial attributes required to create the
 *   SRQ.  If SRQ creation succeeds, then the attributes are updated to
 *   the actual capabilities of the created SRQ.
 *
 *
 * srq_attr->max_wr and srq_attr->max_sge are read the determine the
 * srq_attr->max_wr and srq_attr->max_sge are read the determine the
 * requested size of the SRQ, and set to the actual values allocated
 * requested size of the SRQ, and set to the actual values allocated
@@ -1159,7 +1161,9 @@ static inline int ib_post_srq_recv(struct ib_srq *srq,
 * ib_create_qp - Creates a QP associated with the specified protection
 * ib_create_qp - Creates a QP associated with the specified protection
 *   domain.
 *   domain.
 * @pd: The protection domain associated with the QP.
 * @pd: The protection domain associated with the QP.
 * @qp_init_attr: A list of initial attributes required to create the QP.
 * @qp_init_attr: A list of initial attributes required to create the
 *   QP.  If QP creation succeeds, then the attributes are updated to
 *   the actual capabilities of the created QP.
 */
 */
struct ib_qp *ib_create_qp(struct ib_pd *pd,
struct ib_qp *ib_create_qp(struct ib_pd *pd,
			   struct ib_qp_init_attr *qp_init_attr);
			   struct ib_qp_init_attr *qp_init_attr);