Unit testing replicates a situation similar to an NFV case where the workload is varied without rebooting the HW. In this use case there have to be hooks for the application to inform the implementation that HW needs to be released.
Signed-off-by: Mike Holmes <[email protected]> --- This patch is intended to specify the API, the implementation for it will require a number of other APIs to be created before it is complete. If accepted the follow on work would require APIs and implementations for odp_shm_terminate_global odp_thread_terminate_global odp_buffer_pool_terminate_global odp_queue_terminate_global odp_schedule_terminate_global odp_pktio_terminate_global odp_timer_terminate_global odp_crypto_terminate_global I propose that initially the odp_terminate_global just return success and the implementation of the supporting functionality be built up over time. platform/linux-generic/include/api/odp_init.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/platform/linux-generic/include/api/odp_init.h b/platform/linux-generic/include/api/odp_init.h index fab4f6e..f24ff5a 100644 --- a/platform/linux-generic/include/api/odp_init.h +++ b/platform/linux-generic/include/api/odp_init.h @@ -48,6 +48,8 @@ typedef struct odp_platform_init_t { * * This function must be called once before calling any other ODP API * functions. + * @sa odp_terminate_global() + * * @param[in] params Those parameters that are interpreted by the ODP API * @param[in] platform_params Those parameters that are passed without * interpretation by the ODP API to the implementation. @@ -56,6 +58,24 @@ typedef struct odp_platform_init_t { int odp_init_global(odp_init_t *params, odp_platform_init_t *platform_params); /** + * Terminate ODP session. + * + * This function is the final ODP call made when terminating + * an ODP application in a controlled way. It cannot handle exceptional + * circumstances. + * In general it calls the API modules terminate functions in the reverse order + * to that which the module init functions were called during odp_init_global() + * + * @warning The unwinding of HW resources to allow them to be re used without reseting + * the device is a complex task that the application is expected to coordinate. + * This api may have platform dependant implications. + * @sa odp_init_global() + * + * @return 0 if successful + */ +int odp_terminate_global(void); + +/** * Perform thread local ODP initialization. * * All threads must call this function before calling -- 1.9.1 _______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
