Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Mar 2013 22:06:05 +0000 (UTC)
From:      Jim Harris <jimharris@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r248768 - head/sys/dev/nvme
Message-ID:  <201303262206.r2QM65Qq030805@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jimharris
Date: Tue Mar 26 22:06:05 2013
New Revision: 248768
URL: http://svnweb.freebsd.org/changeset/base/248768

Log:
  Abort and do not retry any outstanding admin commands left over after
  a controller reset.
  
  Sponsored by:	Intel
  Reviewed by:	carl

Modified:
  head/sys/dev/nvme/nvme_qpair.c

Modified: head/sys/dev/nvme/nvme_qpair.c
==============================================================================
--- head/sys/dev/nvme/nvme_qpair.c	Tue Mar 26 21:58:38 2013	(r248767)
+++ head/sys/dev/nvme/nvme_qpair.c	Tue Mar 26 22:06:05 2013	(r248768)
@@ -594,6 +594,21 @@ nvme_qpair_reset(struct nvme_qpair *qpai
 void
 nvme_admin_qpair_enable(struct nvme_qpair *qpair)
 {
+	struct nvme_tracker		*tr;
+	struct nvme_tracker		*tr_temp;
+
+	/*
+	 * Manually abort each outstanding admin command.  Do not retry
+	 *  admin commands found here, since they will be left over from
+	 *  a controller reset and its likely the context in which the
+	 *  command was issued no longer applies.
+	 */
+	TAILQ_FOREACH_SAFE(tr, &qpair->outstanding_tr, tailq, tr_temp) {
+		device_printf(qpair->ctrlr->dev,
+		    "aborting outstanding admin command\n");
+		nvme_qpair_manual_complete_tracker(qpair, tr, NVME_SCT_GENERIC,
+		    NVME_SC_ABORTED_BY_REQUEST, 1 /* do not retry */, TRUE);
+	}
 
 	nvme_qpair_enable(qpair);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303262206.r2QM65Qq030805>