eal: add function to release internal resources
authorHarry van Haaren <harry.van.haaren@intel.com>
Mon, 29 Jan 2018 16:37:30 +0000 (16:37 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 29 Jan 2018 19:33:53 +0000 (20:33 +0100)
commitaec9c13c5257f0dae350152fa0444634fe35859e
treecced567af2983d8b8912264839dd0c6df6d9d3b3
parent1dd133ae073d9e2bcf6f471f3b831385aa0051c4
eal: add function to release internal resources

This commit adds a new function rte_eal_cleanup().
The function serves as a hook to allow DPDK to release
internal resources (e.g.: hugepage allocations).

This function allows DPDK to become more like an ordinary
library, where the library context itself can be initialized
and cleaned up by the application.

The rte_exit() and rte_panic() functions must be considered,
particularly if they should call rte_eal_cleanup() to release any
resources or not. This patch adds the cleanup to rte_exit(),
but does not clean up on rte_panic(). The reason to not clean
up on panicing is that the developer may wish to inspect the
exact internal state of EAL and hugepages.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Vipin Varghese <vipin.varghese@intel.com>
doc/guides/prog_guide/env_abstraction_layer.rst
doc/guides/rel_notes/release_18_02.rst
lib/librte_eal/bsdapp/eal/eal.c
lib/librte_eal/bsdapp/eal/eal_debug.c
lib/librte_eal/common/include/rte_eal.h
lib/librte_eal/linuxapp/eal/eal.c
lib/librte_eal/linuxapp/eal/eal_debug.c
lib/librte_eal/rte_eal_version.map