sched: move grinder configuration
[dpdk.git] / lib / dmadev / rte_dmadev_pmd.h
index d6d2161..82ab7a8 100644 (file)
@@ -14,6 +14,8 @@
  * by any application.
  */
 
+#include <rte_dev.h>
+
 #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,25 +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