[dpdk-dev] [PATCH v8 7/7] igb_uio: fix uio release issue for hotplug

Stephen Hemminger stephen at networkplumber.org
Tue Jul 10 23:52:54 CEST 2018


On Tue, 10 Jul 2018 19:03:27 +0800
Jeff Guo <jia.guo at intel.com> wrote:

> When hotplug out device, the device resource will be released in kernel.
> The fd sys file will disappear, and the irq will be released. At this time,
> if igb uio driver still try to release this resource, it will cause kernel
> crash. On the other hand, interrupt disabling do not automatically be
> processed in kernel. If not handle it, this redundancy and dirty thing will
> affect the interrupt resource be used by other device. So the igb_uio
> driver have to check the hotplug status, and the corresponding process
> should be taken in igb uio driver.
> 
> This patch propose to add enum rte_udev_state into struct rte_uio_pci_dev
> of igb uio driver, which will record the state of uio device, such as
> probed/opened/released/removed. When detect the unexpected removal which
> cause of hotplug out behavior, it will corresponding disable interrupt
> resource. For the part of releasement which kernel have already handle,
> just skip it to avoid double free or null pointer crash issue.
> 
> Signed-off-by: Jeff Guo <jia.guo at intel.com>

The PCI hotplug management is an important and potentially error prone
error of DPDK.

I realize that English is not your native language, but the commit messages
for this are hard to read. Perhaps you can get a volunteer or other person
in the community to reword them. The commit logs and comments contain
important information about the documentation of the code.

How does VFIO handle hotplug? We should direct all users to use VFIO
since it is supported and secure. Igb uio has always been a slightly
dangerous (as they say "running with scissors") way of accessing devices.


More information about the dev mailing list