Skip to content

Commit

Permalink
RDMA/cma: Add RDMA_CM_EVENT_TIMEWAIT_EXIT event
Browse files Browse the repository at this point in the history
Consumers that want to re-use their QPs in new connections need to
know when the QP has exited the timewait state.  Report the timewait
event through the rdma_cm.

Signed-off-by: Amir Vadai <[email protected]>
Acked-by: Sean Hefty <[email protected]>
Signed-off-by: Roland Dreier <[email protected]>
  • Loading branch information
Amir Vadai authored and Roland Dreier committed Jul 22, 2008
1 parent dd5bdff commit 38ca83a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion drivers/infiniband/core/cma.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,10 @@ static int cma_ib_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)
struct rdma_cm_event event;
int ret = 0;

if (cma_disable_callback(id_priv, CMA_CONNECT))
if ((ib_event->event != IB_CM_TIMEWAIT_EXIT &&
cma_disable_callback(id_priv, CMA_CONNECT)) ||
(ib_event->event == IB_CM_TIMEWAIT_EXIT &&
cma_disable_callback(id_priv, CMA_DISCONNECT)))
return 0;

memset(&event, 0, sizeof event);
Expand Down Expand Up @@ -956,6 +959,8 @@ static int cma_ib_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)
event.event = RDMA_CM_EVENT_DISCONNECTED;
break;
case IB_CM_TIMEWAIT_EXIT:
event.event = RDMA_CM_EVENT_TIMEWAIT_EXIT;
break;
case IB_CM_MRA_RECEIVED:
/* ignore event */
goto out;
Expand Down
3 changes: 2 additions & 1 deletion include/rdma/rdma_cm.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ enum rdma_cm_event_type {
RDMA_CM_EVENT_DEVICE_REMOVAL,
RDMA_CM_EVENT_MULTICAST_JOIN,
RDMA_CM_EVENT_MULTICAST_ERROR,
RDMA_CM_EVENT_ADDR_CHANGE
RDMA_CM_EVENT_ADDR_CHANGE,
RDMA_CM_EVENT_TIMEWAIT_EXIT
};

enum rdma_port_space {
Expand Down

0 comments on commit 38ca83a

Please sign in to comment.