From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] bus/vdev: add custom scan hook Date: Tue, 05 Dec 2017 16:21:17 +0100 Message-ID: <1712827.SmiPysL3o0@xps> References: <20171201003642.19827-1-thomas@monjalon.net> <5374836.XgGFu4empV@xps> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: "Tan, Jianfeng" Return-path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 429DD239 for ; Tue, 5 Dec 2017 16:21:19 +0100 (CET) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 05/12/2017 14:56, Tan, Jianfeng: > > On 12/5/2017 4:41 PM, Thomas Monjalon wrote: > > > > 05/12/2017 09:27, Tan, Jianfeng: > > > > > > > > > > On 12/4/2017 5:31 PM, Thomas Monjalon wrote: > > > > > > > > > > > > The hook is in bus->scan(). > > > > > > I think we should launch a bus scan when there is a new device event. > > > > > > > > > > That's what I'm trying to say. We finally need to execute a handler as > > > > > of a device event to finish the job. > > > > Please be more specific, I am not sure to understand. > > > > By the handler, I mean when we monitor the udev by select/poll/epoll and > device uevents come, the application will execute a handler (or just a > function) for each of such uevent. Then why not adding the vdev there? Because it must work for hotplug, and initial scan too. We can also think to application requiring a manual scan. The bus scan is the right place to have every scans called. That's simple.