157 #define RTE_DMADEV_DEFAULT_MAX 64 216 #define RTE_DMA_FOREACH_DEV(p) \ 217 for (p = rte_dma_next_dev(0); \ 219 p = rte_dma_next_dev(p + 1)) 226 #define RTE_DMA_CAPA_MEM_TO_MEM RTE_BIT64(0) 228 #define RTE_DMA_CAPA_MEM_TO_DEV RTE_BIT64(1) 230 #define RTE_DMA_CAPA_DEV_TO_MEM RTE_BIT64(2) 232 #define RTE_DMA_CAPA_DEV_TO_DEV RTE_BIT64(3) 239 #define RTE_DMA_CAPA_SVA RTE_BIT64(4) 245 #define RTE_DMA_CAPA_SILENT RTE_BIT64(5) 253 #define RTE_DMA_CAPA_HANDLES_ERRORS RTE_BIT64(6) 260 #define RTE_DMA_CAPA_M2D_AUTO_FREE RTE_BIT64(7) 266 #define RTE_DMA_CAPA_OPS_COPY RTE_BIT64(32) 268 #define RTE_DMA_CAPA_OPS_COPY_SG RTE_BIT64(33) 270 #define RTE_DMA_CAPA_OPS_FILL RTE_BIT64(34) 522 uint64_t reserved[2];
542 uint64_t reserved[2];
624 #define RTE_DMA_ALL_VCHAN 0xFFFFu 789 #define RTE_DMA_OP_FLAG_FENCE RTE_BIT64(0) 794 #define RTE_DMA_OP_FLAG_SUBMIT RTE_BIT64(1) 799 #define RTE_DMA_OP_FLAG_LLC RTE_BIT64(2) 806 #define RTE_DMA_OP_FLAG_AUTO_FREE RTE_BIT64(3) 837 uint32_t length, uint64_t flags)
839 struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id];
842 #ifdef RTE_DMADEV_DEBUG 845 if (*obj->copy == NULL)
849 ret = (*obj->copy)(obj->dev_private, vchan, src, dst, length, flags);
850 rte_dma_trace_copy(dev_id, vchan, src, dst, length, flags, ret);
887 struct rte_dma_sge *dst, uint16_t nb_src, uint16_t nb_dst,
890 struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id];
893 #ifdef RTE_DMADEV_DEBUG 895 nb_src == 0 || nb_dst == 0)
897 if (*obj->copy_sg == NULL)
901 ret = (*obj->copy_sg)(obj->dev_private, vchan, src, dst, nb_src,
903 rte_dma_trace_copy_sg(dev_id, vchan, src, dst, nb_src, nb_dst, flags,
937 rte_iova_t dst, uint32_t length, uint64_t flags)
939 struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id];
942 #ifdef RTE_DMADEV_DEBUG 945 if (*obj->fill == NULL)
949 ret = (*obj->fill)(obj->dev_private, vchan, pattern, dst, length,
951 rte_dma_trace_fill(dev_id, vchan, pattern, dst, length, flags, ret);
973 struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id];
976 #ifdef RTE_DMADEV_DEBUG 979 if (*obj->submit == NULL)
983 ret = (*obj->submit)(obj->dev_private, vchan);
984 rte_dma_trace_submit(dev_id, vchan, ret);
1011 static inline uint16_t
1013 uint16_t *last_idx,
bool *has_error)
1015 struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id];
1019 #ifdef RTE_DMADEV_DEBUG 1022 if (*obj->completed == NULL)
1034 if (last_idx == NULL)
1036 if (has_error == NULL)
1040 ret = (*obj->completed)(obj->dev_private, vchan, nb_cpls, last_idx,
1042 rte_dma_trace_completed(dev_id, vchan, nb_cpls, last_idx, has_error,
1074 static inline uint16_t
1076 const uint16_t nb_cpls, uint16_t *last_idx,
1079 struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id];
1082 #ifdef RTE_DMADEV_DEBUG 1085 if (*obj->completed_status == NULL)
1089 if (last_idx == NULL)
1092 ret = (*obj->completed_status)(obj->dev_private, vchan, nb_cpls,
1094 rte_dma_trace_completed_status(dev_id, vchan, nb_cpls, last_idx, status,
1112 static inline uint16_t
1115 struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id];
1118 #ifdef RTE_DMADEV_DEBUG 1121 if (*obj->burst_capacity == NULL)
1124 ret = (*obj->burst_capacity)(obj->dev_private, vchan);
1125 rte_dma_trace_burst_capacity(dev_id, vchan, ret);
int rte_dma_configure(int16_t dev_id, const struct rte_dma_conf *dev_conf)
uint16_t rte_dma_count_avail(void)
int rte_dma_stats_get(int16_t dev_id, uint16_t vchan, struct rte_dma_stats *stats)
int rte_dma_start(int16_t dev_id)
int rte_dma_stop(int16_t dev_id)
static int rte_dma_copy_sg(int16_t dev_id, uint16_t vchan, struct rte_dma_sge *src, struct rte_dma_sge *dst, uint16_t nb_src, uint16_t nb_dst, uint64_t flags)
int rte_dma_stats_reset(int16_t dev_id, uint16_t vchan)
static int rte_dma_copy(int16_t dev_id, uint16_t vchan, rte_iova_t src, rte_iova_t dst, uint32_t length, uint64_t flags)
bool rte_dma_is_valid(int16_t dev_id)
int rte_dma_get_dev_id_by_name(const char *name)
int rte_dma_close(int16_t dev_id)
int rte_dma_dev_max(size_t dev_max)
int16_t rte_dma_next_dev(int16_t start_dev_id)
int rte_dma_dump(int16_t dev_id, FILE *f)
static int rte_dma_submit(int16_t dev_id, uint16_t vchan)
int rte_dma_info_get(int16_t dev_id, struct rte_dma_info *dev_info)
int rte_dma_vchan_setup(int16_t dev_id, uint16_t vchan, const struct rte_dma_vchan_conf *conf)
static uint16_t rte_dma_completed_status(int16_t dev_id, uint16_t vchan, const uint16_t nb_cpls, uint16_t *last_idx, enum rte_dma_status_code *status)
static uint16_t rte_dma_burst_capacity(int16_t dev_id, uint16_t vchan)
static int rte_dma_fill(int16_t dev_id, uint16_t vchan, uint64_t pattern, rte_iova_t dst, uint32_t length, uint64_t flags)
static uint16_t rte_dma_completed(int16_t dev_id, uint16_t vchan, const uint16_t nb_cpls, uint16_t *last_idx, bool *has_error)
struct rte_mempool * pool