From patchwork Thu Oct 17 12:44:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 176600 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp887582ill; Thu, 17 Oct 2019 06:01:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqylkPvACrONvADiA4vXxLh9jpl6rPDvJCqgMFONzjHuZgBHeYh0cCnhT8zkpc80NFMMUDRw X-Received: by 2002:a50:e40c:: with SMTP id d12mr3520829edm.256.1571317268574; Thu, 17 Oct 2019 06:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571317268; cv=none; d=google.com; s=arc-20160816; b=EGpLTWdr6i7Ie/+VqfpLlIS2e6Z5QYKMF7rQTJ7zUNBbUFpZ50AJOu5jtAMRWkxjOM OVloNFN60yoTUeoSdCJlx1J+As9yG7tkwvHcLqeGcfKjuJw3cHZhJwzRBze89r0u98j2 c3iNMUUB7cF80D2aqcH1F8p2P7039ShuhfE79OIaDXAr1xm2flSORcCUGuWvbeET2zz/ zlUjee+qd9RuBB6N0uyLfDHMcx6OwJKwWG6B358l/KmAHNo4BpoDLVTi3sUOlaIiFwp2 Mi+kDJX5UejNqk693BaiWq9+D3B8FJXt2hklHQWJG/4XfeY2SBOOPLYxfua4O3TgNLSz 1miQ== 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=F/1Ivn8X3SivPo7ohP4KSSLUAKT+VFSTfGTp5Dy0BmE=; b=WK3j6ZSyRPXKpTR5fjiCu4ETllaDt3Kr6TZsBaLXYSziOEGBzQXjeiNCodnI7H1o3Y +LZY+9IkVyfLcFSpX50XdOxrD8wT4c69r//ZULctJWWSfPs3c4KBMYHVy9UK2xUBkjr2 sKp4v0f9bAlEmymIOcAuolIMJ4BxtxQ6DDTmy5MyH8RZ8w3t5DcuoteLIhJLl+k0Xy3t /sQTJ/2U0ojtcVU1syvjfYzru2eGdQy31OIneJagmw6xigAKpq2EOCdycDEhg5LwLwtX NX7jXSP9Ff9KUZGU4atGysKiEO6OBNWF91E5MS7a9M5ut0zqMYwR4y9BbedJtaSAZrf6 bjhg== 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 n8si1320070eju.311.2019.10.17.06.01.08; Thu, 17 Oct 2019 06:01:08 -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 5CAF51EA01; Thu, 17 Oct 2019 15:00:18 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id C98161E979; Thu, 17 Oct 2019 14:59:54 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id AE7D520067C; Thu, 17 Oct 2019 14:59:54 +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 A00F820067B; Thu, 17 Oct 2019 14:59:51 +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 D42A740305; Thu, 17 Oct 2019 20:59:47 +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: Thu, 17 Oct 2019 18:14:01 +0530 Message-Id: <20191017124403.26734-8-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017124403.26734-1-nipun.gupta@nxp.com> References: <20191011054657.21931-1-nipun.gupta@nxp.com> <20191017124403.26734-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 7/9 v2] 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" 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. 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; } }