From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 5D495374C for ; Fri, 7 Apr 2017 10:15:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491552919; x=1523088919; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=yG0T0F8KZV8/bnyVXmgZ35JhWcOM47d042aq//s3T50=; b=Eki/C1ub/EjGAMh8fhSrgZb+ijDq8itQReWGCYPksTUOgpNGPn93tOeI W6sCrY76V6PoN2+yeJKdSD5yseeO2w==; Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Apr 2017 01:15:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,164,1488873600"; d="scan'208";a="953273531" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by orsmga003.jf.intel.com with ESMTP; 07 Apr 2017 01:15:17 -0700 From: Yuanhan Liu To: Gaetan Rivet Cc: Yuanhan Liu , Adrien Mazarguil , dpdk stable Date: Fri, 7 Apr 2017 16:11:48 +0800 Message-Id: <1491552724-3034-31-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1491552724-3034-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1491552724-3034-1-git-send-email-yuanhan.liu@linux.intel.com> Subject: [dpdk-stable] patch 'net/mlx4: fix returned values upon failed probing' has been queued to LTS release 16.11.2 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: Fri, 07 Apr 2017 08:15:20 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/11/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 8ba039e25b3486a4a915cee32b0ec2365e5e54bb Mon Sep 17 00:00:00 2001 From: Gaetan Rivet Date: Tue, 28 Mar 2017 16:13:11 +0200 Subject: [PATCH] net/mlx4: fix returned values upon failed probing [ upstream commit 9e09761b43179caa3bc825a83b18e3b27ddf7f10 ] Let error messages in place, but return unambiguous values upon probing errors. Fixes: 66e1591687ac ("mlx4: avoid init errors when kernel modules are not loaded") Signed-off-by: Gaetan Rivet Acked-by: Adrien Mazarguil --- drivers/net/mlx4/mlx4.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 262277f..695efe3 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -5571,10 +5571,8 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) list = ibv_get_device_list(&i); if (list == NULL) { assert(errno); - if (errno == ENOSYS) { - WARN("cannot list devices, is ib_uverbs loaded?"); - return 0; - } + if (errno == ENOSYS) + ERROR("cannot list devices, is ib_uverbs loaded?"); return -errno; } assert(i >= 0); @@ -5606,11 +5604,11 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) ibv_free_device_list(list); switch (err) { case 0: - WARN("cannot access device, is mlx4_ib loaded?"); - return 0; + ERROR("cannot access device, is mlx4_ib loaded?"); + return -ENODEV; case EINVAL: - WARN("cannot use device, are drivers up to date?"); - return 0; + ERROR("cannot use device, are drivers up to date?"); + return -EINVAL; } assert(err > 0); return -err; -- 1.9.0