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

Commit 96104eda authored by Sean Hefty's avatar Sean Hefty Committed by Roland Dreier
Browse files

RDMA/core: Add SRQ type field



Currently, there is only a single ("basic") type of SRQ, but with XRC
support we will add a second.  Prepare for this by defining an SRQ type
and setting all current users to IB_SRQT_BASIC.

Signed-off-by: default avatarSean Hefty <sean.hefty@intel.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 59991f94
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2013,6 +2013,7 @@ ssize_t ib_uverbs_create_srq(struct ib_uverbs_file *file,

	attr.event_handler  = ib_uverbs_srq_event_handler;
	attr.srq_context    = file;
	attr.srq_type       = IB_SRQT_BASIC;
	attr.attr.max_wr    = cmd.max_wr;
	attr.attr.max_sge   = cmd.max_sge;
	attr.attr.srq_limit = cmd.srq_limit;
+1 −0
Original line number Diff line number Diff line
@@ -250,6 +250,7 @@ struct ib_srq *ib_create_srq(struct ib_pd *pd,
		srq->uobject       = NULL;
		srq->event_handler = srq_init_attr->event_handler;
		srq->srq_context   = srq_init_attr->srq_context;
		srq->srq_type      = srq_init_attr->srq_type;
		atomic_inc(&pd->usecnt);
		atomic_set(&srq->usecnt, 0);
	}
+3 −0
Original line number Diff line number Diff line
@@ -977,6 +977,9 @@ struct ib_srq *ehca_create_srq(struct ib_pd *pd,
	struct hcp_modify_qp_control_block *mqpcb;
	u64 hret, update_mask;

	if (srq_init_attr->srq_type != IB_SRQT_BASIC)
		return ERR_PTR(-ENOSYS);

	/* For common attributes, internal_create_qp() takes its info
	 * out of qp_init_attr, so copy all common attrs there.
	 */
+5 −0
Original line number Diff line number Diff line
@@ -107,6 +107,11 @@ struct ib_srq *ipath_create_srq(struct ib_pd *ibpd,
	u32 sz;
	struct ib_srq *ret;

	if (srq_init_attr->srq_type != IB_SRQT_BASIC) {
		ret = ERR_PTR(-ENOSYS);
		goto done;
	}

	if (srq_init_attr->attr.max_wr == 0) {
		ret = ERR_PTR(-EINVAL);
		goto done;
+3 −0
Original line number Diff line number Diff line
@@ -81,6 +81,9 @@ struct ib_srq *mlx4_ib_create_srq(struct ib_pd *pd,
	int err;
	int i;

	if (init_attr->srq_type != IB_SRQT_BASIC)
		return ERR_PTR(-ENOSYS);

	/* Sanity check SRQ size before proceeding */
	if (init_attr->attr.max_wr  >= dev->dev->caps.max_srq_wqes ||
	    init_attr->attr.max_sge >  dev->dev->caps.max_srq_sge)
Loading