summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorNipun Gupta <nipun.gupta@nxp.com>2019-09-30 14:02:13 +0530
committerJerin Jacob <jerinj@marvell.com>2019-10-05 15:39:31 +0200
commit68bc970461a14fa2fe53c3c299ac7f243c4f2fed (patch)
tree323a976552a5a5a607e6ae1c6f61603f3925b04f /drivers
parentfebcd5a5b358fcbef93ee0a693260c1719f162d5 (diff)
downloaddpdk-68bc970461a14fa2fe53c3c299ac7f243c4f2fed.zip
dpdk-68bc970461a14fa2fe53c3c299ac7f243c4f2fed.tar.gz
dpdk-68bc970461a14fa2fe53c3c299ac7f243c4f2fed.tar.xz
event/dpaa2: add retry break in packet enqueue
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/event/dpaa2/dpaa2_eventdev.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 9255de1..834d3cb 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 @@ skip_linking:
}
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;