Loading include/spdk/ioat.h +32 −0 Original line number Diff line number Diff line Loading @@ -54,18 +54,27 @@ struct spdk_ioat_chan; /** * Signature for callback function invoked when a request is completed. * * \param arg User-specified opaque value corresponding to cb_arg from the request submission. */ typedef void (*spdk_ioat_req_cb)(void *arg); /** * Callback for spdk_ioat_probe() enumeration. * * \param cb_ctx User-specified opaque value corresponding to cb_ctx from spdk_ioat_probe(). * \param pci_dev PCI device that is being probed. * * \return true to attach to this device. */ typedef bool (*spdk_ioat_probe_cb)(void *cb_ctx, struct spdk_pci_device *pci_dev); /** * Callback for spdk_ioat_probe() to report a device that has been attached to the userspace I/OAT driver. * * \param cb_ctx User-specified opaque value corresponding to cb_ctx from spdk_ioat_probe(). * \param pci_dev PCI device that was attached to the driver. * \param ioat I/OAT channel that was attached to the driver. */ typedef void (*spdk_ioat_attach_cb)(void *cb_ctx, struct spdk_pci_device *pci_dev, struct spdk_ioat_chan *ioat); Loading @@ -74,6 +83,7 @@ typedef void (*spdk_ioat_attach_cb)(void *cb_ctx, struct spdk_pci_device *pci_de * \brief Enumerate the I/OAT devices attached to the system and attach the userspace I/OAT driver * to them if desired. * * \param cb_ctx Opaque value which will be passed back in cb_ctx parameter of the callbacks. * \param probe_cb will be called once per I/OAT device found in the system. * \param attach_cb will be called for devices for which probe_cb returned true once the I/OAT * controller has been attached to the userspace driver. Loading @@ -88,11 +98,20 @@ int spdk_ioat_probe(void *cb_ctx, spdk_ioat_probe_cb probe_cb, spdk_ioat_attach_ /** * Detaches specified device returned by \ref spdk_ioat_probe() from the I/OAT driver. * * \param ioat I/OAT channel to detach from the driver. */ int spdk_ioat_detach(struct spdk_ioat_chan *ioat); /** * Submit a DMA engine memory copy request. * * \param chan I/OAT channel to submit request. * \param cb_arg Opaque value which will be passed back as the arg parameter in the completion callback. * \param cb_fn Callback function which will be called when the request is complete. * \param dst Destination virtual address. * \param src Source virtual address. * \param nbytes Number of bytes to copy. */ int64_t spdk_ioat_submit_copy(struct spdk_ioat_chan *chan, void *cb_arg, spdk_ioat_req_cb cb_fn, Loading @@ -100,6 +119,13 @@ int64_t spdk_ioat_submit_copy(struct spdk_ioat_chan *chan, /** * Submit a DMA engine memory fill request. * * \param chan I/OAT channel to submit request. * \param cb_arg Opaque value which will be passed back as the cb_arg parameter in the completion callback. * \param cb_fn Callback function which will be called when the request is complete. * \param dst Destination virtual address. * \param fill_pattern Repeating eight-byte pattern to use for memory fill. * \param nbytes Number of bytes to fill. */ int64_t spdk_ioat_submit_fill(struct spdk_ioat_chan *chan, void *cb_arg, spdk_ioat_req_cb cb_fn, Loading @@ -108,6 +134,8 @@ int64_t spdk_ioat_submit_fill(struct spdk_ioat_chan *chan, /** * Check for completed requests on an I/OAT channel. * * \param chan I/OAT channel to check for completions. * * \returns 0 on success or negative if something went wrong. */ int spdk_ioat_process_events(struct spdk_ioat_chan *chan); Loading @@ -122,6 +150,10 @@ enum spdk_ioat_dma_capability_flags { /** * Get the DMA engine capabilities. * * \param chan I/OAT channel to query. * * \return A combination of flags from \ref spdk_ioat_dma_capability_flags. */ uint32_t spdk_ioat_get_dma_capabilities(struct spdk_ioat_chan *chan); Loading Loading
include/spdk/ioat.h +32 −0 Original line number Diff line number Diff line Loading @@ -54,18 +54,27 @@ struct spdk_ioat_chan; /** * Signature for callback function invoked when a request is completed. * * \param arg User-specified opaque value corresponding to cb_arg from the request submission. */ typedef void (*spdk_ioat_req_cb)(void *arg); /** * Callback for spdk_ioat_probe() enumeration. * * \param cb_ctx User-specified opaque value corresponding to cb_ctx from spdk_ioat_probe(). * \param pci_dev PCI device that is being probed. * * \return true to attach to this device. */ typedef bool (*spdk_ioat_probe_cb)(void *cb_ctx, struct spdk_pci_device *pci_dev); /** * Callback for spdk_ioat_probe() to report a device that has been attached to the userspace I/OAT driver. * * \param cb_ctx User-specified opaque value corresponding to cb_ctx from spdk_ioat_probe(). * \param pci_dev PCI device that was attached to the driver. * \param ioat I/OAT channel that was attached to the driver. */ typedef void (*spdk_ioat_attach_cb)(void *cb_ctx, struct spdk_pci_device *pci_dev, struct spdk_ioat_chan *ioat); Loading @@ -74,6 +83,7 @@ typedef void (*spdk_ioat_attach_cb)(void *cb_ctx, struct spdk_pci_device *pci_de * \brief Enumerate the I/OAT devices attached to the system and attach the userspace I/OAT driver * to them if desired. * * \param cb_ctx Opaque value which will be passed back in cb_ctx parameter of the callbacks. * \param probe_cb will be called once per I/OAT device found in the system. * \param attach_cb will be called for devices for which probe_cb returned true once the I/OAT * controller has been attached to the userspace driver. Loading @@ -88,11 +98,20 @@ int spdk_ioat_probe(void *cb_ctx, spdk_ioat_probe_cb probe_cb, spdk_ioat_attach_ /** * Detaches specified device returned by \ref spdk_ioat_probe() from the I/OAT driver. * * \param ioat I/OAT channel to detach from the driver. */ int spdk_ioat_detach(struct spdk_ioat_chan *ioat); /** * Submit a DMA engine memory copy request. * * \param chan I/OAT channel to submit request. * \param cb_arg Opaque value which will be passed back as the arg parameter in the completion callback. * \param cb_fn Callback function which will be called when the request is complete. * \param dst Destination virtual address. * \param src Source virtual address. * \param nbytes Number of bytes to copy. */ int64_t spdk_ioat_submit_copy(struct spdk_ioat_chan *chan, void *cb_arg, spdk_ioat_req_cb cb_fn, Loading @@ -100,6 +119,13 @@ int64_t spdk_ioat_submit_copy(struct spdk_ioat_chan *chan, /** * Submit a DMA engine memory fill request. * * \param chan I/OAT channel to submit request. * \param cb_arg Opaque value which will be passed back as the cb_arg parameter in the completion callback. * \param cb_fn Callback function which will be called when the request is complete. * \param dst Destination virtual address. * \param fill_pattern Repeating eight-byte pattern to use for memory fill. * \param nbytes Number of bytes to fill. */ int64_t spdk_ioat_submit_fill(struct spdk_ioat_chan *chan, void *cb_arg, spdk_ioat_req_cb cb_fn, Loading @@ -108,6 +134,8 @@ int64_t spdk_ioat_submit_fill(struct spdk_ioat_chan *chan, /** * Check for completed requests on an I/OAT channel. * * \param chan I/OAT channel to check for completions. * * \returns 0 on success or negative if something went wrong. */ int spdk_ioat_process_events(struct spdk_ioat_chan *chan); Loading @@ -122,6 +150,10 @@ enum spdk_ioat_dma_capability_flags { /** * Get the DMA engine capabilities. * * \param chan I/OAT channel to query. * * \return A combination of flags from \ref spdk_ioat_dma_capability_flags. */ uint32_t spdk_ioat_get_dma_capabilities(struct spdk_ioat_chan *chan); Loading