patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Shani Peretz <shperetz@nvidia.com>
To: Yang Ming <mosesyyoung@gmail.com>
Cc: Anatoly Burakov <anatoly.burakov@intel.com>,
	dpdk stable <stable@dpdk.org>
Subject: patch 'crypto/ipsec_mb: fix QP release in secondary' has been queued to stable release 23.11.6
Date: Sun, 21 Dec 2025 16:56:29 +0200	[thread overview]
Message-ID: <20251221145746.763179-41-shperetz@nvidia.com> (raw)
In-Reply-To: <20251221145746.763179-1-shperetz@nvidia.com>

Hi,

FYI, your patch has been queued to stable release 23.11.6

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/26/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/shanipr/dpdk-stable

This queued commit can be viewed at:
https://github.com/shanipr/dpdk-stable/commit/2ddd67a20a0232b2801c29f16a535420661aa0be
the

Thanks.

Shani

---
From 2ddd67a20a0232b2801c29f16a535420661aa0be Mon Sep 17 00:00:00 2001
From: Yang Ming <mosesyyoung@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@gmail.com>
Acked-by: Anatoly Burakov <anatoly.burakov@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 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.43.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-12-21 16:54:19.412757251 +0200
+++ 0041-crypto-ipsec_mb-fix-QP-release-in-secondary.patch	2025-12-21 16:54:17.043087000 +0200
@@ -1 +1 @@
-From 0e03ab647d07cd985a7cac36cefff5195cc3a07d Mon Sep 17 00:00:00 2001
+From 2ddd67a20a0232b2801c29f16a535420661aa0be 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)

  parent reply	other threads:[~2025-12-21 15:02 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-21 14:55 patch 'test/telemetry: fix test calling all commands' " Shani Peretz
2025-12-21 14:55 ` patch 'eal: fix plugin dir walk' " Shani Peretz
2025-12-21 14:55 ` patch 'cmdline: fix port list parsing' " Shani Peretz
2025-12-21 14:55 ` patch 'cmdline: fix highest bit " Shani Peretz
2025-12-21 14:55 ` patch 'tailq: fix lookup macro' " Shani Peretz
2025-12-21 14:55 ` patch 'hash: fix unaligned access in predictable RSS' " Shani Peretz
2025-12-21 14:55 ` patch 'graph: fix unaligned access in stats' " Shani Peretz
2025-12-21 14:55 ` patch 'eventdev: fix listing timer adapters with telemetry' " Shani Peretz
2025-12-21 14:55 ` patch 'cfgfile: fix section count with no name' " Shani Peretz
2025-12-21 14:55 ` patch 'net/gve: do not write zero-length descriptors' " Shani Peretz
2025-12-21 14:55 ` patch 'net/gve: validate Tx packet before sending' " Shani Peretz
2025-12-21 14:56 ` patch 'net/vmxnet3: fix mapping of mempools to queues' " Shani Peretz
2025-12-21 14:56 ` patch 'app/testpmd: increase size of set cores list command' " Shani Peretz
2025-12-21 14:56 ` patch 'net/dpaa2: fix shaper rate' " Shani Peretz
2025-12-21 14:56 ` patch 'app/testpmd: monitor state of primary process' " Shani Peretz
2025-12-21 14:56 ` patch 'net/gve: fix disabling interrupts on DQ' " Shani Peretz
2025-12-21 14:56 ` patch 'app/testpmd: fix conntrack action query' " Shani Peretz
2025-12-21 14:56 ` patch 'doc: add conntrack state inspect command to testpmd guide' " Shani Peretz
2025-12-21 14:56 ` patch 'net/gve: free Rx mbufs if allocation fails on ring setup' " Shani Peretz
2025-12-21 14:56 ` patch 'app/testpmd: validate DSCP and VLAN for meter creation' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5: fix min and max MTU reporting' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5: fix storage of shared Rx queues' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5/hws: fix ESP header match in strict mode' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5: fix unsupported flow rule port action' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5: fix non-template age rules flush' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5: fix connection tracking state item validation' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5/hws: fix TIR action support in FDB' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5: fix indirect flow age action handling' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5: fix Direct Verbs counter offset detection' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5: fix interface name parameter definition' " Shani Peretz
2025-12-21 14:56 ` patch 'net/iavf: fix Tx vector path selection logic' " Shani Peretz
2025-12-21 14:56 ` patch 'net/ice: fix vector Rx VLAN offload flags' " Shani Peretz
2025-12-21 14:56 ` patch 'net/intel: fix assumption about tag placement order' " Shani Peretz
2025-12-21 14:56 ` patch 'net/ice: fix VLAN tag reporting on Rx' " Shani Peretz
2025-12-21 14:56 ` patch 'net/ice/base: fix adding special words' " Shani Peretz
2025-12-21 14:56 ` patch 'net/ice/base: fix memory leak in HW profile handling' " Shani Peretz
2025-12-21 14:56 ` patch 'net/ice/base: fix memory leak in recipe " Shani Peretz
2025-12-21 14:56 ` patch 'gro: fix payload corruption in coalescing packets' " Shani Peretz
2025-12-21 14:56 ` patch 'eal: fix DMA mask validation with IOVA mode option' " Shani Peretz
2025-12-21 14:56 ` patch 'eal: fix MP socket cleanup' " Shani Peretz
2025-12-21 14:56 ` Shani Peretz [this message]
2025-12-21 14:56 ` patch 'efd: fix AVX2 support' " Shani Peretz
2025-12-21 14:56 ` patch 'net/octeon_ep: fix device start' " Shani Peretz
2025-12-21 14:56 ` patch 'common/cnxk: fix async event handling' " Shani Peretz
2025-12-21 14:56 ` patch 'doc: fix feature list of ice driver' " Shani Peretz
2025-12-21 14:56 ` patch 'doc: fix feature list of iavf " Shani Peretz
2025-12-21 14:56 ` patch 'baseband/acc: fix exported header' " Shani Peretz
2025-12-21 14:56 ` patch 'eventdev: do not include driver header in DMA adapter' " Shani Peretz
2025-12-21 14:56 ` patch 'gpudev: fix driver header for Windows' " Shani Peretz
2025-12-21 14:56 ` patch 'drivers: fix some exported headers' " Shani Peretz
2025-12-21 14:56 ` patch 'test/debug: fix crash with mlx5 devices' " Shani Peretz
2025-12-21 14:56 ` patch 'bus/pci: fix build with MinGW 13' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5: " Shani Peretz
2025-12-21 14:56 ` patch 'dma/hisilicon: fix stop with pending transfers' " Shani Peretz
2025-12-21 14:56 ` patch 'test/dma: fix failure condition' " Shani Peretz
2025-12-21 14:56 ` patch 'eal/x86: enable timeout in AMD power monitor' " Shani Peretz
2025-12-21 14:56 ` patch 'fib6: fix tbl8 allocation check logic' " Shani Peretz
2025-12-21 14:56 ` patch 'vhost: add VDUSE virtqueue ready state polling workaround' " Shani Peretz
2025-12-21 14:56 ` patch 'vhost: fix virtqueue info init in VDUSE vring setup' " Shani Peretz
2025-12-21 14:56 ` patch 'vhost: fix double fetch when dequeue offloading' " Shani Peretz
2025-12-21 14:56 ` patch 'net/ice/base: fix integer overflow on NVM init' " Shani Peretz
2025-12-21 14:56 ` patch 'doc: fix display of commands in cpfl guide' " Shani Peretz
2025-12-21 14:56 ` patch 'net/ice: fix initialization with 8 ports' " Shani Peretz
2025-12-21 14:56 ` patch 'net/ice: remove indirection for FDIR filters' " Shani Peretz
2025-12-21 14:56 ` patch 'net/ice: fix memory leak in raw pattern parse' " Shani Peretz
2025-12-21 14:56 ` patch 'net/i40e: fix symmetric Toeplitz hashing for SCTP' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5/hws: fix ESP header match in strict mode' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5: fix ESP header match after UDP for group 0' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5: fix multicast' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5: fix indirect flow action memory leak' " Shani Peretz
2025-12-21 14:56 ` patch 'net/mlx5: fix MTU initialization' " Shani Peretz
2025-12-21 14:57 ` patch 'net/mlx5: fix leak of flow indexed pools' " Shani Peretz
2025-12-21 14:57 ` patch 'net/hns3: fix inconsistent lock' " Shani Peretz
2025-12-21 14:57 ` patch 'net/hns3: fix VLAN resources freeing' " Shani Peretz
2025-12-21 14:57 ` patch 'net/hns3: fix overwrite mbuf in vector path' " Shani Peretz
2025-12-21 14:57 ` patch 'net/af_packet: fix crash in secondary process' " Shani Peretz
2025-12-21 14:57 ` patch 'net/ark: remove double mbuf free' " Shani Peretz
2025-12-21 14:57 ` patch 'app/testpmd: stop forwarding in secondary process' " Shani Peretz
2025-12-21 14:57 ` patch 'net/tap: fix build with LTO' " Shani Peretz
2025-12-21 14:57 ` patch 'net/hns3: fix VLAN tag loss for short tunnel frame' " Shani Peretz
2025-12-21 14:57 ` patch 'ethdev: fix VLAN filter parameter description' " Shani Peretz
2025-12-21 14:57 ` patch 'net/enetfec: fix file descriptor leak on read error' " Shani Peretz
2025-12-21 14:57 ` patch 'net/enetfec: fix out-of-bounds access in UIO mapping' " Shani Peretz
2025-12-21 14:57 ` patch 'net/enetfec: fix buffer descriptor size configuration' " Shani Peretz
2025-12-21 14:57 ` patch 'net/enetfec: fix Tx queue free' " Shani Peretz
2025-12-21 14:57 ` patch 'net/enetfec: fix checksum flag handling and error return' " Shani Peretz
2025-12-21 14:57 ` patch 'net/enetfec: reject multi-queue configuration' " Shani Peretz
2025-12-21 14:57 ` patch 'net/enetfec: fix memory leak in Rx buffer cleanup' " Shani Peretz
2025-12-21 14:57 ` patch 'net/enetfec: reject Tx deferred queue' " Shani Peretz
2025-12-21 14:57 ` patch 'net/tap: fix interrupt callback crash after failed start' " Shani Peretz
2025-12-21 14:57 ` patch 'net/ena: fix PCI BAR mapping on 64K page size' " Shani Peretz
2025-12-21 14:57 ` patch 'net/ena/base: fix unsafe memcpy on invalid memory' " Shani Peretz
2025-12-21 14:57 ` patch 'net/dpaa2: fix uninitialized variable' " Shani Peretz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251221145746.763179-41-shperetz@nvidia.com \
    --to=shperetz@nvidia.com \
    --cc=anatoly.burakov@intel.com \
    --cc=mosesyyoung@gmail.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).