eal: add device event monitor framework
authorJeff Guo <jia.guo@intel.com>
Fri, 13 Apr 2018 08:30:38 +0000 (16:30 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 13 Apr 2018 10:00:31 +0000 (12:00 +0200)
commita753e53d517b4534573549300b610e3949f65914
tree13f54f02af3c44f740e3132d22906b4cf73aaf4b
parent493b8e173fe6ba98ba8f4322a58c6e6c8b816b17
eal: add device event monitor framework

This patch aims to add a general device event monitor framework at
EAL device layer, for device hotplug awareness and actions adopted
accordingly. It could also expand for all other types of device event
monitor, but not in this scope at the stage.

To get started, users firstly call below new added APIs to enable/disable
the device event monitor mechanism:
  - rte_dev_event_monitor_start
  - rte_dev_event_monitor_stop

Then users shell register or unregister callbacks through the new added
APIs. Callbacks can be some device specific, or for all devices.
  -rte_dev_event_callback_register
  -rte_dev_event_callback_unregister

Use hotplug case for example, when device hotplug insertion or hotplug
removal, we will get notified from kernel, then call user's callbacks
accordingly to handle it, such as detach or attach the device from the
bus, and could benefit further fail-safe or live-migration.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
doc/guides/rel_notes/release_18_05.rst
lib/librte_eal/bsdapp/eal/Makefile
lib/librte_eal/bsdapp/eal/eal_dev.c [new file with mode: 0644]
lib/librte_eal/bsdapp/eal/meson.build
lib/librte_eal/common/eal_common_dev.c
lib/librte_eal/common/eal_private.h
lib/librte_eal/common/include/rte_dev.h
lib/librte_eal/linuxapp/eal/Makefile
lib/librte_eal/linuxapp/eal/eal_dev.c [new file with mode: 0644]
lib/librte_eal/linuxapp/eal/meson.build
lib/librte_eal/rte_eal_version.map