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 0911CA0613 for ; Tue, 27 Aug 2019 13:30:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CBC631C08E; Tue, 27 Aug 2019 13:30:11 +0200 (CEST) Received: from sessmg22.ericsson.net (sessmg22.ericsson.net [193.180.251.58]) by dpdk.org (Postfix) with ESMTP id 9FBBF1C035 for ; Tue, 27 Aug 2019 13:30:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/relaxed; q=dns/txt; i=@ericsson.com; t=1566905409; x=1569497409; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/LVnbR/3hD2Jiq2MDHYvcYw8amApVhMQT65sblasDx4=; b=W13cKc4M2fKCyqq3GLV+Ach+kxeh0UwdbJzFo/QOhipwl+wKRzpNVa1VlqsfUk5v DflgwqATv68bdfEslyaAo6H2lRsScRIV9iABwOHMsOixEgwZq4LGvLwIdAgkeggm bKC+KKJ9X7XOJkfRTHIaZ3nE1lVRiV4f6/vAlLgCQ6U=; X-AuditID: c1b4fb3a-681ff70000000aff-82-5d6514415475 Received: from ESESBMB501.ericsson.se (Unknown_Domain [153.88.183.114]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id DF.E9.02815.144156D5; Tue, 27 Aug 2019 13:30:09 +0200 (CEST) Received: from ESESSMB502.ericsson.se (153.88.183.163) by ESESBMB501.ericsson.se (153.88.183.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 27 Aug 2019 13:30:08 +0200 Received: from ESESSHC002.ericsson.se (153.88.183.24) by ESESSMB502.ericsson.se (153.88.183.163) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P256) id 15.1.1713.5 via Frontend Transport; Tue, 27 Aug 2019 13:30:08 +0200 Received: from ESGSCHC006.ericsson.se (146.11.116.83) by ESESSHC002.ericsson.se (153.88.183.24) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 27 Aug 2019 13:30:08 +0200 Received: from localhost.localdomain (146.11.116.127) by smtps-ao.internal.ericsson.com (146.11.116.83) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 27 Aug 2019 19:29:47 +0800 From: Nitin Katiyar To: CC: Nitin Katiyar Date: Wed, 28 Aug 2019 01:00:17 +0530 Message-ID: <1566934217-23824-2-git-send-email-nitin.katiyar@ericsson.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1566934217-23824-1-git-send-email-nitin.katiyar@ericsson.com> References: <1566934217-23824-1-git-send-email-nitin.katiyar@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [146.11.116.127] Subject: [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" 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 (vbus) { ret = vbus->probe(); - if (ret) + if (ret) { RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", vbus->name); + return ret; + } } return 0; -- 1.9.1