From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet Subject: Re: [PATCH v2] net/failsafe: fix failsafe bus uninit return value Date: Tue, 29 Aug 2017 11:02:10 +0200 Message-ID: <20170829090210.GJ8124@bidouze.vm.6wind.com> References: <20170829081817.GI8124@bidouze.vm.6wind.com> <1503996945-62885-1-git-send-email-rasland@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: thomas@monjalon.net, dev@dpdk.org To: Raslan Darawsheh Return-path: Received: from mail-wr0-f177.google.com (mail-wr0-f177.google.com [209.85.128.177]) by dpdk.org (Postfix) with ESMTP id D2F20137C for ; Tue, 29 Aug 2017 11:02:21 +0200 (CEST) Received: by mail-wr0-f177.google.com with SMTP id z91so8180984wrc.1 for ; Tue, 29 Aug 2017 02:02:21 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1503996945-62885-1-git-send-email-rasland@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Aug 29, 2017 at 11:55:45AM +0300, Raslan Darawsheh wrote: > 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 > --- > drivers/net/failsafe/failsafe_eal.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/drivers/net/failsafe/failsafe_eal.c b/drivers/net/failsafe/failsafe_eal.c > index c8f4318..f6e44ca 100644 > --- a/drivers/net/failsafe/failsafe_eal.c > +++ b/drivers/net/failsafe/failsafe_eal.c > @@ -90,19 +90,21 @@ 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" > + "(errno: %d)", sdev->dev->name, sdev_ret); The error string should be on one line to help grepping the issue. The code displayed is not errno, it should not be named as such. + ERROR("Failed to remove requested device %s (%d)", + sdev->dev->name, sdev_ret); > + ret = -1; > continue; > } > sdev->state = DEV_PROBED - 1; > } > - return 0; > + return ret; > } > > int > @@ -111,8 +113,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 > Otherwise, Acked-by: Gaetan Rivet -- Gaëtan Rivet 6WIND