IB/ehca: Return correct number of SGEs for SRQ
authorJoachim Fenkes <fenkes@de.ibm.com>
Mon, 10 Dec 2007 11:20:57 +0000 (12:20 +0100)
committerRoland Dreier <rolandd@cisco.com>
Wed, 12 Dec 2007 22:09:43 +0000 (14:09 -0800)
Firmware would round up the number of SGEs to four, because the WQE
structure holds four SGEs. For SRQ, only three are supported, so return
a fixed value instead.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/ehca/ehca_qp.c

index dd126681fed095dc7dd58eb674c6dd08e0f80c94..eff5fb55604b4c5b218a693bf61eef9bc0c0063b 100644 (file)
@@ -838,7 +838,7 @@ struct ib_srq *ehca_create_srq(struct ib_pd *pd,
 
        /* copy back return values */
        srq_init_attr->attr.max_wr = qp_init_attr.cap.max_recv_wr;
-       srq_init_attr->attr.max_sge = qp_init_attr.cap.max_recv_sge;
+       srq_init_attr->attr.max_sge = 3;
 
        /* drive SRQ into RTR state */
        mqpcb = ehca_alloc_fw_ctrlblock(GFP_KERNEL);
@@ -1750,7 +1750,7 @@ int ehca_query_srq(struct ib_srq *srq, struct ib_srq_attr *srq_attr)
        }
 
        srq_attr->max_wr = qpcb->max_nr_outst_recv_wr - 1;
-       srq_attr->max_sge = qpcb->actual_nr_sges_in_rq_wqe;
+       srq_attr->max_sge = 3;
        srq_attr->srq_limit = EHCA_BMASK_GET(
                MQPCB_CURR_SRQ_LIMIT, qpcb->curr_srq_limit);