Author: mav
Date: Thu Feb  1 21:25:56 2018
New Revision: 328750
URL: https://svnweb.freebsd.org/changeset/base/328750

Log:
  MFC r327034 (by imp):
  Return domain, bus, slot, and function for the transport settings in
  PATH_INQ requests for nvme.

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

Modified: stable/11/sys/cam/cam_ccb.h
==============================================================================
--- stable/11/sys/cam/cam_ccb.h Thu Feb  1 21:23:42 2018        (r328749)
+++ stable/11/sys/cam/cam_ccb.h Thu Feb  1 21:25:56 2018        (r328750)
@@ -626,6 +626,11 @@ struct ccb_pathinq_settings_sas {
 
 struct ccb_pathinq_settings_nvme {
        uint32_t nsid;          /* Namespace ID for this path */
+       uint32_t domain;
+       uint8_t  bus;
+       uint8_t  slot;
+       uint8_t  function;
+       uint8_t  extra;
 };
 
 #define        PATHINQ_SETTINGS_SIZE   128

Modified: stable/11/sys/dev/nvme/nvme_sim.c
==============================================================================
--- stable/11/sys/dev/nvme/nvme_sim.c   Thu Feb  1 21:23:42 2018        
(r328749)
+++ stable/11/sys/dev/nvme/nvme_sim.c   Thu Feb  1 21:25:56 2018        
(r328750)
@@ -169,7 +169,8 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb)
                break;
        case XPT_PATH_INQ:              /* Path routing inquiry */
        {
-               struct ccb_pathinq *cpi = &ccb->cpi;
+               struct ccb_pathinq      *cpi = &ccb->cpi;
+               device_t                dev = ctrlr->dev;
 
                /*
                 * NVMe may have multiple LUNs on the same path. Current 
generation
@@ -197,6 +198,11 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb)
                 cpi->protocol = PROTO_NVME;
                 cpi->protocol_version = NVME_REV_1;    /* Groks all 1.x NVMe 
cards */
                cpi->xport_specific.nvme.nsid = ns->id;
+               cpi->xport_specific.nvme.domain = pci_get_domain(dev);
+               cpi->xport_specific.nvme.bus = pci_get_bus(dev);
+               cpi->xport_specific.nvme.slot = pci_get_slot(dev);
+               cpi->xport_specific.nvme.function = pci_get_function(dev);
+               cpi->xport_specific.nvme.extra = 0;
                cpi->ccb_h.status = CAM_REQ_CMP;
                break;
        }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to