[6/9] raw/dpaa2_qdma: add retry and timeout in packet enqueue API
diff mbox series

Message ID 20191011054657.21931-7-nipun.gupta@nxp.com
State Superseded
Headers show
Series
  • DPAA and FSLMC driver fixes and cleanup
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Nipun Gupta Oct. 11, 2019, 5:46 a.m. UTC
This patch adds the logic in the DPAA2 QDMA packet enqueue API

Fixes: 4d9a3f2a0159 ("raw/dpaa2_qdma: support RBP mode")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Hemant Agrawal Oct. 15, 2019, 6:55 a.m. UTC | #1
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Patch
diff mbox series

diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
index a391913b0..af678273d 100644
--- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
+++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
@@ -541,13 +541,21 @@  dpdmai_dev_enqueue_multi(struct dpaa2_dpdmai_dev *dpdmai_dev,
 		}
 
 		/* Enqueue the packet to the QBMAN */
-		uint32_t enqueue_loop = 0;
+		uint32_t enqueue_loop = 0, retry_count = 0;
 		while (enqueue_loop < loop) {
-			enqueue_loop += qbman_swp_enqueue_multiple(swp,
+			ret = qbman_swp_enqueue_multiple(swp,
 						&eqdesc,
 						&fd[enqueue_loop],
 						NULL,
 						loop - enqueue_loop);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_MAX_TX_RETRY_COUNT)
+					return num_tx - (loop - enqueue_loop);
+			} else {
+				enqueue_loop += ret;
+				retry_count = 0;
+			}
 		}
 		nb_jobs -= loop;
 	}