diff mbox

[v8] Add global_init params

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

Commit Message

Mike Holmes Oct. 1, 2014, 4:55 p.m. UTC
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 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 | 31 ++++++++++++++++++++++-----
 platform/linux-generic/odp_init.c             |  3 ++-
 test/api_test/odp_common.c                    |  2 +-
 9 files changed, 35 insertions(+), 13 deletions(-)

Comments

Ciprian Barbu Oct. 3, 2014, 12:26 p.m. UTC | #1
Hi,

On Wed, Oct 1, 2014 at 7:55 PM, Mike Holmes <mike.holmes@linaro.org> wrote:
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> ---
>  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 | 31 ++++++++++++++++++++++-----
>  platform/linux-generic/odp_init.c             |  3 ++-
>  test/api_test/odp_common.c                    |  2 +-
>  9 files changed, 35 insertions(+), 13 deletions(-)
>
> diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
> index 27fc868..b2b886f 100644
> --- a/example/generator/odp_generator.c
> +++ b/example/generator/odp_generator.c
> @@ -526,7 +526,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)) {

We need some more feedback on this topic, he already had several
discussion on it but we have to continue.

I had a discussion with Mike today and I raised the question on
whether the odp examples will diverge because of this. For instance
the linux-dpdk implementation of odp_pktio will need to pass some dpdk
specific params, whereas the linux-generic will just pass NULL, NULL.
One solution to this would be to have an extra source file, something
called like platform_init.c, that would call odp_init_global with the
right parameters. Inside the test application there will be a my_init
function with weak sym linkage, that would point to the function
inside platform_init.c, if present. The default my_int would call
odp_init_global(NULL, NULL).

Any opinions on this?

>                 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 a9bba24..2339d34 100644
> --- a/example/ipsec/odp_ipsec.c
> +++ b/example/ipsec/odp_ipsec.c
> @@ -1184,7 +1184,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 6c1d64a..d1df1d0 100644
> --- a/example/l2fwd/odp_l2fwd.c
> +++ b/example/l2fwd/odp_l2fwd.c
> @@ -324,7 +324,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 c80dbbc..ebca4b2 100644
> --- a/example/odp_example/odp_example.c
> +++ b/example/odp_example/odp_example.c
> @@ -952,7 +952,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/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
> index 41315f7..fc4710c 100644
> --- a/example/packet/odp_pktio.c
> +++ b/example/packet/odp_pktio.c
> @@ -312,7 +312,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 6e1715d..9b87921 100644
> --- a/example/timer/odp_timer_test.c
> +++ b/example/timer/odp_timer_test.c
> @@ -257,7 +257,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 490324a..6ae74c9 100644
> --- a/platform/linux-generic/include/api/odp_init.h
> +++ b/platform/linux-generic/include/api/odp_init.h
> @@ -24,17 +24,38 @@ extern "C" {
>
>
>
> +/** ODP initialisation data.
> + * Data that is required to initialize the ODP API with the
> + * implimnetation that is required to initialize 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.
> - *
> + * 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.
> diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c
> index 5b7e192..ace55cc 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_thread_init_global();
>
> 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. 3, 2014, 12:37 p.m. UTC | #2
Additionally we need a place to install the various different builds in OE

Ciprian and I could not decide between
--prefix=/usr/local/odp/<platform>
and
--prefix=/usr/local/<platform>

Any thoughts.



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

> Hi,
>
> On Wed, Oct 1, 2014 at 7:55 PM, Mike Holmes <mike.holmes@linaro.org>
> wrote:
> > Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> > ---
> >  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 | 31
> ++++++++++++++++++++++-----
> >  platform/linux-generic/odp_init.c             |  3 ++-
> >  test/api_test/odp_common.c                    |  2 +-
> >  9 files changed, 35 insertions(+), 13 deletions(-)
> >
> > diff --git a/example/generator/odp_generator.c
> b/example/generator/odp_generator.c
> > index 27fc868..b2b886f 100644
> > --- a/example/generator/odp_generator.c
> > +++ b/example/generator/odp_generator.c
> > @@ -526,7 +526,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)) {
>
> We need some more feedback on this topic, he already had several
> discussion on it but we have to continue.
>
> I had a discussion with Mike today and I raised the question on
> whether the odp examples will diverge because of this. For instance
> the linux-dpdk implementation of odp_pktio will need to pass some dpdk
> specific params, whereas the linux-generic will just pass NULL, NULL.
> One solution to this would be to have an extra source file, something
> called like platform_init.c, that would call odp_init_global with the
> right parameters. Inside the test application there will be a my_init
> function with weak sym linkage, that would point to the function
> inside platform_init.c, if present. The default my_int would call
> odp_init_global(NULL, NULL).
>
> Any opinions on this?
>
> >                 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 a9bba24..2339d34 100644
> > --- a/example/ipsec/odp_ipsec.c
> > +++ b/example/ipsec/odp_ipsec.c
> > @@ -1184,7 +1184,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 6c1d64a..d1df1d0 100644
> > --- a/example/l2fwd/odp_l2fwd.c
> > +++ b/example/l2fwd/odp_l2fwd.c
> > @@ -324,7 +324,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 c80dbbc..ebca4b2 100644
> > --- a/example/odp_example/odp_example.c
> > +++ b/example/odp_example/odp_example.c
> > @@ -952,7 +952,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/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
> > index 41315f7..fc4710c 100644
> > --- a/example/packet/odp_pktio.c
> > +++ b/example/packet/odp_pktio.c
> > @@ -312,7 +312,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 6e1715d..9b87921 100644
> > --- a/example/timer/odp_timer_test.c
> > +++ b/example/timer/odp_timer_test.c
> > @@ -257,7 +257,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 490324a..6ae74c9 100644
> > --- a/platform/linux-generic/include/api/odp_init.h
> > +++ b/platform/linux-generic/include/api/odp_init.h
> > @@ -24,17 +24,38 @@ extern "C" {
> >
> >
> >
> > +/** ODP initialisation data.
> > + * Data that is required to initialize the ODP API with the
> > + * implimnetation that is required to initialize 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.
> > - *
> > + * 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.
> > diff --git a/platform/linux-generic/odp_init.c
> b/platform/linux-generic/odp_init.c
> > index 5b7e192..ace55cc 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_thread_init_global();
> >
> > 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
>
Ciprian Barbu Oct. 3, 2014, 12:45 p.m. UTC | #3
On Fri, Oct 3, 2014 at 3:37 PM, Mike Holmes <mike.holmes@linaro.org> wrote:
> Additionally we need a place to install the various different builds in OE
>
> Ciprian and I could not decide between
> --prefix=/usr/local/odp/<platform>

On a second though I would go with /usr/local/odp/<platform> or other
optional directory, but keep odp too.

> and
> --prefix=/usr/local/<platform>
>
> Any thoughts.
>
>
>
> On 3 October 2014 08:26, Ciprian Barbu <ciprian.barbu@linaro.org> wrote:
>>
>> Hi,
>>
>> On Wed, Oct 1, 2014 at 7:55 PM, Mike Holmes <mike.holmes@linaro.org>
>> wrote:
>> > Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>> > ---
>> >  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 | 31
>> > ++++++++++++++++++++++-----
>> >  platform/linux-generic/odp_init.c             |  3 ++-
>> >  test/api_test/odp_common.c                    |  2 +-
>> >  9 files changed, 35 insertions(+), 13 deletions(-)
>> >
>> > diff --git a/example/generator/odp_generator.c
>> > b/example/generator/odp_generator.c
>> > index 27fc868..b2b886f 100644
>> > --- a/example/generator/odp_generator.c
>> > +++ b/example/generator/odp_generator.c
>> > @@ -526,7 +526,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)) {
>>
>> We need some more feedback on this topic, he already had several
>> discussion on it but we have to continue.
>>
>> I had a discussion with Mike today and I raised the question on
>> whether the odp examples will diverge because of this. For instance
>> the linux-dpdk implementation of odp_pktio will need to pass some dpdk
>> specific params, whereas the linux-generic will just pass NULL, NULL.
>> One solution to this would be to have an extra source file, something
>> called like platform_init.c, that would call odp_init_global with the
>> right parameters. Inside the test application there will be a my_init
>> function with weak sym linkage, that would point to the function
>> inside platform_init.c, if present. The default my_int would call
>> odp_init_global(NULL, NULL).
>>
>> Any opinions on this?
>>
>> >                 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 a9bba24..2339d34 100644
>> > --- a/example/ipsec/odp_ipsec.c
>> > +++ b/example/ipsec/odp_ipsec.c
>> > @@ -1184,7 +1184,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 6c1d64a..d1df1d0 100644
>> > --- a/example/l2fwd/odp_l2fwd.c
>> > +++ b/example/l2fwd/odp_l2fwd.c
>> > @@ -324,7 +324,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 c80dbbc..ebca4b2 100644
>> > --- a/example/odp_example/odp_example.c
>> > +++ b/example/odp_example/odp_example.c
>> > @@ -952,7 +952,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/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
>> > index 41315f7..fc4710c 100644
>> > --- a/example/packet/odp_pktio.c
>> > +++ b/example/packet/odp_pktio.c
>> > @@ -312,7 +312,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 6e1715d..9b87921 100644
>> > --- a/example/timer/odp_timer_test.c
>> > +++ b/example/timer/odp_timer_test.c
>> > @@ -257,7 +257,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 490324a..6ae74c9 100644
>> > --- a/platform/linux-generic/include/api/odp_init.h
>> > +++ b/platform/linux-generic/include/api/odp_init.h
>> > @@ -24,17 +24,38 @@ extern "C" {
>> >
>> >
>> >
>> > +/** ODP initialisation data.
>> > + * Data that is required to initialize the ODP API with the
>> > + * implimnetation that is required to initialize 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.
>> > - *
>> > + * 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.
>> > diff --git a/platform/linux-generic/odp_init.c
>> > b/platform/linux-generic/odp_init.c
>> > index 5b7e192..ace55cc 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_thread_init_global();
>> >
>> > 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
> Linaro  Sr Technical Manager
> LNG - ODP
Taras Kondratiuk Oct. 3, 2014, 12:47 p.m. UTC | #4
On 10/03/2014 03:45 PM, Ciprian Barbu wrote:
> On Fri, Oct 3, 2014 at 3:37 PM, Mike Holmes <mike.holmes@linaro.org> wrote:
>> Additionally we need a place to install the various different builds in OE
>>
>> Ciprian and I could not decide between
>> --prefix=/usr/local/odp/<platform>
>
> On a second though I would go with /usr/local/odp/<platform> or other
> optional directory, but keep odp too.
>
>> and
>> --prefix=/usr/local/<platform>
>>
>> Any thoughts.

Do you want to install several implementations into one image?
Mike Holmes Oct. 3, 2014, 12:48 p.m. UTC | #5
To get back on topic - ping for review-by on the patch its self.

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

> On Fri, Oct 3, 2014 at 3:37 PM, Mike Holmes <mike.holmes@linaro.org>
> wrote:
> > Additionally we need a place to install the various different builds in
> OE
> >
> > Ciprian and I could not decide between
> > --prefix=/usr/local/odp/<platform>
>
> On a second though I would go with /usr/local/odp/<platform> or other
> optional directory, but keep odp too.
>
> > and
> > --prefix=/usr/local/<platform>
> >
> > Any thoughts.
> >
> >
> >
> > On 3 October 2014 08:26, Ciprian Barbu <ciprian.barbu@linaro.org> wrote:
> >>
> >> Hi,
> >>
> >> On Wed, Oct 1, 2014 at 7:55 PM, Mike Holmes <mike.holmes@linaro.org>
> >> wrote:
> >> > Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> >> > ---
> >> >  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 | 31
> >> > ++++++++++++++++++++++-----
> >> >  platform/linux-generic/odp_init.c             |  3 ++-
> >> >  test/api_test/odp_common.c                    |  2 +-
> >> >  9 files changed, 35 insertions(+), 13 deletions(-)
> >> >
> >> > diff --git a/example/generator/odp_generator.c
> >> > b/example/generator/odp_generator.c
> >> > index 27fc868..b2b886f 100644
> >> > --- a/example/generator/odp_generator.c
> >> > +++ b/example/generator/odp_generator.c
> >> > @@ -526,7 +526,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)) {
> >>
> >> We need some more feedback on this topic, he already had several
> >> discussion on it but we have to continue.
> >>
> >> I had a discussion with Mike today and I raised the question on
> >> whether the odp examples will diverge because of this. For instance
> >> the linux-dpdk implementation of odp_pktio will need to pass some dpdk
> >> specific params, whereas the linux-generic will just pass NULL, NULL.
> >> One solution to this would be to have an extra source file, something
> >> called like platform_init.c, that would call odp_init_global with the
> >> right parameters. Inside the test application there will be a my_init
> >> function with weak sym linkage, that would point to the function
> >> inside platform_init.c, if present. The default my_int would call
> >> odp_init_global(NULL, NULL).
> >>
> >> Any opinions on this?
> >>
> >> >                 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 a9bba24..2339d34 100644
> >> > --- a/example/ipsec/odp_ipsec.c
> >> > +++ b/example/ipsec/odp_ipsec.c
> >> > @@ -1184,7 +1184,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 6c1d64a..d1df1d0 100644
> >> > --- a/example/l2fwd/odp_l2fwd.c
> >> > +++ b/example/l2fwd/odp_l2fwd.c
> >> > @@ -324,7 +324,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 c80dbbc..ebca4b2 100644
> >> > --- a/example/odp_example/odp_example.c
> >> > +++ b/example/odp_example/odp_example.c
> >> > @@ -952,7 +952,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/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
> >> > index 41315f7..fc4710c 100644
> >> > --- a/example/packet/odp_pktio.c
> >> > +++ b/example/packet/odp_pktio.c
> >> > @@ -312,7 +312,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 6e1715d..9b87921 100644
> >> > --- a/example/timer/odp_timer_test.c
> >> > +++ b/example/timer/odp_timer_test.c
> >> > @@ -257,7 +257,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 490324a..6ae74c9 100644
> >> > --- a/platform/linux-generic/include/api/odp_init.h
> >> > +++ b/platform/linux-generic/include/api/odp_init.h
> >> > @@ -24,17 +24,38 @@ extern "C" {
> >> >
> >> >
> >> >
> >> > +/** ODP initialisation data.
> >> > + * Data that is required to initialize the ODP API with the
> >> > + * implimnetation that is required to initialize 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.
> >> > - *
> >> > + * 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.
> >> > diff --git a/platform/linux-generic/odp_init.c
> >> > b/platform/linux-generic/odp_init.c
> >> > index 5b7e192..ace55cc 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_thread_init_global();
> >> >
> >> > 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
> > Linaro  Sr Technical Manager
> > LNG - ODP
>
Mike Holmes Oct. 3, 2014, 12:54 p.m. UTC | #6
On 3 October 2014 08:47, Taras Kondratiuk <taras.kondratiuk@linaro.org>
wrote:

> On 10/03/2014 03:45 PM, Ciprian Barbu wrote:
>
>> On Fri, Oct 3, 2014 at 3:37 PM, Mike Holmes <mike.holmes@linaro.org>
>> wrote:
>>
>>> Additionally we need a place to install the various different builds in
>>> OE
>>>
>>> Ciprian and I could not decide between
>>> --prefix=/usr/local/odp/<platform>
>>>
>>
>> On a second though I would go with /usr/local/odp/<platform> or other
>> optional directory, but keep odp too.
>>
>>  and
>>> --prefix=/usr/local/<platform>
>>>
>>> Any thoughts.
>>>
>>
> Do you want to install several implementations into one image?
>

We share to OE filesystem across common architectures so I think we will
want linux-generic + platform acceleration in general.

linux-generic, netmap and DPDK build for X86 and AMD
linux-generic and KS2 in ARM v7 build to support Arnadale and KS2
linux-generic and netmap ARM v8 build to support Juno and APM
Ciprian Barbu Oct. 3, 2014, 1:21 p.m. UTC | #7
On Wed, Oct 1, 2014 at 7:55 PM, Mike Holmes <mike.holmes@linaro.org> wrote:
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> ---
>  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 | 31 ++++++++++++++++++++++-----
>  platform/linux-generic/odp_init.c             |  3 ++-
>  test/api_test/odp_common.c                    |  2 +-
>  9 files changed, 35 insertions(+), 13 deletions(-)
>
> diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
> index 27fc868..b2b886f 100644
> --- a/example/generator/odp_generator.c
> +++ b/example/generator/odp_generator.c
> @@ -526,7 +526,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 a9bba24..2339d34 100644
> --- a/example/ipsec/odp_ipsec.c
> +++ b/example/ipsec/odp_ipsec.c
> @@ -1184,7 +1184,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 6c1d64a..d1df1d0 100644
> --- a/example/l2fwd/odp_l2fwd.c
> +++ b/example/l2fwd/odp_l2fwd.c
> @@ -324,7 +324,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 c80dbbc..ebca4b2 100644
> --- a/example/odp_example/odp_example.c
> +++ b/example/odp_example/odp_example.c
> @@ -952,7 +952,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/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
> index 41315f7..fc4710c 100644
> --- a/example/packet/odp_pktio.c
> +++ b/example/packet/odp_pktio.c
> @@ -312,7 +312,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 6e1715d..9b87921 100644
> --- a/example/timer/odp_timer_test.c
> +++ b/example/timer/odp_timer_test.c
> @@ -257,7 +257,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 490324a..6ae74c9 100644
> --- a/platform/linux-generic/include/api/odp_init.h
> +++ b/platform/linux-generic/include/api/odp_init.h
> @@ -24,17 +24,38 @@ extern "C" {
>
>
>
> +/** ODP initialisation data.

s/initialisation/initialization - although both are generally
accepted, the 'z' version is preferred for US English

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

s/implimnetation/implementation
Also please revise this paragraph, I think there are some remnants of
a previously attempted formulation.

> + * 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.
> - *
> + * 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);

This could sit on a single line, 78 characters in total.

/Ciprian

>
>  /**
>   * Perform thread local ODP initalisation.
> diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c
> index 5b7e192..ace55cc 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_thread_init_global();
>
> 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
Maxim Uvarov Oct. 3, 2014, 1:23 p.m. UTC | #8
On 10/03/2014 04:47 PM, Taras Kondratiuk wrote:
> On 10/03/2014 03:45 PM, Ciprian Barbu wrote:
>> On Fri, Oct 3, 2014 at 3:37 PM, Mike Holmes <mike.holmes@linaro.org> 
>> wrote:
>>> Additionally we need a place to install the various different builds 
>>> in OE
>>>
>>> Ciprian and I could not decide between
>>> --prefix=/usr/local/odp/<platform>
>>
>> On a second though I would go with /usr/local/odp/<platform> or other
>> optional directory, but keep odp too.
>>
>>> and
>>> --prefix=/usr/local/<platform>
>>>
>>> Any thoughts.
>
> Do you want to install several implementations into one image?
>


I think if we will than we can have something like that structure:
/usr/lib/odp/linux-generic/lib/libodp.so
/usr/lib/odp/linux-keystone2/lib/libodp.so
/usr/lib/libodp.so -> /usr/lib/odp/linux-generic/lib/libodp.so

So for dynamic lib we can change symlink. Or add LD_LIBRARY_PATH to 
choose which version we want.

Maxim.

> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Ciprian Barbu Oct. 6, 2014, 9:43 a.m. UTC | #9
On Fri, Oct 3, 2014 at 4:23 PM, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> On 10/03/2014 04:47 PM, Taras Kondratiuk wrote:
>>
>> On 10/03/2014 03:45 PM, Ciprian Barbu wrote:
>>>
>>> On Fri, Oct 3, 2014 at 3:37 PM, Mike Holmes <mike.holmes@linaro.org>
>>> wrote:
>>>>
>>>> Additionally we need a place to install the various different builds in
>>>> OE
>>>>
>>>> Ciprian and I could not decide between
>>>> --prefix=/usr/local/odp/<platform>
>>>
>>>
>>> On a second though I would go with /usr/local/odp/<platform> or other
>>> optional directory, but keep odp too.
>>>
>>>> and
>>>> --prefix=/usr/local/<platform>
>>>>
>>>> Any thoughts.
>>
>>
>> Do you want to install several implementations into one image?
>>
>
>
> I think if we will than we can have something like that structure:
> /usr/lib/odp/linux-generic/lib/libodp.so
> /usr/lib/odp/linux-keystone2/lib/libodp.so
> /usr/lib/libodp.so -> /usr/lib/odp/linux-generic/lib/libodp.so
>
> So for dynamic lib we can change symlink. Or add LD_LIBRARY_PATH to choose
> which version we want.

We could, but I'm afraid it complicates things too much for autotools.
When you configure odp to install the files in a different folder than
standard paths, you provide a --prefix=<dir> option, which goes into
that <dir> and creates a sysroot structure:

bin/
include/
lib/
share/

That's why it's easier to have our installation structure something like

/usr/local/odp/<platform>

where the same dir structure as above will be created.

It also makes things easier for external applications that use
autotools, openvswitch comes to my mind first but it's the same with
other apps. You configure the app with something like
--with-odp-path=<odp_install_path> and then configure adds CFLAGS +=
-I<odp_install_path>/include and LDFLAGS += -L<odp_install_path>/lib

/Ciprian
>
> Maxim.
>
>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Ola Liljedahl Oct. 6, 2014, 9:55 a.m. UTC | #10
How would this look like for cross compilation? libodp.so will exist in the
target file system but header files and libraries needed for building will
live in the host file system. There could be multiple cross-targets
installed at the same time. An ODP platform could be used both for native
development and for cross compilation.

-- Ola

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

> On Fri, Oct 3, 2014 at 4:23 PM, Maxim Uvarov <maxim.uvarov@linaro.org>
> wrote:
> > On 10/03/2014 04:47 PM, Taras Kondratiuk wrote:
> >>
> >> On 10/03/2014 03:45 PM, Ciprian Barbu wrote:
> >>>
> >>> On Fri, Oct 3, 2014 at 3:37 PM, Mike Holmes <mike.holmes@linaro.org>
> >>> wrote:
> >>>>
> >>>> Additionally we need a place to install the various different builds
> in
> >>>> OE
> >>>>
> >>>> Ciprian and I could not decide between
> >>>> --prefix=/usr/local/odp/<platform>
> >>>
> >>>
> >>> On a second though I would go with /usr/local/odp/<platform> or other
> >>> optional directory, but keep odp too.
> >>>
> >>>> and
> >>>> --prefix=/usr/local/<platform>
> >>>>
> >>>> Any thoughts.
> >>
> >>
> >> Do you want to install several implementations into one image?
> >>
> >
> >
> > I think if we will than we can have something like that structure:
> > /usr/lib/odp/linux-generic/lib/libodp.so
> > /usr/lib/odp/linux-keystone2/lib/libodp.so
> > /usr/lib/libodp.so -> /usr/lib/odp/linux-generic/lib/libodp.so
> >
> > So for dynamic lib we can change symlink. Or add LD_LIBRARY_PATH to
> choose
> > which version we want.
>
> We could, but I'm afraid it complicates things too much for autotools.
> When you configure odp to install the files in a different folder than
> standard paths, you provide a --prefix=<dir> option, which goes into
> that <dir> and creates a sysroot structure:
>
> bin/
> include/
> lib/
> share/
>
> That's why it's easier to have our installation structure something like
>
> /usr/local/odp/<platform>
>
> where the same dir structure as above will be created.
>
> It also makes things easier for external applications that use
> autotools, openvswitch comes to my mind first but it's the same with
> other apps. You configure the app with something like
> --with-odp-path=<odp_install_path> and then configure adds CFLAGS +=
> -I<odp_install_path>/include and LDFLAGS += -L<odp_install_path>/lib
>
> /Ciprian
> >
> > Maxim.
> >
> >
> >> _______________________________________________
> >> lng-odp mailing list
> >> lng-odp@lists.linaro.org
> >> http://lists.linaro.org/mailman/listinfo/lng-odp
> >
> >
> >
> > _______________________________________________
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > http://lists.linaro.org/mailman/listinfo/lng-odp
>
> _______________________________________________
> 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 27fc868..b2b886f 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -526,7 +526,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 a9bba24..2339d34 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -1184,7 +1184,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 6c1d64a..d1df1d0 100644
--- a/example/l2fwd/odp_l2fwd.c
+++ b/example/l2fwd/odp_l2fwd.c
@@ -324,7 +324,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 c80dbbc..ebca4b2 100644
--- a/example/odp_example/odp_example.c
+++ b/example/odp_example/odp_example.c
@@ -952,7 +952,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/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
index 41315f7..fc4710c 100644
--- a/example/packet/odp_pktio.c
+++ b/example/packet/odp_pktio.c
@@ -312,7 +312,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 6e1715d..9b87921 100644
--- a/example/timer/odp_timer_test.c
+++ b/example/timer/odp_timer_test.c
@@ -257,7 +257,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 490324a..6ae74c9 100644
--- a/platform/linux-generic/include/api/odp_init.h
+++ b/platform/linux-generic/include/api/odp_init.h
@@ -24,17 +24,38 @@  extern "C" {
 
 
 
+/** ODP initialisation data.
+ * Data that is required to initialize the ODP API with the
+ * implimnetation that is required to initialize 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.
- *
+ * 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.
diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c
index 5b7e192..ace55cc 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_thread_init_global();
 
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;
 	}