From patchwork Fri Oct 11 05:46: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: 175910 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp311802ill; Thu, 10 Oct 2019 23:03:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIoQMKnvyeQdAOqR5gxHjL8KHyzCWT9OxfZOxu9ICDf02jwiE30IX8zUyMREe66gWSdB/k X-Received: by 2002:a05:6402:17f1:: with SMTP id t17mr11548144edy.11.1570773786532; Thu, 10 Oct 2019 23:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570773786; cv=none; d=google.com; s=arc-20160816; b=s2HyhDjXhQKacZvNSXJl9BZNo0nBqfyvxd/j3viR0V+6DcJorQQMJDAcyWMmh5JVd6 F4fOxHo/EoBSz3W8l5YLqAECVdNKfex7S367AhR0VJZWZdaM1OMMd9cKL4t927sBnW9+ IpgDINoJaXVTvsi8Qy9SnNg0WZR+SmAM7DdFsEhVFoWkg9XLn2hSW7OcctMfXd59Hy74 w57Dnr9DR4Wk4M+TnusjY7TJEnXv/GIN4AgiIsG2T5+OxBAgdFykJQRf8aGAfq6aIsZw pkG3JwPmikegNCaBFpPBKLGvlfZHzASdQEcqJWWzwjAr8GR05pNW0wne1vREumEaCDCt IxIA== 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=5WSJY5s2GBPSBQD8pIhSdfYrB+SiS+0Q9Z1oZafIZ+w=; b=oO3l2+qcsuxrpqX63dBQdlHDettNKEzLsLK3wiouVc8JVd5Ky0sY+PlrS6Jv7JkJjO kefxvkyVwKd/FqdRM2McAVzqOEmfcTNqqraF0MjkRQsk2bDzsgZv+Jf2BrC8yf8zW7JB uDCFgIfDjbm5FrIJfcVIE3wZzcOZo/2j4fFFQWs1k/6r4RiNf4YU2tPOOkp4W2Psutim vIHC7mUTD8ikEi+jvgaEguEsLjltZ+DSXPcUHvHCO2mztNqdlin9FH3v/TDSp9aee2dW Efh3KOUqRCOVoOUQqS3PaSz00ti0RS1rBFgKab4fv3D9k2FFeIO1GEVvdGWT/F4BoX5q jnXg== 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 c1si4633038edq.250.2019.10.10.23.03.06; Thu, 10 Oct 2019 23:03:06 -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 A03B31E8EE; Fri, 11 Oct 2019 08:02:43 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 664A11E932; Fri, 11 Oct 2019 08:02:37 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 2D0C4200094; Fri, 11 Oct 2019 08:02:37 +0200 (CEST) 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 166772004E9; Fri, 11 Oct 2019 08:02:34 +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 D0DA4402E7; Fri, 11 Oct 2019 14:02:29 +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, Radu Bulie Date: Fri, 11 Oct 2019 11:16:52 +0530 Message-Id: <20191011054657.21931-5-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 4/9] mempool/dpaa2: panic 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" When BMAN is not able to accept more buffers, it could be that there are no FBPR's (internal mem provided to bman) left. Panic in such conditions. Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool") Cc: stable@dpdk.org Signed-off-by: Radu Bulie --- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 23 +++++++++++++++-------- 1 file changed, 15 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..7e815a1ce 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,13 @@ 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) + rte_panic("bman release retry exceeded, low fbpr?\n"); + } aligned: /* if there are more buffers to free */ @@ -243,10 +247,13 @@ 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) + rte_panic("bman release retry exceeded, low fbpr?\n"); + } n += DPAA2_MBUF_MAX_ACQ_REL; } }