From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 65EC31B114 for ; Wed, 21 Nov 2018 17:06:30 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C3A18394D4D; Wed, 21 Nov 2018 16:06:29 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id D09BD2C8DC; Wed, 21 Nov 2018 16:06:28 +0000 (UTC) From: Kevin Traynor To: Alejandro Lucero Cc: Andrew Rybchenko , dpdk stable Date: Wed, 21 Nov 2018 16:04:20 +0000 Message-Id: <20181121160440.9014-30-ktraynor@redhat.com> In-Reply-To: <20181121160440.9014-1-ktraynor@redhat.com> References: <20181121160440.9014-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 21 Nov 2018 16:06:29 +0000 (UTC) Subject: [dpdk-stable] patch 'ethdev: fix error handling in create function' has been queued to stable release 18.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:06:30 -0000 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 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 Reviewed-by: Andrew Rybchenko --- 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 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@dpdk.org Signed-off-by: Alejandro Lucero Reviewed-by: Andrew Rybchenko @@ -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: