aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorFaisal Latif <faisal.latif@intel.com>2011-09-25 21:27:52 -0400
committerRoland Dreier <roland@purestorage.com>2011-10-10 13:47:44 -0400
commitbab3a9f43f211554626e189519b91ab9ef952f2d (patch)
tree5a5c0dbb2b4a4238f77a55bf6cbc98d9b410c806 /drivers/infiniband/hw
parente2e435f290795e409a649423f19574ba77942854 (diff)
RDMA/nes: Fix terminate connection
Fixes a crash that occurs during close when error async event is received. Terminate message is not sent to the remote node if already processing close. Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com> Signed-off-by: Faisal Latif <Faisal.Latif@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index be36cbeae630..43bebe805d2e 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -3553,9 +3553,9 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev,
3553 3553
3554 aeqe_cq_id = le32_to_cpu(aeqe->aeqe_words[NES_AEQE_COMP_QP_CQ_ID_IDX]); 3554 aeqe_cq_id = le32_to_cpu(aeqe->aeqe_words[NES_AEQE_COMP_QP_CQ_ID_IDX]);
3555 if (aeq_info & NES_AEQE_QP) { 3555 if (aeq_info & NES_AEQE_QP) {
3556 if ((!nes_is_resource_allocated(nesadapter, nesadapter->allocated_qps, 3556 if (!nes_is_resource_allocated(nesadapter,
3557 aeqe_cq_id)) || 3557 nesadapter->allocated_qps,
3558 (atomic_read(&nesqp->close_timer_started))) 3558 aeqe_cq_id))
3559 return; 3559 return;
3560 } 3560 }
3561 3561
@@ -3566,8 +3566,7 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev,
3566 3566
3567 if (atomic_inc_return(&nesqp->close_timer_started) == 1) { 3567 if (atomic_inc_return(&nesqp->close_timer_started) == 1) {
3568 if ((tcp_state == NES_AEQE_TCP_STATE_CLOSE_WAIT) && 3568 if ((tcp_state == NES_AEQE_TCP_STATE_CLOSE_WAIT) &&
3569 (nesqp->ibqp_state == IB_QPS_RTS) && 3569 (nesqp->ibqp_state == IB_QPS_RTS)) {
3570 ((nesadapter->eeprom_version >> 16) != NES_A0)) {
3571 spin_lock_irqsave(&nesqp->lock, flags); 3570 spin_lock_irqsave(&nesqp->lock, flags);
3572 nesqp->hw_iwarp_state = iwarp_state; 3571 nesqp->hw_iwarp_state = iwarp_state;
3573 nesqp->hw_tcp_state = tcp_state; 3572 nesqp->hw_tcp_state = tcp_state;
@@ -3594,9 +3593,10 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev,
3594 return; 3593 return;
3595 } 3594 }
3596 spin_lock_irqsave(&nesqp->lock, flags); 3595 spin_lock_irqsave(&nesqp->lock, flags);
3597 nesqp->hw_iwarp_state = NES_AEQE_IWARP_STATE_CLOSING; 3596 nesqp->hw_iwarp_state = iwarp_state;
3597 nesqp->hw_tcp_state = tcp_state;
3598 nesqp->last_aeq = async_event_id;
3598 spin_unlock_irqrestore(&nesqp->lock, flags); 3599 spin_unlock_irqrestore(&nesqp->lock, flags);
3599 nes_hw_modify_qp(nesdev, nesqp, NES_CQP_QP_IWARP_STATE_CLOSING, 0, 0);
3600 nes_cm_disconn(nesqp); 3600 nes_cm_disconn(nesqp);
3601 break; 3601 break;
3602 3602
@@ -3694,7 +3694,8 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev,
3694 case NES_AEQE_AEID_ROE_INVALID_RDMA_WRITE_OR_READ_RESP: 3694 case NES_AEQE_AEID_ROE_INVALID_RDMA_WRITE_OR_READ_RESP:
3695 printk(KERN_ERR PFX "QP[%u] async_event_id=0x%04X IB_EVENT_QP_FATAL\n", 3695 printk(KERN_ERR PFX "QP[%u] async_event_id=0x%04X IB_EVENT_QP_FATAL\n",
3696 nesqp->hwqp.qp_id, async_event_id); 3696 nesqp->hwqp.qp_id, async_event_id);
3697 nes_terminate_connection(nesdev, nesqp, aeqe, IB_EVENT_QP_FATAL); 3697 if (!atomic_read(&nesqp->close_timer_started))
3698 nes_terminate_connection(nesdev, nesqp, aeqe, IB_EVENT_QP_FATAL);
3698 break; 3699 break;
3699 3700
3700 case NES_AEQE_AEID_CQ_OPERATION_ERROR: 3701 case NES_AEQE_AEID_CQ_OPERATION_ERROR: