[openib-general] [PATCH RFC] return qp pointer as part of ib_wc

Michael S. Tsirkin mst at mellanox.co.il
Tue Jan 2 01:02:59 PST 2007


> > ib_wc currently only includes the local QP number: this matches the IB spec,
> > but seems mostly useless. The following patch replaces this with the pointer
> > to qp itself, and updates all low level drivers and all users.
> 
> > Use case:
> > 
> > In IPoIB CM code, I have a common CQ shared by multiple QPs.
> > To track connection usage, I need a way to get at some per-QP context
> > upon the completion, and I would like to avoid allocating
> > context object per work request just to stick a QP pointer into it.
> > With this code, I can just use wc->qp->qp_context.
> 
> IPoIB CM uses SRQ so you can not stick a qp context in advanced, simply 
> b/c you can't tell on behalf of which QP this WR would be used.

Sorry, I could not parse this sentence.

All my patch does is, put struct ib_qp * instead of qp_num in ib_wc -
this is more useful for ULPs and turns out not to have extra cost
for low-level drivers.

> However, looking on ipoib_cm_handle_rx_wc and the code is calls, i don't 
> see where it uses wc->qp_num. Actually, unless the wc status is not 
> success, why would you care from which QP you have got this packet?

To detect stale (unused) connections and remove them.
I have not pushed this code yet.

-- 
MST




More information about the general mailing list