• Steve Wise's avatar
    iw_cm: free cm_id resources on the last deref · 59c68ac3
    Steve Wise authored
    Remove the complicated logic to free the iw_cm_id inside iw_cm
    event handlers vs when an application thread destroys the cm_id.
    Also remove the block in iw_destroy_cm_id() to block the application
    until all references are removed.  This block can cause a deadlock when
    disconnecting or destroying cm_ids inside an rdma_cm event handler.
    Simply allowing the last deref of the iw_cm_id to free the memory
    is cleaner and avoids this potential deadlock. Also a flag is added,
    IW_CM_DROP_EVENTS, that is set when the cm_id is marked for destruction.
    If any events are pending on this iw_cm_id, then as they are processed
    they will be dropped vs posted upstream if IW_CM_DROP_EVENTS is set.
    Signed-off-by: default avatarSteve Wise <swise@opengridcomputing.com>
    Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
    59c68ac3
iwcm.c 32.8 KB