Commit d21ec1f0 authored by Seth Howell's avatar Seth Howell Committed by Daniel Verkamp
Browse files

lib/nvme: Add spdk_nvme_ns_get_ctrlr to the public api



This can be used in callbacks when a user has a namespace but needs to
call controller specific functions such as alloc_io_qpair.

Change-Id: I00c931e2846e42f540c17f3254fe97a45e9bd079
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/375022


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 59f2a376
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@ into account when splitting I/O requests.
The HotplugEnable option in `[Nvme]` sections of the configuration file is now
"No" by default. It was previously "Yes".

The NVMe library now includes a function spdk_nvme_ns_get_ctrlr which returns the
NVMe Controller associated with a given namespace.

### NVMe-oF Target (nvmf)

The NVMe-oF target no longer requires any in capsule data buffers to run, and
@@ -42,6 +45,7 @@ additional clarity when constructing spdk_mempools. Previously, -1 could be
passed and the library would choose a reasonable default, but this new value
makes it explicit that the default is being used.


## v17.07: Build system improvements, userspace vhost-blk target, and GPT bdev

### Build System
+8 −0
Original line number Diff line number Diff line
@@ -847,6 +847,14 @@ const struct spdk_nvme_ns_data *spdk_nvme_ns_get_data(struct spdk_nvme_ns *ns);
 */
uint32_t spdk_nvme_ns_get_id(struct spdk_nvme_ns *ns);

/**
 * \brief Get the Controller with which this namespace is associated.
 *
 * This function is thread safe and can be called at any point while the controller is attached to
 *  the SPDK NVMe driver.
 */
struct spdk_nvme_ctrlr *spdk_nvme_ns_get_ctrlr(struct spdk_nvme_ns *ns);

/**
 * \brief Determine whether a namespace is active.
 *
+6 −0
Original line number Diff line number Diff line
@@ -143,6 +143,12 @@ spdk_nvme_ns_is_active(struct spdk_nvme_ns *ns)
	return nsdata->ncap != 0;
}

struct spdk_nvme_ctrlr *
spdk_nvme_ns_get_ctrlr(struct spdk_nvme_ns *ns)
{
	return ns->ctrlr;
}

uint32_t
spdk_nvme_ns_get_max_io_xfer_size(struct spdk_nvme_ns *ns)
{