patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Nipun Gupta <nipun.gupta@nxp.com>
To: ktraynor@redhat.com
Cc: stable@dpdk.org, Nipun Gupta <nipun.gupta@nxp.com>
Subject: [dpdk-stable] [PATCH 18.11 2/5] raw/dpaa2_cmdif: add retry and timeout in packet enqueue API
Date: Tue, 17 Dec 2019 15:00:42 +0530	[thread overview]
Message-ID: <20191217093045.12659-2-nipun.gupta@nxp.com> (raw)
In-Reply-To: <20191217093045.12659-1-nipun.gupta@nxp.com>

This patch adds retry in the DPAA2 CMDIF packet enqueue API

Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations")
Cc: stable@dpdk.org

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
index 55ded4645..9687e14d6 100644
--- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
+++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c
@@ -62,6 +62,7 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev,
 	struct qbman_fd fd;
 	struct qbman_eq_desc eqdesc;
 	struct qbman_swp *swp;
+	uint32_t retry_count = 0;
 	int ret;
 
 	DPAA2_CMDIF_FUNC_TRACE();
@@ -102,11 +103,15 @@ dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev,
 		ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd, NULL, 1);
 		if (ret < 0 && ret != -EBUSY)
 			DPAA2_CMDIF_ERR("Transmit failure with err: %d\n", ret);
-	} while (ret == -EBUSY);
+		retry_count++;
+	} while ((ret == -EBUSY) && (retry_count < DPAA2_MAX_TX_RETRY_COUNT));
+
+	if (ret < 0)
+		return ret;
 
 	DPAA2_CMDIF_DP_DEBUG("Successfully transmitted a packet\n");
 
-	return 0;
+	return 1;
 }
 
 static int
-- 
2.17.1


  reply	other threads:[~2019-12-17  9:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17  9:30 [dpdk-stable] [PATCH 18.11 1/5] net/dpaa2: " Nipun Gupta
2019-12-17  9:30 ` Nipun Gupta [this message]
2019-12-17  9:30 ` [dpdk-stable] [PATCH 18.11 3/5] net/dpaa2: set port in mbuf Nipun Gupta
2019-12-17  9:30 ` [dpdk-stable] [PATCH 18.11 4/5] bus/dpaa: fix dpaa_sec blacklist Nipun Gupta
2019-12-17  9:30 ` [dpdk-stable] [PATCH 18.11 5/5] test/crypto: fix session init failure for wireless case Nipun Gupta
2019-12-17 14:08 ` [dpdk-stable] [PATCH 18.11 1/5] net/dpaa2: add retry and timeout in packet enqueue API Kevin Traynor
2019-12-18  5:02   ` Nipun Gupta

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=20191217093045.12659-2-nipun.gupta@nxp.com \
    --to=nipun.gupta@nxp.com \
    --cc=ktraynor@redhat.com \
    --cc=stable@dpdk.org \
    /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).