[openib-general] UCM accesses internal cm_id state
Sean Hefty
sean.hefty at intel.com
Thu Jun 2 12:55:34 PDT 2005
The ucm code in ib_ucm_event_handler() reads the cm_id->state information in
response to an event occurrence. The cm_id state can change dynamically in
response to an event, and in general should not be accessed. (I.e. the
current cm_id state may not match up with the event being reported.)
Access to the state requires coordination with the CM code itself, so trying
to rely on it to drive external states will eventually lead to problems.
Clients of the CM should either maintain their own state information or
perform operations based on the occurrence of the reported event.
I had originally exposed the state only for debugging purposes. A comment
was added that it should only be used for internal/debug use, but I will
make a note to remove the state from the externally visible cm_id structure.
The kDAPL code was recently converted to be event driven rather than state
driven, so you may want to examine that code as an example.
- Sean
More information about the general
mailing list