From mboxrd@z Thu Jan 1 00:00:00 1970 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) 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> <1fe7b405-0b78-08fe-4696-5d96e6769567@nxp.com> From: Jan Blunck Date: Tue, 28 Feb 2017 10:19:06 +0100 X-Google-Sender-Auth: gdFed7liiNjnOXTTQ20NiU_eWUY Message-ID: To: Shreyansh Jain Cc: dev , David Marchand , Ferruh Yigit 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 09:19:07 -0000 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()).