RDMA/nes: FIN during MPA startup causes timeout
authorFaisal Latif <faisal.latif@intel.com>
Wed, 9 Dec 2009 23:54:32 +0000 (15:54 -0800)
committerRoland Dreier <rolandd@cisco.com>
Wed, 9 Dec 2009 23:54:32 +0000 (15:54 -0800)
A FIN that is received during an MPA start up sequence causes a
timeout in iwcm.c.  The connection has not been completely closed so
the iwcm code is waiting for resources to be cleaned up.  This closes
the connection so everything cleans up correctly.

Signed-off-by: Don Wood <donald.e.wood@intel.com>
Signed-off-by: Faisal Latif <faisal.latif@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/nes/nes_cm.c

index b139806a9667000134a2e6eb5e700db334127d22..4acf04a03e1cffdcae4040e314b57d130c2d8776 100644 (file)
@@ -1354,13 +1354,20 @@ static void handle_fin_pkt(struct nes_cm_node *cm_node)
        case NES_CM_STATE_SYN_RCVD:
        case NES_CM_STATE_SYN_SENT:
        case NES_CM_STATE_ESTABLISHED:
-       case NES_CM_STATE_MPAREQ_SENT:
        case NES_CM_STATE_MPAREJ_RCVD:
                cm_node->tcp_cntxt.rcv_nxt++;
                cleanup_retrans_entry(cm_node);
                cm_node->state = NES_CM_STATE_LAST_ACK;
                send_fin(cm_node, NULL);
                break;
+       case NES_CM_STATE_MPAREQ_SENT:
+               create_event(cm_node, NES_CM_EVENT_ABORTED);
+               cm_node->tcp_cntxt.rcv_nxt++;
+               cleanup_retrans_entry(cm_node);
+               cm_node->state = NES_CM_STATE_CLOSED;
+               add_ref_cm_node(cm_node);
+               send_reset(cm_node, NULL);
+               break;
        case NES_CM_STATE_FIN_WAIT1:
                cm_node->tcp_cntxt.rcv_nxt++;
                cleanup_retrans_entry(cm_node);