diff options
author | Steve Wise <swise@opengridcomputing.com> | 2016-07-29 21:00:54 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-08-02 20:15:18 +0300 |
commit | 59c68ac31e15ad09d2cb04734e3c8c544a95f8d4 (patch) | |
tree | 762e01018c61bcbf000303b4929f71b0d10c83d3 /drivers/infiniband/core/iwcm.h | |
parent | ad61a4c7a9b7ae7e10ca93b0d2b357e02c208e75 (diff) | |
download | linux-59c68ac31e15ad09d2cb04734e3c8c544a95f8d4.tar.xz |
iw_cm: free cm_id resources on the last deref
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: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/iwcm.h')
-rw-r--r-- | drivers/infiniband/core/iwcm.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/iwcm.h b/drivers/infiniband/core/iwcm.h index 3f6cc82564c8..82c2cd1b0a80 100644 --- a/drivers/infiniband/core/iwcm.h +++ b/drivers/infiniband/core/iwcm.h @@ -56,7 +56,7 @@ struct iwcm_id_private { struct list_head work_free_list; }; -#define IWCM_F_CALLBACK_DESTROY 1 +#define IWCM_F_DROP_EVENTS 1 #define IWCM_F_CONNECT_WAIT 2 #endif /* IWCM_H */ |