IB/ehca: Prevent overwriting QP init attributes given by caller
PATCH 7/7 IB/ehca: Prevent overwriting QP init attributes given by caller
--- drivers/infiniband/hw/ehca/ehca_qp.c | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-)
drivers/infiniband/hw/ehca/ehca_qp.c +5 -9
@@ -709,12 +709,12 @@ static struct ehca_qp *internal_create_qp( my_qp->ib_qp.event_handler = init_attr->event_handler; } - init_attr->cap.max_inline_data =0 ;/* not supported yet */ - init_attr->cap.max_recv_sge = parms.rqueue.act_nr_sges; - init_attr->cap.max_recv_wr = parms.rqueue.act_nr_wqes; - init_attr->cap.max_send_sge = parms.squeue.act_nr_sges; - init_attr->cap.max_send_wr = parms.squeue.act_nr_wqes; my_qp->init_attr = *init_attr; + my_qp->init_attr.cap.max_inline_data =0 ;/* not supported yet */ + my_qp->init_attr.cap.max_recv_sge = parms.rqueue.act_nr_sges; + my_qp->init_attr.cap.max_recv_wr = parms.rqueue.act_nr_wqes; + my_qp->init_attr.cap.max_send_sge = parms.squeue.act_nr_sges; + my_qp->init_attr.cap.max_send_wr = parms.squeue.act_nr_wqes;/* NOTE: define_apq0() not supported yet */ if (qp_type ==IB_QPT_GSI ) {
@@ -825,10 +825,6 @@ struct ib_srq *ehca_create_srq(struct ib_pd *pd,if (IS_ERR (my_qp))return (struct ib_srq *)my_qp; -/* 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; -/* drive SRQ into RTR state */ mqpcb =ehca_alloc_fw_ctrlblock (GFP_KERNEL );if (!mqpcb) {
Signature · 1 line
1.5.2
I don't understand this patch. <rdma/ib_verbs.h> says this about ib_create_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.
So it seems the current code is actually correct and your patch breaks it??
[email protected] wrote on 16.08.2007 18:17:22:
Quoted 9 lines
I don't understand this patch. <
rdma/ib_verbs.h> says this aboutib_create_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.So it seems the current code is actually correct and your patch breaks it??
Yes. That's absolutely true. Please ignore it.
Thanks!
Nam