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 54A1DA052B; Thu, 6 Aug 2020 01:33:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A09F61BFF5; Thu, 6 Aug 2020 01:33:51 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by dpdk.org (Postfix) with ESMTP id 026DC2C28 for ; Thu, 6 Aug 2020 01:33:49 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id B0787B7F; Wed, 5 Aug 2020 19:33:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 05 Aug 2020 19:33:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= Nh7QaabquFdp9ttlMElSOXGyshusOqxtToOphDXzBxI=; b=J80ugfImLsrPrpHJ yUGASWgpvhB0ue5LU7epW9WJNlyvVdxI5LWJpFgxtScCPFvnr3HI0U/AWD3KkjCg JFbr2Mdjz3PApApXBynj5kRiBJqmHymNt/X7+r6ivwSK9aAGolPvbxz56g8fbg7d 5irIlBv/5mAL3F9fJRE5FTamqbYzuofxbKk2TWKWXjP6s+XvEetmgJZ5uQB4o114 0OQNhfodL/tIpeJ4oduqa22BLrURR1hBkiTccSvR1LprKBb72udgxJiQILyGfENY AhV4ms5irMgMMvyTQqj+qys+FS+5vFmbEQSWm0rfMw7semhunqeVtoSf1n03iJVK Zt9dJg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=Nh7QaabquFdp9ttlMElSOXGyshusOqxtToOphDXzB xI=; b=Ow46bcc/JJWrAoQHSHkbKYGmUIr0W2IXiSk7i21OcvuXDdZHNCnXQYDs+ o+rqm68mAiQUAPWhymnpy2svhNPP93D9pla9zEiKVS7h4VfV0abQol41GZ0lUIw6 iVN0s7TRYlSNIjRILsj2FOEhnDQ87b3npt0uNF6rI22LpxewAjZ/Eo9JalR8LVBU vcnlUvaYwwOEQfp0y9o6M/gt75jhg6Oqvamncjb5s+8krSJzM9DTcTpe0uwRSfe9 LkS1nggCMisCV4ip3fUgCUJnYcaLu9qy+W4g7uTeS6Sk+8q8m1LcFZJH3m8i9MQp cCzkoOgWjU9RhqmZkJkTcuTHEG0nQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrjeelgddvgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 2D2E33280066; Wed, 5 Aug 2020 19:33:47 -0400 (EDT) From: Thomas Monjalon To: Maxime Coquelin Cc: dev@dpdk.org, grive@u256.net, david.marchand@redhat.com, wenzhuo.lu@intel.com, beilei.xing@intel.com, bernard.iremonger@intel.com Date: Thu, 06 Aug 2020 01:33:46 +0200 Message-ID: <2896958.gFCnIyvRxY@thomas> In-Reply-To: <20200625080430.1392037-3-maxime.coquelin@redhat.com> References: <20200625080430.1392037-1-maxime.coquelin@redhat.com> <20200625080430.1392037-3-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2 (v20.11) 2/2] eal: improve device probing API 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" 25/06/2020 10:04, Maxime Coquelin: > This patch makes rte_dev_probe() to return the > rte_device pointer on success and NULL on error > instead of returning 0 on success and negative > value on error. > > The goal is to avoid that the calling application > iterates the devices list afterwards to retrieve > the pointer. Retrieving the pointer is required > for calling rte_dev_remove() later. > > Signed-off-by: Maxime Coquelin > --- > --- a/lib/librte_eal/include/rte_dev.h > +++ b/lib/librte_eal/include/rte_dev.h > @@ -148,9 +148,9 @@ int rte_eal_hotplug_add(const char *busname, const char *devname, > * @param devargs > * Device arguments including bus, class and driver properties. > * @return > - * 0 on success, negative on error. > + * Generic device pointer on success, NULL on error. > */ > -int rte_dev_probe(const char *devargs); > +struct rte_device *rte_dev_probe(const char *devargs); Sorry for not catching it earlier, I think this change is against the idea of having a generic devargs syntax. One string could identify multiple devices. And a successful probe does not mean there is a new rte_device (can be an update, allowing more ports on the same device).