151 #include <rte_compat.h> 158 #define RTE_DMADEV_DEFAULT_MAX 64 234 #define RTE_DMA_FOREACH_DEV(p) \ 235 for (p = rte_dma_next_dev(0); \ 237 p = rte_dma_next_dev(p + 1)) 244 #define RTE_DMA_CAPA_MEM_TO_MEM RTE_BIT64(0) 246 #define RTE_DMA_CAPA_MEM_TO_DEV RTE_BIT64(1) 248 #define RTE_DMA_CAPA_DEV_TO_MEM RTE_BIT64(2) 250 #define RTE_DMA_CAPA_DEV_TO_DEV RTE_BIT64(3) 257 #define RTE_DMA_CAPA_SVA RTE_BIT64(4) 263 #define RTE_DMA_CAPA_SILENT RTE_BIT64(5) 271 #define RTE_DMA_CAPA_HANDLES_ERRORS RTE_BIT64(6) 276 #define RTE_DMA_CAPA_OPS_COPY RTE_BIT64(32) 278 #define RTE_DMA_CAPA_OPS_COPY_SG RTE_BIT64(33) 280 #define RTE_DMA_CAPA_OPS_FILL RTE_BIT64(34) 553 uint64_t reserved[2];
631 #define RTE_DMA_ALL_VCHAN 0xFFFFu 811 #define RTE_DMA_OP_FLAG_FENCE RTE_BIT64(0) 816 #define RTE_DMA_OP_FLAG_SUBMIT RTE_BIT64(1) 821 #define RTE_DMA_OP_FLAG_LLC RTE_BIT64(2) 856 uint32_t length, uint64_t flags)
858 struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id];
860 #ifdef RTE_DMADEV_DEBUG 863 RTE_FUNC_PTR_OR_ERR_RET(*obj->copy, -ENOTSUP);
866 return (*obj->copy)(obj->dev_private, vchan, src, dst, length, flags);
905 struct rte_dma_sge *dst, uint16_t nb_src, uint16_t nb_dst,
908 struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id];
910 #ifdef RTE_DMADEV_DEBUG 912 nb_src == 0 || nb_dst == 0)
914 RTE_FUNC_PTR_OR_ERR_RET(*obj->copy_sg, -ENOTSUP);
917 return (*obj->copy_sg)(obj->dev_private, vchan, src, dst, nb_src,
953 rte_iova_t dst, uint32_t length, uint64_t flags)
955 struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id];
957 #ifdef RTE_DMADEV_DEBUG 960 RTE_FUNC_PTR_OR_ERR_RET(*obj->fill, -ENOTSUP);
963 return (*obj->fill)(obj->dev_private, vchan, pattern, dst, length,
988 struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id];
990 #ifdef RTE_DMADEV_DEBUG 993 RTE_FUNC_PTR_OR_ERR_RET(*obj->submit, -ENOTSUP);
996 return (*obj->submit)(obj->dev_private, vchan);
1023 static inline uint16_t
1025 uint16_t *last_idx,
bool *has_error)
1027 struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id];
1031 #ifdef RTE_DMADEV_DEBUG 1034 RTE_FUNC_PTR_OR_ERR_RET(*obj->completed, 0);
1045 if (last_idx == NULL)
1047 if (has_error == NULL)
1051 return (*obj->completed)(obj->dev_private, vchan, nb_cpls, last_idx,
1083 static inline uint16_t
1085 const uint16_t nb_cpls, uint16_t *last_idx,
1088 struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id];
1091 #ifdef RTE_DMADEV_DEBUG 1094 RTE_FUNC_PTR_OR_ERR_RET(*obj->completed_status, 0);
1097 if (last_idx == NULL)
1100 return (*obj->completed_status)(obj->dev_private, vchan, nb_cpls,
1120 static inline uint16_t
1123 struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id];
1125 #ifdef RTE_DMADEV_DEBUG 1128 RTE_FUNC_PTR_OR_ERR_RET(*obj->burst_capacity, 0);
1130 return (*obj->burst_capacity)(obj->dev_private, vchan);
__rte_experimental uint16_t rte_dma_count_avail(void)
__rte_experimental int rte_dma_dump(int16_t dev_id, FILE *f)
__rte_experimental bool rte_dma_is_valid(int16_t dev_id)
__rte_experimental int rte_dma_info_get(int16_t dev_id, struct rte_dma_info *dev_info)
static __rte_experimental 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)
__rte_experimental int rte_dma_get_dev_id_by_name(const char *name)
__rte_experimental int rte_dma_vchan_setup(int16_t dev_id, uint16_t vchan, const struct rte_dma_vchan_conf *conf)
static __rte_experimental 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)
__rte_experimental int rte_dma_stats_get(int16_t dev_id, uint16_t vchan, struct rte_dma_stats *stats)
__rte_experimental int rte_dma_stop(int16_t dev_id)
__rte_experimental int16_t rte_dma_next_dev(int16_t start_dev_id)
static __rte_experimental uint16_t rte_dma_completed(int16_t dev_id, uint16_t vchan, const uint16_t nb_cpls, uint16_t *last_idx, bool *has_error)
__rte_experimental int rte_dma_close(int16_t dev_id)
static __rte_experimental 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)
__rte_experimental int rte_dma_stats_reset(int16_t dev_id, uint16_t vchan)
__rte_experimental int rte_dma_start(int16_t dev_id)
static __rte_experimental uint16_t rte_dma_burst_capacity(int16_t dev_id, uint16_t vchan)
__rte_experimental int rte_dma_dev_max(size_t dev_max)
static __rte_experimental int rte_dma_fill(int16_t dev_id, uint16_t vchan, uint64_t pattern, rte_iova_t dst, uint32_t length, uint64_t flags)
__rte_experimental int rte_dma_configure(int16_t dev_id, const struct rte_dma_conf *dev_conf)
static __rte_experimental int rte_dma_submit(int16_t dev_id, uint16_t vchan)