IDXD driver public interface. More...
Macros | |
#define | SPDK_IDXD_FLAG_NONTEMPORAL IDXD_FLAG_CACHE_CONTROL |
Typedefs | |
typedef void(* | spdk_idxd_req_cb) (void *arg, int status) |
Signature for callback function invoked when a request is completed. | |
typedef void(* | spdk_idxd_attach_cb) (void *cb_ctx, struct spdk_idxd_device *idxd) |
Callback for spdk_idxd_probe() to report a device that has been attached to the userspace IDXD driver. | |
typedef bool(* | spdk_idxd_probe_cb) (void *cb_ctx, struct spdk_pci_device *dev) |
Callback for spdk_idxd_probe() to report a device that has been found. | |
Functions | |
uint32_t | spdk_idxd_get_socket (struct spdk_idxd_device *idxd) |
Get the socket that this device is on. | |
int | spdk_idxd_probe (void *cb_ctx, spdk_idxd_attach_cb attach_cb, spdk_idxd_probe_cb probe_cb) |
Enumerate the IDXD devices attached to the system and attach the userspace IDXD driver to them if desired. | |
void | spdk_idxd_detach (struct spdk_idxd_device *idxd) |
Detach specified device returned by spdk_idxd_probe() from the IDXD driver. | |
int | spdk_idxd_set_config (bool kernel_mode) |
Sets the IDXD configuration. | |
int | spdk_idxd_submit_copy (struct spdk_idxd_io_channel *chan, struct iovec *diov, uint32_t diovcnt, struct iovec *siov, uint32_t siovcnt, int flags, spdk_idxd_req_cb cb_fn, void *cb_arg) |
Build and submit an idxd memory copy request. | |
int | spdk_idxd_submit_dualcast (struct spdk_idxd_io_channel *chan, void *dst1, void *dst2, const void *src, uint64_t nbytes, int flags, spdk_idxd_req_cb cb_fn, void *cb_arg) |
Build and submit an idxd dualcast request. | |
int | spdk_idxd_submit_compare (struct spdk_idxd_io_channel *chan, struct iovec *siov1, size_t siov1cnt, struct iovec *siov2, size_t siov2cnt, int flags, spdk_idxd_req_cb cb_fn, void *cb_arg) |
Build and submit a memory compare request. | |
int | spdk_idxd_submit_fill (struct spdk_idxd_io_channel *chan, struct iovec *diov, size_t diovcnt, uint64_t fill_pattern, int flags, spdk_idxd_req_cb cb_fn, void *cb_arg) |
Build and submit a idxd memory fill request. | |
int | spdk_idxd_submit_crc32c (struct spdk_idxd_io_channel *chan, struct iovec *siov, size_t siovcnt, uint32_t seed, uint32_t *crc_dst, int flags, spdk_idxd_req_cb cb_fn, void *cb_arg) |
Build and submit a memory CRC32-C request. | |
int | spdk_idxd_submit_copy_crc32c (struct spdk_idxd_io_channel *chan, struct iovec *diov, size_t diovcnt, struct iovec *siov, size_t siovcnt, uint32_t seed, uint32_t *crc_dst, int flags, spdk_idxd_req_cb cb_fn, void *cb_arg) |
Build and submit a copy combined with CRC32-C request. | |
int | spdk_idxd_submit_compress (struct spdk_idxd_io_channel *chan, void *dst, uint64_t nbytes, struct iovec *siov, uint32_t siovcnt, uint32_t *output_size, int flags, spdk_idxd_req_cb cb_fn, void *cb_arg) |
Build and submit an IAA memory compress request. | |
int | spdk_idxd_submit_decompress (struct spdk_idxd_io_channel *chan, struct iovec *diov, uint32_t diovcnt, struct iovec *siov, uint32_t siovcnt, int flags, spdk_idxd_req_cb cb_fn, void *cb_arg) |
Build and submit an IAA memory decompress request. | |
int | spdk_idxd_submit_dif_check (struct spdk_idxd_io_channel *chan, struct iovec *siov, size_t siovcnt, uint32_t num_blocks, const struct spdk_dif_ctx *ctx, int flags, spdk_idxd_req_cb cb_fn, void *cb_arg) |
Build and submit a DIF check request. | |
int | spdk_idxd_submit_dif_insert (struct spdk_idxd_io_channel *chan, struct iovec *diov, size_t diovcnt, struct iovec *siov, size_t siovcnt, uint32_t num_blocks, const struct spdk_dif_ctx *ctx, int flags, spdk_idxd_req_cb cb_fn, void *cb_arg) |
Build and submit a DIF insert request. | |
int | spdk_idxd_submit_dif_strip (struct spdk_idxd_io_channel *chan, struct iovec *diov, size_t diovcnt, struct iovec *siov, size_t siovcnt, uint32_t num_blocks, const struct spdk_dif_ctx *ctx, int flags, spdk_idxd_req_cb cb_fn, void *cb_arg) |
Build and submit a DIF strip request. | |
int | spdk_idxd_submit_raw_desc (struct spdk_idxd_io_channel *chan, struct idxd_hw_desc *desc, spdk_idxd_req_cb cb_fn, void *cb_arg) |
Build and submit an IDXD raw request. | |
int | spdk_idxd_process_events (struct spdk_idxd_io_channel *chan) |
Check for completed requests on an IDXD channel. | |
struct spdk_idxd_io_channel * | spdk_idxd_get_channel (struct spdk_idxd_device *idxd) |
Returns an IDXD channel for a given IDXD device. | |
void | spdk_idxd_put_channel (struct spdk_idxd_io_channel *chan) |
Free an IDXD channel. | |
IDXD driver public interface.
typedef void(* spdk_idxd_attach_cb) (void *cb_ctx, struct spdk_idxd_device *idxd) |
Callback for spdk_idxd_probe() to report a device that has been attached to the userspace IDXD driver.
cb_ctx | User-specified opaque value corresponding to cb_ctx from spdk_idxd_probe(). |
idxd | IDXD device that was attached to the driver. |
typedef bool(* spdk_idxd_probe_cb) (void *cb_ctx, struct spdk_pci_device *dev) |
Callback for spdk_idxd_probe() to report a device that has been found.
cb_ctx | User-specified opaque value corresponding to cb_ctx from spdk_idxd_probe(). |
dev | PCI device that is in question. |
typedef void(* spdk_idxd_req_cb) (void *arg, int status) |
Signature for callback function invoked when a request is completed.
arg | User-specified opaque value corresponding to cb_arg from the request submission. |
status | 0 on success, negative errno on failure. |
void spdk_idxd_detach | ( | struct spdk_idxd_device * | idxd | ) |
Detach specified device returned by spdk_idxd_probe() from the IDXD driver.
idxd | IDXD device to detach from the driver. |
struct spdk_idxd_io_channel * spdk_idxd_get_channel | ( | struct spdk_idxd_device * | idxd | ) |
Returns an IDXD channel for a given IDXD device.
idxd | IDXD device to get a channel for. |
uint32_t spdk_idxd_get_socket | ( | struct spdk_idxd_device * | idxd | ) |
Get the socket that this device is on.
idxd | device to query |
int spdk_idxd_probe | ( | void * | cb_ctx, |
spdk_idxd_attach_cb | attach_cb, | ||
spdk_idxd_probe_cb | probe_cb ) |
Enumerate the IDXD devices attached to the system and attach the userspace IDXD driver to them if desired.
If called more than once, only devices that are not already attached to the SPDK IDXD driver will be reported.
To stop using the controller and release its associated resources, call spdk_idxd_detach() with the idxd_channel instance returned by this function.
cb_ctx | Opaque value which will be passed back in cb_ctx parameter of the callbacks. |
probe_cb | callback to determine if the device being probe should be attached. |
attach_cb | will be called for devices for which probe_cb returned true. once the IDXD controller has been attached to the userspace driver. |
int spdk_idxd_process_events | ( | struct spdk_idxd_io_channel * | chan | ) |
Check for completed requests on an IDXD channel.
chan | IDXD channel to check for completions. |
void spdk_idxd_put_channel | ( | struct spdk_idxd_io_channel * | chan | ) |
Free an IDXD channel.
chan | IDXD channel to free. |
int spdk_idxd_set_config | ( | bool | kernel_mode | ) |
Sets the IDXD configuration.
kernel_mode | true if using kernel driver. |
int spdk_idxd_submit_compare | ( | struct spdk_idxd_io_channel * | chan, |
struct iovec * | siov1, | ||
size_t | siov1cnt, | ||
struct iovec * | siov2, | ||
size_t | siov2cnt, | ||
int | flags, | ||
spdk_idxd_req_cb | cb_fn, | ||
void * | cb_arg ) |
Build and submit a memory compare request.
This function will build the compare descriptor and then immediately submit by writing to the proper device portal.
chan | IDXD channel to submit request. |
siov1 | First source iovec. |
siov1cnt | Number of elements in siov1. |
siov2 | Second source iovec. |
siov2cnt | Number of elements in siov2. |
flags | Flags, optional flags that can vary per operation. |
cb_fn | Callback function which will be called when the request is complete. |
cb_arg | Opaque value which will be passed back as the arg parameter in the completion callback. |
int spdk_idxd_submit_compress | ( | struct spdk_idxd_io_channel * | chan, |
void * | dst, | ||
uint64_t | nbytes, | ||
struct iovec * | siov, | ||
uint32_t | siovcnt, | ||
uint32_t * | output_size, | ||
int | flags, | ||
spdk_idxd_req_cb | cb_fn, | ||
void * | cb_arg ) |
Build and submit an IAA memory compress request.
This function will build the compress descriptor and then immediately submit by writing to the proper device portal.
chan | IDXD channel to submit request. |
dst | Destination to write the compressed data to. |
nbytes | Length in bytes. The dst buffer should be large enough to hold the compressed data. |
siov | Source iovec. |
siovcnt | Number of elements in siov. |
output_size | The size of the compressed data. |
flags | Flags, optional flags that can vary per operation. |
cb_fn | Callback function which will be called when the request is complete. |
cb_arg | Opaque value which will be passed back as the arg parameter in the completion callback. |
int spdk_idxd_submit_copy | ( | struct spdk_idxd_io_channel * | chan, |
struct iovec * | diov, | ||
uint32_t | diovcnt, | ||
struct iovec * | siov, | ||
uint32_t | siovcnt, | ||
int | flags, | ||
spdk_idxd_req_cb | cb_fn, | ||
void * | cb_arg ) |
Build and submit an idxd memory copy request.
This function will build the copy descriptor and then immediately submit by writing to the proper device portal.
chan | IDXD channel to submit request. |
diov | Destination iovec. |
diovcnt | Number of elements in diov. |
siov | Source iovec. |
siovcnt | Number of elements in siov. |
flags | Flags, optional flags that can vary per operation. |
cb_fn | Callback function which will be called when the request is complete. |
cb_arg | Opaque value which will be passed back as the arg parameter in the completion callback. |
int spdk_idxd_submit_copy_crc32c | ( | struct spdk_idxd_io_channel * | chan, |
struct iovec * | diov, | ||
size_t | diovcnt, | ||
struct iovec * | siov, | ||
size_t | siovcnt, | ||
uint32_t | seed, | ||
uint32_t * | crc_dst, | ||
int | flags, | ||
spdk_idxd_req_cb | cb_fn, | ||
void * | cb_arg ) |
Build and submit a copy combined with CRC32-C request.
This function will build the descriptor for copy plus CRC32-C and then immediately submit by writing to the proper device portal.
chan | IDXD channel to submit request. |
diov | Destination iovec. |
diovcnt | Number of elements in diov. |
siov | Source iovec. |
siovcnt | Number of elements in siov. |
seed | Four byte CRC-32C seed value. |
crc_dst | Resulting calculation. |
flags | Flags, optional flags that can vary per operation. |
cb_fn | Callback function which will be called when the request is complete. |
cb_arg | Opaque value which will be passed back as the cb_arg parameter in the completion callback. |
int spdk_idxd_submit_crc32c | ( | struct spdk_idxd_io_channel * | chan, |
struct iovec * | siov, | ||
size_t | siovcnt, | ||
uint32_t | seed, | ||
uint32_t * | crc_dst, | ||
int | flags, | ||
spdk_idxd_req_cb | cb_fn, | ||
void * | cb_arg ) |
Build and submit a memory CRC32-C request.
This function will build the CRC-32C descriptor and then immediately submit by writing to the proper device portal.
chan | IDXD channel to submit request. |
siov | Source iovec. |
siovcnt | Number of elements in siov. |
seed | Four byte CRC-32C seed value. |
crc_dst | Resulting calculation. |
flags | Flags, optional flags that can vary per operation. |
cb_fn | Callback function which will be called when the request is complete. |
cb_arg | Opaque value which will be passed back as the cb_arg parameter in the completion callback. |
int spdk_idxd_submit_decompress | ( | struct spdk_idxd_io_channel * | chan, |
struct iovec * | diov, | ||
uint32_t | diovcnt, | ||
struct iovec * | siov, | ||
uint32_t | siovcnt, | ||
int | flags, | ||
spdk_idxd_req_cb | cb_fn, | ||
void * | cb_arg ) |
Build and submit an IAA memory decompress request.
This function will build the decompress descriptor and then immediately submit by writing to the proper device portal.
chan | IDXD channel to submit request. |
diov | Destination iovec. diov with diovcnt must be large enough to hold decompressed data. |
diovcnt | Number of elements in diov for decompress buffer. |
siov | Source iovec. |
siovcnt | Number of elements in siov. |
flags | Flags, optional flags that can vary per operation. |
cb_fn | Callback function which will be called when the request is complete. |
cb_arg | Opaque value which will be passed back as the arg parameter in the completion callback. |
int spdk_idxd_submit_dif_check | ( | struct spdk_idxd_io_channel * | chan, |
struct iovec * | siov, | ||
size_t | siovcnt, | ||
uint32_t | num_blocks, | ||
const struct spdk_dif_ctx * | ctx, | ||
int | flags, | ||
spdk_idxd_req_cb | cb_fn, | ||
void * | cb_arg ) |
Build and submit a DIF check request.
This function will build the DIF check descriptor and then immediately submit by writing to the proper device portal.
chan | IDXD channel to submit request. |
siov | Source iovec. |
siovcnt | Number of elements in siov. |
num_blocks | Total number of blocks to process. |
ctx | DIF context. Contains the DIF configuration values, including the reference Application Tag value and initial value of the Reference Tag to check. |
flags | Flags, optional flags that can vary per operation. |
cb_fn | Callback function which will be called when the request is complete. |
cb_arg | Opaque value which will be passed back as the cb_arg parameter in the completion callback. |
int spdk_idxd_submit_dif_insert | ( | struct spdk_idxd_io_channel * | chan, |
struct iovec * | diov, | ||
size_t | diovcnt, | ||
struct iovec * | siov, | ||
size_t | siovcnt, | ||
uint32_t | num_blocks, | ||
const struct spdk_dif_ctx * | ctx, | ||
int | flags, | ||
spdk_idxd_req_cb | cb_fn, | ||
void * | cb_arg ) |
Build and submit a DIF insert request.
This function will build the DIF insert descriptor and then immediately submit by writing to the proper device portal.
chan | IDXD channel to submit request. |
diov | Destination iovec. |
diovcnt | Number of elements in diov. |
siov | Source iovec. |
siovcnt | Number of elements in siov. |
num_blocks | Total number of blocks to process. |
ctx | DIF context. Contains the DIF configuration values, including the reference Application Tag value and initial value of the Reference Tag to insert. |
flags | Flags, optional flags that can vary per operation. |
cb_fn | Callback function which will be called when the request is complete. |
cb_arg | Opaque value which will be passed back as the cb_arg parameter in the completion callback. |
int spdk_idxd_submit_dif_strip | ( | struct spdk_idxd_io_channel * | chan, |
struct iovec * | diov, | ||
size_t | diovcnt, | ||
struct iovec * | siov, | ||
size_t | siovcnt, | ||
uint32_t | num_blocks, | ||
const struct spdk_dif_ctx * | ctx, | ||
int | flags, | ||
spdk_idxd_req_cb | cb_fn, | ||
void * | cb_arg ) |
Build and submit a DIF strip request.
This function will build the DIF strip descriptor and then immediately submit by writing to the proper device portal. The transfer size must be a multiple of the source block size plus metadata for each source block. The number of bytes written to the destination is the transfer size minus metadata for each source block. The source and destination data can be scattered across several different buffers, but each source buffer has to be a multiple of a block size and each destination buffer has to be a multiple of a data block size excluding metadata. Moreover, the length of each element in the source array (siov) must be exactly the same as the corresponding element in the destination array (diov) excluding metadata size.
chan | IDXD channel to submit request. |
diov | Destination iovec. |
diovcnt | Number of elements in diov. |
siov | Source iovec. |
siovcnt | Number of elements in siov. |
num_blocks | Total number of blocks to process. |
ctx | DIF context. Contains the DIF configuration values, including the reference Application Tag value and initial value of the Reference Tag. |
flags | Flags, optional flags that can vary per operation. |
cb_fn | Callback function which will be called when the request is complete. |
cb_arg | Opaque value which will be passed back as the cb_arg parameter in the completion callback. |
int spdk_idxd_submit_dualcast | ( | struct spdk_idxd_io_channel * | chan, |
void * | dst1, | ||
void * | dst2, | ||
const void * | src, | ||
uint64_t | nbytes, | ||
int | flags, | ||
spdk_idxd_req_cb | cb_fn, | ||
void * | cb_arg ) |
Build and submit an idxd dualcast request.
This function will build the dual cast descriptor and then immediately submit by writing to the proper device portal.
chan | IDXD channel to submit request. |
dst1 | First destination virtual address (must be 4K aligned). |
dst2 | Second destination virtual address (must be 4K aligned). |
src | Source virtual address. |
nbytes | Number of bytes to copy. |
flags | Flags, optional flags that can vary per operation. |
cb_fn | Callback function which will be called when the request is complete. |
cb_arg | Opaque value which will be passed back as the arg parameter in the completion callback. |
int spdk_idxd_submit_fill | ( | struct spdk_idxd_io_channel * | chan, |
struct iovec * | diov, | ||
size_t | diovcnt, | ||
uint64_t | fill_pattern, | ||
int | flags, | ||
spdk_idxd_req_cb | cb_fn, | ||
void * | cb_arg ) |
Build and submit a idxd memory fill request.
This function will build the fill descriptor and then immediately submit by writing to the proper device portal.
chan | IDXD channel to submit request. |
diov | Destination iovec. |
diovcnt | Number of elements in diov. |
fill_pattern | Repeating eight-byte pattern to use for memory fill. |
flags | Flags, optional flags that can vary per operation. |
cb_fn | Callback function which will be called when the request is complete. |
cb_arg | Opaque value which will be passed back as the cb_arg parameter in the completion callback. |
int spdk_idxd_submit_raw_desc | ( | struct spdk_idxd_io_channel * | chan, |
struct idxd_hw_desc * | desc, | ||
spdk_idxd_req_cb | cb_fn, | ||
void * | cb_arg ) |
Build and submit an IDXD raw request.
This function will process the supplied descriptor and then immediately submit by writing to the proper device portal.
chan | IDXD channel to submit request. |
desc | properly formatted IDXD descriptor. Memory addresses should be physical. The completion address will be filled in by the lower level library. |
cb_fn | Callback function which will be called when the request is complete. |
cb_arg | Opaque value which will be passed back as the arg parameter in the completion callback. |