[11/14] eal: cleanup plugins data
Checks
Commit Message
When rte_eal_cleanup is called walk through the list of shared
objects loaded, and close them and free the data structure.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/common/eal_common_options.c | 12 ++++++++++++
lib/librte_eal/common/eal_options.h | 1 +
lib/librte_eal/linux/eal/eal.c | 1 +
3 files changed, 14 insertions(+)
@@ -308,6 +308,18 @@ eal_plugins_init(void)
return 0;
}
+void
+eal_plugins_cleanup(void)
+{
+ struct shared_driver *solib, *tmp;
+
+ TAILQ_FOREACH_SAFE(solib, &solib_list, next, tmp) {
+ if (solib->lib_handle)
+ dlclose(solib->lib_handle);
+ free(solib);
+ }
+}
+
/*
* Parse the coremask given as argument (hexadecimal string) and fill
* the global configuration (core role and core count) with the parsed
@@ -84,5 +84,6 @@ int eal_check_common_options(struct internal_config *internal_cfg);
void eal_common_usage(void);
enum rte_proc_type_t eal_proc_type_detect(void);
int eal_plugins_init(void);
+void eal_plugins_cleanup(void);
#endif /* EAL_OPTIONS_H */
@@ -1344,6 +1344,7 @@ rte_eal_cleanup(void)
rte_eal_intr_cleanup();
rte_eal_alarm_cleanup();
rte_mp_channel_cleanup();
+ eal_plugins_cleanup();
eal_cleanup_config(&internal_config);
rte_eal_log_cleanup();