From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9BA02A3160 for ; Fri, 11 Oct 2019 08:03:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BEA291E9C5; Fri, 11 Oct 2019 08:02:51 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 006CA1E97A; Fri, 11 Oct 2019 08:02:41 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id BBA371A02AF; Fri, 11 Oct 2019 08:02:41 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A72351A0501; Fri, 11 Oct 2019 08:02:38 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 11EB9402DA; Fri, 11 Oct 2019 14:02:33 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Fri, 11 Oct 2019 11:16:55 +0530 Message-Id: <20191011054657.21931-8-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191011054657.21931-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 7/9] raw/dpaa2_cmdif: add retry and timeout in packet enqueue API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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 3f42da1fe..ae53114b5 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; RTE_SET_USED(count); @@ -100,11 +101,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