DPDK  22.07.0
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
22 extern "C" {
23 #endif
24 
25 struct rte_dma_dev;
26 
28 typedef 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 
33 typedef int (*rte_dma_configure_t)(struct rte_dma_dev *dev,
34  const struct rte_dma_conf *dev_conf,
35  uint32_t conf_sz);
36 
38 typedef int (*rte_dma_start_t)(struct rte_dma_dev *dev);
39 
41 typedef int (*rte_dma_stop_t)(struct rte_dma_dev *dev);
42 
44 typedef int (*rte_dma_close_t)(struct rte_dma_dev *dev);
45 
47 typedef 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 
52 typedef 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 
57 typedef int (*rte_dma_stats_reset_t)(struct rte_dma_dev *dev, uint16_t vchan);
58 
60 typedef int (*rte_dma_vchan_status_t)(const struct rte_dma_dev *dev, uint16_t vchan,
61  enum rte_dma_vchan_status *status);
62 
64 typedef 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 
96 struct 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 
124 struct 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
153 struct rte_dma_dev *rte_dma_pmd_allocate(const char *name, int numa_node,
154  size_t private_data_size);
155 
166 __rte_internal
167 int rte_dma_pmd_release(const char *name);
168 
169 #ifdef __cplusplus
170 }
171 #endif
172 
173 #endif /* RTE_DMADEV_PMD_H */
rte_dma_dev_state
void * dev_private
#define __rte_cache_aligned
Definition: rte_common.h:445
rte_dma_vchan_status
Definition: rte_dmadev.h:679