From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id D1F52A045E for ; Thu, 30 May 2019 15:25:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 80AA0375B; Thu, 30 May 2019 15:25:41 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id B3D712AB for ; Thu, 30 May 2019 15:25:40 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190530132539euoutp02e7bcc79a30d0b2ac79c77a6ae34191f2~jeNIRyFjv1174111741euoutp02Q for ; Thu, 30 May 2019 13:25:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190530132539euoutp02e7bcc79a30d0b2ac79c77a6ae34191f2~jeNIRyFjv1174111741euoutp02Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1559222739; bh=b+z0yptfefroHKUx3R9hiZ7LnDW8wEiCUuyKt1OkcEE=; h=From:To:Cc:Subject:Date:References:From; b=QWWE/UQKLqS6PFyv+encCJcs5FNMkt3niZ3I/OsPpZVzbr+lGa1nbEtn8nuX034JV aq5PlN+EThnBFM6Bc0nim5aEDt0/ZrW614wk2jeNEcKQCtC+Zee2IqIr/FfKW/VmmB yuMBd40W/c8tedR1Ts1bdsWJx5aolKtQ1czrL0gQ= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190530132539eucas1p154090b90011337b2a2b89d6df2841fdb~jeNH2mdak1991019910eucas1p1-; Thu, 30 May 2019 13:25:39 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 5B.A8.04377.2D9DFEC5; Thu, 30 May 2019 14:25:38 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190530132538eucas1p28fcfddad5b73d3a0baf7095f25a6c1fd~jeNHENwlm1119911199eucas1p2v; Thu, 30 May 2019 13:25:38 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190530132538eusmtrp210503e1ef1521735ee6f70bd5bfb2d94~jeNG0tnSP1729417294eusmtrp2W; Thu, 30 May 2019 13:25:38 +0000 (GMT) X-AuditID: cbfec7f4-113ff70000001119-6a-5cefd9d2c11f Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B1.4B.04140.2D9DFEC5; Thu, 30 May 2019 14:25:38 +0100 (BST) Received: from imaximets.rnd.samsung.ru (unknown [106.109.129.180]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190530132537eusmtip1063ff78071974548cb8580d498b86936~jeNGR_cIJ2447324473eusmtip1B; Thu, 30 May 2019 13:25:37 +0000 (GMT) From: Ilya Maximets To: dev@dpdk.org Cc: Thomas Monjalon , Anatoly Burakov , Jan Blunck , Qi Zhang , Kevin Traynor , Ilya Maximets , stable@dpdk.org Date: Thu, 30 May 2019 16:25:26 +0300 Message-Id: <20190530132526.3496-1-i.maximets@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOIsWRmVeSWpSXmKPExsWy7djPc7qXbr6PMTj10tTi0b3FzBbvPm1n srjS/pPdovVhK5PF2kMf2C2mb+hns/jX8Yfd4tODEywOHB6/Fixl9di8Qstj8Z6XTB7Hbk5j 93i/7yqbR9+WVYwBbFFcNimpOZllqUX6dglcGfNfXmcrmMxdMenvIuYGxk7OLkZODgkBE4nL W8+xgNhCAisYJaZtUOli5AKyvzBKfF//jxX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JW50zQdr5hWwknjx+gkLxAZ5idUbDjBPYORZwMiwilEktbQ4Nz23 2EivODG3uDQvXS85P3cTIzA0tx37uWUHY9e74EOMAhyMSjy8AgffxwixJpYVV+YeYpTgYFYS 4fW+ABTiTUmsrEotyo8vKs1JLT7EaAq0fCKzlGhyPjBu8kriDU0NzS0sDc2NzY3NLJTEeTsE DsYICaQnlqRmp6YWpBbB9DFxcEo1ME626uhobj9hnV4S1nvne5+RkKX1q81rZa6ws5S3Tefh 8LbrXPKB8ZG1RF7rS/54qceMT14UP98vz/B9xXKJxNuOh6dEPvtx41bG80kqv+vEPX5ddtJu WDf5734ldveU78r3zsaszrnrtP8yS8bXnfteqxR4ha7cemZ53Hvt0OI3azXuPf6Uel6JpTgj 0VCLuag4EQDkA/spYwIAAA== X-CMS-MailID: 20190530132538eucas1p28fcfddad5b73d3a0baf7095f25a6c1fd X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20190530132538eucas1p28fcfddad5b73d3a0baf7095f25a6c1fd X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190530132538eucas1p28fcfddad5b73d3a0baf7095f25a6c1fd References: Subject: [dpdk-dev] [PATCH] eal: fix positive error codes from probe/remove 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" According to API, 'rte_dev_probe()' and 'rte_dev_remove()' and their 'hotplug' equivalents must return 0 or negative error code. Bus code returns positive values if device wasn't recognized by any driver, so the result of 'bus->plug/unplug()' must be converted. Positive on remove means that device not found by driver. Positive on probe means that there are no suitable buses/drivers, i.e. device is not supported. CC: stable@dpdk.org Fixes: a3ee360f4440 ("eal: add hotplug add/remove device") Fixes: 244d5130719c ("eal: enable hotplug on multi-process") Signed-off-by: Ilya Maximets --- lib/librte_eal/common/eal_common_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c index 824b8f926..f9cae8e26 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -233,7 +233,7 @@ rte_dev_probe(const char *devargs) * process. */ if (ret != -EEXIST) - return ret; + return (ret < 0) ? ret : -ENOTSUP; } /* primary send attach sync request to secondary. */ @@ -319,7 +319,7 @@ local_dev_remove(struct rte_device *dev) if (ret) { RTE_LOG(ERR, EAL, "Driver cannot detach the device (%s)\n", dev->name); - return ret; + return (ret < 0) ? ret : -ENOENT; } return 0; -- 2.17.1