DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org
Cc: jerinj@marvell.com, Nipun Gupta <nipun.gupta@nxp.com>
Subject: [dpdk-dev] [PATCH v4 4/6] event/dpaa2: add retry break in packet enqueue
Date: Mon, 30 Sep 2019 14:02:13 +0530	[thread overview]
Message-ID: <20190930083215.8241-5-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <20190930083215.8241-1-hemant.agrawal@nxp.com>

From: Nipun Gupta <nipun.gupta@nxp.com>

The patch adds the break in the TX function, if it is failing
to send the packets out. Previously the system was trying
infinitely to send packet out.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 drivers/event/dpaa2/dpaa2_eventdev.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 9255de16f..834d3cba1 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -49,6 +49,7 @@
 
 /* Dynamic logging identified for mempool */
 int dpaa2_logtype_event;
+#define DPAA2_EV_TX_RETRY_COUNT 10000
 
 static uint16_t
 dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[],
@@ -59,7 +60,7 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[],
 	struct dpaa2_dpio_dev *dpio_dev;
 	uint32_t queue_id = ev[0].queue_id;
 	struct dpaa2_eventq *evq_info;
-	uint32_t fqid;
+	uint32_t fqid, retry_count;
 	struct qbman_swp *swp;
 	struct qbman_fd fd_arr[MAX_TX_RING_SLOTS];
 	uint32_t loop, frames_to_send;
@@ -162,13 +163,25 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[],
 		}
 send_partial:
 		loop = 0;
+		retry_count = 0;
 		while (loop < frames_to_send) {
-			loop += qbman_swp_enqueue_multiple_desc(swp,
+			ret = qbman_swp_enqueue_multiple_desc(swp,
 					&eqdesc[loop], &fd_arr[loop],
 					frames_to_send - loop);
+			if (unlikely(ret < 0)) {
+				retry_count++;
+				if (retry_count > DPAA2_EV_TX_RETRY_COUNT) {
+					num_tx += loop;
+					nb_events -= loop;
+					return num_tx + loop;
+				}
+			} else {
+				loop += ret;
+				retry_count = 0;
+			}
 		}
-		num_tx += frames_to_send;
-		nb_events -= frames_to_send;
+		num_tx += loop;
+		nb_events -= loop;
 	}
 
 	return num_tx;
-- 
2.17.1


  parent reply	other threads:[~2019-09-30  8:35 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 10:34 [dpdk-dev] [PATCH 0/5] NXP DPAA2 EVENTDEV enhancements Hemant Agrawal
2019-09-06 10:34 ` [dpdk-dev] [PATCH 1/5] event/dpaa2: fix def queue conf Hemant Agrawal
2019-09-06 10:34 ` [dpdk-dev] [PATCH 2/5] event/dpaa2: remove conditional compilation Hemant Agrawal
2019-09-06 10:34 ` [dpdk-dev] [PATCH 3/5] event/dpaa2: add destroy support Hemant Agrawal
2019-09-06 10:34 ` [dpdk-dev] [PATCH 4/5] event/dpaa2: add selftest cases Hemant Agrawal
2019-09-06 19:29   ` Aaron Conole
2019-09-06 10:34 ` [dpdk-dev] [PATCH 5/5] test/event: enable dpaa2 self test Hemant Agrawal
2019-09-07  6:42 ` [dpdk-dev] [PATCH v2 0/5] NXP DPAA2 EVENTDEV enhancements Hemant Agrawal
2019-09-07  6:42   ` [dpdk-dev] [PATCH v2 1/5] event/dpaa2: fix def queue conf Hemant Agrawal
2019-09-13  6:24     ` Jerin Jacob
2019-09-26 17:55       ` Jerin Jacob
2019-09-27  6:02         ` Hemant Agrawal
2019-09-07  6:42   ` [dpdk-dev] [PATCH v2 2/5] event/dpaa2: remove conditional compilation Hemant Agrawal
2019-09-07  6:42   ` [dpdk-dev] [PATCH v2 3/5] event/dpaa2: add destroy support Hemant Agrawal
2019-09-07  6:42   ` [dpdk-dev] [PATCH v2 4/5] event/dpaa2: add selftest cases Hemant Agrawal
2019-09-09 13:10     ` Aaron Conole
2019-09-10  7:19       ` Hemant Agrawal
2019-09-07  6:42   ` [dpdk-dev] [PATCH v2 5/5] test/event: enable dpaa2 self test Hemant Agrawal
2019-09-27  7:58   ` [dpdk-dev] [PATCH 0/6] NXP DPAA2 EVENTDEV enhancements Hemant Agrawal
2019-09-27  7:58     ` [dpdk-dev] [PATCH 1/6] event/dpaa2: fix def queue conf Hemant Agrawal
2019-09-30  6:43       ` Jerin Jacob
2019-09-27  7:58     ` [dpdk-dev] [PATCH 2/6] event/dpaa2: remove conditional compilation Hemant Agrawal
2019-09-27  7:58     ` [dpdk-dev] [PATCH 3/6] event/dpaa2: add destroy support Hemant Agrawal
2019-09-27  7:58     ` [dpdk-dev] [PATCH 4/6] event/dpaa2: add retry break in packet enqueue Hemant Agrawal
2019-09-27  7:58     ` [dpdk-dev] [PATCH 5/6] event/dpaa2: add selftest cases Hemant Agrawal
2019-09-27  7:58     ` [dpdk-dev] [PATCH 6/6] test/event: enable dpaa2 self test Hemant Agrawal
2019-09-30  8:32     ` [dpdk-dev] [PATCH v4 0/6] NXP DPAA2 EVENTDEV enhancements Hemant Agrawal
2019-09-30  8:32       ` [dpdk-dev] [PATCH v4 1/6] event/dpaa2: fix def queue conf Hemant Agrawal
2019-09-30 14:17         ` Jerin Jacob
2019-09-30  8:32       ` [dpdk-dev] [PATCH v4 2/6] event/dpaa2: remove conditional compilation Hemant Agrawal
2019-09-30  8:32       ` [dpdk-dev] [PATCH v4 3/6] event/dpaa2: add destroy support Hemant Agrawal
2019-09-30  8:32       ` Hemant Agrawal [this message]
2019-09-30  8:32       ` [dpdk-dev] [PATCH v4 5/6] event/dpaa2: add selftest cases Hemant Agrawal
2019-09-30  8:32       ` [dpdk-dev] [PATCH v4 6/6] test/event: enable dpaa2 self test Hemant Agrawal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190930083215.8241-5-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=nipun.gupta@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).