X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fdmadev%2Frte_dmadev_pmd.h;h=82ab7a8cc7a7858447cc87b0e8d2bcef0c5c3243;hb=ec487c189686ee9b3b7551d3aca138cec3f91e74;hp=5fcf0f60b8e374eb5f221c46163f9ed0bedc55e3;hpb=e0180db144f843795aad11765c779c4beb544339;p=dpdk.git diff --git a/lib/dmadev/rte_dmadev_pmd.h b/lib/dmadev/rte_dmadev_pmd.h index 5fcf0f60b8..82ab7a8cc7 100644 --- a/lib/dmadev/rte_dmadev_pmd.h +++ b/lib/dmadev/rte_dmadev_pmd.h @@ -14,6 +14,8 @@ * by any application. */ +#include + #include "rte_dmadev.h" #ifdef __cplusplus @@ -54,6 +56,10 @@ typedef int (*rte_dma_stats_get_t)(const struct rte_dma_dev *dev, /** @internal Used to reset basic statistics. */ typedef int (*rte_dma_stats_reset_t)(struct rte_dma_dev *dev, uint16_t vchan); +/** @internal Used to check if a virtual channel has finished all jobs. */ +typedef int (*rte_dma_vchan_status_t)(const struct rte_dma_dev *dev, uint16_t vchan, + enum rte_dma_vchan_status *status); + /** @internal Used to dump internal information. */ typedef int (*rte_dma_dump_t)(const struct rte_dma_dev *dev, FILE *f); @@ -74,8 +80,30 @@ struct rte_dma_dev_ops { rte_dma_stats_get_t stats_get; rte_dma_stats_reset_t stats_reset; + rte_dma_vchan_status_t vchan_status; rte_dma_dump_t dev_dump; }; + +/** + * @internal + * The data part, with no function pointers, associated with each DMA device. + * + * This structure is safe to place in shared memory to be common among different + * processes in a multi-process configuration. + * + * @see struct rte_dma_dev::data + */ +struct rte_dma_dev_data { + char dev_name[RTE_DEV_NAME_MAX_LEN]; /**< Unique identifier name */ + int16_t dev_id; /**< Device [external] identifier. */ + int16_t numa_node; /**< Local NUMA memory ID. -1 if unknown. */ + void *dev_private; /**< PMD-specific private data. */ + struct rte_dma_conf dev_conf; /**< DMA device configuration. */ + __extension__ + uint8_t dev_started : 1; /**< Device state: STARTED(1)/STOPPED(0). */ + uint64_t reserved[2]; /**< Reserved for future fields */ +} __rte_cache_aligned; + /** * Possible states of a DMA device. * @@ -94,23 +122,17 @@ enum rte_dma_dev_state { * The generic data structure associated with each DMA device. */ struct rte_dma_dev { - char dev_name[RTE_DEV_NAME_MAX_LEN]; /**< Unique identifier name */ - int16_t dev_id; /**< Device [external] identifier. */ - int16_t numa_node; /**< Local NUMA memory ID. -1 if unknown. */ - void *dev_private; /**< PMD-specific private data. */ /** Device info which supplied during device initialization. */ struct rte_device *device; + struct rte_dma_dev_data *data; /**< Pointer to shared device data. */ + /**< Fast-path functions and related data. */ + struct rte_dma_fp_object *fp_obj; /** Functions implemented by PMD. */ const struct rte_dma_dev_ops *dev_ops; - struct rte_dma_conf dev_conf; /**< DMA device configuration. */ enum rte_dma_dev_state state; /**< Flag indicating the device state. */ - __extension__ - uint8_t dev_started : 1; /**< Device state: STARTED(1)/STOPPED(0). */ uint64_t reserved[2]; /**< Reserved for future fields. */ } __rte_cache_aligned; -extern struct rte_dma_dev *rte_dma_devices; - /** * @internal * Allocate a new dmadev slot for an DMA device and return the pointer to that