DPDK 21.11.9
rte_dmadev_pmd.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2021 HiSilicon Limited
3 */
4
5#ifndef RTE_DMADEV_PMD_H
6#define RTE_DMADEV_PMD_H
7
17#include <rte_dev.h>
18
19#include "rte_dmadev.h"
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25struct rte_dma_dev;
26
28typedef int (*rte_dma_info_get_t)(const struct rte_dma_dev *dev,
29 struct rte_dma_info *dev_info,
30 uint32_t info_sz);
31
33typedef int (*rte_dma_configure_t)(struct rte_dma_dev *dev,
34 const struct rte_dma_conf *dev_conf,
35 uint32_t conf_sz);
36
38typedef int (*rte_dma_start_t)(struct rte_dma_dev *dev);
39
41typedef int (*rte_dma_stop_t)(struct rte_dma_dev *dev);
42
44typedef int (*rte_dma_close_t)(struct rte_dma_dev *dev);
45
47typedef int (*rte_dma_vchan_setup_t)(struct rte_dma_dev *dev, uint16_t vchan,
48 const struct rte_dma_vchan_conf *conf,
49 uint32_t conf_sz);
50
52typedef int (*rte_dma_stats_get_t)(const struct rte_dma_dev *dev,
53 uint16_t vchan, struct rte_dma_stats *stats,
54 uint32_t stats_sz);
55
57typedef int (*rte_dma_stats_reset_t)(struct rte_dma_dev *dev, uint16_t vchan);
58
60typedef int (*rte_dma_vchan_status_t)(const struct rte_dma_dev *dev, uint16_t vchan,
61 enum rte_dma_vchan_status *status);
62
64typedef int (*rte_dma_dump_t)(const struct rte_dma_dev *dev, FILE *f);
65
72 rte_dma_info_get_t dev_info_get;
73 rte_dma_configure_t dev_configure;
74 rte_dma_start_t dev_start;
75 rte_dma_stop_t dev_stop;
76 rte_dma_close_t dev_close;
77
78 rte_dma_vchan_setup_t vchan_setup;
79
80 rte_dma_stats_get_t stats_get;
81 rte_dma_stats_reset_t stats_reset;
82
83 rte_dma_vchan_status_t vchan_status;
84 rte_dma_dump_t dev_dump;
85};
86
96struct rte_dma_dev_data {
97 char dev_name[RTE_DEV_NAME_MAX_LEN];
98 int16_t dev_id;
99 int16_t numa_node;
100 void *dev_private;
101 struct rte_dma_conf dev_conf;
102 __extension__
103 uint8_t dev_started : 1;
104 uint64_t reserved[2];
106
118};
119
124struct rte_dma_dev {
126 struct rte_device *device;
127 struct rte_dma_dev_data *data;
129 struct rte_dma_fp_object *fp_obj;
131 const struct rte_dma_dev_ops *dev_ops;
132 enum rte_dma_dev_state state;
133 uint64_t reserved[2];
135
152__rte_internal
153struct rte_dma_dev *rte_dma_pmd_allocate(const char *name, int numa_node,
154 size_t private_data_size);
155
166__rte_internal
167int rte_dma_pmd_release(const char *name);
168
169#ifdef __cplusplus
170}
171#endif
172
173#endif /* RTE_DMADEV_PMD_H */
#define __rte_cache_aligned
Definition: rte_common.h:420
rte_dma_vchan_status
Definition: rte_dmadev.h:680
void * dev_private
rte_dma_dev_state
@ RTE_DMA_DEV_REGISTERED
@ RTE_DMA_DEV_READY
@ RTE_DMA_DEV_UNUSED