svn commit: r248768 - head/sys/dev/nvme

Jim Harris jimharris at FreeBSD.org
Tue Mar 26 22:06:06 UTC 2013


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);
 }


More information about the svn-src-all mailing list