On 06/13/05 14:56, Fab Tillier wrote:
From: Jeff Carr [mailto:[EMAIL PROTECTED]
Sent: Monday, June 13, 2005 2:52 PM
On 06/13/05 14:12, Roland Dreier wrote:
Jeff> On the recieving end of a request, when the handler gets
Jeff> called and the cm-id gets passed to your handler (aka when
Jeff> the handler gets IB_CM_REQ_RECEIVED) it seems cm-id->context
Jeff> isn't null. Is there some useful data in there? If not, I
Jeff> think it makes more sense (and makes code easier to write to
Jeff> use the cm handler) if the context is set to NULL.
I think the context gets populated from the context of the
corresponding cm_id that was passed to ib_cm_listen().
OK, thanks. I checked and it does look like that is what is happening.
I'll set the context for the cm_id I pass into ib_cm_listen to null.
Assuming of course, that the cm_id context for that one doesn't matter.
The CM doesn't interpret the user's context ever. It is just there for the
benefit of the user. If your app doesn't need the context in the REQ callback,
then you can set it to NULL.
Out of curiosity, if you don't set the listen's context, how do you figure out
which listen received the callback? Does DAPL not care?
I only call ib_cm_listen once:
ib_cm_listen(listen_id, LISTEN_NUM, 0);
Is it necessary to call listen for each connection I wish to recieve? It
seems like the cm handler function I register when I create the cm_id
continues to handle req events until it is destroyed so I'm assuming
this is all I need.
In the case where I only have one number I'm listening on, then it
doesn't matter to me what the context is; NULL makes the code simple.
Jeff
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general