From patchwork Sat Aug 14 21:05:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faisal Latif X-Patchwork-Id: 119600 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7EL50U8023087 for ; Sat, 14 Aug 2010 21:05:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755718Ab0HNVFH (ORCPT ); Sat, 14 Aug 2010 17:05:07 -0400 Received: from mga09.intel.com ([134.134.136.24]:31899 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755622Ab0HNVFG (ORCPT ); Sat, 14 Aug 2010 17:05:06 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 14 Aug 2010 14:05:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.55,368,1278313200"; d="scan'208";a="545365683" Received: from flatif-mobl3.amr.corp.intel.com (HELO flatif-MOBL.intel.com) ([10.232.236.36]) by orsmga002.jf.intel.com with SMTP; 14 Aug 2010 14:05:04 -0700 Received: by flatif-MOBL.intel.com (sSMTP sendmail emulation); Sat, 14 Aug 2010 16:05:04 -0500 Date: Sat, 14 Aug 2010 16:05:04 -0500 From: Faisal Latif To: Roland Dreier Cc: linux-rdma@vger.kernel.org Subject: [PATCH] RDMA/nes: change state to closing after FIN Message-ID: <20100814210504.GA5300@FLATIF-MOBL3> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 14 Aug 2010 21:05:08 +0000 (UTC) diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c index 679dd01..a63934c 100644 --- a/drivers/infiniband/hw/nes/nes_hw.c +++ b/drivers/infiniband/hw/nes/nes_hw.c @@ -3469,8 +3469,19 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev, case NES_AEQE_AEID_LLP_FIN_RECEIVED: if (nesqp->term_flags) return; /* Ignore it, wait for close complete */ - if (atomic_inc_return(&nesqp->close_timer_started) == 1) { + if ((tcp_state == NES_AEQE_TCP_STATE_CLOSE_WAIT) && + (nesqp->ibqp_state == IB_QPS_RTS)) { + spin_lock_irqsave(&nesqp->lock, flags); + nesqp->hw_iwarp_state = iwarp_state; + nesqp->hw_tcp_state = tcp_state; + nesqp->last_aeq = async_event_id; + next_iwarp_state = NES_CQP_QP_IWARP_STATE_CLOSING; + nesqp->hw_iwarp_state = NES_AEQE_IWARP_STATE_CLOSING; + spin_unlock_irqrestore(&nesqp->lock, flags); + nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 0, 0); + nes_cm_disconn(nesqp); + } nesqp->cm_id->add_ref(nesqp->cm_id); schedule_nes_timer(nesqp->cm_node, (struct sk_buff *)nesqp, NES_TIMER_TYPE_CLOSE, 1, 0); @@ -3480,7 +3491,6 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev, nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount), async_event_id, nesqp->last_aeq, tcp_state); } - break; case NES_AEQE_AEID_LLP_CLOSE_COMPLETE: if (nesqp->term_flags) {