DPDK 22.11.7
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 <dev_driver.h>
18
19#include <rte_compat.h>
20#include "rte_dmadev.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26struct rte_dma_dev;
27
29typedef int (*rte_dma_info_get_t)(const struct rte_dma_dev *dev,
30 struct rte_dma_info *dev_info,
31 uint32_t info_sz);
32
34typedef int (*rte_dma_configure_t)(struct rte_dma_dev *dev,
35 const struct rte_dma_conf *dev_conf,
36 uint32_t conf_sz);
37
39typedef int (*rte_dma_start_t)(struct rte_dma_dev *dev);
40
42typedef int (*rte_dma_stop_t)(struct rte_dma_dev *dev);
43
45typedef int (*rte_dma_close_t)(struct rte_dma_dev *dev);
46
48typedef int (*rte_dma_vchan_setup_t)(struct rte_dma_dev *dev, uint16_t vchan,
49 const struct rte_dma_vchan_conf *conf,
50 uint32_t conf_sz);
51
53typedef int (*rte_dma_stats_get_t)(const struct rte_dma_dev *dev,
54 uint16_t vchan, struct rte_dma_stats *stats,
55 uint32_t stats_sz);
56
58typedef int (*rte_dma_stats_reset_t)(struct rte_dma_dev *dev, uint16_t vchan);
59
61typedef int (*rte_dma_vchan_status_t)(const struct rte_dma_dev *dev, uint16_t vchan,
62 enum rte_dma_vchan_status *status);
63
65typedef int (*rte_dma_dump_t)(const struct rte_dma_dev *dev, FILE *f);
66
73 rte_dma_info_get_t dev_info_get;
74 rte_dma_configure_t dev_configure;
75 rte_dma_start_t dev_start;
76 rte_dma_stop_t dev_stop;
77 rte_dma_close_t dev_close;
78
79 rte_dma_vchan_setup_t vchan_setup;
80
81 rte_dma_stats_get_t stats_get;
82 rte_dma_stats_reset_t stats_reset;
83
84 rte_dma_vchan_status_t vchan_status;
85 rte_dma_dump_t dev_dump;
86};
87
97struct rte_dma_dev_data {
98 char dev_name[RTE_DEV_NAME_MAX_LEN];
99 int16_t dev_id;
100 int16_t numa_node;
101 void *dev_private;
102 struct rte_dma_conf dev_conf;
103 __extension__
104 uint8_t dev_started : 1;
105 uint64_t reserved[2];
107
119};
120
125struct rte_dma_dev {
127 struct rte_device *device;
128 struct rte_dma_dev_data *data;
130 struct rte_dma_fp_object *fp_obj;
132 const struct rte_dma_dev_ops *dev_ops;
133 enum rte_dma_dev_state state;
134 uint64_t reserved[2];
136
153__rte_internal
154struct rte_dma_dev *rte_dma_pmd_allocate(const char *name, int numa_node,
155 size_t private_data_size);
156
167__rte_internal
168int rte_dma_pmd_release(const char *name);
169
170#ifdef __cplusplus
171}
172#endif
173
174#endif /* RTE_DMADEV_PMD_H */
#define __rte_cache_aligned
Definition: rte_common.h:440
rte_dma_vchan_status
Definition: rte_dmadev.h:679
void * dev_private
rte_dma_dev_state
@ RTE_DMA_DEV_REGISTERED
@ RTE_DMA_DEV_READY
@ RTE_DMA_DEV_UNUSED