patch 'crypto/ipsec_mb: fix QP release in secondary' has been queued to stable release 24.11.4
Kevin Traynor
ktraynor at redhat.com
Fri Oct 31 15:32:56 CET 2025
Hi,
FYI, your patch has been queued to stable release 24.11.4
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/05/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/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/ff46fb5d2cbf8aaa5636a1c5c7f1263324fc4cb5
the
Thanks.
Kevin
---
>From ff46fb5d2cbf8aaa5636a1c5c7f1263324fc4cb5 Mon Sep 17 00:00:00 2001
From: Yang Ming <mosesyyoung at gmail.com>
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 <mosesyyoung at gmail.com>
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
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 910efb1a97..50ee140ccd 100644
--- a/drivers/crypto/ipsec_mb/ipsec_mb_ops.c
+++ b/drivers/crypto/ipsec_mb/ipsec_mb_ops.c
@@ -139,4 +139,5 @@ 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)
@@ -153,6 +154,8 @@ ipsec_mb_qp_release(struct rte_cryptodev *dev, uint16_t qp_id)
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.51.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-10-31 13:53:53.946230481 +0000
+++ 0054-crypto-ipsec_mb-fix-QP-release-in-secondary.patch 2025-10-31 13:53:52.164523768 +0000
@@ -1 +1 @@
-From 0e03ab647d07cd985a7cac36cefff5195cc3a07d Mon Sep 17 00:00:00 2001
+From ff46fb5d2cbf8aaa5636a1c5c7f1263324fc4cb5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0e03ab647d07cd985a7cac36cefff5195cc3a07d ]
+
@@ -41 +42,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list