On 09/01/2014 11:26 AM, Wiles, Roger Keith wrote:

On Sep 1, 2014, at 3:07 AM, Savolainen, Petri (NSN - FI/Espoo) 
<[email protected]> wrote:

diff --git a/platform/linux-generic/odp_init.c b/platform/linux-
generic/odp_init.c
index 5b7e192..f595def 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -8,13 +8,18 @@
   #include <odp_internal.h>
   #include <odp_debug.h>

-
-int odp_init_global(void)
+int odp_init_global(odp_global_init_t *params  ODP_UNUSED,
+                 odp_global_platform_init_t *platform_params ODP_UNUSED)
   {
        odp_thread_init_global();

        odp_system_info_init();

+     if (odp_init_platform(platform_params)) {
platform_params is used here, so remove ODP_UNUSED from argument list.

On the other hand, it would be better to remove odp_init_platform()
altogether since does not do anything. It's better to add it when actually used.
The order of init calls is very important, e.g. now you could not allocate 
shared
memory in odp_init_platform() because it's executed before shm init...
  odp_init_platform() does do something for DPDK / KS2 and we need a place 
holder because
we want this to be shared between implementations don't we ?
This is the stuff that must happen before any ODP init starts to satisfy the 
platform SDK

Internals of odp_init_global() is totally platform independent - it cannot be 
shared in general. It's HW/OS/ODP implementation dependent what needs to be 
initialized in global init, and in which order (e.g. HW spinlocks before shm, 
shm before barriers, etc.).

All of the platform dependent inits should be in the odp_init_platform() and 
the calls from odp_init() should be generic for all Linux platforms. The 
odp_init_platform() should be close to the bottom of the odp_init() routine as 
no routine called before the platform init should require any thing from the 
platform.

Assumption that all init functions don't need platform to be
initialized is not true for a current code. Sure it can be changed in a
way you assume, but what's the profit to do so? Why to constrain
implementation?

If someone can point out why odp_init() is not generic with specific examples 
that would help as I do not see any of the above examples as being platform 
specific. Why would sum, spin locks and barriers (which are linux features) 
need to be in the platform.

So, if odp_init_platform() is empty for linux-generic, it's better to leave it 
out. Also it may not be even one call, the platform_params maybe passed all 
over the init calls.

We need the place holder for the function even if it is empty, besides it does 
not hurt anything to have the function. It maybe we need to add something to 
the linux-generic at some point.


-Petri


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Keith Wiles, Principal Technologist with CTO office, Wind River mobile 
972-213-5533


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp



_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to