From patchwork Fri Jun 4 18:30:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Heinz X-Patchwork-Id: 104311 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 o54IUoUL027101 for ; Fri, 4 Jun 2010 18:30:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754144Ab0FDSau (ORCPT ); Fri, 4 Jun 2010 14:30:50 -0400 Received: from avexcashub1.qlogic.com ([198.70.193.61]:9313 "EHLO avexcashub1.qlogic.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754073Ab0FDSat convert rfc822-to-8bit (ORCPT ); Fri, 4 Jun 2010 14:30:49 -0400 Received: from avexcashub2.qlogic.org (10.1.4.116) by avexcashub1.qlogic.org (10.1.4.161) with Microsoft SMTP Server (TLS) id 8.1.375.2; Fri, 4 Jun 2010 11:30:49 -0700 Received: from MNEXCASHUB2.qlogic.org (10.33.2.104) by avexcashub2.qlogic.org (10.1.4.162) with Microsoft SMTP Server (TLS) id 8.1.375.2; Fri, 4 Jun 2010 11:30:49 -0700 Received: from MNEXMB1.qlogic.org ([fe80::c6b:fda:afec:79a1]) by MNEXCASHUB2.qlogic.org ([::1]) with mapi; Fri, 4 Jun 2010 13:30:47 -0500 From: Mike Heinz To: "linux-rdma@vger.kernel.org" , "ewg@openfabrics.org" Date: Fri, 4 Jun 2010 13:30:45 -0500 Subject: [PATCH] Handling busy responses from the SA Thread-Topic: [PATCH] Handling busy responses from the SA Thread-Index: AcsEFAv71tJ7/LtkT3+TrUHFBLISog== Message-ID: <4C2744E8AD2982428C5BFE523DF8CDCB49A488DAF3@MNEXMB1.qlogic.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 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, 04 Jun 2010 18:30:50 +0000 (UTC) diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index efca783..05f2930 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c @@ -1815,9 +1815,20 @@ static void ib_mad_complete_recv(struct ib_mad_agent_private *mad_agent_priv, */ /* Complete corresponding request */ if (ib_response_mad(mad_recv_wc->recv_buf.mad)) { + u16 busy = __be16_to_cpu(mad_recv_wc->recv_buf.mad->mad_hdr.status) & + IB_MGMT_MAD_STATUS_BUSY; + spin_lock_irqsave(&mad_agent_priv->lock, flags); mad_send_wr = ib_find_send_mad(mad_agent_priv, mad_recv_wc); if (mad_send_wr) { + if (busy && mad_send_wr->retries_left) { + /* Just let the query timeout and have it requeued later */ + spin_unlock_irqrestore(&mad_agent_priv->lock, flags); + ib_free_recv_mad(mad_recv_wc); + deref_mad_agent(mad_agent_priv); + printk(KERN_NOTICE PFX "Response returned with MAD_STATUS_BUSY\n"); + return; + } ib_mark_mad_done(mad_send_wr); spin_unlock_irqrestore(&mad_agent_priv->lock, flags); diff --git a/include/rdma/ib_mad.h b/include/rdma/ib_mad.h index 2651e93..e9dc4cc 100644 --- a/include/rdma/ib_mad.h +++ b/include/rdma/ib_mad.h @@ -77,6 +77,15 @@ #define IB_MGMT_MAX_METHODS 128 +/* MAD Status field bit masks */ +#define IB_MGMT_MAD_STATUS_SUCCESS 0x0000 +#define IB_MGMT_MAD_STATUS_BUSY 0x0001 +#define IB_MGMT_MAD_STATUS_REDIRECT_REQD 0x0002 +#define IB_MGMT_MAD_STATUS_BAD_VERERSION 0x0004 +#define IB_MGMT_MAD_STATUS_UNSUPPORTED_METHOD 0x0008 +#define IB_MGMT_MAD_STATUS_UNSUPPORTED_METHOD_ATTRIB 0x000c +#define IB_MGMT_MAD_STATUS_INVALID_ATTRIB_VALUE 0x001c + /* RMPP information */ #define IB_MGMT_RMPP_VERSION 1 #define IB_MGMT_RMPP_PASSTHRU 255