[openib-general] Re: uCM create connection ID

Libor Michalek libor at topspin.com
Wed Jun 29 18:10:54 PDT 2005


On Wed, Jun 29, 2005 at 12:42:09PM -0700, Arlin Davis wrote:
> Libor Michalek wrote:
> >On Tue, Jun 28, 2005 at 01:59:01PM -0700, Arlin Davis wrote:
> >>
> >>I have a couple of uCM questions regarding create_id and events...
> >>
> >>Is it possible for a consumer of uCM to provide a context with the 
> >>create_id that could be returned with the event? I will have some scale 
> >>up issues if I have to walk a list looking for a uCM provided connection 
> >>ID instead of a context that could point directly to the appropriate 
> >>uDAPL CM object.
> >>    
> >
> >  It would be easy to add in a context variable. I had left it out on
> >purpose, since it's easy to get into a situation where using the context
> >as a pointer you can end up referencing deallocated memory. However, I
> >suppose it should be there for flexability.
> >
> Thanks.  Also, in the case with listen's (conn_req), the event returns 
> the new conn_id but not the original conn_id associated with the listen. 
> I will need the listen conn_id to associate back to the proper listen 
> service point.

  The listen id is in the req rcvd event. (event->param.req_rcvd.listen_id)
Do you mean that it is not being set correctly?

> >>It would also be very helpful if the CM event could be woke from 
> >>user space.
> >
> >  You mean break CM event out of it's wait? I would instead recommend that
> >you call poll on the file descriptor for read readiness, and only call for
> >the CM event when there's an event available. Also, if you insist on using
> >threads, tou can break out of poll by sending a signal to the thread that
> >is waiting on the poll, which will return -1 with an errno of EINTR.
>
> Fair enough. Have you tried the polling method?  I am having problems 
> waking up on the event even though I see the following kernel message 
> from ucm.
> 
> "kernel: UCM: Event. CM ID <10> event <1>"

Yes, it should be working, for example I just tried this:

	struct pollfd ufds;
	int result;

	ufds.fd      = ib_cm_get_fd();
	ufds.events  = POLLIN;
	ufds.revents = 0;

	*event = NULL;

	result = poll(&ufds, 1, 100000);
	if (!result)
		return -ETIMEDOUT;

	if (result < 0)
		return result;

	return ib_cm_event_get(event);


-Libor



More information about the general mailing list