From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Guo Subject: Re: [PATCH v8 7/7] igb_uio: fix uio release issue for hotplug Date: Wed, 11 Jul 2018 11:10:44 +0800 Message-ID: References: <1498711073-42917-1-git-send-email-jia.guo@intel.com> <1531220607-2977-1-git-send-email-jia.guo@intel.com> <1531220607-2977-8-git-send-email-jia.guo@intel.com> <20180710144813.2d08babf@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: bruce.richardson@intel.com, ferruh.yigit@intel.com, konstantin.ananyev@intel.com, gaetan.rivet@6wind.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, wenzhuo.lu@intel.com, jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org, helin.zhang@intel.com To: Stephen Hemminger Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 0F88F1B48B for ; Wed, 11 Jul 2018 05:10:50 +0200 (CEST) In-Reply-To: <20180710144813.2d08babf@xeon-e3> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 7/11/2018 5:48 AM, Stephen Hemminger wrote: > On Tue, 10 Jul 2018 19:03:27 +0800 > Jeff Guo wrote: > >> >> +/* uio pci device state */ >> +enum rte_udev_state { >> + RTE_UDEV_PROBED, >> + RTE_UDEV_OPENNED, >> + RTE_UDEV_RELEASED, >> + RTE_UDEV_REMOVED, >> +}; >> + > The states here are a little confusing. especially since pci_release > seems to take different actions based on the state. And there is nothing > preventing races between unexpected removal (PCI), and removing the > device from being used by igb_uio. The states here just manage in igb uio, and only restore the status of igb uio. And only the RTE_UDEV_REMOVED that the key status might be a highlight and process, it is means pci have been removed, then directly come to igb uio remove without go igb uio release at first, the status is for hotplug out, need to do specific process. It will no affect the normal process, and for normal igb uio remove, udev be release, no any status need to restore. > Would it be possible to only use state variable from the kernel PCI > layer where the value is consistent? The state which i only care here is hot remove state, i check that kobj->state_remove_uevent_sent could be use in igb uio, except that still can not find a specific state of kernel pci to identify it. If we can find it, it should be best. what's other comment from guys? > Also there is refcounting in PCI layer (and locking). Could that > be used instead? It might be, but if state is enough here we might not considerate to use it. If i am missing anything, let me know.