On Tue, 10 Jul 2018 19:03:27 +0800 Jeff Guo <jia....@intel.com> 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. Would it be possible to only use state variable from the kernel PCI layer where the value is consistent? Also there is refcounting in PCI layer (and locking). Could that be used instead?