From patchwork Tue Nov 5 14:23:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178527 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp847198ilf; Tue, 5 Nov 2019 06:41:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzV60qOeLEYPyc5ACZHYnyYwla/ZR12Jc7W87OrmatubQHYCZ7zZcKcYAvcp3a/8g6AG1oK X-Received: by 2002:a17:906:5015:: with SMTP id s21mr28899299ejj.226.1572964859937; Tue, 05 Nov 2019 06:40:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572964859; cv=none; d=google.com; s=arc-20160816; b=MbhDbbp4Oc9rs4bGZ90EPmD0NydjrN/vYcK7AzKwWmbMaxRBqbMOlHx9bvHBDND5HT NQG0o30PlZ6UoX02wsdchV+BUJemlsnjkurkptUM3m01olwbCwuDWHN05TyDw4rhg92c suG79MT+9pSqzlMhOUS9+cshXlzv4Oa9n809dw+6PTduSr8/jSNDaPTOSS+yL/XxLaxd nidstW0oZM6Vnx8y3ZB/se5zI7HOLnVY1z+JwS4c/ZBsxt1cwQ7LEjFTh58uTn6PuPAJ lv1Bla+UUwU2BMP4grQTX1/mMVtN+iisWoCSgNCMP2K2Xj6ZVeuo/hAIkGu8WtZ38GfN 085w== 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=PIGeZ/3/FwcPdjjjF8B7aNoOQSTKb1M/5aJITZnjhKM1AUIothh/imBl5cxIMFgBsD LgDl923c+Kb7e7PBGfYE7xtkFOOlF22BMIbX3WMI5kLJZxTCyKTmYF85OSBU7LNJhGuS bheMb3dKakR969t/fKo3IgGESor2SqQnkB7u4CbP1FTBAub5CdAQOqq8NPr6aFEJPOkk AxdQD4se2EkbpVy4hVPM6nl/zOkJTkoWvnlJGfyy7EBOANgqptJq6vdm2EAqucUFTIVN l4D9qEgrWSU9hjFhM8486pq2N6OS3wr9kDjn7PHEtF6IsURtuISwNPGrqq2n5mQAcnAO JCyw== 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 w19si9954432edd.51.2019.11.05.06.40.59; Tue, 05 Nov 2019 06:40:59 -0800 (PST) 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 E29B01BF5A; Tue, 5 Nov 2019 15:39:57 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id EF9FB1BF45; Tue, 5 Nov 2019 15:39:52 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B241C1A082B; Tue, 5 Nov 2019 15:39:52 +0100 (CET) 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 5E8AA1A00C5; Tue, 5 Nov 2019 15:39:49 +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 50AE44030E; Tue, 5 Nov 2019 22:39:42 +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: Tue, 5 Nov 2019 19:53:18 +0530 Message-Id: <20191105142321.7478-7-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191105142321.7478-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191105142321.7478-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 6/9 v4] 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