[ofa-general] librdmacm - okay to select on a cm channel's file descriptor?

Bryan Green bryan.d.green at nasa.gov
Mon Aug 17 13:20:36 PDT 2009


Roland Dreier writes:
> 
>  > In an attempt to get unexpected DISCONNECT notifications during
>  > ib communication, I'm trying to use 'select()' on the cm channel's file
>  > descriptor, testing it for readability.  I've found that this works some=
>  of
>  > the time, but not all of the time.
> 
> What happens when it doesn't work?  select() doesn't give you an event
> but when you try to read there actually is an event there?

Yes.

> I took a quick look at the ucma kernel code and the implementation of
> select() (the kernel uses poll() as the name but it all ends up in the
> same code) looks straightforwardly correct -- there's only one place
> where events are added to the queue for a file, and that place wakes up
> the poll wait queue.  But maybe there is a funny bug somehow.
> 
>  - R.

Thanks for confirming that use of select() should work.  I wasn't sure because
I couldn't find any reference to select() in the docs or examples.
After further investigation, I found that I was neglecting
to reinitialize the fd_set structure after each call to select.
It's working great now.

Thanks,
-bryan




More information about the general mailing list