eal: fix hotplug add / remove
The hotplug API requires a few properties that were not previously
explicitly enforced:
- Idempotency, two consecutive scans should result in the same state.
- Upon returning, internal devices are now allocated and available
through the new `find_device` operator, meaning that they should be
identifiable.
The current rte_eal_hotplug_add implementation identifies devices by
their names, as it is readily available and easy to define.
The device name must be passed to the internal rte_device handle in
order to be available during scan, when it is then assigned to the
device. The current way of passing down this information from the device
declaration is through the global rte_devargs list.
Furthermore, the rte_device cannot take a bus-specific generated name,
as it is then not identifiable by the `find_device` operator. The device
must take the user-defined name. Ideally, an rte_device name should not
change during its existence.
This commit generates a new rte_devargs associated with the plugged
device and inserts it in the global rte_devargs list. It consequently
releases it upon device removal.
Fixes:
a3ee360f4440 ("eal: add hotplug add/remove device")
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>