From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 92AA14C99; Thu, 25 Oct 2018 12:52:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Oct 2018 03:52:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,424,1534834800"; d="scan'208";a="91135361" Received: from violet.igk.intel.com ([10.102.54.177]) by FMSMGA003.fm.intel.com with ESMTP; 25 Oct 2018 03:52:07 -0700 From: Darek Stojaczyk To: dev@dpdk.org Cc: Darek Stojaczyk , thomas@monjalon.net, stable@dpdk.org Date: Thu, 25 Oct 2018 12:51:01 +0200 Message-Id: <20181025105101.137701-1-dariusz.stojaczyk@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] eal: fixup hotplugging an already present device 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: , X-List-Received-Date: Thu, 25 Oct 2018 10:52:10 -0000 We were returning rc = -1 from a device probing function whenever the provided device was already probed before. This basically broke hotplugging a device in secondary process when the same device was already hotplugged in the primary. To fix it, just return 0 instead of -1. I believe this is the originally intented behavior. Fixes: e9d159c3d534 ("eal: allow probing a device again") Cc: thomas@monjalon.net Cc: stable@dpdk.org Signed-off-by: Darek Stojaczyk --- lib/librte_eal/common/eal_common_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c index 6ac3ee859..75b83418c 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -222,7 +222,7 @@ local_dev_probe(const char *devargs, struct rte_device **new_dev) ret = dev->bus->plug(dev); if (ret) { if (rte_dev_is_probed(dev)) /* if already succeeded earlier */ - return ret; /* no rollback */ + return 0; /* no rollback */ RTE_LOG(ERR, EAL, "Driver cannot attach the device (%s)\n", dev->name); goto err_devarg; -- 2.17.1