[dpdk-stable] patch 'ethdev: fix error handling in create function' has been queued to stable release 18.08.1
Kevin Traynor
ktraynor at redhat.com
Wed Nov 21 17:04:20 CET 2018
Hi,
FYI, your patch has been queued to stable release 18.08.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 11/26/18. 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. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.
Thanks.
Kevin Traynor
---
>From 0484ed2eaa05e89e81ec071bf99c4af67cbce147 Mon Sep 17 00:00:00 2001
From: Alejandro Lucero <alejandro.lucero at netronome.com>
Date: Mon, 24 Sep 2018 14:43:24 +0100
Subject: [PATCH] ethdev: fix error handling in create function
[ upstream commit aa3c4fb6a451dcb1686e699ffbb87fb03e1ff9a4 ]
This patch fixes how function exit is handled when errors inside
rte_eth_dev_create.
Fixes: e489007a411c ("ethdev: add generic create/destroy ethdev APIs")
Signed-off-by: Alejandro Lucero <alejandro.lucero at netronome.com>
Reviewed-by: Andrew Rybchenko <arybchenko at solarflare.com>
---
lib/librte_ethdev/rte_ethdev.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index a43dfc8b7..a20498711 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -3477,8 +3477,6 @@ rte_eth_dev_create(struct rte_device *device, const char *name,
if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
ethdev = rte_eth_dev_allocate(name);
- if (!ethdev) {
- retval = -ENODEV;
- goto probe_failed;
- }
+ if (!ethdev)
+ return -ENODEV;
if (priv_data_size) {
@@ -3490,5 +3488,5 @@ rte_eth_dev_create(struct rte_device *device, const char *name,
RTE_LOG(ERR, EAL, "failed to allocate private data");
retval = -ENOMEM;
- goto probe_failed;
+ goto data_alloc_failed;
}
}
@@ -3498,6 +3496,5 @@ rte_eth_dev_create(struct rte_device *device, const char *name,
RTE_LOG(ERR, EAL, "secondary process attach failed, "
"ethdev doesn't exist");
- retval = -ENODEV;
- goto probe_failed;
+ return -ENODEV;
}
}
@@ -3528,4 +3525,5 @@ probe_failed:
rte_free(ethdev->data->dev_private);
+data_alloc_failed:
rte_eth_dev_release_port(ethdev);
--
2.19.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2018-11-21 15:59:14.389961661 +0000
+++ 0030-ethdev-fix-error-handling-in-create-function.patch 2018-11-21 15:59:13.000000000 +0000
@@ -1,13 +1,14 @@
-From aa3c4fb6a451dcb1686e699ffbb87fb03e1ff9a4 Mon Sep 17 00:00:00 2001
+From 0484ed2eaa05e89e81ec071bf99c4af67cbce147 Mon Sep 17 00:00:00 2001
From: Alejandro Lucero <alejandro.lucero at netronome.com>
Date: Mon, 24 Sep 2018 14:43:24 +0100
Subject: [PATCH] ethdev: fix error handling in create function
+[ upstream commit aa3c4fb6a451dcb1686e699ffbb87fb03e1ff9a4 ]
+
This patch fixes how function exit is handled when errors inside
rte_eth_dev_create.
Fixes: e489007a411c ("ethdev: add generic create/destroy ethdev APIs")
-Cc: stable at dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero at netronome.com>
Reviewed-by: Andrew Rybchenko <arybchenko at solarflare.com>
@@ -16,10 +17,10 @@
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
-index aa7730ce2..ef99f7068 100644
+index a43dfc8b7..a20498711 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
-@@ -3468,8 +3468,6 @@ rte_eth_dev_create(struct rte_device *device, const char *name,
+@@ -3477,8 +3477,6 @@ rte_eth_dev_create(struct rte_device *device, const char *name,
if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
ethdev = rte_eth_dev_allocate(name);
- if (!ethdev) {
@@ -30,14 +31,14 @@
+ return -ENODEV;
if (priv_data_size) {
-@@ -3481,5 +3479,5 @@ rte_eth_dev_create(struct rte_device *device, const char *name,
+@@ -3490,5 +3488,5 @@ rte_eth_dev_create(struct rte_device *device, const char *name,
RTE_LOG(ERR, EAL, "failed to allocate private data");
retval = -ENOMEM;
- goto probe_failed;
+ goto data_alloc_failed;
}
}
-@@ -3489,6 +3487,5 @@ rte_eth_dev_create(struct rte_device *device, const char *name,
+@@ -3498,6 +3496,5 @@ rte_eth_dev_create(struct rte_device *device, const char *name,
RTE_LOG(ERR, EAL, "secondary process attach failed, "
"ethdev doesn't exist");
- retval = -ENODEV;
@@ -45,7 +46,7 @@
+ return -ENODEV;
}
}
-@@ -3519,4 +3516,5 @@ probe_failed:
+@@ -3528,4 +3525,5 @@ probe_failed:
rte_free(ethdev->data->dev_private);
+data_alloc_failed:
More information about the stable
mailing list