From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 75B1D98 for ; Tue, 21 Aug 2018 10:18:01 +0200 (CEST) Received: by mail-wr1-f65.google.com with SMTP id u12-v6so15067634wrr.4 for ; Tue, 21 Aug 2018 01:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=4M6AkwTPw3M8F7a+/r96ysDjf4lfK+Q/iDM0MUc1nQ8=; b=SGe1PlFEZS+LHBMP3l9WAV3aisO70hGa3Jxh4jNF3oeK+HlVD/pC7jea/024eyYtT4 ajaz6YavUGMIvMWbQfFznDUoQB9VHq557/O/yLtl5mfIt7D830vbvcjeNYsn2AUOq8cE jQC4B8AS3tbzgBkAI7PKE2UVh+GnhmUl8InL3Ey7Qbb3lTRSs9hRYQ21okkFJytInvZP RCqqC2dTYdmPL77oaD0V091jBgFH1KHWMbxrwVorWy7Gx47Ns66jQpzQicQRZqfXQ9R6 bTMYebZVIrGwWfPn/9mH8pGsDO7MNLHHp3Lg2FruSo5y+O+abvZxglXIJ3zZsOi4Gebw 6Ndg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=4M6AkwTPw3M8F7a+/r96ysDjf4lfK+Q/iDM0MUc1nQ8=; b=JEt1zfkxTxXlamoGjP9Oml3ztTIucBesS9j0I4qYzmvrfLDkr4qvxQTxm191FAkrf7 58EG/Wfe3PS76/d0fnnI4UQQUGeGfcV9L7TZ/dzJ9UhJ0XTBymIs3qTholRQoQ2sNZpW 29C3EOu3stl4tGz3gtBbEEMc8cRBrwRCDFrkObPMu+fB7EZZobFvC5dlH4BHBz+gJUJP QRigsLUKio48Tj61PDfOYzAF3di3bwrcEZR2MDcr7t8UlZsapYMIrZLV94xOviU3zKaf 2keKC6eZvyxqVlCadub6taO+o9RQHmtzqXpiSgENsR+wVp6v+gEOzLfAxGEYnHj2OYhP YveA== X-Gm-Message-State: AOUpUlEsUzCgoL/VoDU8ukOT9DYNCMhSl1pEl3rmXqisbZEjY3rcA/DG gA6j/4RhP0pL12llkDIAdwwslQ== X-Google-Smtp-Source: AA+uWPwDHxI8XC8hjmQRhCXNR6C4jVS8S9le+4Dv1PjmbdUk+v1Er1q4QNz4UU3szt1pjFH8BfQWJQ== X-Received: by 2002:adf:a789:: with SMTP id j9-v6mr31146126wrc.277.1534839481088; Tue, 21 Aug 2018 01:18:01 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id w4-v6sm10427236wrl.46.2018.08.21.01.17.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Aug 2018 01:18:00 -0700 (PDT) Date: Tue, 21 Aug 2018 10:17:42 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Jeff Guo Cc: stephen@networkplumber.org, bruce.richardson@intel.com, ferruh.yigit@intel.com, konstantin.ananyev@intel.com, jingjing.wu@intel.com, thomas@monjalon.net, motih@mellanox.com, matan@mellanox.com, harry.van.haaren@intel.com, qi.z.zhang@intel.com, shaopeng.he@intel.com, bernard.iremonger@intel.com, arybchenko@solarflare.com, jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org, helin.zhang@intel.com Message-ID: <20180821081742.admyo7ba4evqho2u@bidouze.vm.6wind.com> References: <1534503091-31910-1-git-send-email-jia.guo@intel.com> <20180820091533.yl2wzmvzfxqwo2po@bidouze.vm.6wind.com> <1c5769b1-e196-a209-e19e-b0ea4cb51c4a@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1c5769b1-e196-a209-e19e-b0ea4cb51c4a@intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v1 0/5] Enable hotplug in vfio 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, 21 Aug 2018 08:18:01 -0000 On Tue, Aug 21, 2018 at 02:45:32PM +0800, Jeff Guo wrote: > hi, gaetan > > > On 8/20/2018 5:15 PM, Gaëtan Rivet wrote: > > Hi Jeff, > > > > On Fri, Aug 17, 2018 at 06:51:26PM +0800, Jeff Guo wrote: > > > As we may know that the process of hotplug is different between igb_uio > > > and vfio. For igb_uio, it could use uevent notification and memory > > > failure handle mechanism for hotplug. But for vfio, when device is be > > > hotplug-out, the uevent can not be detected immediately, because of the > > > vfio kernel module will use a special mechanism to guaranty the pci > > > device would not be deleted until the user space release the resources, > > > so it will use another event “req notifier” at first to notify user space > > > to release resources for hotplug. > > > > > > This patch will add a new interrupt type of req notifier in eal interrupt, > > > and add the new interrupt handler in pci device to handle the req device > > > event. When the req notifier be detected, it can trigger the device event > > > callback process to process for hotplug. With this mechanism, hotplug > > > could be enable in vfio. > > > > > The REQ event seems VFIO specific. > > Why not leave it within the PCI bus, around the vfio glue, and leave the > > EAL unmodified? > > Sorry i don' t see if there are any problem. Firstly, as we can see the eal > interrupt type, it cover the ext/uio/vfio/dev event types, which are not > general for all platform/bus/driver type. > so i think base on the current framework, the interrupt type structure > should be considerate as combined set, it could extend for other adding > interrupts case by case. And secondly, i don't know what > is your way about leave it within the PCI bus, because i need to use the eal > interrupt epoll to process this req interrupt which is familiar with other > interrupts. What do you think about that, if you still > have better suggestion, please detail it for clarify. > Ah, yes, unfortunately you're right. There is a genericization effort going on for the EAL, but these parts are still depending on the interrupts being reworked. So for now, not much can be done to avoid it. > > > Jeff Guo (5): > > > eal: add a new req notifier to eal interrupt > > > eal: add a new req event to device event > > > eal: modify device event callback process func > > > pci: add req handler field to generic pci device > > > vfio: enable vfio hotplug by req notifier handler > > > > > > drivers/bus/pci/linux/pci_vfio.c | 104 +++++++++++++++++++++ > > > drivers/bus/pci/pci_common.c | 10 ++ > > > drivers/bus/pci/rte_bus_pci.h | 1 + > > > lib/librte_eal/common/eal_common_dev.c | 5 +- > > > lib/librte_eal/common/eal_private.h | 12 --- > > > lib/librte_eal/common/include/rte_dev.h | 20 +++- > > > lib/librte_eal/common/include/rte_eal_interrupts.h | 1 + > > > lib/librte_eal/linuxapp/eal/eal_dev.c | 2 +- > > > lib/librte_eal/linuxapp/eal/eal_interrupts.c | 71 ++++++++++++++ > > > lib/librte_ethdev/rte_ethdev.c | 3 +- > > > 10 files changed, 212 insertions(+), 17 deletions(-) > > > > > > -- > > > 2.7.4 > > > > -- Gaëtan Rivet 6WIND