RDMA/iwcm: iWARP connection timeouts shouldn't be reported as rejects
authorSteve Wise <swise@opengridcomputing.com>
Fri, 15 Dec 2006 22:50:17 +0000 (16:50 -0600)
committerRoland Dreier <rolandd@cisco.com>
Mon, 8 Jan 2007 04:15:58 +0000 (20:15 -0800)
The iWARP CM should report timeouts as event RDMA_CM_EVENT_UNREACHABLE,
not event RDMA_CM_EVENT_REJECTED.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/core/cma.c

index 533193d..9e0ab04 100644 (file)
@@ -1088,10 +1088,21 @@ static int cma_iw_handler(struct iw_cm_id *iw_id, struct iw_cm_event *iw_event)
                *sin = iw_event->local_addr;
                sin = (struct sockaddr_in *) &id_priv->id.route.addr.dst_addr;
                *sin = iw_event->remote_addr;
-               if (iw_event->status)
-                       event.event = RDMA_CM_EVENT_REJECTED;
-               else
+               switch (iw_event->status) {
+               case 0:
                        event.event = RDMA_CM_EVENT_ESTABLISHED;
+                       break;
+               case -ECONNRESET:
+               case -ECONNREFUSED:
+                       event.event = RDMA_CM_EVENT_REJECTED;
+                       break;
+               case -ETIMEDOUT:
+                       event.event = RDMA_CM_EVENT_UNREACHABLE;
+                       break;
+               default:
+                       event.event = RDMA_CM_EVENT_CONNECT_ERROR;
+                       break;
+               }
                break;
        case IW_CM_EVENT_ESTABLISHED:
                event.event = RDMA_CM_EVENT_ESTABLISHED;