From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <jblunck@gmail.com>
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 <dev@dpdk.org>; Tue, 28 Feb 2017 10:19:07 +0100 (CET)
Received: by mail-wm0-f66.google.com with SMTP id u63so1300990wmu.2
 for <dev@dpdk.org>; Tue, 28 Feb 2017 01:19:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:sender:in-reply-to:references:from:date:message-id
 :subject:to:cc;
 bh=51Am9kolNw2lYJaD+Hf7u2P0w4Pwg/8zLbiO9vOKSCo=;
 b=YaWjc1Oxmj1Lwsazl4sZ0FsmhDHCQvouydkRQoOCC8Bvxz09ax89L5ep+s/6e/DU0E
 zz1Ic2Gu7egnTe1qMXj2uTl/QTk5ZZvQJ8HpstYUcHKz3PWd3LwV9/4n/kwRFMd3MkOP
 GHDeSsnI/1rex8Xj05wyrLtsbjtfrmAJn5pjliQvlX5nxNmJIu7kGFRXyk0qXAVgMzRi
 DF0gPHieuvd4YW5hGGUCqSkCWFRg66xK4fojzlGnbMygg4RXoi9xiJ4DQEc1pnMMUzYz
 +dr1hEL/1xALL20Gw+UBzgQNpH9GS1fd9zZUTmO6YA8QkfQjFsXf2Bwvj/ROMT0tvyds
 3+cA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
 :date:message-id:subject:to:cc;
 bh=51Am9kolNw2lYJaD+Hf7u2P0w4Pwg/8zLbiO9vOKSCo=;
 b=fVRKpkUKFvoMheJSIOXpLwMRtbpaKJPu4xvqCyawfUE5GdYwcbBWvhhxcd0jAwqUXk
 cf69ZiL5QFhUbMgK9AdqfnhPG+jrxhr0g0J9z/KDhZl3igg0KKEDqjjCsOp8VzCVR/dG
 qjEErYFMa0d1fHMFBoWsVU64z0TG+YfnuITGC4D6CEDEsrXOON0YTuTe/9FbXZLNqLGr
 0wl3CrcntPXAXJ6T0WTzWPJc+a57IOY1weUgu5N3QDY/YtqhZ1DeJT0nPLh2QaMaPBa5
 IT1N1kdpvL9e2P8jm0fR8cDPxK8ZekCciCeyx/F+RhurDJA5nge0oTez18Lt6UyuRAE0
 RcQw==
X-Gm-Message-State: AMke39kKxsf2HLv9SbrILbOL3HU+LJWaSmL9C0mnBow+61gkrQRoBjvw1gIzB1oAgxgM48W1goa8RR+uquX/Uw==
X-Received: by 10.28.135.82 with SMTP id j79mr16629151wmd.19.1488273547194;
 Tue, 28 Feb 2017 01:19:07 -0800 (PST)
MIME-Version: 1.0
Sender: jblunck@gmail.com
Received: by 10.28.211.20 with HTTP; Tue, 28 Feb 2017 01:19:06 -0800 (PST)
In-Reply-To: <1fe7b405-0b78-08fe-4696-5d96e6769567@nxp.com>
References: <1487600262-14382-1-git-send-email-jblunck@infradead.org>
 <1488018496-995-1-git-send-email-jblunck@infradead.org>
 <CALe+Z02h_-Cmot9qauNfWOGz6OL-GeoB4+C7uGcGd6TrBodJpA@mail.gmail.com>
 <1fe7b405-0b78-08fe-4696-5d96e6769567@nxp.com>
From: Jan Blunck <jblunck@infradead.org>
Date: Tue, 28 Feb 2017 10:19:06 +0100
X-Google-Sender-Auth: gdFed7liiNjnOXTTQ20NiU_eWUY
Message-ID: <CALe+Z03HUoTAujUT2+g13kupe_3MHXBAn3n7w7awxVy0gFo6=w@mail.gmail.com>
To: Shreyansh Jain <shreyansh.jain@nxp.com>
Cc: dev <dev@dpdk.org>, David Marchand <david.marchand@6wind.com>, 
 Ferruh Yigit <ferruh.yigit@intel.com>
Content-Type: text/plain; charset=UTF-8
Subject: Re: [dpdk-dev] [PATCH v3 00/10] Rework vdev probing to use rte_bus
	infrastructure
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Feb 2017 09:19:07 -0000

On Tue, Feb 28, 2017 at 9:48 AM, Shreyansh Jain <shreyansh.jain@nxp.com> wrote:
> On Monday 27 February 2017 06:39 PM, Jan Blunck wrote:
>>
>> On Sat, Feb 25, 2017 at 11:28 AM, Jan Blunck <jblunck@infradead.org>
>> 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()).