Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Apr 2020 20:58:34 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r360503 - head/sys/dev/nvme
Message-ID:  <202004302058.03UKwYja080988@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Thu Apr 30 20:58:33 2020
New Revision: 360503
URL: https://svnweb.freebsd.org/changeset/base/360503

Log:
  Move / reword a comment.
  
  Explain what we're doing with mapping CAM's notion of a LUN to NVMe's
  notion of a namespace.

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

Modified: head/sys/dev/nvme/nvme_sim.c
==============================================================================
--- head/sys/dev/nvme/nvme_sim.c	Thu Apr 30 19:48:55 2020	(r360502)
+++ head/sys/dev/nvme/nvme_sim.c	Thu Apr 30 20:58:33 2020	(r360503)
@@ -172,12 +172,6 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb)
 		struct ccb_pathinq	*cpi = &ccb->cpi;
 		device_t		dev = ctrlr->dev;
 
-		/*
-		 * NVMe may have multiple LUNs on the same path. Current generation
-		 * of NVMe devives support only a single name space. Multiple name
-		 * space drives are coming, but it's unclear how we should report
-		 * them up the stack.
-		 */
 		cpi->version_num = 1;
 		cpi->hba_inquiry = 0;
 		cpi->target_sprt = 0;
@@ -332,13 +326,17 @@ nvme_sim_new_ns(struct nvme_namespace *ns, void *sc_ar
 		return (NULL);
 	}
 
+	/*
+	 * We map the NVMe namespace idea onto the CAM unit LUN. For
+	 * each new namespace, we create a new CAM path for it. We then
+	 * rescan the path to get it to enumerate.
+	 */
 	if (xpt_create_path(&ccb->ccb_h.path, /*periph*/NULL,
 	    cam_sim_path(sc->s_sim), 0, ns->id) != CAM_REQ_CMP) {
 		printf("unable to create path for rescan\n");
 		xpt_free_ccb(ccb);
 		return (NULL);
 	}
-
 	xpt_rescan(ccb);
 
 	return (ns);



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