From patchwork Wed Oct 30 12:09:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 178112 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp1205298ill; Wed, 30 Oct 2019 05:27:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqx75YgAgWRxnSVGpvzTcMLpVjQENUYOCIZbMXcYMId1DBR2TM/C4dKkD5FR5d5Vhglhb9p3 X-Received: by 2002:a17:906:2ada:: with SMTP id m26mr8695345eje.87.1572438441549; Wed, 30 Oct 2019 05:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572438441; cv=none; d=google.com; s=arc-20160816; b=lqAOSHUciLx1k+J0DzYv6KCdRa1u1T24ZPz3vSn8KkzVeFrY8HqLHqbKc1TM6V2tdP SpMjp8Fu6K0ANqDa0MJLEDaAMJQ/3dObhpPJngCpgYmzihK27XPwhtMZxpjsDwu3/SMo RPzhmbDX2wLJ7SyyVYpvkKu4KXkCl6ZA3SQsVMS/Y4SqtXOXTYo0X4B2BUVQcgOVZeZV /QWTF6NshaOBE8OpWRuo7JJZIJbWiuodJ7+ElyO33onmOKotE9p/5aSXmtozUgEXa3Ue kW7wf3KkjhBYxDVNVqDtlnGfsZY7zFje8sPdao3mtnk2d+L4Dk8MWynQqRZUe7dqlpks Y8dA== 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=ZOUs9TdB8bEiWBF7IqGxpoWz2sDx5NNhCItS0jiboJ4=; b=evpfzqlWpLA7rgUrNgNt/kO9Au29LA8Axku7myxaY7wFmNSpIipmbPy+tMF6FrM0Bo yHja+puzmT+Mjaymds5T0dfrvYQL2FoyUC+bqImUj2bFKK89hhkTt4y5keXqlyQiRhNT 8vVwIM41RV1wVQyT8DNISZI9QWQPaz4rPiLdQRWL66meVMYfXbmAfSUItV4OO3X+M/0E X4VZafeQousPj3x1yNjjzJovbCRQC4oJGujZi1/4BTgzZFEmvxmik4iOghr6lkjctuQr 4cJ2YWFGCyrmCu0lJcDHKpciHbaQ4J1YhIrw20FtVErJKcFD/LwSdORe+Rtcf0q27yTV P+2w== 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 w7si1326634edj.96.2019.10.30.05.27.21; Wed, 30 Oct 2019 05:27:21 -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 8010C1C0D9; Wed, 30 Oct 2019 13:26:51 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 13D221C069; Wed, 30 Oct 2019 13:26:14 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id CF5AC200787; Wed, 30 Oct 2019 13:26:13 +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 19F5D200485; Wed, 30 Oct 2019 13:26:10 +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 76FA7402FC; Wed, 30 Oct 2019 20:26:05 +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, Radu Bulie , Nipun Gupta Date: Wed, 30 Oct 2019 17:39:53 +0530 Message-Id: <20191030120955.26904-8-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 7/9 v3] mempool/dpaa2: report error on endless loop in mbuf release 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" From: Radu Bulie When BMAN is not able to accept more buffers, it could be that there are no FBPR's (internal mem provided to bman) left. Report error in such condition. Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool") Cc: stable@dpdk.org Signed-off-by: Radu Bulie Signed-off-by: Nipun Gupta --- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 27 +++++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c index f26c30b00..cc4f837b6 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -192,7 +192,7 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused, struct qbman_release_desc releasedesc; struct qbman_swp *swp; int ret; - int i, n; + int i, n, retry_count; uint64_t bufs[DPAA2_MBUF_MAX_ACQ_REL]; if (unlikely(!DPAA2_PER_LCORE_DPIO)) { @@ -225,9 +225,15 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused, } /* feed them to bman */ - do { - ret = qbman_swp_release(swp, &releasedesc, bufs, n); - } while (ret == -EBUSY); + retry_count = 0; + while ((ret = qbman_swp_release(swp, &releasedesc, bufs, n)) == + -EBUSY) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) { + DPAA2_MEMPOOL_ERR("bman release retry exceeded, low fbpr?"); + return; + } + } aligned: /* if there are more buffers to free */ @@ -243,10 +249,15 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused, #endif } - do { - ret = qbman_swp_release(swp, &releasedesc, bufs, - DPAA2_MBUF_MAX_ACQ_REL); - } while (ret == -EBUSY); + retry_count = 0; + while ((ret = qbman_swp_release(swp, &releasedesc, bufs, + DPAA2_MBUF_MAX_ACQ_REL)) == -EBUSY) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) { + DPAA2_MEMPOOL_ERR("bman release retry exceeded, low fbpr?"); + return; + } + } n += DPAA2_MBUF_MAX_ACQ_REL; } }