From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BB82C79F9F for ; Thu, 10 Sep 2026 13:52:16 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9AA45427D9; Thu, 10 Sep 2026 15:52:08 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id C6C83427C3; Thu, 10 Sep 2026 15:52:05 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A7B8D1A0043; Thu, 10 Sep 2026 15:52:05 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 7BCF21A044C; Thu, 10 Sep 2026 15:52:05 +0200 (CEST) Received: from lsv031405.swis.in-blr01.nxp.com (lsv031405.swis.in-blr01.nxp.com [92.120.147.93]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 4D08218000B1; Thu, 10 Sep 2026 21:52:04 +0800 (+08) From: Prashant Gupta To: stephen@networkplumber.org, dev@dpdk.org Cc: stable@dpdk.org, Gagandeep Singh Subject: [PATCH v2 02/47] crypto/dpaa2_sec: fix FLE pool leak on sec FD build failure Date: Thu, 10 Sep 2026 19:21:13 +0530 Message-ID: <20260910135158.2181141-3-prashant.gupta_3@nxp.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260910135158.2181141-1-prashant.gupta_3@nxp.com> References: <20260903135353.3358303-1-prashant.gupta_3@nxp.com> <20260910135158.2181141-1-prashant.gupta_3@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Gagandeep Singh When build_sec_fd fails at index loop inside the enqueue burst loops, the previously built FD entries (indices 0..loop-1) were never freed. The cleanup loop iterated in the wrong direction, starting at the failed index and going up to frames_to_send, which are entries that were never built. This caused silent FLE pool exhaustion, after which every subsequent build_sec_fd returned -ENOMEM, enqueue_burst returned 0 indefinitely, and the crypto-perf test hung. Fix both dpaa2_sec_enqueue_burst and dpaa2_sec_enqueue_burst_ordered by clamping frames_to_send to loop + 1 and iterating from 0 to free all allocated FLE buffers including the failed entry. Fixes: 623326dded3a ("crypto/dpaa2_sec: introduce poll mode driver") Cc: stable@dpdk.org Signed-off-by: Gagandeep Singh --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 96c2e56ff5..e710b4fbd3 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1553,6 +1553,9 @@ dpaa2_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, ret = build_sec_fd(*ops, &fd_arr[loop], bpid, dpaa2_qp); if (ret) { DPAA2_SEC_DP_DEBUG("FD build failed"); + frames_to_send = loop + 1; + for (loop = 0; loop < frames_to_send; loop++) + free_fle(&fd_arr[loop], dpaa2_qp); goto skip_tx; } ops++; @@ -1912,6 +1915,9 @@ dpaa2_sec_enqueue_burst_ordered(void *qp, struct rte_crypto_op **ops, ret = build_sec_fd(*ops, &fd_arr[loop], bpid, dpaa2_qp); if (ret) { DPAA2_SEC_DP_DEBUG("FD build failed"); + frames_to_send = loop + 1; + for (loop = 0; loop < frames_to_send; loop++) + free_fle(&fd_arr[loop], dpaa2_qp); goto skip_tx; } ops++; -- 2.43.0