libxnvme_pi.h#
Enums#
xnvme_pi_check_type#
xnvme_pi_type#
Structs#
xnvme_pi_ctx#
-
struct xnvme_pi_ctx#
Functions#
xnvme_pi_ctx_init#
-
int xnvme_pi_ctx_init(struct xnvme_pi_ctx *ctx, uint32_t block_size, uint32_t md_size, bool md_interleave, bool pi_loc, enum xnvme_pi_type pi_type, uint32_t pi_flags, uint32_t init_ref_tag, uint16_t apptag_mask, uint16_t app_tag, enum xnvme_spec_nvm_ns_pif pi_format)#
Initialize the Protection Information context.
- Parameters:
ctx – Pointer to xnvme_pi_ctx
block_size – Block size
md_size – Metadata size
md_interleave – metadata part of data buffer
pi_loc – Protection Information location in data/metadata buffer
pi_type – Protection Information Type
pi_flags – Protection Information flags
init_ref_tag – initial offset
apptag_mask – Application Tag mask
app_tag – Application Tag
pi_format – Protection Information Format
- Returns:
On success, 0 is returned. On error, negative
errno
is returned.
xnvme_pi_generate#
-
void xnvme_pi_generate(struct xnvme_pi_ctx *ctx, uint8_t *data_buf, uint8_t *md_buf, uint32_t num_blocks)#
Generate and fill Protection information part of metadata.
- Parameters:
ctx – Pointer to xnvme_pi_ctx
data_buf – Pointer to data-payload
md_buf – Pointer to meta-payload
num_blocks – Number of logical blocks
xnvme_pi_size#
-
size_t xnvme_pi_size(enum xnvme_spec_nvm_ns_pif pi_format)#
Return the protection information size.
- Parameters:
pi_format – Protection Information Format
- Returns:
On success, the size for protection information format.
xnvme_pi_verify#
-
int xnvme_pi_verify(struct xnvme_pi_ctx *ctx, uint8_t *data_buf, uint8_t *md_buf, uint32_t num_blocks)#
Verify the protection information content of metadata.
- Parameters:
ctx – Pointer to xnvme_pi_ctx
data_buf – Pointer to data-payload
md_buf – Pointer to meta-payload
num_blocks – Number of logical blocks
- Returns:
On success, 0 is returned. On error, negative
errno
is returned.