From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BEB79A04F0 for ; Thu, 19 Dec 2019 15:40:27 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B33FB1BFD5; Thu, 19 Dec 2019 15:40:27 +0100 (CET) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 31A781BFE7 for ; Thu, 19 Dec 2019 15:40:26 +0100 (CET) Received: by mail-wr1-f67.google.com with SMTP id w15so6245999wru.4 for ; Thu, 19 Dec 2019 06:40:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7SJMUMHsuqe6P5wdNBMqxk32pLYXzbubneZdnq9RGNo=; b=DLukUhS+iJlFcmGDcSF1WsGtSfc3QDFNg8rcpSLXkgnPkjLPabRdX522R3TSforkIJ A1iPBmCfN1DY+jebUvLze5r5FqMzbuvg7tdTP0KlNb3n5t8z+J5p/qbTm7zvWw6imUum UdkNotJFz5jyLtuu3ABFH2IALaVazOu1w07IwKqm/mkcMdW+s2U7E6THX/Fi4sGe/yAX USpbZEroWP/5rYJSoFUFDruva/OXtXhH0qHzzijFqSpAkEJ/DbY0ES8Nx2nQ1DN95E55 vj0D0XS1VXonoH+4zCM0JaW43Q/bsmnwEfppcruPI5RdcvLSjpxzjEp8RXmoTaCxeA/J FwDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7SJMUMHsuqe6P5wdNBMqxk32pLYXzbubneZdnq9RGNo=; b=ptdmvBVGZOcWvemCmTnb/igFOXtH0HgOih/X1J3ZS0w4bVGtbkwA9EOxADXS2Ebtuw iqXBa7OMz37Gg8vXlm6q5awA7o0A5TPyPxrqaC/50jFA04FPV3jjZRLfs3gEWqJVlO+S btbuxGG90eMucMq5/d+e57vFSs4VHeQR2mgAGNS23IzXmyl4f2Xw/jyoAkzj4mutjqaY GdBJEcBZT/oFSIsacOt0NToButHBuU00tyOcvByn/DAUHUL8ZnRURB4Vy1gNAMn46tNM 1AL2ruDIReQEU7B+aKBvlFKH8urQC+vE81FO2gaItPeEW1bog37OzwMa55v9q+uBS/7p cZcg== X-Gm-Message-State: APjAAAWqNLR+we7CPDtK6IKE6eE+y+JuvT/z3+o4Rr7X9lUiBzwAyhc2 UFvWOy5HSAGPK9p3ONjX3g3fQ1LnrXI= X-Google-Smtp-Source: APXvYqzrqvSDjmarLErfd9PX/sbNX9+PKIpJSbjcadEDDX/FzBbr4QK1GcUVoE1Hy3hDqhNU0hK6Ng== X-Received: by 2002:adf:82a7:: with SMTP id 36mr10314012wrc.203.1576766425841; Thu, 19 Dec 2019 06:40:25 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id z187sm6451519wme.16.2019.12.19.06.40.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 06:40:25 -0800 (PST) From: luca.boccassi@gmail.com To: Radu Bulie Cc: Nipun Gupta , dpdk stable Date: Thu, 19 Dec 2019 14:34:06 +0000 Message-Id: <20191219143447.21506-99-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219143447.21506-1-luca.boccassi@gmail.com> References: <20191219143447.21506-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'mempool/dpaa2: report error on endless loop in mbuf release' has been queued to LTS release 17.11.10 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 17.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/21/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From ddbaab62521e6d5db2c9a216db1f71abc456a92f Mon Sep 17 00:00:00 2001 From: Radu Bulie Date: Tue, 5 Nov 2019 19:53:19 +0530 Subject: [PATCH] mempool/dpaa2: report error on endless loop in mbuf release [ upstream commit f0617163b8d2678371d0c93926cebb6c1e7981d7 ] 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") 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(-) diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c index 8bcbaa8927..81b7e85d4e 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -200,7 +200,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)) { @@ -233,9 +233,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 */ @@ -251,10 +257,15 @@ aligned: #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; } } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-12-19 14:32:30.271833366 +0000 +++ 0099-mempool-dpaa2-report-error-on-endless-loop-in-mbuf-r.patch 2019-12-19 14:32:26.229300284 +0000 @@ -1,14 +1,15 @@ -From f0617163b8d2678371d0c93926cebb6c1e7981d7 Mon Sep 17 00:00:00 2001 +From ddbaab62521e6d5db2c9a216db1f71abc456a92f Mon Sep 17 00:00:00 2001 From: Radu Bulie Date: Tue, 5 Nov 2019 19:53:19 +0530 Subject: [PATCH] mempool/dpaa2: report error on endless loop in mbuf release +[ upstream commit f0617163b8d2678371d0c93926cebb6c1e7981d7 ] + 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 @@ -17,10 +18,10 @@ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c -index f26c30b007..cc4f837b68 100644 +index 8bcbaa8927..81b7e85d4e 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, +@@ -200,7 +200,7 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused, struct qbman_release_desc releasedesc; struct qbman_swp *swp; int ret; @@ -29,7 +30,7 @@ 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, +@@ -233,9 +233,15 @@ rte_dpaa2_mbuf_release(struct rte_mempool *pool __rte_unused, } /* feed them to bman */ @@ -48,7 +49,7 @@ aligned: /* if there are more buffers to free */ -@@ -243,10 +249,15 @@ aligned: +@@ -251,10 +257,15 @@ aligned: #endif }