diff mbox

[v9] Add global_init params

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

Commit Message

Mike Holmes Oct. 3, 2014, 3:16 p.m. UTC
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
v9:
 consistent spelling
 remove bad cut and paste in description

 example/generator/odp_generator.c             |  2 +-
 example/ipsec/odp_ipsec.c                     |  2 +-
 example/l2fwd/odp_l2fwd.c                     |  2 +-
 example/odp_example/odp_example.c             |  2 +-
 example/packet/odp_pktio.c                    |  2 +-
 example/timer/odp_timer_test.c                |  2 +-
 platform/linux-generic/include/api/odp_init.h | 33 +++++++++++++++++++++------
 platform/linux-generic/odp_init.c             |  3 ++-
 test/api_test/odp_common.c                    |  2 +-
 9 files changed, 35 insertions(+), 15 deletions(-)

Comments

Ciprian Barbu Oct. 6, 2014, 12:19 p.m. UTC | #1
On Fri, Oct 3, 2014 at 6:16 PM, Mike Holmes <mike.holmes@linaro.org> wrote:
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> ---
> v9:
>  consistent spelling
>  remove bad cut and paste in description
>
>  example/generator/odp_generator.c             |  2 +-
>  example/ipsec/odp_ipsec.c                     |  2 +-
>  example/l2fwd/odp_l2fwd.c                     |  2 +-
>  example/odp_example/odp_example.c             |  2 +-
>  example/packet/odp_pktio.c                    |  2 +-
>  example/timer/odp_timer_test.c                |  2 +-
>  platform/linux-generic/include/api/odp_init.h | 33 +++++++++++++++++++++------
>  platform/linux-generic/odp_init.c             |  3 ++-
>  test/api_test/odp_common.c                    |  2 +-
>  9 files changed, 35 insertions(+), 15 deletions(-)
>
> diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
> index 6055324..eb8b340 100644
> --- a/example/generator/odp_generator.c
> +++ b/example/generator/odp_generator.c
> @@ -519,7 +519,7 @@ int main(int argc, char *argv[])
>         odp_shm_t shm;
>
>         /* Init ODP before calling anything else */
> -       if (odp_init_global()) {
> +       if (odp_init_global(NULL, NULL)) {
>                 ODP_ERR("Error: ODP global init failed.\n");
>                 exit(EXIT_FAILURE);
>         }
> diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
> index 1b652cf..acaa1c2 100644
> --- a/example/ipsec/odp_ipsec.c
> +++ b/example/ipsec/odp_ipsec.c
> @@ -1176,7 +1176,7 @@ main(int argc, char *argv[])
>         odp_shm_t shm;
>
>         /* Init ODP before calling anything else */
> -       if (odp_init_global()) {
> +       if (odp_init_global(NULL, NULL)) {
>                 ODP_ERR("Error: ODP global init failed.\n");
>                 exit(EXIT_FAILURE);
>         }
> diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c
> index 8aa0ba0..57037cd 100644
> --- a/example/l2fwd/odp_l2fwd.c
> +++ b/example/l2fwd/odp_l2fwd.c
> @@ -319,7 +319,7 @@ int main(int argc, char *argv[])
>         odp_shm_t shm;
>
>         /* Init ODP before calling anything else */
> -       if (odp_init_global()) {
> +       if (odp_init_global(NULL, NULL)) {
>                 ODP_ERR("Error: ODP global init failed.\n");
>                 exit(EXIT_FAILURE);
>         }
> diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c
> index 47d764e..0e9aa3d 100644
> --- a/example/odp_example/odp_example.c
> +++ b/example/odp_example/odp_example.c
> @@ -985,7 +985,7 @@ int main(int argc, char *argv[])
>         memset(thread_tbl, 0, sizeof(thread_tbl));
>
>         /* ODP global init */
> -       if (odp_init_global()) {
> +       if (odp_init_global(NULL, NULL)) {
>                 ODP_ERR("ODP global init failed.\n");
>                 return -1;
>         }
> diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
> index 145ae47..2cf3f0d 100644
> --- a/example/packet/odp_pktio.c
> +++ b/example/packet/odp_pktio.c
> @@ -299,7 +299,7 @@ int main(int argc, char *argv[])
>         odp_shm_t shm;
>
>         /* Init ODP before calling anything else */
> -       if (odp_init_global()) {
> +       if (odp_init_global(NULL, NULL)) {
>                 ODP_ERR("Error: ODP global init failed.\n");
>                 exit(EXIT_FAILURE);
>         }
> diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
> index 87900fc..78b2ae2 100644
> --- a/example/timer/odp_timer_test.c
> +++ b/example/timer/odp_timer_test.c
> @@ -256,7 +256,7 @@ int main(int argc, char *argv[])
>
>         memset(thread_tbl, 0, sizeof(thread_tbl));
>
> -       if (odp_init_global()) {
> +       if (odp_init_global(NULL, NULL)) {
>                 printf("ODP global init failed.\n");
>                 return -1;
>         }
> diff --git a/platform/linux-generic/include/api/odp_init.h b/platform/linux-generic/include/api/odp_init.h
> index 13c8e44..f35ce20 100644
> --- a/platform/linux-generic/include/api/odp_init.h
> +++ b/platform/linux-generic/include/api/odp_init.h
> @@ -24,20 +24,39 @@ extern "C" {
>
>
>
> +/** ODP initialisation data.

initialization again

> + * Data that is required to initialise the ODP API with the

initialize

> + * application specific data such as specifying a logging callback, the log
> + * level etc.
> + */
> +typedef struct odp_init_t {
> +} odp_init_t;
> +
> +/** ODP platform initialization data.
> + * @note ODP API does nothing with this data. It is the underlying
> + * implementation that requires it and any data passed here is not portable.
> + * It is required that the application takes care of identifying and
> + * passing any required platform specific data.
> + */
> +
> +typedef struct odp_platform_init_t {
> +} odp_platform_init_t;
> +
>
>  /**
> - * Perform global ODP initalisation.
> - *
> - * This function must be called once before calling
> - * any other ODP API functions.
> + * Perform global ODP initialization.
>   *
> + * This function must be called once before calling any other ODP API
> + * functions.
> + * @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.
>   * @return 0 if successful
>   */
> -int odp_init_global(void);
> -
> +int odp_init_global(odp_init_t *params, odp_platform_init_t *platform_params);
>
>  /**
> - * Perform thread local ODP initalisation.
> + * Perform thread local ODP initialization.
>   *
>   * All threads must call this function before calling
>   * any other ODP API functions.
> diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c
> index 55fa53a..c97c5aa 100644
> --- a/platform/linux-generic/odp_init.c
> +++ b/platform/linux-generic/odp_init.c
> @@ -9,7 +9,8 @@
>  #include <odp_debug.h>
>
>
> -int odp_init_global(void)
> +int odp_init_global(odp_init_t *params  ODP_UNUSED,
> +                       odp_platform_init_t *platform_params ODP_UNUSED)
>  {
>         odp_system_info_init();
>
> diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c
> index b0a6fbc..ed1fc97 100644
> --- a/test/api_test/odp_common.c
> +++ b/test/api_test/odp_common.c
> @@ -56,7 +56,7 @@ int odp_test_global_init(void)
>  {
>         memset(thread_tbl, 0, sizeof(thread_tbl));
>
> -       if (odp_init_global()) {
> +       if (odp_init_global(NULL, NULL)) {
>                 ODP_ERR("ODP global init failed.\n");
>                 return -1;
>         }
> --
> 1.9.1
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Mike Holmes Oct. 6, 2014, 12:27 p.m. UTC | #2
Ciprian with that fixed would you add reviewed by ?

On 6 October 2014 08:19, Ciprian Barbu <ciprian.barbu@linaro.org> wrote:

> On Fri, Oct 3, 2014 at 6:16 PM, Mike Holmes <mike.holmes@linaro.org>
> wrote:
> > Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> > ---
> > v9:
> >  consistent spelling
> >  remove bad cut and paste in description
> >
> >  example/generator/odp_generator.c             |  2 +-
> >  example/ipsec/odp_ipsec.c                     |  2 +-
> >  example/l2fwd/odp_l2fwd.c                     |  2 +-
> >  example/odp_example/odp_example.c             |  2 +-
> >  example/packet/odp_pktio.c                    |  2 +-
> >  example/timer/odp_timer_test.c                |  2 +-
> >  platform/linux-generic/include/api/odp_init.h | 33
> +++++++++++++++++++++------
> >  platform/linux-generic/odp_init.c             |  3 ++-
> >  test/api_test/odp_common.c                    |  2 +-
> >  9 files changed, 35 insertions(+), 15 deletions(-)
> >
> > diff --git a/example/generator/odp_generator.c
> b/example/generator/odp_generator.c
> > index 6055324..eb8b340 100644
> > --- a/example/generator/odp_generator.c
> > +++ b/example/generator/odp_generator.c
> > @@ -519,7 +519,7 @@ int main(int argc, char *argv[])
> >         odp_shm_t shm;
> >
> >         /* Init ODP before calling anything else */
> > -       if (odp_init_global()) {
> > +       if (odp_init_global(NULL, NULL)) {
> >                 ODP_ERR("Error: ODP global init failed.\n");
> >                 exit(EXIT_FAILURE);
> >         }
> > diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
> > index 1b652cf..acaa1c2 100644
> > --- a/example/ipsec/odp_ipsec.c
> > +++ b/example/ipsec/odp_ipsec.c
> > @@ -1176,7 +1176,7 @@ main(int argc, char *argv[])
> >         odp_shm_t shm;
> >
> >         /* Init ODP before calling anything else */
> > -       if (odp_init_global()) {
> > +       if (odp_init_global(NULL, NULL)) {
> >                 ODP_ERR("Error: ODP global init failed.\n");
> >                 exit(EXIT_FAILURE);
> >         }
> > diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c
> > index 8aa0ba0..57037cd 100644
> > --- a/example/l2fwd/odp_l2fwd.c
> > +++ b/example/l2fwd/odp_l2fwd.c
> > @@ -319,7 +319,7 @@ int main(int argc, char *argv[])
> >         odp_shm_t shm;
> >
> >         /* Init ODP before calling anything else */
> > -       if (odp_init_global()) {
> > +       if (odp_init_global(NULL, NULL)) {
> >                 ODP_ERR("Error: ODP global init failed.\n");
> >                 exit(EXIT_FAILURE);
> >         }
> > diff --git a/example/odp_example/odp_example.c
> b/example/odp_example/odp_example.c
> > index 47d764e..0e9aa3d 100644
> > --- a/example/odp_example/odp_example.c
> > +++ b/example/odp_example/odp_example.c
> > @@ -985,7 +985,7 @@ int main(int argc, char *argv[])
> >         memset(thread_tbl, 0, sizeof(thread_tbl));
> >
> >         /* ODP global init */
> > -       if (odp_init_global()) {
> > +       if (odp_init_global(NULL, NULL)) {
> >                 ODP_ERR("ODP global init failed.\n");
> >                 return -1;
> >         }
> > diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
> > index 145ae47..2cf3f0d 100644
> > --- a/example/packet/odp_pktio.c
> > +++ b/example/packet/odp_pktio.c
> > @@ -299,7 +299,7 @@ int main(int argc, char *argv[])
> >         odp_shm_t shm;
> >
> >         /* Init ODP before calling anything else */
> > -       if (odp_init_global()) {
> > +       if (odp_init_global(NULL, NULL)) {
> >                 ODP_ERR("Error: ODP global init failed.\n");
> >                 exit(EXIT_FAILURE);
> >         }
> > diff --git a/example/timer/odp_timer_test.c
> b/example/timer/odp_timer_test.c
> > index 87900fc..78b2ae2 100644
> > --- a/example/timer/odp_timer_test.c
> > +++ b/example/timer/odp_timer_test.c
> > @@ -256,7 +256,7 @@ int main(int argc, char *argv[])
> >
> >         memset(thread_tbl, 0, sizeof(thread_tbl));
> >
> > -       if (odp_init_global()) {
> > +       if (odp_init_global(NULL, NULL)) {
> >                 printf("ODP global init failed.\n");
> >                 return -1;
> >         }
> > diff --git a/platform/linux-generic/include/api/odp_init.h
> b/platform/linux-generic/include/api/odp_init.h
> > index 13c8e44..f35ce20 100644
> > --- a/platform/linux-generic/include/api/odp_init.h
> > +++ b/platform/linux-generic/include/api/odp_init.h
> > @@ -24,20 +24,39 @@ extern "C" {
> >
> >
> >
> > +/** ODP initialisation data.
>
> initialization again
>
> > + * Data that is required to initialise the ODP API with the
>
> initialize
>
> > + * application specific data such as specifying a logging callback, the
> log
> > + * level etc.
> > + */
> > +typedef struct odp_init_t {
> > +} odp_init_t;
> > +
> > +/** ODP platform initialization data.
> > + * @note ODP API does nothing with this data. It is the underlying
> > + * implementation that requires it and any data passed here is not
> portable.
> > + * It is required that the application takes care of identifying and
> > + * passing any required platform specific data.
> > + */
> > +
> > +typedef struct odp_platform_init_t {
> > +} odp_platform_init_t;
> > +
> >
> >  /**
> > - * Perform global ODP initalisation.
> > - *
> > - * This function must be called once before calling
> > - * any other ODP API functions.
> > + * Perform global ODP initialization.
> >   *
> > + * This function must be called once before calling any other ODP API
> > + * functions.
> > + * @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.
> >   * @return 0 if successful
> >   */
> > -int odp_init_global(void);
> > -
> > +int odp_init_global(odp_init_t *params, odp_platform_init_t
> *platform_params);
> >
> >  /**
> > - * Perform thread local ODP initalisation.
> > + * Perform thread local ODP initialization.
> >   *
> >   * All threads must call this function before calling
> >   * any other ODP API functions.
> > diff --git a/platform/linux-generic/odp_init.c
> b/platform/linux-generic/odp_init.c
> > index 55fa53a..c97c5aa 100644
> > --- a/platform/linux-generic/odp_init.c
> > +++ b/platform/linux-generic/odp_init.c
> > @@ -9,7 +9,8 @@
> >  #include <odp_debug.h>
> >
> >
> > -int odp_init_global(void)
> > +int odp_init_global(odp_init_t *params  ODP_UNUSED,
> > +                       odp_platform_init_t *platform_params ODP_UNUSED)
> >  {
> >         odp_system_info_init();
> >
> > diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c
> > index b0a6fbc..ed1fc97 100644
> > --- a/test/api_test/odp_common.c
> > +++ b/test/api_test/odp_common.c
> > @@ -56,7 +56,7 @@ int odp_test_global_init(void)
> >  {
> >         memset(thread_tbl, 0, sizeof(thread_tbl));
> >
> > -       if (odp_init_global()) {
> > +       if (odp_init_global(NULL, NULL)) {
> >                 ODP_ERR("ODP global init failed.\n");
> >                 return -1;
> >         }
> > --
> > 1.9.1
> >
> >
> > _______________________________________________
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > http://lists.linaro.org/mailman/listinfo/lng-odp
>
diff mbox

Patch

diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
index 6055324..eb8b340 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -519,7 +519,7 @@  int main(int argc, char *argv[])
 	odp_shm_t shm;
 
 	/* Init ODP before calling anything else */
-	if (odp_init_global()) {
+	if (odp_init_global(NULL, NULL)) {
 		ODP_ERR("Error: ODP global init failed.\n");
 		exit(EXIT_FAILURE);
 	}
diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
index 1b652cf..acaa1c2 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -1176,7 +1176,7 @@  main(int argc, char *argv[])
 	odp_shm_t shm;
 
 	/* Init ODP before calling anything else */
-	if (odp_init_global()) {
+	if (odp_init_global(NULL, NULL)) {
 		ODP_ERR("Error: ODP global init failed.\n");
 		exit(EXIT_FAILURE);
 	}
diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c
index 8aa0ba0..57037cd 100644
--- a/example/l2fwd/odp_l2fwd.c
+++ b/example/l2fwd/odp_l2fwd.c
@@ -319,7 +319,7 @@  int main(int argc, char *argv[])
 	odp_shm_t shm;
 
 	/* Init ODP before calling anything else */
-	if (odp_init_global()) {
+	if (odp_init_global(NULL, NULL)) {
 		ODP_ERR("Error: ODP global init failed.\n");
 		exit(EXIT_FAILURE);
 	}
diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c
index 47d764e..0e9aa3d 100644
--- a/example/odp_example/odp_example.c
+++ b/example/odp_example/odp_example.c
@@ -985,7 +985,7 @@  int main(int argc, char *argv[])
 	memset(thread_tbl, 0, sizeof(thread_tbl));
 
 	/* ODP global init */
-	if (odp_init_global()) {
+	if (odp_init_global(NULL, NULL)) {
 		ODP_ERR("ODP global init failed.\n");
 		return -1;
 	}
diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
index 145ae47..2cf3f0d 100644
--- a/example/packet/odp_pktio.c
+++ b/example/packet/odp_pktio.c
@@ -299,7 +299,7 @@  int main(int argc, char *argv[])
 	odp_shm_t shm;
 
 	/* Init ODP before calling anything else */
-	if (odp_init_global()) {
+	if (odp_init_global(NULL, NULL)) {
 		ODP_ERR("Error: ODP global init failed.\n");
 		exit(EXIT_FAILURE);
 	}
diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index 87900fc..78b2ae2 100644
--- a/example/timer/odp_timer_test.c
+++ b/example/timer/odp_timer_test.c
@@ -256,7 +256,7 @@  int main(int argc, char *argv[])
 
 	memset(thread_tbl, 0, sizeof(thread_tbl));
 
-	if (odp_init_global()) {
+	if (odp_init_global(NULL, NULL)) {
 		printf("ODP global init failed.\n");
 		return -1;
 	}
diff --git a/platform/linux-generic/include/api/odp_init.h b/platform/linux-generic/include/api/odp_init.h
index 13c8e44..f35ce20 100644
--- a/platform/linux-generic/include/api/odp_init.h
+++ b/platform/linux-generic/include/api/odp_init.h
@@ -24,20 +24,39 @@  extern "C" {
 
 
 
+/** ODP initialisation data.
+ * Data that is required to initialise the ODP API with the
+ * application specific data such as specifying a logging callback, the log
+ * level etc.
+ */
+typedef struct odp_init_t {
+} odp_init_t;
+
+/** ODP platform initialization data.
+ * @note ODP API does nothing with this data. It is the underlying
+ * implementation that requires it and any data passed here is not portable.
+ * It is required that the application takes care of identifying and
+ * passing any required platform specific data.
+ */
+
+typedef struct odp_platform_init_t {
+} odp_platform_init_t;
+
 
 /**
- * Perform global ODP initalisation.
- *
- * This function must be called once before calling
- * any other ODP API functions.
+ * Perform global ODP initialization.
  *
+ * This function must be called once before calling any other ODP API
+ * functions.
+ * @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.
  * @return 0 if successful
  */
-int odp_init_global(void);
-
+int odp_init_global(odp_init_t *params, odp_platform_init_t *platform_params);
 
 /**
- * Perform thread local ODP initalisation.
+ * Perform thread local ODP initialization.
  *
  * All threads must call this function before calling
  * any other ODP API functions.
diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c
index 55fa53a..c97c5aa 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -9,7 +9,8 @@ 
 #include <odp_debug.h>
 
 
-int odp_init_global(void)
+int odp_init_global(odp_init_t *params  ODP_UNUSED,
+			odp_platform_init_t *platform_params ODP_UNUSED)
 {
 	odp_system_info_init();
 
diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c
index b0a6fbc..ed1fc97 100644
--- a/test/api_test/odp_common.c
+++ b/test/api_test/odp_common.c
@@ -56,7 +56,7 @@  int odp_test_global_init(void)
 {
 	memset(thread_tbl, 0, sizeof(thread_tbl));
 
-	if (odp_init_global()) {
+	if (odp_init_global(NULL, NULL)) {
 		ODP_ERR("ODP global init failed.\n");
 		return -1;
 	}