raw/dpaa2_qdma: support burst mode
[dpdk.git] / drivers / raw / dpaa2_qdma / rte_pmd_dpaa2_qdma.h
index 29a1e4b..e1ccc19 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2018 NXP
+ * Copyright 2018-2019 NXP
  */
 
 #ifndef __RTE_PMD_DPAA2_QDMA_H__
@@ -12,6 +12,9 @@
  *
  */
 
+/** Maximum qdma burst size */
+#define RTE_QDMA_BURST_NB_MAX 32
+
 /** Determines the mode of operation */
 enum {
        /**
@@ -113,7 +116,7 @@ struct rte_qdma_job {
  *   - 0: Success.
  *   - <0: Error code.
  */
-int __rte_experimental
+int
 rte_qdma_init(void);
 
 /**
@@ -122,7 +125,7 @@ rte_qdma_init(void);
  * @param qdma_attr
  *   QDMA attributes providing total number of hw queues etc.
  */
-void __rte_experimental
+void
 rte_qdma_attr_get(struct rte_qdma_attr *qdma_attr);
 
 /**
@@ -134,7 +137,7 @@ rte_qdma_attr_get(struct rte_qdma_attr *qdma_attr);
  *   - 0: Success.
  *   - <0: Error code.
  */
-int __rte_experimental
+int
 rte_qdma_reset(void);
 
 /**
@@ -144,7 +147,7 @@ rte_qdma_reset(void);
  *   - 0: Success.
  *   - <0: Error code.
  */
-int __rte_experimental
+int
 rte_qdma_configure(struct rte_qdma_config *qdma_config);
 
 /**
@@ -154,7 +157,7 @@ rte_qdma_configure(struct rte_qdma_config *qdma_config);
  *   - 0: Success.
  *   - <0: Error code.
  */
-int __rte_experimental
+int
 rte_qdma_start(void);
 
 /**
@@ -171,9 +174,80 @@ rte_qdma_start(void);
  *   - >= 0: Virtual queue ID.
  *   - <0: Error code.
  */
-int __rte_experimental
+int
 rte_qdma_vq_create(uint32_t lcore_id, uint32_t flags);
 
+/**
+ * Enqueue multiple jobs to a Virtual Queue.
+ * If the enqueue is successful, the H/W will perform DMA operations
+ * on the basis of the QDMA jobs provided.
+ *
+ * @param vq_id
+ *   Virtual Queue ID.
+ * @param job
+ *   List of QDMA Jobs containing relevant information related to DMA.
+ * @param nb_jobs
+ *   Number of QDMA jobs provided by the user.
+ *
+ * @returns
+ *   - >=0: Number of jobs successfully submitted
+ *   - <0: Error code.
+ */
+int
+rte_qdma_vq_enqueue_multi(uint16_t vq_id,
+                         struct rte_qdma_job **job,
+                         uint16_t nb_jobs);
+
+/**
+ * Enqueue a single job to a Virtual Queue.
+ * If the enqueue is successful, the H/W will perform DMA operations
+ * on the basis of the QDMA job provided.
+ *
+ * @param vq_id
+ *   Virtual Queue ID.
+ * @param job
+ *   A QDMA Job containing relevant information related to DMA.
+ *
+ * @returns
+ *   - >=0: Number of jobs successfully submitted
+ *   - <0: Error code.
+ */
+int
+rte_qdma_vq_enqueue(uint16_t vq_id,
+                   struct rte_qdma_job *job);
+
+/**
+ * Dequeue multiple completed jobs from a Virtual Queue.
+ * Provides the list of completed jobs capped by nb_jobs.
+ *
+ * @param vq_id
+ *   Virtual Queue ID.
+ * @param job
+ *   List of QDMA Jobs returned from the API.
+ * @param nb_jobs
+ *   Number of QDMA jobs requested for dequeue by the user.
+ *
+ * @returns
+ *   - >=0: Number of jobs successfully received
+ *   - <0: Error code.
+ */
+int
+rte_qdma_vq_dequeue_multi(uint16_t vq_id,
+                         struct rte_qdma_job **job,
+                         uint16_t nb_jobs);
+
+/**
+ * Dequeue a single completed jobs from a Virtual Queue.
+ *
+ * @param vq_id
+ *   Virtual Queue ID.
+ *
+ * @returns
+ *   - A completed job or NULL if no job is there.
+ */
+struct rte_qdma_job * __rte_experimental
+rte_qdma_vq_dequeue(uint16_t vq_id);
+
 /**
  * Get a Virtual Queue statistics.
  *
@@ -182,7 +256,7 @@ rte_qdma_vq_create(uint32_t lcore_id, uint32_t flags);
  * @param vq_stats
  *   VQ statistics structure which will be filled in by the driver.
  */
-void __rte_experimental
+void
 rte_qdma_vq_stats(uint16_t vq_id,
                  struct rte_qdma_vq_stats *vq_stats);
 
@@ -198,19 +272,19 @@ rte_qdma_vq_stats(uint16_t vq_id,
  *   - 0: Success.
  *   - <0: Error code.
  */
-int __rte_experimental
+int
 rte_qdma_vq_destroy(uint16_t vq_id);
 
 /**
  * Stop QDMA device.
  */
-void __rte_experimental
+void
 rte_qdma_stop(void);
 
 /**
  * Destroy the QDMA device.
  */
-void __rte_experimental
+void
 rte_qdma_destroy(void);
 
 #endif /* __RTE_PMD_DPAA2_QDMA_H__*/