return 0;
}
+int16_t
+rte_dma_next_dev(int16_t start_dev_id)
+{
+ int16_t dev_id = start_dev_id;
+ while (dev_id < dma_devices_max && rte_dma_devices[dev_id].state == RTE_DMA_DEV_UNUSED)
+ dev_id++;
+
+ if (dev_id < dma_devices_max)
+ return dev_id;
+
+ return -1;
+}
+
static int
dma_check_name(const char *name)
{
__rte_experimental
uint16_t rte_dma_count_avail(void);
+/**
+ * Iterates over valid dmadev instances.
+ *
+ * @param start_dev_id
+ * The id of the next possible dmadev.
+ * @return
+ * Next valid dmadev, UINT16_MAX if there is none.
+ */
+__rte_experimental
+int16_t rte_dma_next_dev(int16_t start_dev_id);
+
+/** Utility macro to iterate over all available dmadevs */
+#define RTE_DMA_FOREACH_DEV(p) \
+ for (p = rte_dma_next_dev(0); \
+ p != -1; \
+ p = rte_dma_next_dev(p + 1))
+
+
/**@{@name DMA capability
* @see struct rte_dma_info::dev_capa
*/