Commit 8b81801e authored by Jim Harris's avatar Jim Harris Committed by Changpeng Liu
Browse files

env_dpdk: do rte_eal_cleanup() at process exit



We already use destructor functions in env_dpdk to do
some cleanup at process exit, so let's also add one
to call rte_eal_cleanup.  This ensures all hugepage
files are freed before the process exits.

Fixes issue #2267.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I8c93f503d77f35717b3d18a63ea49b31789dbc00
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10983


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 1e463739
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -620,6 +620,15 @@ spdk_env_init(const struct spdk_env_opts *opts)
	return rc;
}

__attribute__((destructor)) static void
dpdk_cleanup(void)
{
	/* Only call rte_eal_cleanup if the SPDK env library called rte_eal_init. */
	if (!g_external_init) {
		rte_eal_cleanup();
	}
}

void
spdk_env_fini(void)
{