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 0E026C624A4 for ; Thu, 3 Sep 2026 13:54:18 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F125A427C5; Thu, 3 Sep 2026 15:54:02 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id 2FA574279D; Thu, 3 Sep 2026 15:54:01 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 07FB31A0054; Thu, 3 Sep 2026 15:54:01 +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 C63821A0035; Thu, 3 Sep 2026 15:54:00 +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 454ED18000BA; Thu, 3 Sep 2026 21:53:59 +0800 (+08) From: Prashant Gupta To: stephen@networkplumber.org, dev@dpdk.org Cc: stable@dpdk.org, Gagandeep Singh Subject: [PATCH 02/45] crypto/dpaa2_sec: fix FLE pool leak on sec FD build failure Date: Thu, 3 Sep 2026 19:23:10 +0530 Message-ID: <20260903135353.3358303-3-prashant.gupta_3@nxp.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260903135353.3358303-1-prashant.gupta_3@nxp.com> References: <20260903135353.3358303-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 2a015a3d82..15152cc5a1 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -1550,6 +1550,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++; @@ -1909,6 +1912,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