From patchwork Wed Oct 30 12:09:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178108 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1204548ill; Wed, 30 Oct 2019 05:26:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqx47GjwTBQ6lk8ayRDeSRCSZbsadVyBxr5IqeG7CsruNTvB2oped3eSTiHg8D3vSsesjC0L X-Received: by 2002:a05:6402:2c5:: with SMTP id b5mr31623450edx.157.1572438401986; Wed, 30 Oct 2019 05:26:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572438401; cv=none; d=google.com; s=arc-20160816; b=qMed+qq/Q7klH4Xka/xZHaJYfddxAAQ5HAxp1NfvyspClOcvMIF4F7adklRsrM1M3c Tks+2p/OL8g5yhcX66dxnqtXr4kpxAY9AEarYEZCmlj7aZj7Bo+RtTCyRdFwJfKfuBNO hOE389IRFiYe8EJPHd+X25X0iM7517q6bi0QzCsDhh2ZL5zCFrTheWKzFiS83d17lTYl CD6tvWe0WP8OqClHkwFwXPchWA5RKS/vDf3NhPK9i1+VdmV8k0dSUKYKCoiO5mxYcSIL 3weyOOmQe8OZOQ/vIycSoZSWI+oQU0YdLy9wbS6EbYRSKwZaCAGv/O2A7/pfzAGKVsZc xH2A== 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=6ppxzN1ewA70JijZ7R+NLSRlDaoKyUzohLuUg2I/QAM=; b=Pqm48BmRsBrdEcCT/4vxWze6BOzdseeE6AYm6idCmin4PgiOJ1oZQZsvZEmVEMNBz4 kNsb42aDQOeIDqMuC4cmJQi/P5S9sdyh4fHF1khAlYQTIBKpwcE5InH6CNt2VcTpDzCK F7L475evRHfTtbd1+zgMP6rpicKwJsBdUhgJw7O81fRdeMPPdcvPbjB2gbImknTAm3K3 jaWMqwutLGANph6eZOCAl7QPVO2523NxBNNZDxGAHft8B/w/w9ryHuU1lnTerQ/6q8dg pUmg4sVifAnYY3czngp01720egaoE3ZJapllP/BURa17qeynvZ9giSd28tbgAD/bL5cQ ovKQ== 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 o2si1514556edj.290.2019.10.30.05.26.41; Wed, 30 Oct 2019 05:26:41 -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 406FA1C0AB; Wed, 30 Oct 2019 13:26:20 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 2F49A1C045; Wed, 30 Oct 2019 13:26:12 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 110D6200462; Wed, 30 Oct 2019 13:26:12 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id AEAD1200497; Wed, 30 Oct 2019 13:26:08 +0100 (CET) Received: from GDB1.ap.freescale.net (gdb1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 819CA402E2; Wed, 30 Oct 2019 20:26:04 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org, Nipun Gupta Date: Wed, 30 Oct 2019 17:39:52 +0530 Message-Id: <20191030120955.26904-7-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191030120955.26904-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191030120955.26904-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 6/9 v3] 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 Acked-by: Hemant Agrawal --- drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.17.1 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