[openib-general] Re: [PATCH] mthca: query_qp and query_srq

Michael S. Tsirkin mst at mellanox.co.il
Mon Feb 13 15:30:51 PST 2006


Quoting Roland Dreier <rdreier at cisco.com>:
> Subject: Re: [PATCH] mthca: query_qp and query_srq
> 
>  > --- openib_gen2.orig/drivers/infiniband/core/verbs.c
>  > +++ openib_gen2/drivers/infiniband/core/verbs.c
>  > @@ -257,9 +257,18 @@ int ib_query_qp(struct ib_qp *qp,
>  >  		int qp_attr_mask,
>  >  		struct ib_qp_init_attr *qp_init_attr)
>  >  {
>  > -	return qp->device->query_qp ?
>  > +	int err;
>  > +
>  > +	err = qp->device->query_qp ?
>  >  		qp->device->query_qp(qp, qp_attr, qp_attr_mask, qp_init_attr) :
>  >  		-ENOSYS;
>  > +	if (err)
>  > +		return err;
>  > +	qp_init_attr->recv_cq = qp->recv_cq;
>  > +	qp_init_attr->send_cq = qp->send_cq;
>  > +	qp_init_attr->srq = qp->srq;
>  > +
>  > +	return err;
>  >  }
>  >  EXPORT_SYMBOL(ib_query_qp);
> 
> Actually this chunk is pretty silly -- anyone querying the QP could
> just look into the qp struct and get the information directly.  So I'm
> going to drop this chunk unless there's something I'm missing.
> 
>  - R.

Still, it seems a bit ugly to leave some fields in ib_qp_init_attr
uninitialized.

-- 
Michael S. Tsirkin
Staff Engineer, Mellanox Technologies



More information about the general mailing list