aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/nes/nes_cm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/nes/nes_cm.c')
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 443cea55daac..61e0efd4ccfb 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -502,7 +502,9 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct sk_buff *skb,
502static void nes_retrans_expired(struct nes_cm_node *cm_node) 502static void nes_retrans_expired(struct nes_cm_node *cm_node)
503{ 503{
504 struct iw_cm_id *cm_id = cm_node->cm_id; 504 struct iw_cm_id *cm_id = cm_node->cm_id;
505 switch (cm_node->state) { 505 enum nes_cm_node_state state = cm_node->state;
506 cm_node->state = NES_CM_STATE_CLOSED;
507 switch (state) {
506 case NES_CM_STATE_SYN_RCVD: 508 case NES_CM_STATE_SYN_RCVD:
507 case NES_CM_STATE_CLOSING: 509 case NES_CM_STATE_CLOSING:
508 rem_ref_cm_node(cm_node->cm_core, cm_node); 510 rem_ref_cm_node(cm_node->cm_core, cm_node);
@@ -511,7 +513,6 @@ static void nes_retrans_expired(struct nes_cm_node *cm_node)
511 case NES_CM_STATE_FIN_WAIT1: 513 case NES_CM_STATE_FIN_WAIT1:
512 if (cm_node->cm_id) 514 if (cm_node->cm_id)
513 cm_id->rem_ref(cm_id); 515 cm_id->rem_ref(cm_id);
514 cm_node->state = NES_CM_STATE_CLOSED;
515 send_reset(cm_node, NULL); 516 send_reset(cm_node, NULL);
516 break; 517 break;
517 default: 518 default:
@@ -1439,9 +1440,6 @@ static void handle_rst_pkt(struct nes_cm_node *cm_node, struct sk_buff *skb,
1439 break; 1440 break;
1440 case NES_CM_STATE_MPAREQ_RCVD: 1441 case NES_CM_STATE_MPAREQ_RCVD:
1441 passive_state = atomic_add_return(1, &cm_node->passive_state); 1442 passive_state = atomic_add_return(1, &cm_node->passive_state);
1442 if (passive_state == NES_SEND_RESET_EVENT)
1443 create_event(cm_node, NES_CM_EVENT_RESET);
1444 cm_node->state = NES_CM_STATE_CLOSED;
1445 dev_kfree_skb_any(skb); 1443 dev_kfree_skb_any(skb);
1446 break; 1444 break;
1447 case NES_CM_STATE_ESTABLISHED: 1445 case NES_CM_STATE_ESTABLISHED:
@@ -1456,6 +1454,7 @@ static void handle_rst_pkt(struct nes_cm_node *cm_node, struct sk_buff *skb,
1456 case NES_CM_STATE_CLOSED: 1454 case NES_CM_STATE_CLOSED:
1457 drop_packet(skb); 1455 drop_packet(skb);
1458 break; 1456 break;
1457 case NES_CM_STATE_FIN_WAIT2:
1459 case NES_CM_STATE_FIN_WAIT1: 1458 case NES_CM_STATE_FIN_WAIT1:
1460 case NES_CM_STATE_LAST_ACK: 1459 case NES_CM_STATE_LAST_ACK:
1461 cm_node->cm_id->rem_ref(cm_node->cm_id); 1460 cm_node->cm_id->rem_ref(cm_node->cm_id);
@@ -2777,6 +2776,12 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
2777 return -EINVAL; 2776 return -EINVAL;
2778 } 2777 }
2779 2778
2779 passive_state = atomic_add_return(1, &cm_node->passive_state);
2780 if (passive_state == NES_SEND_RESET_EVENT) {
2781 rem_ref_cm_node(cm_node->cm_core, cm_node);
2782 return -ECONNRESET;
2783 }
2784
2780 /* associate the node with the QP */ 2785 /* associate the node with the QP */
2781 nesqp->cm_node = (void *)cm_node; 2786 nesqp->cm_node = (void *)cm_node;
2782 cm_node->nesqp = nesqp; 2787 cm_node->nesqp = nesqp;
@@ -2979,9 +2984,6 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
2979 printk(KERN_ERR "%s[%u] OFA CM event_handler returned, " 2984 printk(KERN_ERR "%s[%u] OFA CM event_handler returned, "
2980 "ret=%d\n", __func__, __LINE__, ret); 2985 "ret=%d\n", __func__, __LINE__, ret);
2981 2986
2982 passive_state = atomic_add_return(1, &cm_node->passive_state);
2983 if (passive_state == NES_SEND_RESET_EVENT)
2984 create_event(cm_node, NES_CM_EVENT_RESET);
2985 return 0; 2987 return 0;
2986} 2988}
2987 2989