From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Blunck Subject: Re: [PATCH v3 00/10] Rework vdev probing to use rte_bus infrastructure Date: Tue, 28 Feb 2017 10:19:06 +0100 Message-ID: References: <1487600262-14382-1-git-send-email-jblunck@infradead.org> <1488018496-995-1-git-send-email-jblunck@infradead.org> <1fe7b405-0b78-08fe-4696-5d96e6769567@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: dev , David Marchand , Ferruh Yigit To: Shreyansh Jain Return-path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 6D1FC2BB2 for ; Tue, 28 Feb 2017 10:19:07 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id u63so1300990wmu.2 for ; Tue, 28 Feb 2017 01:19:07 -0800 (PST) In-Reply-To: <1fe7b405-0b78-08fe-4696-5d96e6769567@nxp.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Feb 28, 2017 at 9:48 AM, Shreyansh Jain wrote: > On Monday 27 February 2017 06:39 PM, Jan Blunck wrote: >> >> On Sat, Feb 25, 2017 at 11:28 AM, Jan Blunck >> wrote: >>> >>> With the rte_bus infrastructure present in 17.02 it is possible to >>> refactor >>> the virtual device probing into a bus. This series also introduces the >>> rte_vdev_device to better keep track of devices. >>> >>> This patchset depends on: >>> http://dpdk.org/dev/patchwork/patch/20416/ >>> http://dpdk.org/dev/patchwork/patch/20417/ >>> >>> Changes since version 2: >>> * implicit bus registration through rte_eal_vdrv_register() >> >> >> On a second thought I don't think that this is correct though since it >> opens up the possibility of racing an alternative "virtual" bus. I >> don't think that this is a good thing though. I'll fix this in v4. >> >> Thoughts? > > > I prefer the RTE_REGISTER* way. > The issue of duplicate bus remains whether we use the macro or the > implicit way. > > If you use RTE_*, do you think that duplicate registration issue > is worth fixing? > (It would mean rte_bus_register to return error which the caller > would then need to handle). > I don't think that there is a good way to handle this if we use the library constructors. It is better to fail the registration of the bus and log the error via RTE_LOG(). That introduces a dependency on the initialization of the logging system to be available before the library constructors run (before main()).