From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C3F1B489EF for ; Mon, 27 Oct 2025 17:21:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BDFB040668; Mon, 27 Oct 2025 17:21:37 +0100 (CET) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mails.dpdk.org (Postfix) with ESMTP id E7B3A40663 for ; Mon, 27 Oct 2025 17:21:36 +0100 (CET) Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-429a0d1c31aso731058f8f.1 for ; Mon, 27 Oct 2025 09:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761582096; x=1762186896; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/VGN1IewhbMgtLJrH2gzbVwtc7aFKArkCLUX7/aG/2o=; b=jXliMAWgrCxnHuchEVS9nB7CtWPNbuw8f6RkIx0lhTSNLxQC4fiW0VJnBaXxIp8gpm ndP+BxpxNer6Mw67gG0x/Vf7vybxgZ28ZvAhPGQIDeWvOdlugDjK++jCvJ5J2hanPD8+ V3yiLzkbEtheuWfRz41WdvaZg5zwxqo4MIJ2VdZbgDvcBZKtrktB9VbYm5OFvrdAvaoQ 0+1vAgcMg3Je/0uYBETz/A7K0lMdFf0PQkghg1/6qUI9MScTdJLLet5yM1kdKOT7/YoN zyuTRkOW1h7Hj/FWe+JqRTRJ8QZiJ3OgnN0Vl86p0BfROVW9gwivIyTX87j0S7iHRPBU k5sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761582096; x=1762186896; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/VGN1IewhbMgtLJrH2gzbVwtc7aFKArkCLUX7/aG/2o=; b=GFnnfJNw1kHg89AS2AUZgYnfkUm8lSZ/IMMVMPEQ8uaxptvteaEFV5z0Uq9r6MjaRO ppWZJJx8nYptrSpMP3Tl1WNWYg9hUxEvfClrUN6uP34hVKGrAXYj8+vr1c7yc+zn+c7w fNRZX22Z7IAy8JLpkxr5wgJd+beO1dzIDARMC/TOHhVaTSLZUV4JUx74VyFPuN65cajh 15LCbgFTYsklI3S+HJDrJ19HCWJJYyO7MqtaMfUCtzUcOGuw511z18GIhfXPtsFqEnM6 s+YukyJwhLk2MDYNxFWJqkd3d9GhWWeB/A0FMEsd0DzJt66pqyW9bES3DfgfKvXcLa3X RzOA== X-Forwarded-Encrypted: i=1; AJvYcCV7aNo0DTcRXo52YtVQbqk/rRkosri1mwq9t+FXM2aQzT4En8sqO9caDONyVuQFEX4NP2NB7Ho=@dpdk.org X-Gm-Message-State: AOJu0YzF6su3qZBAdBYqTIAsRYQ8W35JKxoWmgadz5BmgCRMYPmCEgI4 J8ePw1wxObEKvRma+sU0qqx+yQ+VPAWtOo9aaVwoSCEqwibWEqRMcOdMHeovJw== X-Gm-Gg: ASbGnctar+DolvXaZAWwoRw9HKq+mDZqZN9DSi4/oSED/XznuYyC/OxDM1uLrllc0va eYO22ugpE1XaUL4i/WJuaI4unmiqyZhjKhDa9eW46Zg9P0mGP0+/c9qCa3lGQSEJEy+np9m9tI9 HNSA+wn48/c/OAzWdFjlrW58MbZhiQRyXsZ1Lv3shnlLfgX/qADniFOi4W3ArKJpvXtM31dSgkw l3YltQ+ypPdvktsDtJx0b4n31ArDd1OQ0TxCwe12NGS8pDzTjmQTW6cx98UmfSaNjpihnIMY3gg I/L8dO+tZhGT29IR/Z/vCPS0yx1QrezDIQryxdOe4f57UqzxzcKTFCoBD41/PphMi8x+bNZpro6 u0LneV/YXTiF9fSrJZ37TQrafhFk1oaHRnkry7zjAIrIJWEzCAKSQnsOEIZKIgJjtu1Qjotwo7u dchbk5SzQeEPZrehdR X-Google-Smtp-Source: AGHT+IHPOqiCktNEL6F5cDS0DEEHai9zwYpPeWvVSt+bOujIMTd80Rr/mhTA/NAPMAO8SsNaIERSRw== X-Received: by 2002:a05:6000:18a6:b0:427:84a:6db1 with SMTP id ffacd0b85a97d-429a83e66c1mr13771f8f.31.1761582096418; Mon, 27 Oct 2025 09:21:36 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:6fc5:c3bc:147e:832c]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-429952d514asm15253053f8f.23.2025.10.27.09.21.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 09:21:35 -0700 (PDT) From: luca.boccassi@gmail.com To: Yang Ming Cc: Anatoly Burakov , dpdk stable Subject: patch 'crypto/ipsec_mb: fix QP release in secondary' has been queued to stable release 22.11.11 Date: Mon, 27 Oct 2025 16:19:08 +0000 Message-ID: <20251027162001.3710450-30-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251027162001.3710450-1-luca.boccassi@gmail.com> References: <20251027162001.3710450-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 22.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/29/25. 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. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/56657366e67ba64b46ed9f65a9db5da54e2c0506 the Thanks. Luca Boccassi --- >From 56657366e67ba64b46ed9f65a9db5da54e2c0506 Mon Sep 17 00:00:00 2001 From: Yang Ming Date: Sat, 19 Jul 2025 23:32:26 +0800 Subject: [PATCH] crypto/ipsec_mb: fix QP release in secondary [ upstream commit 0e03ab647d07cd985a7cac36cefff5195cc3a07d ] When a secondary process tries to release a queue pair (QP) that does not belong to it, error logs occur: CRYPTODEV: ipsec_mb_ipc_request() line 373: Unable to release qp_id=0 EAL: Message data is too long EAL: Fail to handle message: ipsec_mb_mp_msg EAL: Fail to recv reply for request /tmp/dpdk/l2hi/mp_socket: ipsec_mb_mp_msg >From the code path, cryptodev->data is allocated in the primary via rte_cryptodev_data_alloc() (inside ipsec_mb_create-->rte_cryptodev_pmd_create -->rte_cryptodev_pmd_allocate-->rte_cryptodev_data_alloc). This memory is placed in a shared memzone (rte_cryptodev_data_%u), so both primary and secondary processes reference the same cryptodev->data, including nb_queue_pairs and queue_pairs[]. As a result, when the secondary process exits, ipsec_mb_remove() is called (inside rte_eal_cleanup-->eal_bus_cleanup-->vdev_cleanup -->rte_vdev_driver-->ipsec_mb_remove-->ipsec_mb_qp_release -->ipsec_mb_secondary_qp_op) and it loops through all queue pairs using: for (qp_id = 0; qp_id < cryptodev->data->nb_queue_pairs; qp_id++) ipsec_mb_qp_release(cryptodev, qp_id); This causes the secondary to attempt releasing queue pairs it doesn't own, triggering the error logs mentioned above. This patch ensures that a secondary process only frees a QP if it actually owns it, preventing conflicts and resolving the issue. Fixes: b35848bc01f6 ("crypto/ipsec_mb: add multi-process IPC request handler") Signed-off-by: Yang Ming Acked-by: Anatoly Burakov --- drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c index 2a5599b7d8..ccfda2048a 100644 --- a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c +++ b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c @@ -139,6 +139,7 @@ int ipsec_mb_qp_release(struct rte_cryptodev *dev, uint16_t qp_id) { struct ipsec_mb_qp *qp = dev->data->queue_pairs[qp_id]; + uint16_t process_id = (uint16_t)getpid(); if (!qp) return 0; @@ -158,8 +159,10 @@ ipsec_mb_qp_release(struct rte_cryptodev *dev, uint16_t qp_id) rte_free(qp); dev->data->queue_pairs[qp_id] = NULL; } else { /* secondary process */ - return ipsec_mb_secondary_qp_op(dev->data->dev_id, qp_id, - NULL, 0, RTE_IPSEC_MB_MP_REQ_QP_FREE); + if (qp->qp_used_by_pid == process_id) + return ipsec_mb_secondary_qp_op(dev->data->dev_id, + qp_id, NULL, 0, + RTE_IPSEC_MB_MP_REQ_QP_FREE); } return 0; } -- 2.47.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-10-27 15:54:35.979605120 +0000 +++ 0030-crypto-ipsec_mb-fix-QP-release-in-secondary.patch 2025-10-27 15:54:34.803949751 +0000 @@ -1 +1 @@ -From 0e03ab647d07cd985a7cac36cefff5195cc3a07d Mon Sep 17 00:00:00 2001 +From 56657366e67ba64b46ed9f65a9db5da54e2c0506 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0e03ab647d07cd985a7cac36cefff5195cc3a07d ] + @@ -41 +42,0 @@ -Cc: stable@dpdk.org @@ -50 +51 @@ -index 910efb1a97..50ee140ccd 100644 +index 2a5599b7d8..ccfda2048a 100644 @@ -53 +54 @@ -@@ -138,6 +138,7 @@ int +@@ -139,6 +139,7 @@ int @@ -61 +62 @@ -@@ -152,8 +153,10 @@ ipsec_mb_qp_release(struct rte_cryptodev *dev, uint16_t qp_id) +@@ -158,8 +159,10 @@ ipsec_mb_qp_release(struct rte_cryptodev *dev, uint16_t qp_id)