nvme_ocssd.h File Reference

NVMe driver public API extension for Open-Channel. More...

Functions

bool spdk_nvme_ctrlr_is_ocssd_supported (struct spdk_nvme_ctrlr *ctrlr)
 Determine if OpenChannel is supported by the given NVMe controller. More...
 
int spdk_nvme_ocssd_ctrlr_cmd_geometry (struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid, void *payload, uint32_t payload_size, spdk_nvme_cmd_cb cb_fn, void *cb_arg)
 Identify geometry of the given namespace. More...
 
int spdk_nvme_ocssd_ns_cmd_vector_reset (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, uint64_t *lba_list, uint32_t num_lbas, struct spdk_ocssd_chunk_information_entry *chunk_info, spdk_nvme_cmd_cb cb_fn, void *cb_arg)
 Submits a vector reset command to the specified NVMe namespace. More...
 
int spdk_nvme_ocssd_ns_cmd_vector_write (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, void *buffer, uint64_t *lba_list, uint32_t num_lbas, spdk_nvme_cmd_cb cb_fn, void *cb_arg, uint32_t io_flags)
 Submits a vector write command to the specified NVMe namespace. More...
 
int spdk_nvme_ocssd_ns_cmd_vector_write_with_md (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, void *buffer, void *metadata, uint64_t *lba_list, uint32_t num_lbas, spdk_nvme_cmd_cb cb_fn, void *cb_arg, uint32_t io_flags)
 Submits a vector write command to the specified NVMe namespace. More...
 
int spdk_nvme_ocssd_ns_cmd_vector_read (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, void *buffer, uint64_t *lba_list, uint32_t num_lbas, spdk_nvme_cmd_cb cb_fn, void *cb_arg, uint32_t io_flags)
 Submits a vector read command to the specified NVMe namespace. More...
 
int spdk_nvme_ocssd_ns_cmd_vector_read_with_md (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, void *buffer, void *metadata, uint64_t *lba_list, uint32_t num_lbas, spdk_nvme_cmd_cb cb_fn, void *cb_arg, uint32_t io_flags)
 Submits a vector read command to the specified NVMe namespace. More...
 
int spdk_nvme_ocssd_ns_cmd_vector_copy (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, uint64_t *dst_lba_list, uint64_t *src_lba_list, uint32_t num_lbas, spdk_nvme_cmd_cb cb_fn, void *cb_arg, uint32_t io_flags)
 Submits a vector copy command to the specified NVMe namespace. More...
 

Detailed Description

NVMe driver public API extension for Open-Channel.

Function Documentation

◆ spdk_nvme_ctrlr_is_ocssd_supported()

bool spdk_nvme_ctrlr_is_ocssd_supported ( struct spdk_nvme_ctrlr *  ctrlr)

Determine if OpenChannel is supported by the given NVMe controller.

Parameters
ctrlrNVMe controller to check.
Returns
true if support OpenChannel

◆ spdk_nvme_ocssd_ctrlr_cmd_geometry()

int spdk_nvme_ocssd_ctrlr_cmd_geometry ( struct spdk_nvme_ctrlr *  ctrlr,
uint32_t  nsid,
void *  payload,
uint32_t  payload_size,
spdk_nvme_cmd_cb  cb_fn,
void *  cb_arg 
)

Identify geometry of the given namespace.

Parameters
ctrlrNVMe controller to query.
nsidId of the given namespace.
payloadThe pointer to the payload buffer.
payload_sizeThe size of payload buffer. Shall be multiple of 4K.
cb_fnCallback function to invoke when the feature has been retrieved.
cb_argArgument to pass to the callback function.
Returns
0 if successfully submitted, ENOMEM if resources could not be allocated for this request, EINVAL if wrong payload size.

◆ spdk_nvme_ocssd_ns_cmd_vector_copy()

int spdk_nvme_ocssd_ns_cmd_vector_copy ( struct spdk_nvme_ns *  ns,
struct spdk_nvme_qpair *  qpair,
uint64_t *  dst_lba_list,
uint64_t *  src_lba_list,
uint32_t  num_lbas,
spdk_nvme_cmd_cb  cb_fn,
void *  cb_arg,
uint32_t  io_flags 
)

Submits a vector copy command to the specified NVMe namespace.

Parameters
nsNVMe namespace to submit the command
qpairI/O queue pair to submit the request
dst_lba_listan array of destination LBAs for processing. Must be allocated through spdk_dma_malloc() or its variants
src_lba_listan array of source LBAs for processing. Must be allocated through spdk_dma_malloc() or its variants
num_lbasnumber of LBAs stored in src_lba_list and dst_lba_list
cb_fncallback function to invoke when the I/O is completed
cb_argargument to pass to the callback function
io_flagsset flags, defined by the SPDK_OCSSD_IO_FLAGS_* entries in spdk/nvme_ocssd_spec.h, for this I/O.
Returns
0 if successfully submitted, ENOMEM if an nvme_request structure cannot be allocated for the I/O request

◆ spdk_nvme_ocssd_ns_cmd_vector_read()

int spdk_nvme_ocssd_ns_cmd_vector_read ( struct spdk_nvme_ns *  ns,
struct spdk_nvme_qpair *  qpair,
void *  buffer,
uint64_t *  lba_list,
uint32_t  num_lbas,
spdk_nvme_cmd_cb  cb_fn,
void *  cb_arg,
uint32_t  io_flags 
)

Submits a vector read command to the specified NVMe namespace.

Parameters
nsNVMe namespace to submit the command
qpairI/O queue pair to submit the request
buffervirtual address pointer to the data payload
lba_listan array of LBAs for processing. Must be allocated through spdk_dma_malloc() or its variants
num_lbasnumber of LBAs stored in lba_list
cb_fncallback function to invoke when the I/O is completed
cb_argargument to pass to the callback function
io_flagsset flags, defined by the SPDK_OCSSD_IO_FLAGS_* entries in spdk/nvme_ocssd_spec.h, for this I/O.
Returns
0 if successfully submitted, ENOMEM if an nvme_request structure cannot be allocated for the I/O request

◆ spdk_nvme_ocssd_ns_cmd_vector_read_with_md()

int spdk_nvme_ocssd_ns_cmd_vector_read_with_md ( struct spdk_nvme_ns *  ns,
struct spdk_nvme_qpair *  qpair,
void *  buffer,
void *  metadata,
uint64_t *  lba_list,
uint32_t  num_lbas,
spdk_nvme_cmd_cb  cb_fn,
void *  cb_arg,
uint32_t  io_flags 
)

Submits a vector read command to the specified NVMe namespace.

Parameters
nsNVMe namespace to submit the command
qpairI/O queue pair to submit the request
buffervirtual address pointer to the data payload
metadatavirtual address pointer to the metadata payload, the length of metadata is specified by spdk_nvme_ns_get_md_size()
lba_listan array of LBAs for processing. Must be allocated through spdk_dma_malloc() or its variants
num_lbasnumber of LBAs stored in lba_list
cb_fncallback function to invoke when the I/O is completed
cb_argargument to pass to the callback function
io_flagsset flags, defined by the SPDK_OCSSD_IO_FLAGS_* entries in spdk/nvme_ocssd_spec.h, for this I/O.
Returns
0 if successfully submitted, ENOMEM if an nvme_request structure cannot be allocated for the I/O request

◆ spdk_nvme_ocssd_ns_cmd_vector_reset()

int spdk_nvme_ocssd_ns_cmd_vector_reset ( struct spdk_nvme_ns *  ns,
struct spdk_nvme_qpair *  qpair,
uint64_t *  lba_list,
uint32_t  num_lbas,
struct spdk_ocssd_chunk_information_entry chunk_info,
spdk_nvme_cmd_cb  cb_fn,
void *  cb_arg 
)

Submits a vector reset command to the specified NVMe namespace.

Parameters
nsNVMe namespace to submit the command
qpairI/O queue pair to submit the request
lba_listan array of LBAs for processing. LBAs must correspond to the start of chunks to reset. Must be allocated through spdk_dma_malloc() or its variants
num_lbasnumber of LBAs stored in lba_list
chunk_infoan array of chunk info on DMA-able memory
cb_fncallback function to invoke when the I/O is completed
cb_argargument to pass to the callback function
Returns
0 if successfully submitted, ENOMEM if an nvme_request structure cannot be allocated for the I/O request

◆ spdk_nvme_ocssd_ns_cmd_vector_write()

int spdk_nvme_ocssd_ns_cmd_vector_write ( struct spdk_nvme_ns *  ns,
struct spdk_nvme_qpair *  qpair,
void *  buffer,
uint64_t *  lba_list,
uint32_t  num_lbas,
spdk_nvme_cmd_cb  cb_fn,
void *  cb_arg,
uint32_t  io_flags 
)

Submits a vector write command to the specified NVMe namespace.

Parameters
nsNVMe namespace to submit the command
qpairI/O queue pair to submit the request
buffervirtual address pointer to the data payload
lba_listan array of LBAs for processing. Must be allocated through spdk_dma_malloc() or its variants
num_lbasnumber of LBAs stored in lba_list
cb_fncallback function to invoke when the I/O is completed
cb_argargument to pass to the callback function
io_flagsset flags, defined by the SPDK_OCSSD_IO_FLAGS_* entries in spdk/nvme_ocssd_spec.h, for this I/O.
Returns
0 if successfully submitted, ENOMEM if an nvme_request structure cannot be allocated for the I/O request

◆ spdk_nvme_ocssd_ns_cmd_vector_write_with_md()

int spdk_nvme_ocssd_ns_cmd_vector_write_with_md ( struct spdk_nvme_ns *  ns,
struct spdk_nvme_qpair *  qpair,
void *  buffer,
void *  metadata,
uint64_t *  lba_list,
uint32_t  num_lbas,
spdk_nvme_cmd_cb  cb_fn,
void *  cb_arg,
uint32_t  io_flags 
)

Submits a vector write command to the specified NVMe namespace.

Parameters
nsNVMe namespace to submit the command
qpairI/O queue pair to submit the request
buffervirtual address pointer to the data payload
metadatavirtual address pointer to the metadata payload, the length of metadata is specified by spdk_nvme_ns_get_md_size()
lba_listan array of LBAs for processing. Must be allocated through spdk_dma_malloc() or its variants
num_lbasnumber of LBAs stored in lba_list
cb_fncallback function to invoke when the I/O is completed
cb_argargument to pass to the callback function
io_flagsset flags, defined by the SPDK_OCSSD_IO_FLAGS_* entries in spdk/nvme_ocssd_spec.h, for this I/O.
Returns
0 if successfully submitted, ENOMEM if an nvme_request structure cannot be allocated for the I/O request