numam-dpdk/lib/eal/freebsd
Kevin Laatz 1cab1a40ea bus: cleanup devices on shutdown
During EAL init, all buses are probed and the devices found are
initialized. On eal_cleanup(), the inverse does not happen, meaning any
allocated memory and other configuration will not be cleaned up
appropriately on exit.

Currently, in order for device cleanup to take place, applications must
call the driver-relevant functions to ensure proper cleanup is done before
the application exits. Since initialization occurs for all devices on the
bus, not just the devices used by an application, it requires a)
application awareness of all bus devices that could have been probed on the
system, and b) code duplication across applications to ensure cleanup is
performed. An example of this is rte_eth_dev_close() which is commonly used
across the example applications.

This patch proposes adding bus cleanup to the eal_cleanup() to make EAL's
init/exit more symmetrical, ensuring all bus devices are cleaned up
appropriately without the application needing to be aware of all bus types
that may have been probed during initialization.

Contained in this patch are the changes required to perform cleanup for
devices on the PCI bus and VDEV bus during eal_cleanup(). There would be an
ask for bus maintainers to add the relevant cleanup for their buses since
they have the domain expertise.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
2022-10-04 21:20:15 +02:00
..
include eal/freebsd: fix use of newer cpuset macros 2022-05-24 12:48:11 +02:00
eal_alarm_private.h lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
eal_alarm.c alarm: remove direct access to interrupt handle 2021-10-25 21:20:12 +02:00
eal_cpuflags.c lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
eal_dev.c lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
eal_hugepage_info.c eal/freebsd: lock memory device to prevent conflicts 2021-10-02 16:30:16 +02:00
eal_interrupts.c fix spelling in comments and strings 2022-01-11 12:16:53 +01:00
eal_lcore.c lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
eal_memalloc.c lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
eal_memory.c mem: skip attaching external memory in secondary process 2022-04-28 13:44:13 +02:00
eal_thread.c eal: factorize lcore main loop 2022-04-14 13:59:50 +02:00
eal_timer.c lib: remove librte_ prefix from directory names 2021-04-21 14:04:09 +02:00
eal.c bus: cleanup devices on shutdown 2022-10-04 21:20:15 +02:00
meson.build eal/unix: make stack dump signal safe 2022-06-23 13:40:50 +02:00