LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Steve Wise <swise@opengridcomputing.com>
To: rdreier@cisco.com, jeff@garzik.org
Cc: divy@chelsio.com, general@lists.openfabrics.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH 2.6.22 4/5] iw_cxgb3: Support for new abort logic.
Date: Thu, 26 Apr 2007 15:21:20 -0500	[thread overview]
Message-ID: <20070426202120.24234.62250.stgit@dell3.ogc.int> (raw)
In-Reply-To: <20070426202057.24234.56383.stgit@dell3.ogc.int>


Support for new abort logic.

The HW now posts 2 ABORT_RPL and/or PEER_ABORT_REQ messages.  We need
to handle them by silenty dropping the 1st but mark that we're ready
for the final message.  This plugs some close races between the uP and HW.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---

 drivers/infiniband/hw/cxgb3/iwch_cm.c |   18 ++++++++++++++++++
 drivers/infiniband/hw/cxgb3/iwch_cm.h |    6 ++++++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index a990423..3a46a97 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -1107,6 +1107,15 @@ static int abort_rpl(struct t3cdev *tdev
 
 	PDBG("%s ep %p\n", __FUNCTION__, ep);
 
+	/*
+ 	 * We get 2 abort replies from the HW.  The first one must
+	 * be ignored except for scribbling that we need one more.
+	 */
+	if (!(ep->flags & ABORT_REQ_IN_PROGRESS)) {
+		ep->flags |= ABORT_REQ_IN_PROGRESS;
+		return CPL_RET_BUF_DONE;
+	}
+
 	close_complete_upcall(ep);
 	state_set(&ep->com, DEAD);
 	release_ep_resources(ep);
@@ -1474,6 +1483,15 @@ static int peer_abort(struct t3cdev *tde
 	int ret;
 	int state;
 
+	/*
+ 	 * We get 2 peer aborts from the HW.  The first one must
+	 * be ignored except for scribbling that we need one more.
+	 */
+	if (!(ep->flags & PEER_ABORT_IN_PROGRESS)) {
+		ep->flags |= PEER_ABORT_IN_PROGRESS;
+		return CPL_RET_BUF_DONE;
+	}
+
 	if (is_neg_adv_abort(req->status)) {
 		PDBG("%s neg_adv_abort ep %p tid %d\n", __FUNCTION__, ep,
 		     ep->hwtid);
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.h b/drivers/infiniband/hw/cxgb3/iwch_cm.h
index 0c6f281..21a388c 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.h
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.h
@@ -143,6 +143,11 @@ enum iwch_ep_state {
 	DEAD,
 };
 
+enum iwch_ep_flags {
+	PEER_ABORT_IN_PROGRESS	= (1 << 0),
+	ABORT_REQ_IN_PROGRESS	= (1 << 1),
+};
+
 struct iwch_ep_common {
 	struct iw_cm_id *cm_id;
 	struct iwch_qp *qp;
@@ -181,6 +186,7 @@ struct iwch_ep {
 	u16 plen;
 	u32 ird;
 	u32 ord;
+	u32 flags;
 };
 
 static inline struct iwch_ep *to_ep(struct iw_cm_id *cm_id)

  parent reply	other threads:[~2007-04-26 20:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-26 20:20 [PATCH 2.6.22 0/5] iw_cxgb3: Bug Fixes + Firmware update Steve Wise
2007-04-26 20:21 ` [PATCH 2.6.22 1/5] iw_cxgb3: Fix TERM codes Steve Wise
2007-04-26 20:21 ` [PATCH 2.6.22 2/5] iw_cxgb3: Fail qp creation if the requested max_inline is too large Steve Wise
2007-04-26 20:21 ` [PATCH 2.6.22 3/5] iw_cxgb3: Initialize cpu_idx field in cpl_close_listserv_req message Steve Wise
2007-04-26 20:21 ` Steve Wise [this message]
2007-04-26 20:21 ` [PATCH 2.6.22 5/5] iw_cxgb3: Update required firmware revision to 4.0.0 Steve Wise
2007-04-27  3:12   ` Roland Dreier
2007-04-27 13:03     ` Steve Wise
2007-04-27 16:52     ` Divy Le Ray
2007-04-30 23:59   ` Roland Dreier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070426202120.24234.62250.stgit@dell3.ogc.int \
    --to=swise@opengridcomputing.com \
    --cc=divy@chelsio.com \
    --cc=general@lists.openfabrics.org \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rdreier@cisco.com \
    --subject='Re: [PATCH 2.6.22 4/5] iw_cxgb3: Support for new abort logic.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).