diff mbox

[v2] odp_init.h: Add odp_terminate_global

Message ID 1413396869-34738-1-git-send-email-mike.holmes@linaro.org
State Rejected
Headers show

Commit Message

Mike Holmes Oct. 15, 2014, 6:14 p.m. UTC
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 <mike.holmes@linaro.org>
---
v2:
Modify the name from terminate to term

 platform/linux-generic/include/api/odp_init.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Taras Kondratiuk Oct. 16, 2014, 8:37 a.m. UTC | #1
On 10/15/2014 09:14 PM, Mike Holmes wrote:
> 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.

odp_term_global doesn't make much sense without odp_term_local().
Per-thread resources need to be cleared by threads.
Could you please add it to this patch?

Also patch name still has an old function name.
Mike Holmes Oct. 16, 2014, 11:41 a.m. UTC | #2
On 16 October 2014 04:37, Taras Kondratiuk <taras.kondratiuk@linaro.org>
wrote:

> On 10/15/2014 09:14 PM, Mike Holmes wrote:
>
>> 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.
>>
>
> odp_term_global doesn't make much sense without odp_term_local().
> Per-thread resources need to be cleared by threads.
> Could you please add it to this patch?
>

Yes, if this one is settled I will add that.

>
> Also patch name still has an old function name.
>
Thanks :)
diff mbox

Patch

diff --git a/platform/linux-generic/include/api/odp_init.h b/platform/linux-generic/include/api/odp_init.h
index fab4f6e..cfb50f9 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_term_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_term_global(void);
+
+/**
  * Perform thread local ODP initialization.
  *
  * All threads must call this function before calling