From: Yan Sonming <[email protected]>
Signed-off-by: Yan Sonming <[email protected]>
Signed-off-by: Mike Holmes <[email protected]>
---
platform/linux-generic/include/odp_internal.h | 1 +
platform/linux-generic/odp_classification.c | 25 +++++++++++++++++++++++++
platform/linux-generic/odp_init.c | 6 +++++-
3 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/platform/linux-generic/include/odp_internal.h
b/platform/linux-generic/include/odp_internal.h
index cd1adeb..40c040f 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 a7344f8..7d9f73a 100644
--- a/platform/linux-generic/odp_classification.c
+++ b/platform/linux-generic/odp_classification.c
@@ -128,6 +128,31 @@ error:
return -1;
}
+int odp_classification_term_global(void)
+{
+ odp_shm_t cos_shm;
+ odp_shm_t pmr_shm;
+ odp_shm_t pmr_set_shm;
+ int ret = 0;
+
+ cos_shm = odp_shm_lookup("shm_odp_cos_tbl");
+ if (cos_shm == ODP_SHM_INVALID)
+ return -1;
+ ret = odp_shm_free(cos_shm);
+
+ pmr_shm = odp_shm_lookup("shm_odp_pmr_tbl");
+ if (pmr_shm == ODP_SHM_INVALID)
+ return -1;
+ ret = odp_shm_free(pmr_shm);
+
+ pmr_set_shm = odp_shm_lookup("shm_odp_pmr_set_tbl");
+ if (pmr_set_shm == ODP_SHM_INVALID)
+ return -1;
+ ret = odp_shm_free(pmr_set_shm);
+
+ return ret;
+}
+
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 cd8dc46..91f4ee7 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -76,7 +76,11 @@ int odp_init_global(odp_init_t *params ODP_UNUSED,
int odp_term_global(void)
{
- ODP_UNIMPLEMENTED();
+ if (odp_classification_term_global()) {
+ ODP_ERR("ODP classificatio term failed.\n");
+ return -1;
+ }
+
return 0;
}
--
2.1.0
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp