DPDK  20.08.0
rte_pmd_dpaa2_qdma.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2018-2019 NXP
3  */
4 
5 #ifndef __RTE_PMD_DPAA2_QDMA_H__
6 #define __RTE_PMD_DPAA2_QDMA_H__
7 
16 #define RTE_QDMA_BURST_NB_MAX 256
17 
19 enum {
34 };
35 
37 enum {
38  RTE_QDMA_LONG_FORMAT,
39  RTE_QDMA_ULTRASHORT_FORMAT,
40 };
41 
49 #define RTE_QDMA_VQ_EXCLUSIVE_PQ (1ULL)
50 
52 #define RTE_QDMA_JOB_SRC_PHY (1ULL)
53 
55 #define RTE_QDMA_JOB_DEST_PHY (1ULL << 1)
56 
58 struct rte_qdma_attr {
60  uint16_t num_hw_queues;
61 };
62 
68  uint16_t max_vqs;
70  uint8_t mode;
72  uint8_t format;
82 };
83 
84 struct rte_qdma_rbp {
85  uint32_t use_ultrashort:1;
86  uint32_t enable:1;
96  uint32_t dportid:4;
97  uint32_t dpfid:2;
98  uint32_t dvfid:6;
99  /*using route by port for destination */
100  uint32_t drbp:1;
110  uint32_t sportid:4;
111  uint32_t spfid:2;
112  uint32_t svfid:6;
113  /* using route by port for source */
114  uint32_t srbp:1;
115  uint32_t rsv:4;
116 };
117 
123  uint32_t lcore_id;
124  /* Total number of enqueues on this VQ */
125  uint64_t num_enqueues;
126  /* Total number of dequeues from this VQ */
127  uint64_t num_dequeues;
128  /* total number of pending jobs in this VQ */
129  uint64_t num_pending_jobs;
130 };
131 
133 struct rte_qdma_job {
135  uint64_t src;
137  uint64_t dest;
139  uint32_t len;
141  uint32_t flags;
146  uint64_t cnxt;
153  uint16_t status;
154  uint16_t vq_id;
155 };
156 
164 int
165 rte_qdma_init(void);
166 
173 void
174 rte_qdma_attr_get(struct rte_qdma_attr *qdma_attr);
175 
185 int
186 rte_qdma_reset(void);
187 
195 int
196 rte_qdma_configure(struct rte_qdma_config *qdma_config);
197 
205 int
206 rte_qdma_start(void);
207 
222 int
223 rte_qdma_vq_create(uint32_t lcore_id, uint32_t flags);
224 
225 /*create vq for route-by-port*/
226 int
227 rte_qdma_vq_create_rbp(uint32_t lcore_id, uint32_t flags,
228  struct rte_qdma_rbp *rbp);
229 
246 int
247 rte_qdma_vq_enqueue_multi(uint16_t vq_id,
248  struct rte_qdma_job **job,
249  uint16_t nb_jobs);
250 
265 int
266 rte_qdma_vq_enqueue(uint16_t vq_id,
267  struct rte_qdma_job *job);
268 
284 int
285 rte_qdma_vq_dequeue_multi(uint16_t vq_id,
286  struct rte_qdma_job **job,
287  uint16_t nb_jobs);
288 
298 struct rte_qdma_job *
299 rte_qdma_vq_dequeue(uint16_t vq_id);
300 
309 void
310 rte_qdma_vq_stats(uint16_t vq_id,
311  struct rte_qdma_vq_stats *vq_stats);
312 
325 int
326 rte_qdma_vq_destroy(uint16_t vq_id);
327 
341 int
342 rte_qdma_vq_destroy_rbp(uint16_t vq_id);
346 void
347 rte_qdma_stop(void);
348 
352 void
353 rte_qdma_destroy(void);
354 
355 #endif /* __RTE_PMD_DPAA2_QDMA_H__*/
int rte_qdma_configure(struct rte_qdma_config *qdma_config)
struct rte_qdma_job * rte_qdma_vq_dequeue(uint16_t vq_id)
int rte_qdma_vq_enqueue(uint16_t vq_id, struct rte_qdma_job *job)
uint16_t num_hw_queues
void rte_qdma_destroy(void)
void rte_qdma_vq_stats(uint16_t vq_id, struct rte_qdma_vq_stats *vq_stats)
int rte_qdma_vq_dequeue_multi(uint16_t vq_id, struct rte_qdma_job **job, uint16_t nb_jobs)
int rte_qdma_vq_create(uint32_t lcore_id, uint32_t flags)
void rte_qdma_stop(void)
int rte_qdma_vq_destroy_rbp(uint16_t vq_id)
int rte_qdma_start(void)
int rte_qdma_init(void)
void rte_qdma_attr_get(struct rte_qdma_attr *qdma_attr)
int rte_qdma_reset(void)
uint16_t max_hw_queues_per_core
int rte_qdma_vq_enqueue_multi(uint16_t vq_id, struct rte_qdma_job **job, uint16_t nb_jobs)
int rte_qdma_vq_destroy(uint16_t vq_id)