[openib-general] [PATCH 1/2] [RFC] Implement resize of CQ

Krishna Kumar krkumar at us.ibm.com
Wed Nov 3 17:33:36 PST 2004


Hi Sean,

I just checked the spec for create_qp on pg567 and found that it expects
the verb/driver to modify this field, as you indicated. So I will go ahead
and submit a new patch to fix this.

Thanks for your input,

- KK

On Wed, 3 Nov 2004, Sean Hefty wrote:

> Krishna Kumar wrote:
> > QP. When I do a query for the QP, all I really need is the qp ptr and
> > the qp_attr structure to fill in values. What I didn't figure out is
> > why an attr_mask and ib_qp_init_attr is needed. BTW, I had thought that
> > ib_qp_init_attr was used for initialization type of attributes, exactly
> > once the device is passed init attributes, then onwards ib_qp_attr should
> > be used. So ib_qp_init_attr seems redundant. Or I have understood the
> > code wrong.
>
> The mask allows the query to be a little more selective about what data
> it is trying to access, which can potentially avoid accessing the hardware.
>
> The qp_attr and qp_init_attr contain different data, so both are
> returned from the query call.  To have ib_query_qp return only qp_attr,
> we would need to add the fields from qp_init_attr to it.
>
> > If you are not already adding the exact same functionality, please let me
> > know if the following looks correct. I recreated both patches after Hal's
> > checkin (Patch1 and Patch2 below).
>
> I am not adding this same functionality, and I'm coding around where
> your patch would go.
>
> > Also, I saw your other mail, and I had looked at the driver and it
> > didn't modify the final size of the new QP in the init_attr. It used the
> > structure to do it's work but doesn't update it. I was initially planning
> > on not using query() and instead rely on this structure getting updated.
> > The verb interface cannot do it since it qp doesn't contain the size. We
> > cannot change the driver to change the init structure since potentially
> > other drivers may not do it, so the reason to do a query to figure the
> > correct size.
>
> The original call to ib_create_qp took a third parameter, a qp_cap
> structure, for output.  This structure contained the actual QP settings
> returned from the ib_create_qp call.  I assumed that by removing this
> parameter, the capabilities would be returned directly in the
> qp_init_attr structure.  If this is not the case, then the driver should
> probably change to do that.   This matches what is defined by verbs, so
> I think that it's safe to do it.
>
> >                 qp->sq.max    = init_attr->cap.max_send_wr;
> >                 qp->rq.max    = init_attr->cap.max_recv_wr;
> >                 qp->sq.max_gs = init_attr->cap.max_send_sge;
> >                 qp->rq.max_gs = init_attr->cap.max_recv_sge;
> >
> >                 err = mthca_alloc_sqp(to_mdev(pd->device), to_mpd(pd),
>
> I haven't looked at the mthca_alloc_sqp call in more detail, but if it
> doesn't create a QP larger than that specified, then it wouldn't need to
> change the qp_cap fields.
>
>
>




More information about the general mailing list