From owner-svn-src-all@freebsd.org Wed Dec 20 19:13:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C45EE9DCCA; Wed, 20 Dec 2017 19:13:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26D817CB22; Wed, 20 Dec 2017 19:13:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKJDuLw087196; Wed, 20 Dec 2017 19:13:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKJDuV9087194; Wed, 20 Dec 2017 19:13:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712201913.vBKJDuV9087194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 20 Dec 2017 19:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327034 - in head/sys: cam dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: cam dev/nvme X-SVN-Commit-Revision: 327034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 19:13:57 -0000 Author: imp Date: Wed Dec 20 19:13:55 2017 New Revision: 327034 URL: https://svnweb.freebsd.org/changeset/base/327034 Log: Return domain, bus, slot, and function for the transport settings in PATH_INQ requests for nvme. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13546 Modified: head/sys/cam/cam_ccb.h head/sys/dev/nvme/nvme_sim.c Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Wed Dec 20 19:12:15 2017 (r327033) +++ head/sys/cam/cam_ccb.h Wed Dec 20 19:13:55 2017 (r327034) @@ -633,6 +633,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: head/sys/dev/nvme/nvme_sim.c ============================================================================== --- head/sys/dev/nvme/nvme_sim.c Wed Dec 20 19:12:15 2017 (r327033) +++ head/sys/dev/nvme/nvme_sim.c Wed Dec 20 19:13:55 2017 (r327034) @@ -182,7 +182,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 @@ -210,6 +211,11 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) cpi->protocol = PROTO_NVME; cpi->protocol_version = nvme_mmio_read_4(ctrlr, vs); 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; }