diff options
author | Roland Dreier <rolandd@cisco.com> | 2010-09-08 17:43:28 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-09-08 17:43:28 -0400 |
commit | 17859d07c89165a54a5cf6beb7f068b140660892 (patch) | |
tree | add21a71d4df43056b565189c48ecbd11a172e07 /drivers/infiniband | |
parent | dc4e96ce2dceb649224ee84f83592aac8c54c9b7 (diff) | |
parent | 29da03b9d1c6f24548d98cebda1e15a25d80ee1b (diff) |
Merge branches 'cxgb3' and 'nes' into for-linus
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/nes/nes_cm.c | 18 | ||||
-rw-r--r-- | drivers/infiniband/hw/nes/nes_hw.c | 14 | ||||
-rw-r--r-- | drivers/infiniband/hw/nes/nes_hw.h | 1 | ||||
-rw-r--r-- | drivers/infiniband/hw/nes/nes_nic.c | 4 |
4 files changed, 26 insertions, 11 deletions
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 443cea55daa..61e0efd4ccf 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, | |||
502 | static void nes_retrans_expired(struct nes_cm_node *cm_node) | 502 | static 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 | ||
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c index f8233c851c6..1980a461c49 100644 --- a/drivers/infiniband/hw/nes/nes_hw.c +++ b/drivers/infiniband/hw/nes/nes_hw.c | |||
@@ -3468,6 +3468,19 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev, | |||
3468 | return; /* Ignore it, wait for close complete */ | 3468 | return; /* Ignore it, wait for close complete */ |
3469 | 3469 | ||
3470 | if (atomic_inc_return(&nesqp->close_timer_started) == 1) { | 3470 | if (atomic_inc_return(&nesqp->close_timer_started) == 1) { |
3471 | if ((tcp_state == NES_AEQE_TCP_STATE_CLOSE_WAIT) && | ||
3472 | (nesqp->ibqp_state == IB_QPS_RTS) && | ||
3473 | ((nesadapter->eeprom_version >> 16) != NES_A0)) { | ||
3474 | spin_lock_irqsave(&nesqp->lock, flags); | ||
3475 | nesqp->hw_iwarp_state = iwarp_state; | ||
3476 | nesqp->hw_tcp_state = tcp_state; | ||
3477 | nesqp->last_aeq = async_event_id; | ||
3478 | next_iwarp_state = NES_CQP_QP_IWARP_STATE_CLOSING; | ||
3479 | nesqp->hw_iwarp_state = NES_AEQE_IWARP_STATE_CLOSING; | ||
3480 | spin_unlock_irqrestore(&nesqp->lock, flags); | ||
3481 | nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 0, 0); | ||
3482 | nes_cm_disconn(nesqp); | ||
3483 | } | ||
3471 | nesqp->cm_id->add_ref(nesqp->cm_id); | 3484 | nesqp->cm_id->add_ref(nesqp->cm_id); |
3472 | schedule_nes_timer(nesqp->cm_node, (struct sk_buff *)nesqp, | 3485 | schedule_nes_timer(nesqp->cm_node, (struct sk_buff *)nesqp, |
3473 | NES_TIMER_TYPE_CLOSE, 1, 0); | 3486 | NES_TIMER_TYPE_CLOSE, 1, 0); |
@@ -3477,7 +3490,6 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev, | |||
3477 | nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount), | 3490 | nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount), |
3478 | async_event_id, nesqp->last_aeq, tcp_state); | 3491 | async_event_id, nesqp->last_aeq, tcp_state); |
3479 | } | 3492 | } |
3480 | |||
3481 | break; | 3493 | break; |
3482 | case NES_AEQE_AEID_LLP_CLOSE_COMPLETE: | 3494 | case NES_AEQE_AEID_LLP_CLOSE_COMPLETE: |
3483 | if (nesqp->term_flags) { | 3495 | if (nesqp->term_flags) { |
diff --git a/drivers/infiniband/hw/nes/nes_hw.h b/drivers/infiniband/hw/nes/nes_hw.h index aa9183db32b..1204c3432b6 100644 --- a/drivers/infiniband/hw/nes/nes_hw.h +++ b/drivers/infiniband/hw/nes/nes_hw.h | |||
@@ -45,6 +45,7 @@ | |||
45 | #define NES_PHY_TYPE_KR 9 | 45 | #define NES_PHY_TYPE_KR 9 |
46 | 46 | ||
47 | #define NES_MULTICAST_PF_MAX 8 | 47 | #define NES_MULTICAST_PF_MAX 8 |
48 | #define NES_A0 3 | ||
48 | 49 | ||
49 | enum pci_regs { | 50 | enum pci_regs { |
50 | NES_INT_STAT = 0x0000, | 51 | NES_INT_STAT = 0x0000, |
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c index 6dfdd49cdbc..10560c796fd 100644 --- a/drivers/infiniband/hw/nes/nes_nic.c +++ b/drivers/infiniband/hw/nes/nes_nic.c | |||
@@ -1446,14 +1446,14 @@ static int nes_netdev_set_pauseparam(struct net_device *netdev, | |||
1446 | NES_IDX_MAC_TX_CONFIG + (nesdev->mac_index*0x200)); | 1446 | NES_IDX_MAC_TX_CONFIG + (nesdev->mac_index*0x200)); |
1447 | u32temp |= NES_IDX_MAC_TX_CONFIG_ENABLE_PAUSE; | 1447 | u32temp |= NES_IDX_MAC_TX_CONFIG_ENABLE_PAUSE; |
1448 | nes_write_indexed(nesdev, | 1448 | nes_write_indexed(nesdev, |
1449 | NES_IDX_MAC_TX_CONFIG_ENABLE_PAUSE + (nesdev->mac_index*0x200), u32temp); | 1449 | NES_IDX_MAC_TX_CONFIG + (nesdev->mac_index*0x200), u32temp); |
1450 | nesdev->disable_tx_flow_control = 0; | 1450 | nesdev->disable_tx_flow_control = 0; |
1451 | } else if ((et_pauseparam->tx_pause == 0) && (nesdev->disable_tx_flow_control == 0)) { | 1451 | } else if ((et_pauseparam->tx_pause == 0) && (nesdev->disable_tx_flow_control == 0)) { |
1452 | u32temp = nes_read_indexed(nesdev, | 1452 | u32temp = nes_read_indexed(nesdev, |
1453 | NES_IDX_MAC_TX_CONFIG + (nesdev->mac_index*0x200)); | 1453 | NES_IDX_MAC_TX_CONFIG + (nesdev->mac_index*0x200)); |
1454 | u32temp &= ~NES_IDX_MAC_TX_CONFIG_ENABLE_PAUSE; | 1454 | u32temp &= ~NES_IDX_MAC_TX_CONFIG_ENABLE_PAUSE; |
1455 | nes_write_indexed(nesdev, | 1455 | nes_write_indexed(nesdev, |
1456 | NES_IDX_MAC_TX_CONFIG_ENABLE_PAUSE + (nesdev->mac_index*0x200), u32temp); | 1456 | NES_IDX_MAC_TX_CONFIG + (nesdev->mac_index*0x200), u32temp); |
1457 | nesdev->disable_tx_flow_control = 1; | 1457 | nesdev->disable_tx_flow_control = 1; |
1458 | } | 1458 | } |
1459 | if ((et_pauseparam->rx_pause == 1) && (nesdev->disable_rx_flow_control == 1)) { | 1459 | if ((et_pauseparam->rx_pause == 1) && (nesdev->disable_rx_flow_control == 1)) { |