From patchwork Fri Oct 11 05:46:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 175911 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp311950ill; Thu, 10 Oct 2019 23:03:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjiS0fnufLwuRSeQZPrJRO75gzsPiTPdQPDIhmd0tDvttF4WUjiD/Rnw+sUcyC6UvWXLYW X-Received: by 2002:a05:6402:1b8a:: with SMTP id cc10mr11880190edb.202.1570773793613; Thu, 10 Oct 2019 23:03:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570773793; cv=none; d=google.com; s=arc-20160816; b=ZU4M9ZwKFea6AjlyLwJ1z3fqtXWM4Z9V4d4KEQrEofshIRjTF+JwFgOq2RITFecI5Y jgvJl5Kz3fHdNjNQnWHm1sfcysogqI3y+ZAd5DLjH2I6GVVclMbgQhCwWasCC6sB7HAM Fqm0IfELV5C+sVxqv9i/Am/EP8smID5SCIduzVBJfHk9mTCh7lTd0ZtQ2ThD8V7b3zq9 JHFNONHG/GTOrW11ilJLGxDw1bJR6OfdgSMh35YmUtIDDPRtFtq+AvzoqJG17+a1bBm/ 1U3FJ7+o+0Mrpbm+jDbUn6DfNIz4y6aeKC0nqZNZ8jhiM1G5e5mv8ETY36r0pJaRDGuL 2cGg== 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=TBzjmuR3Eylrx2Z/5mkGDeRghWLnFrSQFXfkkqso9xc=; b=vurqhpGg085qQ9+SETZuwSpEovNYSu9p4+mJMh27QW7WgqGDPh/iWT+IwcejQ1Y6nj jDiyrwWNBNYSVdGCXW4wWggvnISjM5+AcTg9Qb18CrKYBhKJMtfmrTGsHTaIX2Njl+/6 8NdBsib1gDNgSydcrBe/2HCDVOnD7m9CnpjPooVQ/4oUI1NSVwDNzeY/dSefsY3xh3S3 ZXgkL3nkesdQmJ18QhyHt+a7w7gmZUqaFWqI4R84+NEwguF8o9slCDQDNHmD6qiHs+CU ahpgA8mk5Ld9hNhbcnveZgK0ylTFHSZfLcIUJu473L7aGWcLZLCrjRw7Qe1VHsuDN+Gc xopA== 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 c24si4718829edt.364.2019.10.10.23.03.13; Thu, 10 Oct 2019 23:03:13 -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 42FD01E937; Fri, 11 Oct 2019 08:02:46 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 24BED1E932; Fri, 11 Oct 2019 08:02:40 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 07DDD1A04E3; Fri, 11 Oct 2019 08:02:40 +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 E6E171A04EE; Fri, 11 Oct 2019 08:02:36 +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 A2902402FF; Fri, 11 Oct 2019 14:02:32 +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:54 +0530 Message-Id: <20191011054657.21931-7-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 6/9] raw/dpaa2_qdma: 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 the logic in the DPAA2 QDMA packet enqueue API Fixes: 4d9a3f2a0159 ("raw/dpaa2_qdma: support RBP mode") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta --- drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.17.1 Acked-by: Hemant Agrawal diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c index a391913b0..af678273d 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -541,13 +541,21 @@ dpdmai_dev_enqueue_multi(struct dpaa2_dpdmai_dev *dpdmai_dev, } /* Enqueue the packet to the QBMAN */ - uint32_t enqueue_loop = 0; + uint32_t enqueue_loop = 0, retry_count = 0; while (enqueue_loop < loop) { - enqueue_loop += qbman_swp_enqueue_multiple(swp, + ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd[enqueue_loop], NULL, loop - enqueue_loop); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) + return num_tx - (loop - enqueue_loop); + } else { + enqueue_loop += ret; + retry_count = 0; + } } nb_jobs -= loop; }