nvme: add API to get maximum data transfer size

Change-Id: I8573732b3049e2a5b471e5a0313e39019fdaad5f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/410518
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Daniel Verkamp 2018-05-08 16:05:35 -07:00
parent abfed22981
commit ace321df22
2 changed files with 17 additions and 0 deletions

View File

@ -468,6 +468,17 @@ uint32_t spdk_nvme_ctrlr_get_num_ns(struct spdk_nvme_ctrlr *ctrlr);
*/
struct spdk_pci_device *spdk_nvme_ctrlr_get_pci_device(struct spdk_nvme_ctrlr *ctrlr);
/**
* \brief Get the maximum data transfer size of a given NVMe controller.
*
* \return Maximum data transfer size of the NVMe controller in bytes.
*
* The I/O command helper functions, such as spdk_nvme_ns_cmd_read(), will split large I/Os
* automatically; however, it is up to the user to obey this limit for commands submitted
* with the raw command functions, such as spdk_nvme_ctrlr_cmd_io_raw().
*/
uint32_t spdk_nvme_ctrlr_get_max_xfer_size(const struct spdk_nvme_ctrlr *ctrlr);
/**
* \brief Return true if nsid is an active ns for the given NVMe controller.
*

View File

@ -1969,6 +1969,12 @@ spdk_nvme_ctrlr_get_pci_device(struct spdk_nvme_ctrlr *ctrlr)
return nvme_ctrlr_proc_get_devhandle(ctrlr);
}
uint32_t
spdk_nvme_ctrlr_get_max_xfer_size(const struct spdk_nvme_ctrlr *ctrlr)
{
return ctrlr->max_xfer_size;
}
void
spdk_nvme_ctrlr_register_aer_callback(struct spdk_nvme_ctrlr *ctrlr,
spdk_nvme_aer_cb aer_cb_fn,