svn commit: r328699 - stable/11/sys/dev/nvme

Alexander Motin mav at FreeBSD.org
Thu Feb 1 19:01:07 UTC 2018


Author: mav
Date: Thu Feb  1 19:01:06 2018
New Revision: 328699
URL: https://svnweb.freebsd.org/changeset/base/328699

Log:
  MFC r324075 (by imp): Tweak performance of nda completions
  
  Use xpt_done_direct in preference to xpt_done when completing a
  successful I/O. Continue to use xpt_done when there's an error, or for
  completion of the submission of a CCB. This eliminates a context
  switch to the cam_doneq thread.

Modified:
  stable/11/sys/dev/nvme/nvme_sim.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/nvme/nvme_sim.c
==============================================================================
--- stable/11/sys/dev/nvme/nvme_sim.c	Thu Feb  1 19:00:05 2018	(r328698)
+++ stable/11/sys/dev/nvme/nvme_sim.c	Thu Feb  1 19:01:06 2018	(r328699)
@@ -73,11 +73,13 @@ nvme_sim_nvmeio_done(void *ccb_arg, const struct nvme_
 	 * it means. Make our best guess, though for the status code.
 	 */
 	memcpy(&ccb->nvmeio.cpl, cpl, sizeof(*cpl));
-	if (nvme_completion_is_error(cpl))
+	if (nvme_completion_is_error(cpl)) {
 		ccb->ccb_h.status = CAM_REQ_CMP_ERR;
-	else
+		xpt_done(ccb);
+	} else {
 		ccb->ccb_h.status = CAM_REQ_CMP;
-	xpt_done(ccb);
+		xpt_done_direct(ccb);
+	}
 }
 
 static void


More information about the svn-src-all mailing list