patch 'net/memif: unwind partial device on create failure' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 14:04:00 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.5

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/08/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/687b9495f1724fcda0083d9bcd32bd57dccb6a85

Thanks.

Kevin

---
>From 687b9495f1724fcda0083d9bcd32bd57dccb6a85 Mon Sep 17 00:00:00 2001
From: Sriram Yagnaraman <sriram.yagnaraman at ericsson.com>
Date: Fri, 16 Oct 2026 21:58:53 +0200
Subject: [PATCH] net/memif: unwind partial device on create failure

[ upstream commit 4092dee3e7994f3824315edf4490f34321e85603 ]

memif_create() returned -1 directly when the process-private allocation
or memif_socket_init() failed, leaving the port allocated by
rte_eth_vdev_allocate() registered and the process-private memory
leaked. Jump to an error label that frees the process-private data and
releases the port instead.

Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD")
Fixes: c41a04958b09 ("net/memif: support multi-process")

Signed-off-by: Sriram Yagnaraman <sriram.yagnaraman at ericsson.com>
---
 drivers/net/memif/rte_eth_memif.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index da2263c0a0..953a9c1b08 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -1964,16 +1964,16 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
 	const char *name = rte_vdev_device_name(vdev);
 
+	/* Allocate process-private data before reserving the port. */
+	process_private = rte_zmalloc(name, sizeof(struct pmd_process_private),
+				      RTE_CACHE_LINE_SIZE);
+	if (process_private == NULL) {
+		MIF_LOG(ERR, "Failed to alloc memory for process private");
+		return -ENOMEM;
+	}
+
 	eth_dev = rte_eth_vdev_allocate(vdev, sizeof(*pmd));
 	if (eth_dev == NULL) {
 		MIF_LOG(ERR, "%s: Unable to allocate device struct.", name);
-		return -1;
-	}
-
-	process_private = (struct pmd_process_private *)
-		rte_zmalloc(name, sizeof(struct pmd_process_private),
-			    RTE_CACHE_LINE_SIZE);
-
-	if (process_private == NULL) {
-		MIF_LOG(ERR, "Failed to alloc memory for process private");
+		rte_free(process_private);
 		return -1;
 	}
@@ -1995,5 +1995,5 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
 	ret = memif_socket_init(eth_dev, socket_filename);
 	if (ret < 0)
-		return ret;
+		goto error;
 
 	memset(pmd->secret, 0, sizeof(char) * ETH_MEMIF_SECRET_SIZE);
@@ -2030,4 +2030,11 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
 
 	return 0;
+
+error:
+	/* rte_eth_dev_release_port() does not free process_private. */
+	rte_free(eth_dev->process_private);
+	eth_dev->process_private = NULL;
+	rte_eth_dev_release_port(eth_dev);
+	return ret;
 }
 
-- 
2.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:48.091471534 +0000
+++ 0314-net-memif-unwind-partial-device-on-create-failure.patch	2026-12-03 12:52:39.245873833 +0000
@@ -1 +1 @@
-From 4092dee3e7994f3824315edf4490f34321e85603 Mon Sep 17 00:00:00 2001
+From 687b9495f1724fcda0083d9bcd32bd57dccb6a85 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4092dee3e7994f3824315edf4490f34321e85603 ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index 70359554e6..e70443976d 100644
+index da2263c0a0..953a9c1b08 100644
@@ -25 +26 @@
-@@ -1958,16 +1958,16 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
+@@ -1964,16 +1964,16 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
@@ -51 +52 @@
-@@ -1989,5 +1989,5 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
+@@ -1995,5 +1995,5 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
@@ -58 +59 @@
-@@ -2024,4 +2024,11 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
+@@ -2030,4 +2030,11 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,



More information about the stable mailing list