DPDK patches and discussions
 help / color / mirror / Atom feed
From: Raslan Darawsheh <rasland@mellanox.com>
To: thomas@monjalon.net, gaetan.rivet@6wind.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v3] net/failsafe: fix failsafe bus uninit return value
Date: Tue, 29 Aug 2017 12:08:08 +0300	[thread overview]
Message-ID: <1503997688-1182-1-git-send-email-rasland@mellanox.com> (raw)
In-Reply-To: <1503996945-62885-1-git-send-email-rasland@mellanox.com>

fs_bus_uninit is always returning 0 no matter what was the status
of each sub device bus_uninit value.

Fixes: a46f8d58 ("net/failsafe: add fail-safe PMD")

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
---
 drivers/net/failsafe/failsafe_eal.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/net/failsafe/failsafe_eal.c b/drivers/net/failsafe/failsafe_eal.c
index c8f4318..aeb87a0 100644
--- a/drivers/net/failsafe/failsafe_eal.c
+++ b/drivers/net/failsafe/failsafe_eal.c
@@ -90,19 +90,20 @@ fs_bus_uninit(struct rte_eth_dev *dev)
 {
 	struct sub_device *sdev = NULL;
 	uint8_t i;
-	int ret;
+	int sdev_ret;
+	int ret = 0;
 
 	FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) {
-		ret = rte_eal_hotplug_remove(sdev->bus->name,
-					     sdev->dev->name);
-		if (ret) {
-			ERROR("Failed to remove requested device %s",
-			      sdev->dev->name);
+		sdev_ret = rte_eal_hotplug_remove(sdev->bus->name,
+							sdev->dev->name);
+		if (sdev_ret) {
+			ERROR("Failed to remove requested device %s (err: %d)",
+			      sdev->dev->name, sdev_ret);
 			continue;
 		}
 		sdev->state = DEV_PROBED - 1;
 	}
-	return 0;
+	return ret;
 }
 
 int
@@ -111,8 +112,6 @@ failsafe_eal_uninit(struct rte_eth_dev *dev)
 	int ret;
 
 	ret = fs_bus_uninit(dev);
-	if (ret)
-		return ret;
 	PRIV(dev)->state = DEV_PROBED - 1;
-	return 0;
+	return ret;
 }
-- 
2.7.4

  parent reply	other threads:[~2017-08-29  9:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29  7:51 [dpdk-dev] [PATCH] " Raslan Darawsheh
2017-08-29  8:18 ` Gaëtan Rivet
2017-08-29  8:55   ` [dpdk-dev] [PATCH v2] " Raslan Darawsheh
2017-08-29  9:02     ` Gaëtan Rivet
2017-08-29  9:08     ` Raslan Darawsheh [this message]
2017-08-29  9:28       ` [dpdk-dev] [PATCH v3] " Gaëtan Rivet
2017-08-30  9:09         ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1503997688-1182-1-git-send-email-rasland@mellanox.com \
    --to=rasland@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=gaetan.rivet@6wind.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).