spdk_bdev_fn_table Struct Reference

Function table for a block device backend. More...

Data Fields

int(* destruct )(void *ctx)
 Destroy the backend block device object.
 
void(* submit_request )(struct spdk_io_channel *ch, struct spdk_bdev_io *)
 Process the IO.
 
bool(* io_type_supported )(void *ctx, enum spdk_bdev_io_type)
 Check if the block device supports a specific I/O type.
 
struct spdk_io_channel *(* get_io_channel )(void *ctx)
 Get an I/O channel for the specific bdev for the calling thread.
 
int(* dump_info_json )(void *ctx, struct spdk_json_write_ctx *w)
 Output driver-specific information to a JSON stream. More...
 
void(* write_config_json )(struct spdk_bdev *bdev, struct spdk_json_write_ctx *w)
 Output bdev-specific RPC configuration to a JSON stream. More...
 
uint64_t(* get_spin_time )(struct spdk_io_channel *ch)
 Get spin-time per I/O channel in microseconds. More...
 
void *(* get_module_ctx )(void *ctx)
 Get bdev module context.
 
int(* get_memory_domains )(void *ctx, struct spdk_memory_domain **domains, int array_size)
 Get memory domains used by bdev. More...
 

Detailed Description

Function table for a block device backend.

The backend block device function table provides a set of APIs to allow communication with a backend. The main commands are read/write API calls for I/O via submit_request.

Field Documentation

◆ dump_info_json

int(* spdk_bdev_fn_table::dump_info_json) (void *ctx, struct spdk_json_write_ctx *w)

Output driver-specific information to a JSON stream.

Optional - may be NULL.

The JSON write context will be initialized with an open object, so the bdev driver should write a name (based on the driver name) followed by a JSON value (most likely another nested object).

◆ get_memory_domains

int(* spdk_bdev_fn_table::get_memory_domains) (void *ctx, struct spdk_memory_domain **domains, int array_size)

Get memory domains used by bdev.

Optional - may be NULL. Vbdev module implementation should call spdk_bdev_get_memory_domains for underlying bdev. Vbdev module must inspect types of memory domains returned by base bdev and report only those memory domains that it can work with.

◆ get_spin_time

uint64_t(* spdk_bdev_fn_table::get_spin_time) (struct spdk_io_channel *ch)

Get spin-time per I/O channel in microseconds.

Optional - may be NULL.

◆ write_config_json

void(* spdk_bdev_fn_table::write_config_json) (struct spdk_bdev *bdev, struct spdk_json_write_ctx *w)

Output bdev-specific RPC configuration to a JSON stream.

Optional - may be NULL.

This function should only be implemented for bdevs which can be configured independently of other bdevs. For example, RPCs to create a bdev for an NVMe namespace may not be generated by this function, since enumerating an NVMe namespace requires attaching to an NVMe controller, and that controller may contain multiple namespaces. The spdk_bdev_module's config_json function should be used instead for these cases.

The JSON write context will be initialized with an open object, so the bdev driver should write all data necessary to recreate this bdev by invoking constructor method. No other data should be written.


The documentation for this struct was generated from the following file: