eal: add failure handling for hot-unplug
authorJeff Guo <jia.guo@intel.com>
Mon, 15 Oct 2018 11:27:26 +0000 (19:27 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 15 Oct 2018 20:17:49 +0000 (22:17 +0200)
commit0fc54536b14aa0edef4d36567f49fb382251bfe9
tree8c7e41f017f90a96f77c3b6d04fe6488eb325bc4
parent62e63653baf5fb20315c887bb3d21bebd0259e73
eal: add failure handling for hot-unplug

The mechanism can initially register the sigbus handler after the device
event monitor is enabled. When a sigbus event is captured, it will check
the failure address and accordingly handle the memory failure of the
corresponding device by invoke the hot-unplug handler. It could prevent
the application from crashing when a device is hot-unplugged.

By this patch, users could call below new added APIs to enable/disable
the device hotplug handle mechanism. Note that it just implement the
hot-unplug handler in these functions, the other handler of hotplug, such
as handler for hotplug binding, could be add in the future if need:
  - rte_dev_hotplug_handle_enable
  - rte_dev_hotplug_handle_disable

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
doc/guides/rel_notes/release_18_11.rst
lib/librte_eal/bsdapp/eal/eal_dev.c
lib/librte_eal/common/eal_private.h
lib/librte_eal/common/include/rte_dev.h
lib/librte_eal/linuxapp/eal/eal_dev.c
lib/librte_eal/rte_eal_version.map