Message ID | 20160421160722.GA44244@erachmi-ericsson.ki.sw.ericsson.se |
---|---|
State | New |
Headers | show |
On 04/21 18:07:23, Christophe Milard wrote: > Since v1: > -variable declaration gathered in function 's head (Petri) > -linux prefix removed from helper's types and function names (Mike, Christophe) > > Hi, > > This patch series adds the ability to run tests/ exemples / perf-test > in "process mode" (i.e letting OPD threads being linux processes) > It it hence tackling ODP-171. > > This is achieved in 2 main steps: > > A] > The 2 pairs of helper functions: > odph_linux_pthread_create(), odph_linux_pthread_join() > and > odph_linux_process_fork_n(), odph_linux_process_wait_n() > are replaced by: > odph_linux_odpthreads_create() and odph_linux_odpthreads_join() > The latter's callers are unaware of the actual implementation of the ODP > thread (making test truly platform agnostic). > The helper functions decide at run time whether an odp thread is to be > a linux process or pthread based on the command line argument. This patch series helps simplify the use of mature APIs. The benefit of this is that ODP becomes easier to port, and the ODP API can be simplified too. This is a good thing. > B] each test/example now calls a new helper function, > odph_linux_parse_options(), so that the helper can get its own arguments > out of the command line. > Currentely supported args are: --odph_proc, --odph_thread. > Defaults assumes thread. specifying both options runs in mixed mode. And, it seems that existing test code can still be leveraged! I think shortopts1 can be copied via strcat() as well since you explicitly added the null terminator before appending the two shortopts. That function is also ripe for a body of surrounding test cases. > The changed are first done on the shmem tests, and thereafter propagated > to other helper users. > Note that this patch series enable the option but does not affect > make check at this time: make check still calls the tests with no options > which default to thread mode. > > This patch series nicely splits it two groups (you can split your review > there): > 1) up to "validation: pktio: adding command line argument parsing", the new > helper functions are introduced, and used in the validation tests. > 2) from "helper: adding a function to merge getopt parameters" the ability > to parse command line arguments in subset in added and applied to > the example and performance tests. > > Hope this makes sence for you too! > > ---- > > > The following changes since commit 69d0a401c92807852b503418612812242ba9f8f2: > > configure: default ODP_DEBUG to false (2016-04-20 23:00:59 +0300) > > are available in the git repository at: > > https://git.linaro.org/people/christophe.milard/odp.git test_in_process_mode_v2 > > for you to fetch changes up to 53a81edc1c77dc7aac08d97cd28e8cc5f7d9d842: > > helper: removing dead code (2016-04-21 17:26:26 +0200) Just a heads-up, there were conflicts when merging into origin/master. Reviewed-by: Brian Brooks <brian.brooks@linaro.org>