From 368de579b629c2b348391bbacd414811e90ce3af Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 29 Oct 2019 14:32:47 -0700 Subject: [PATCH] nvme: Document new cuse functions Change-Id: I2644d7909899fd7aa4e9690eec0fe20de5f17289 Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472834 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki --- include/spdk/nvme.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/spdk/nvme.h b/include/spdk/nvme.h index 6c9d390cf..3cc511618 100644 --- a/include/spdk/nvme.h +++ b/include/spdk/nvme.h @@ -2585,7 +2585,29 @@ char *spdk_nvme_cuse_get_ctrlr_name(struct spdk_nvme_ctrlr *ctrlr); */ char *spdk_nvme_cuse_get_ns_name(struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid); +/** + * Create a character device at the path specified (Experimental) + * + * The character device can handle ioctls and is compatible with a standard + * Linux kernel NVMe device. Tools such as nvme-cli can be used to configure + * SPDK devices through this interface. + * + * The user is expected to be polling the admin qpair for this controller periodically + * for the CUSE device to function. + * + * \param ctrlr Opaque handle to the NVMe controller. + * \param dev_path The path at which the device should appear. Ex. /dev/spdk/nvme0n1 + * + * \return 0 on success. Negated errno on failure. + */ int spdk_nvme_cuse_register(struct spdk_nvme_ctrlr *ctrlr, const char *dev_path); + +/** + * Remove a previously created character device (Experimental) + * + * \param ctrlr Opaque handle to the NVMe controller. + * + */ void spdk_nvme_cuse_unregister(struct spdk_nvme_ctrlr *ctrlr); #ifdef __cplusplus