From patchwork Fri Oct 11 05:46:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 175914 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp312325ill; Thu, 10 Oct 2019 23:03:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjZ2ftuuJeHod1IdMWWrTZF1lhkKLITnRFnbTKLWe0FSEYuB5HKAOGHVbQC9aGmEEhiYTK X-Received: by 2002:a17:906:b6c6:: with SMTP id ec6mr12115052ejb.54.1570773819034; Thu, 10 Oct 2019 23:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570773819; cv=none; d=google.com; s=arc-20160816; b=Nl65D3s6h3mN7gWf0U8XUycxBNh9hqjEgLRRL9Ctu6Jn6e3Kdtd7lyc+vFyehDYXYy KsU9hHaNXT5hNXiOEkxO/HG45Ki6l0uBr3lk+I59SCnjz0kTvr4wt/AkKeGkojtyYwNu 4wGu/Q8N3+Xo/OFi+UHT9kE4rEPqjvONMEr1qgczikfZR/KccCtZ7DZg5XltrCbQ6u1p VzvVR7OBH0GEqV/+eJRC3O9e3ZOXp1D5cZQpuphs9AfRK9ewvVY2uScq0gsWg7nbf2su Y0VdMwOIIiLX1hG3ty59/edBnMi2f8vzExX2ON+W1xTXZ2XpJBi+jyUIA4RK+iqIerUc gpVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=yMzQMAIix6gQMlstUC8mQTY+bQBJvL78Lq2INujXIzk=; b=i4dDlul0cvbTCr0FyoQnZwLQYpg6wGof7xR6TxeHB9N628t2rWXaR1FiKZMbKWxwoZ UsYx+TBDnqyqlXYFLu1hNa2rQzu+OVMd/bqkuYrsf9JfnC6fGEnMf8AVQYSK+f2MoKJL hvezBge50Rd8eX4a4vDcANhzD/WX+eoiyY8jIXif3LaGB2Eqqtvmv8wXGkAqa2X314Lz zUfvMmXQR5CfCHhdRdyFtSfZP7j1a+VBEziA7w6QYXfOwEBcU+cXbhCOwwh997Cn90be lPJtOjdaSXiANea7cpn7SBjLjypDC3pjMCxv4wv+NIK3mGT2ATbNebpJ228i8+kWYs2v 1HGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id h17si5597477edb.89.2019.10.10.23.03.38; Thu, 10 Oct 2019 23:03:39 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com 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(-) -- 2.17.1 Acked-by: Hemant Agrawal 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