From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4DB6BA0613 for ; Tue, 27 Aug 2019 15:57:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7FC041C11F; Tue, 27 Aug 2019 15:57:04 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id EBA5C1C11D for ; Tue, 27 Aug 2019 15:57:02 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 42CE93082A8D; Tue, 27 Aug 2019 13:57:02 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (unknown [10.18.25.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DF0B65D71C; Tue, 27 Aug 2019 13:57:01 +0000 (UTC) From: Aaron Conole To: Nitin Katiyar Cc: References: <1566934217-23824-1-git-send-email-nitin.katiyar@ericsson.com> <1566934217-23824-2-git-send-email-nitin.katiyar@ericsson.com> Date: Tue, 27 Aug 2019 09:57:01 -0400 In-Reply-To: <1566934217-23824-2-git-send-email-nitin.katiyar@ericsson.com> (Nitin Katiyar's message of "Wed, 28 Aug 2019 01:00:17 +0530") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 27 Aug 2019 13:57:02 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH 2/2] eal: DPDK init doesn't fail even if device probe fails. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Nitin Katiyar writes: > rte_bus_probe() doesn't return error. As a result rte_eal_init() > doesn't catch this error and thus making dpdk initialization > successful despite probe failing for devices. > > This patch returns error if probe fails for any of device. > > Signed-off-by: Nitin Katiyar > --- > lib/librte_eal/common/eal_common_bus.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c > index baa5b53..1721179 100644 > --- a/lib/librte_eal/common/eal_common_bus.c > +++ b/lib/librte_eal/common/eal_common_bus.c > @@ -70,16 +70,20 @@ > } > > ret = bus->probe(); > - if (ret) > + if (ret) { > RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", > bus->name); > + return ret; > + } If we return an error here, won't this fail to probe vbus? In fact, this will disrupt all subsequent bus probes, yes? Why should a single bus problem be a 'cannot init' level failure? > } > > if (vbus) { > ret = vbus->probe(); > - if (ret) > + if (ret) { > RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", > vbus->name); > + return ret; > + } > } > > return 0;