from: Signed-off-by: Amir Vadai <[EMAIL PROTECTED]>

Applications 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]>
---

Roland, this obviously isn't critical, but it would be nice to get into 2.6.27
if possible, to include it in the next release of the librdmacm.

> drivers/infiniband/core/cma.c |    7 ++++++-
> include/rdma/rdma_cm.h        |    3 ++-
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
>index ae11d5c..9fa1371 100644
>--- a/drivers/infiniband/core/cma.c
>+++ b/drivers/infiniband/core/cma.c
>@@ -914,7 +914,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);
>@@ -950,6 +953,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_TIMWAIT_EXIT;
>+              break;
>       case IB_CM_MRA_RECEIVED:
>               /* ignore event */
>               goto out;
>diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h
>index 22bb2e7..80170bd 100644
>--- a/include/rdma/rdma_cm.h
>+++ b/include/rdma/rdma_cm.h
>@@ -57,7 +57,8 @@ enum rdma_cm_event_type {
>       RDMA_CM_EVENT_DISCONNECTED,
>       RDMA_CM_EVENT_DEVICE_REMOVAL,
>       RDMA_CM_EVENT_MULTICAST_JOIN,
>-      RDMA_CM_EVENT_MULTICAST_ERROR
>+      RDMA_CM_EVENT_MULTICAST_ERROR,
>+      RDMA_CM_EVENT_TIMWAIT_EXIT
> };
>
> enum rdma_port_space {
>--
>1.5.3


_______________________________________________
general mailing list
general@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to