nvme_zns.h File Reference

NVMe driver public API extension for Zoned Namespace Command Set. More...

Functions

const struct spdk_nvme_zns_ns_dataspdk_nvme_zns_ns_get_data (struct spdk_nvme_ns *ns)
 Get the Zoned Namespace Command Set Specific Identify Namespace data as defined by the NVMe Zoned Namespace Command Set Specification. More...
 
uint64_t spdk_nvme_zns_ns_get_zone_size (struct spdk_nvme_ns *ns)
 Get the zone size, in bytes, of the given namespace. More...
 
uint64_t spdk_nvme_zns_ns_get_num_zones (struct spdk_nvme_ns *ns)
 Get the number of zones for the given namespace. More...
 
const struct spdk_nvme_zns_ctrlr_dataspdk_nvme_zns_ctrlr_get_data (struct spdk_nvme_ctrlr *ctrlr)
 Get the Zoned Namespace Command Set Specific Identify Controller data as defined by the NVMe Zoned Namespace Command Set Specification. More...
 
uint32_t spdk_nvme_zns_ctrlr_get_max_zone_append_size (const struct spdk_nvme_ctrlr *ctrlr)
 Get the maximum zone append data transfer size of a given NVMe controller. More...
 
int spdk_nvme_zns_close_zone (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, uint64_t slba, bool select_all, spdk_nvme_cmd_cb cb_fn, void *cb_arg)
 Submit a Close Zone operation to the specified NVMe namespace. More...
 
int spdk_nvme_zns_finish_zone (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, uint64_t slba, bool select_all, spdk_nvme_cmd_cb cb_fn, void *cb_arg)
 Submit a Finish Zone operation to the specified NVMe namespace. More...
 
int spdk_nvme_zns_open_zone (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, uint64_t slba, bool select_all, spdk_nvme_cmd_cb cb_fn, void *cb_arg)
 Submit a Open Zone operation to the specified NVMe namespace. More...
 
int spdk_nvme_zns_reset_zone (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, uint64_t slba, bool select_all, spdk_nvme_cmd_cb cb_fn, void *cb_arg)
 Submit a Reset Zone operation to the specified NVMe namespace. More...
 
int spdk_nvme_zns_offline_zone (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, uint64_t slba, bool select_all, spdk_nvme_cmd_cb cb_fn, void *cb_arg)
 Submit a Offline Zone operation to the specified NVMe namespace. More...
 
int spdk_nvme_zns_report_zones (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, void *payload, uint32_t payload_size, uint64_t slba, enum spdk_nvme_zns_zra_report_opts report_opts, bool partial_report, spdk_nvme_cmd_cb cb_fn, void *cb_arg)
 Get a zone report from the specified NVMe namespace. More...
 

Detailed Description

NVMe driver public API extension for Zoned Namespace Command Set.

Function Documentation

◆ spdk_nvme_zns_close_zone()

int spdk_nvme_zns_close_zone ( struct spdk_nvme_ns *  ns,
struct spdk_nvme_qpair *  qpair,
uint64_t  slba,
bool  select_all,
spdk_nvme_cmd_cb  cb_fn,
void *  cb_arg 
)

Submit a Close Zone operation to the specified NVMe namespace.

Parameters
nsNamespace.
qpairI/O queue pair to submit the request.
slbastarting LBA of the zone to operate on.
select_allIf this is set, slba will be ignored, and operation will be performed on all zones that are in ZSIO or ZSEO state.
cb_fnCallback function invoked when the I/O command completes.
cb_argArgument passed to callback function.
Returns
0 on success. Negated errno on failure.

◆ spdk_nvme_zns_ctrlr_get_data()

const struct spdk_nvme_zns_ctrlr_data* spdk_nvme_zns_ctrlr_get_data ( struct spdk_nvme_ctrlr *  ctrlr)

Get the Zoned Namespace Command Set Specific Identify Controller data as defined by the NVMe Zoned Namespace Command Set Specification.

This function is thread safe and can be called at any point while the controller is attached to the SPDK NVMe driver.

Parameters
ctrlrOpaque handle to NVMe controller.
Returns
pointer to the controller data, or NULL if the controller does not support the Zoned Command Set.

◆ spdk_nvme_zns_ctrlr_get_max_zone_append_size()

uint32_t spdk_nvme_zns_ctrlr_get_max_zone_append_size ( const struct spdk_nvme_ctrlr *  ctrlr)

Get the maximum zone append data transfer size of a given NVMe controller.

Parameters
ctrlrOpaque handle to NVMe controller.
Returns
Maximum zone append data transfer size of the NVMe controller in bytes.

◆ spdk_nvme_zns_finish_zone()

int spdk_nvme_zns_finish_zone ( struct spdk_nvme_ns *  ns,
struct spdk_nvme_qpair *  qpair,
uint64_t  slba,
bool  select_all,
spdk_nvme_cmd_cb  cb_fn,
void *  cb_arg 
)

Submit a Finish Zone operation to the specified NVMe namespace.

Parameters
nsNamespace.
qpairI/O queue pair to submit the request.
slbastarting LBA of the zone to operate on.
select_allIf this is set, slba will be ignored, and operation will be performed on all zones that are in ZSIO, ZSEO, or ZSC state.
cb_fnCallback function invoked when the I/O command completes.
cb_argArgument passed to callback function.
Returns
0 on success. Negated errno on failure.

◆ spdk_nvme_zns_ns_get_data()

const struct spdk_nvme_zns_ns_data* spdk_nvme_zns_ns_get_data ( struct spdk_nvme_ns *  ns)

Get the Zoned Namespace Command Set Specific Identify Namespace data as defined by the NVMe Zoned Namespace Command Set Specification.

This function is thread safe and can be called at any point while the controller is attached to the SPDK NVMe driver.

Parameters
nsNamespace.
Returns
a pointer to the namespace data, or NULL if the namespace is not a Zoned Namespace.

◆ spdk_nvme_zns_ns_get_num_zones()

uint64_t spdk_nvme_zns_ns_get_num_zones ( struct spdk_nvme_ns *  ns)

Get the number of zones for the given namespace.

This function is thread safe and can be called at any point while the controller is attached to the SPDK NVMe driver.

Parameters
nsNamespace to query.
Returns
the number of zones.

◆ spdk_nvme_zns_ns_get_zone_size()

uint64_t spdk_nvme_zns_ns_get_zone_size ( struct spdk_nvme_ns *  ns)

Get the zone size, in bytes, of the given namespace.

This function is thread safe and can be called at any point while the controller is attached to the SPDK NVMe driver.

Parameters
nsNamespace to query.
Returns
the zone size of the given namespace in bytes.

◆ spdk_nvme_zns_offline_zone()

int spdk_nvme_zns_offline_zone ( struct spdk_nvme_ns *  ns,
struct spdk_nvme_qpair *  qpair,
uint64_t  slba,
bool  select_all,
spdk_nvme_cmd_cb  cb_fn,
void *  cb_arg 
)

Submit a Offline Zone operation to the specified NVMe namespace.

Parameters
nsNamespace.
qpairI/O queue pair to submit the request.
slbastarting LBA of the zone to operate on.
select_allIf this is set, slba will be ignored, and operation will be performed on all zones that are in ZSRO state.
cb_fnCallback function invoked when the I/O command completes.
cb_argArgument passed to callback function.
Returns
0 on success. Negated errno on failure.

◆ spdk_nvme_zns_open_zone()

int spdk_nvme_zns_open_zone ( struct spdk_nvme_ns *  ns,
struct spdk_nvme_qpair *  qpair,
uint64_t  slba,
bool  select_all,
spdk_nvme_cmd_cb  cb_fn,
void *  cb_arg 
)

Submit a Open Zone operation to the specified NVMe namespace.

Parameters
nsNamespace.
qpairI/O queue pair to submit the request.
slbastarting LBA of the zone to operate on.
select_allIf this is set, slba will be ignored, and operation will be performed on all zones that are in ZSC state.
cb_fnCallback function invoked when the I/O command completes.
cb_argArgument passed to callback function.
Returns
0 on success. Negated errno on failure.

◆ spdk_nvme_zns_report_zones()

int spdk_nvme_zns_report_zones ( struct spdk_nvme_ns *  ns,
struct spdk_nvme_qpair *  qpair,
void *  payload,
uint32_t  payload_size,
uint64_t  slba,
enum spdk_nvme_zns_zra_report_opts  report_opts,
bool  partial_report,
spdk_nvme_cmd_cb  cb_fn,
void *  cb_arg 
)

Get a zone report from the specified NVMe namespace.

Parameters
nsNamespace.
qpairI/O queue pair to submit the request.
payloadThe pointer to the payload buffer.
payload_sizeThe size of payload buffer.
slbastarting LBA of the zone to operate on.
report_optsFilter on which zone states to include in the zone report.
partial_reportIf true, nr_zones field in the zone report indicates the number of zone descriptors that were successfully written to the zone report. If false, nr_zones field in the zone report indicates the number of zone descriptors that match the report_opts criteria.
cb_fnCallback function invoked when the I/O command completes.
cb_argArgument passed to callback function.
Returns
0 on success. Negated errno on failure.

◆ spdk_nvme_zns_reset_zone()

int spdk_nvme_zns_reset_zone ( struct spdk_nvme_ns *  ns,
struct spdk_nvme_qpair *  qpair,
uint64_t  slba,
bool  select_all,
spdk_nvme_cmd_cb  cb_fn,
void *  cb_arg 
)

Submit a Reset Zone operation to the specified NVMe namespace.

Parameters
nsNamespace.
qpairI/O queue pair to submit the request.
slbastarting LBA of the zone to operate on.
select_allIf this is set, slba will be ignored, and operation will be performed on all zones that are in ZSIO, ZSEO, ZSC, or ZSF state.
cb_fnCallback function invoked when the I/O command completes.
cb_argArgument passed to callback function.
Returns
0 on success. Negated errno on failure.