diff options
-rw-r--r-- | platform/linux-generic/include/odp_internal.h | 1 | ||||
-rw-r--r-- | platform/linux-generic/odp_classification.c | 26 | ||||
-rw-r--r-- | platform/linux-generic/odp_init.c | 10 |
3 files changed, 35 insertions, 2 deletions
diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index b250ed6..fd684d1 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -44,6 +44,7 @@ int odp_pktio_init_global(void); int odp_pktio_init_local(void); int odp_classification_init_global(void); +int odp_classification_term_global(void); int odp_queue_init_global(void); diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index cd9ad9e..9fb034f 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -128,6 +128,32 @@ error: return -1; } +int odp_classification_term_global(void) +{ + int ret = 0; + int rc = 0; + + ret = odp_shm_free(odp_shm_lookup("shm_odp_cos_tbl")); + if (ret < 0) { + ODP_ERR("shm free failed for shm_odp_cos_tbl"); + rc = -1; + } + + ret = odp_shm_free(odp_shm_lookup("shm_odp_pmr_tbl")); + if (ret < 0) { + ODP_ERR("shm free failed for shm_odp_pmr_tbl"); + rc = -1; + } + + ret = odp_shm_free(odp_shm_lookup("shm_odp_pmr_set_tbl")); + if (ret < 0) { + ODP_ERR("shm free failed for shm_odp_pmr_tbl"); + rc = -1; + } + + return rc; +} + odp_cos_t odp_cos_create(const char *name) { int i; diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 2d91744..58e1ab6 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -76,8 +76,14 @@ int odp_init_global(odp_init_t *params, int odp_term_global(void) { - ODP_UNIMPLEMENTED(); - return 0; + int rc = 0; + + if (odp_classification_term_global()) { + ODP_ERR("ODP classificatio term failed.\n"); + rc = -1; + } + + return rc; } int odp_init_local(void) |