DPDK  24.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 <dev_driver.h>
18 
19 #include <rte_compat.h>
20 #include "rte_dmadev.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 struct rte_dma_dev;
27 
29 typedef 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 
34 typedef int (*rte_dma_configure_t)(struct rte_dma_dev *dev,
35  const struct rte_dma_conf *dev_conf,
36  uint32_t conf_sz);
37 
39 typedef int (*rte_dma_start_t)(struct rte_dma_dev *dev);
40 
42 typedef int (*rte_dma_stop_t)(struct rte_dma_dev *dev);
43 
45 typedef int (*rte_dma_close_t)(struct rte_dma_dev *dev);
46 
48 typedef 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 
53 typedef 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 
58 typedef int (*rte_dma_stats_reset_t)(struct rte_dma_dev *dev, uint16_t vchan);
59 
61 typedef int (*rte_dma_vchan_status_t)(const struct rte_dma_dev *dev, uint16_t vchan,
62  enum rte_dma_vchan_status *status);
63 
65 typedef 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 
97 struct __rte_cache_aligned 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];
106 };
107 
119 };
120 
125 struct __rte_cache_aligned 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];
135 };
136 
153 __rte_internal
154 struct rte_dma_dev *rte_dma_pmd_allocate(const char *name, int numa_node,
155  size_t private_data_size);
156 
167 __rte_internal
168 int rte_dma_pmd_release(const char *name);
169 
180 __rte_internal
181 struct rte_dma_dev *rte_dma_pmd_get_dev_by_id(int16_t dev_id);
182 
183 #ifdef __cplusplus
184 }
185 #endif
186 
187 #endif /* RTE_DMADEV_PMD_H */
rte_dma_dev_state
#define __rte_cache_aligned
Definition: rte_common.h:568
rte_dma_vchan_status
Definition: rte_dmadev.h:664