patch 'net/memif: unwind partial device on create failure' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Nov 5 17:42:47 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.11.9
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/07/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/0d04242131d19b6d5e4510c07563899663d8e80e
Thanks.
Luca Boccassi
---
>From 0d04242131d19b6d5e4510c07563899663d8e80e 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 9382aefebfd..0df8c140ee7 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -1960,18 +1960,18 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
const unsigned int numa_node = vdev->device.numa_node;
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;
}
eth_dev->process_private = process_private;
@@ -1991,7 +1991,7 @@ 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);
if (secret != NULL)
@@ -2026,6 +2026,13 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
rte_eth_dev_probing_finish(eth_dev);
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;
}
static int
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-11-05 16:42:48.012351925 +0000
+++ 0080-net-memif-unwind-partial-device-on-create-failure.patch 2026-11-05 16:42:45.013063535 +0000
@@ -1 +1 @@
-From 4092dee3e7994f3824315edf4490f34321e85603 Mon Sep 17 00:00:00 2001
+From 0d04242131d19b6d5e4510c07563899663d8e80e 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 9382aefebfd..0df8c140ee7 100644
@@ -25 +26 @@
-@@ -1957,18 +1957,18 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
+@@ -1960,18 +1960,18 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
@@ -53 +54 @@
-@@ -1988,7 +1988,7 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
+@@ -1991,7 +1991,7 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
@@ -62 +63 @@
-@@ -2023,6 +2023,13 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
+@@ -2026,6 +2026,13 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
More information about the stable
mailing list