diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-07-01 07:36:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-01 12:56:02 -0400 |
commit | 357b552ff3d82a2e6b97c63c6394f748cb217cf8 (patch) | |
tree | e3579183539fb16eeffad16f02fc2725452bfbce /drivers/infiniband/hw/ipath/ipath_qp.c | |
parent | 3e0018bc74275ab99d223fb5dca0b65067a5ffc1 (diff) |
[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>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_qp.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_qp.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c index 68f01513214f..a77a0dad0fa0 100644 --- a/drivers/infiniband/hw/ipath/ipath_qp.c +++ b/drivers/infiniband/hw/ipath/ipath_qp.c | |||
@@ -685,16 +685,22 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, | |||
685 | ret = ERR_PTR(-ENOMEM); | 685 | ret = ERR_PTR(-ENOMEM); |
686 | goto bail; | 686 | goto bail; |
687 | } | 687 | } |
688 | qp->r_rq.size = init_attr->cap.max_recv_wr + 1; | 688 | if (init_attr->srq) { |
689 | sz = sizeof(struct ipath_sge) * | 689 | qp->r_rq.size = 0; |
690 | init_attr->cap.max_recv_sge + | 690 | qp->r_rq.max_sge = 0; |
691 | sizeof(struct ipath_rwqe); | 691 | qp->r_rq.wq = NULL; |
692 | qp->r_rq.wq = vmalloc(qp->r_rq.size * sz); | 692 | } else { |
693 | if (!qp->r_rq.wq) { | 693 | qp->r_rq.size = init_attr->cap.max_recv_wr + 1; |
694 | kfree(qp); | 694 | qp->r_rq.max_sge = init_attr->cap.max_recv_sge; |
695 | vfree(swq); | 695 | sz = (sizeof(struct ipath_sge) * qp->r_rq.max_sge) + |
696 | ret = ERR_PTR(-ENOMEM); | 696 | sizeof(struct ipath_rwqe); |
697 | goto bail; | 697 | qp->r_rq.wq = vmalloc(qp->r_rq.size * sz); |
698 | if (!qp->r_rq.wq) { | ||
699 | kfree(qp); | ||
700 | vfree(swq); | ||
701 | ret = ERR_PTR(-ENOMEM); | ||
702 | goto bail; | ||
703 | } | ||
698 | } | 704 | } |
699 | 705 | ||
700 | /* | 706 | /* |
@@ -713,7 +719,6 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, | |||
713 | qp->s_wq = swq; | 719 | qp->s_wq = swq; |
714 | qp->s_size = init_attr->cap.max_send_wr + 1; | 720 | qp->s_size = init_attr->cap.max_send_wr + 1; |
715 | qp->s_max_sge = init_attr->cap.max_send_sge; | 721 | qp->s_max_sge = init_attr->cap.max_send_sge; |
716 | qp->r_rq.max_sge = init_attr->cap.max_recv_sge; | ||
717 | qp->s_flags = init_attr->sq_sig_type == IB_SIGNAL_REQ_WR ? | 722 | qp->s_flags = init_attr->sq_sig_type == IB_SIGNAL_REQ_WR ? |
718 | 1 << IPATH_S_SIGNAL_REQ_WR : 0; | 723 | 1 << IPATH_S_SIGNAL_REQ_WR : 0; |
719 | dev = to_idev(ibpd->device); | 724 | dev = to_idev(ibpd->device); |