[PATCH] IB/ipath: ignore receive queue size if SRQ is specified

The receive work queue size should be ignored if the QP is created to use a
shared receive queue according to the IB spec.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Bryan O'Sullivan 2006-07-01 04:36:16 -07:00 committed by Linus Torvalds
parent 3e0018bc74
commit 357b552ff3

View file

@ -685,16 +685,22 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
ret = ERR_PTR(-ENOMEM); ret = ERR_PTR(-ENOMEM);
goto bail; goto bail;
} }
qp->r_rq.size = init_attr->cap.max_recv_wr + 1; if (init_attr->srq) {
sz = sizeof(struct ipath_sge) * qp->r_rq.size = 0;
init_attr->cap.max_recv_sge + qp->r_rq.max_sge = 0;
sizeof(struct ipath_rwqe); qp->r_rq.wq = NULL;
qp->r_rq.wq = vmalloc(qp->r_rq.size * sz); } else {
if (!qp->r_rq.wq) { qp->r_rq.size = init_attr->cap.max_recv_wr + 1;
kfree(qp); qp->r_rq.max_sge = init_attr->cap.max_recv_sge;
vfree(swq); sz = (sizeof(struct ipath_sge) * qp->r_rq.max_sge) +
ret = ERR_PTR(-ENOMEM); sizeof(struct ipath_rwqe);
goto bail; qp->r_rq.wq = vmalloc(qp->r_rq.size * sz);
if (!qp->r_rq.wq) {
kfree(qp);
vfree(swq);
ret = ERR_PTR(-ENOMEM);
goto bail;
}
} }
/* /*
@ -713,7 +719,6 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
qp->s_wq = swq; qp->s_wq = swq;
qp->s_size = init_attr->cap.max_send_wr + 1; qp->s_size = init_attr->cap.max_send_wr + 1;
qp->s_max_sge = init_attr->cap.max_send_sge; qp->s_max_sge = init_attr->cap.max_send_sge;
qp->r_rq.max_sge = init_attr->cap.max_recv_sge;
qp->s_flags = init_attr->sq_sig_type == IB_SIGNAL_REQ_WR ? qp->s_flags = init_attr->sq_sig_type == IB_SIGNAL_REQ_WR ?
1 << IPATH_S_SIGNAL_REQ_WR : 0; 1 << IPATH_S_SIGNAL_REQ_WR : 0;
dev = to_idev(ibpd->device); dev = to_idev(ibpd->device);