From patchwork Fri May 21 21:55:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faisal Latif X-Patchwork-Id: 101568 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4LLt0vJ011267 for ; Fri, 21 May 2010 21:55:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758540Ab0EUVzF (ORCPT ); Fri, 21 May 2010 17:55:05 -0400 Received: from mga03.intel.com ([143.182.124.21]:57736 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758599Ab0EUVzF (ORCPT ); Fri, 21 May 2010 17:55:05 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 21 May 2010 14:55:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,280,1272870000"; d="scan'208";a="280023537" Received: from flatif-mobl1.amr.corp.intel.com (HELO flatif-MOBL.intel.com) ([10.232.237.159]) by azsmga001.ch.intel.com with SMTP; 21 May 2010 14:55:02 -0700 Received: by flatif-MOBL.intel.com (sSMTP sendmail emulation); Fri, 21 May 2010 16:55:03 -0500 Date: Fri, 21 May 2010 16:55:03 -0500 From: Faisal Latif To: Roland Dreier Cc: linux-rdma@vger.kernel.org Subject: [PATCH] RDMA/nes: AE for closed QP causes crash Message-ID: <20100521215503.GA4256@flatif-MOBL1> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.4.2.2i 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]); Fri, 21 May 2010 21:55:07 +0000 (UTC) diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c index c36a3f5..bfc9969 100644 --- a/drivers/infiniband/hw/nes/nes_hw.c +++ b/drivers/infiniband/hw/nes/nes_hw.c @@ -3424,6 +3424,7 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev, struct nes_adapter *nesadapter = nesdev->nesadapter; u32 aeq_info; u32 next_iwarp_state = 0; + u32 aeqe_cq_id; u16 async_event_id; u8 tcp_state; u8 iwarp_state; @@ -3451,6 +3452,14 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev, le32_to_cpu(aeqe->aeqe_words[NES_AEQE_COMP_QP_CQ_ID_IDX]), aeqe, nes_tcp_state_str[tcp_state], nes_iwarp_state_str[iwarp_state]); + aeqe_cq_id = le32_to_cpu(aeqe->aeqe_words[NES_AEQE_COMP_QP_CQ_ID_IDX]); + if (aeq_info & NES_AEQE_QP) { + if ((!nes_is_resource_allocated(nesadapter, nesadapter->allocated_qps, + aeqe_cq_id)) || + (atomic_read(&nesqp->close_timer_started))) + return; + } + switch (async_event_id) { case NES_AEQE_AEID_LLP_FIN_RECEIVED: if (nesqp->term_flags)