From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wj0-f182.google.com (mail-wj0-f182.google.com [209.85.210.182]) by dpdk.org (Postfix) with ESMTP id A99773777 for ; Tue, 3 Jan 2017 22:46:54 +0100 (CET) Received: by mail-wj0-f182.google.com with SMTP id sd9so270317867wjb.1 for ; Tue, 03 Jan 2017 13:46:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=NlveWJH5kfdW9gAXjvpyASQAniAwTgnCdhIpb5+VUGI=; b=x0lxLfVvCEnAO1ir9tOIyn945ORd6jE7cqdhWl3rbuLrar4E8NGS6VONJvDpjyZIgJ UKW0nVjWroAVMIHaDlGjGyDpydbLrbWCY705YtssvDN+Dqj1Gug0L+p7VCNpc8flnM2X ipg6IYKZmKd0o5BRsuFER2PsBwRaetLviYgQM6CiolpnPSBwOv43zUG/wUwWPk7hctWy uY0VwPMJXcovB7HyfkTAetrbCc0r+UwKwwo5hP9rTmaNrI9F1vvtqJRmZ94Pgwdn6mBg L0S4eeDdyCj0lOMc4r5BWTQ9mYRwbo90qKgvk5E264w4/9Scx3fz3727bjR05JR1smhz Jkgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=NlveWJH5kfdW9gAXjvpyASQAniAwTgnCdhIpb5+VUGI=; b=c8VevI1FA8kMUCPsh8oNB6+hiymxDthZyWu6qG5mxWKzwlJ+G2tptkUSfgtaFY1I5i F6AX4xG463piEPLT2/zumuo5fpXnJ6vZrd7qncQHa3C9RyaoG5naQsZKF9eSQpEYAgjF Y2jFKkaRDjmYqvA5E8X0OAr/ZVtkpJeRz+P93Zlvzyei/UMV+ZK5nM64a8T0qyFEUdFq kf6dtR4P6ZOtWQpOnuFLMBWM1UH1SdyD/jiPl6FGoX5ce/g1FvGdpjIGbCrdUMX+qORl +E440kT0hzE0EEkU9Vtjxwv6Mrh0+uQbladHrWAWhd7XmoIT/dvy2YmfY85cBkC+RXFB a26w== X-Gm-Message-State: AIkVDXILpbvHS0aeVxcZxYPJqiEn9d6EUfWysSgW0Ddsns6ZvWB1arMCrE6rZikYI8cJBGcR X-Received: by 10.194.90.231 with SMTP id bz7mr52847330wjb.35.1483480011416; Tue, 03 Jan 2017 13:46:51 -0800 (PST) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id g73sm91730557wme.16.2017.01.03.13.46.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2017 13:46:50 -0800 (PST) From: Thomas Monjalon To: Shreyansh Jain Cc: david.marchand@6wind.com, dev@dpdk.org Date: Tue, 03 Jan 2017 22:46:49 +0100 Message-ID: <1763533.RfUee4nzA4@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1482758645-23057-5-git-send-email-shreyansh.jain@nxp.com> References: <1482756644-13726-1-git-send-email-shreyansh.jain@nxp.com> <1482758645-23057-1-git-send-email-shreyansh.jain@nxp.com> <1482758645-23057-5-git-send-email-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v5 04/12] eal: integrate bus scan and probe with EAL 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, 03 Jan 2017 21:46:54 -0000 2016-12-26 18:53, Shreyansh Jain: > --- a/lib/librte_eal/linuxapp/eal/eal.c > +++ b/lib/librte_eal/linuxapp/eal/eal.c > @@ -844,6 +845,9 @@ rte_eal_init(int argc, char **argv) > if (rte_eal_intr_init() < 0) > rte_panic("Cannot init interrupt-handling thread\n"); > > + if (rte_eal_bus_scan()) > + rte_panic("Cannot scan the buses for devices\n"); Yes, definitely. Just one scan functions which scan registered bus. > @@ -884,6 +888,9 @@ rte_eal_init(int argc, char **argv) > if (rte_eal_pci_probe()) > rte_panic("Cannot probe PCI\n"); > > + if (rte_eal_bus_probe()) > + rte_panic("Cannot probe devices\n"); > + > if (rte_eal_dev_init() < 0) > rte_panic("Cannot init pmd devices\n"); What is the benefit of initializing (probe) a device outside of the scan? Currently, it is done in two steps, so you are keeping the same behaviour. I imagine a model where the scan function decide to initialize the device and can require some help from a callback to make this decision. So the whitelist/blacklist policy can be implemented with callbacks at the scan level and possibly the responsibility of the application. Note that the callback model would be a change for a next release.