Date: Thu, 18 Jun 2020 20:23:46 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362339 - stable/12/sys/dev/nvme Message-ID: <202006182023.05IKNk6A041820@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Jun 18 20:23:46 2020 New Revision: 362339 URL: https://svnweb.freebsd.org/changeset/base/362339 Log: MFC r360503 (by imp): 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: stable/12/sys/dev/nvme/nvme_sim.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme_sim.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_sim.c Thu Jun 18 19:32:34 2020 (r362338) +++ stable/12/sys/dev/nvme/nvme_sim.c Thu Jun 18 20:23:46 2020 (r362339) @@ -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; @@ -330,13 +324,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?202006182023.05IKNk6A041820>