patch 'net/iavf: fix memory leak on egress IPsec flows' has been queued to stable release 25.11.1

Kevin Traynor ktraynor at redhat.com
Thu Feb 26 14:10:12 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/02/26. 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/78419b4ee99dfe2b3fe977daf8d5e5adb7433e93

Thanks.

Kevin

---
>From 78419b4ee99dfe2b3fe977daf8d5e5adb7433e93 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov at intel.com>
Date: Fri, 13 Feb 2026 09:10:10 +0000
Subject: [PATCH] net/iavf: fix memory leak on egress IPsec flows

[ upstream commit e783da175250095e65d39bc8a97631f1725f3256 ]

When creating egress IPsec flows, no action need to be done in hardware,
as this is just a software association. However, because we do not write
anything to the rte_flow entry, subsequent destroy call will not destroy
this kind of flow, because it expects a valid engine to be set for every
flow. This results in memory unable to be freed back to the system.

In addition to that, when creating these flows, we do not actually store
the rte_flow pointer anywhere, so even if the user has triggered
`uninit` (which would have freed the flow), this flow isn't in the list
so it would never get freed.

Fix this by marking the flow as egress IPsec flows, adding it to the
tailq, and changing the `destroy` code to take all of that into account.

Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto")

Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Radu Nicolau <radu.nicolau at intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
---
 drivers/net/intel/iavf/iavf_generic_flow.c | 30 +++++++++++++++++-----
 drivers/net/intel/iavf/iavf_generic_flow.h |  1 +
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/drivers/net/intel/iavf/iavf_generic_flow.c b/drivers/net/intel/iavf/iavf_generic_flow.c
index 6f6e95fc45..02917f863d 100644
--- a/drivers/net/intel/iavf/iavf_generic_flow.c
+++ b/drivers/net/intel/iavf/iavf_generic_flow.c
@@ -2266,6 +2266,8 @@ iavf_flow_create(struct rte_eth_dev *dev,
 
 	/* Special case for inline crypto egress flows */
-	if (attr->egress && actions[0].type == RTE_FLOW_ACTION_TYPE_SECURITY)
-		goto free_flow;
+	if (attr->egress && actions[0].type == RTE_FLOW_ACTION_TYPE_SECURITY) {
+		flow->is_ipsec_egress_flow = true;
+		goto tailq_insert;
+	}
 
 	ret = iavf_flow_process_filter(dev, flow, attr, pattern, actions,
@@ -2279,4 +2281,5 @@ iavf_flow_create(struct rte_eth_dev *dev,
 
 	flow->engine = engine;
+tailq_insert:
 	rte_spinlock_lock(&vf->flow_ops_lock);
 	TAILQ_INSERT_TAIL(&vf->flow_list, flow, node);
@@ -2294,5 +2297,12 @@ iavf_flow_is_valid(struct rte_flow *flow)
 	void *temp;
 
-	if (flow && flow->engine) {
+	if (flow == NULL)
+		return false;
+
+	/* these flows don't use engines */
+	if (flow->is_ipsec_egress_flow)
+		return true;
+
+	if (flow->engine) {
 		RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
 			if (engine == flow->engine)
@@ -2312,7 +2322,8 @@ iavf_flow_destroy(struct rte_eth_dev *dev,
 		IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
+	bool need_destroy;
 	int ret = 0;
 
-	if (!iavf_flow_is_valid(flow) || !flow->engine->destroy) {
+	if (!iavf_flow_is_valid(flow)) {
 		rte_flow_error_set(error, EINVAL,
 				   RTE_FLOW_ERROR_TYPE_HANDLE,
@@ -2320,8 +2331,15 @@ iavf_flow_destroy(struct rte_eth_dev *dev,
 		return -rte_errno;
 	}
+	need_destroy = !flow->is_ipsec_egress_flow;
+
+	if (need_destroy && flow->engine->destroy == NULL) {
+		return rte_flow_error_set(error, EINVAL,
+				RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
+				"Invalid flow destroy");
+	}
 
 	rte_spinlock_lock(&vf->flow_ops_lock);
-
-	ret = flow->engine->destroy(ad, flow, error);
+	if (need_destroy)
+		ret = flow->engine->destroy(ad, flow, error);
 
 	if (!ret) {
diff --git a/drivers/net/intel/iavf/iavf_generic_flow.h b/drivers/net/intel/iavf/iavf_generic_flow.h
index 60d8ab02b4..b11bb4cf2b 100644
--- a/drivers/net/intel/iavf/iavf_generic_flow.h
+++ b/drivers/net/intel/iavf/iavf_generic_flow.h
@@ -518,4 +518,5 @@ TAILQ_HEAD(iavf_engine_list, iavf_flow_engine);
 struct rte_flow {
 	TAILQ_ENTRY(rte_flow) node;
+	bool is_ipsec_egress_flow;
 	struct iavf_flow_engine *engine;
 	void *rule;
-- 
2.53.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-02-26 10:16:52.129781523 +0000
+++ 0130-net-iavf-fix-memory-leak-on-egress-IPsec-flows.patch	2026-02-26 10:16:47.188460273 +0000
@@ -1 +1 @@
-From e783da175250095e65d39bc8a97631f1725f3256 Mon Sep 17 00:00:00 2001
+From 78419b4ee99dfe2b3fe977daf8d5e5adb7433e93 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e783da175250095e65d39bc8a97631f1725f3256 ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list