1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2021-2022 NXP
5 #ifndef _RTE_PMD_DPAA2_QDMA_H_
6 #define _RTE_PMD_DPAA2_QDMA_H_
8 /** States if the source addresses is physical. */
9 #define RTE_DPAA2_QDMA_JOB_SRC_PHY (1ULL << 30)
11 /** States if the destination addresses is physical. */
12 #define RTE_DPAA2_QDMA_JOB_DEST_PHY (1ULL << 31)
14 struct rte_dpaa2_qdma_rbp {
15 uint32_t use_ultrashort:1;
29 /*using route by port for destination */
43 /* using route by port for source */
48 /** Determines a QDMA job */
49 struct rte_dpaa2_qdma_job {
50 /** Source Address from where DMA is (to be) performed */
52 /** Destination Address where DMA is (to be) done */
54 /** Length of the DMA operation in bytes. */
56 /** See RTE_QDMA_JOB_ flags */
59 * Status of the transaction.
60 * This is filled in the dequeue operation by the driver.
61 * upper 8bits acc_err for route by port.
62 * lower 8bits fd error
67 * FLE pool element maintained by user, in case no qDMA response.
68 * Note: the address must be allocated from DPDK memory pool.
75 * @b EXPERIMENTAL: this API may change without prior notice.
77 * Enable FD in Ultra Short format on a channel. This API should be
78 * called before calling 'rte_dma_vchan_setup()' API.
81 * The identifier of the device.
83 * The identifier of virtual DMA channel.
86 void rte_dpaa2_qdma_vchan_fd_us_enable(int16_t dev_id, uint16_t vchan);
90 * @b EXPERIMENTAL: this API may change without prior notice.
92 * Enable internal SG processing on a channel. This API should be
93 * called before calling 'rte_dma_vchan_setup()' API.
96 * The identifier of the device.
98 * The identifier of virtual DMA channel.
101 void rte_dpaa2_qdma_vchan_internal_sg_enable(int16_t dev_id, uint16_t vchan);
105 * @b EXPERIMENTAL: this API may change without prior notice.
107 * Enable Route-by-port on a channel. This API should be
108 * called before calling 'rte_dma_vchan_setup()' API.
111 * The identifier of the device.
113 * The identifier of virtual DMA channel.
115 * Configuration for route-by-port
118 void rte_dpaa2_qdma_vchan_rbp_enable(int16_t dev_id, uint16_t vchan,
119 struct rte_dpaa2_qdma_rbp *rbp_config);
123 * @b EXPERIMENTAL: this API may change without prior notice.
125 * Enqueue a copy operation onto the virtual DMA channel for silent mode,
126 * when dequeue is not required.
128 * This queues up a copy operation to be performed by hardware, if the 'flags'
129 * parameter contains RTE_DMA_OP_FLAG_SUBMIT then trigger doorbell to begin
130 * this operation, otherwise do not trigger doorbell.
133 * The identifier of the device.
135 * The identifier of virtual DMA channel.
137 * Jobs to be submitted to QDMA.
139 * Number of DMA jobs.
142 * - >= 0..Number of enqueued job.
143 * - -ENOSPC: if no space left to enqueue.
144 * - other values < 0 on failure.
147 int rte_dpaa2_qdma_copy_multi(int16_t dev_id, uint16_t vchan,
148 struct rte_dpaa2_qdma_job **jobs, uint16_t nb_cpls);
152 * @b EXPERIMENTAL: this API may change without prior notice.
154 * Return the number of operations that have been successfully completed.
157 * The identifier of the device.
159 * The identifier of virtual DMA channel.
161 * Jobs completed by QDMA.
163 * Number of completed DMA jobs.
166 * The number of operations that successfully completed. This return value
167 * must be less than or equal to the value of nb_cpls.
170 uint16_t rte_dpaa2_qdma_completed_multi(int16_t dev_id, uint16_t vchan,
171 struct rte_dpaa2_qdma_job **jobs, uint16_t nb_cpls);
173 #endif /* _RTE_PMD_DPAA2_QDMA_H_ */