aboutsummaryrefslogtreecommitdiff
path: root/example
AgeCommit message (Collapse)Author
2015-10-09example:ipsec: Using environment varibale for pktio mode.Nikhil Agarwal
Pktio input mode of operation should be derived from environment variable input instead of compile time flag. Signed-off-by: Nikhil Agarwal <nikhil.agarwal@freescale.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-10-08linux-generic: pktio: add netmap pktio supportMatias Elo
Added new netmap pktio interface type which operates in the same manner as the existing socket io interfaces. The code is based on the odp-netmap branch. Using netmap io requires netmap headers and loaded netmap kernel module. Netmap can be installed from https://github.com/luigirizzo/netmap. ODP netmap support is enabled using --with-netmap-path=<netmap_dir> configuration option. If netmap kernel module is loaded when starting ODP application netmap io will be used by default. If the module is not found standard socket io is used. Netmap io can be disabled with ODP_PKTIO_DISABLE_NETMAP environment variable. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-and-tested by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-10-05example:generator : Fix UDP checksum computationGrigore Ion
The UDP checksum is computed in the CPU endianness. The returned result must be converted to the BE ordering when it is used to update the UDP checksum in a packet. Signed-off-by: Grigore Ion <ion.grigore@freescale.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-10-05example:packet: Add pktio start in burst Mode.Nikhil Agarwal
default state of pktio interface after odp_pktio_open is disabled. Need to enable the interface befaore using it. Seems like it has been missed for burst mode. Signed-off-by: Nikhil Agarwal <nikhil.agarwal@freescale.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-09-22example: ipsec: avoid mixing of scheduler wait time and time API timeIvan Khoronzhuk
It's not correct to mix time API time and scheduler wait time, used timers can have different rates. As in this example scheduler is used only for polling till event, using wait time for scheduling can be avoided at all. This patch replaces callback function on function w/o wait time, and doesn't add any functional changes. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-09-22example: timer: print timer ticks/ns table instead of cycles/nsIvan Khoronzhuk
The timer API can have nothing common with CPU cycles or time API. Thus timer test shouldn't print conversion cycles/ns table. More correct to print conversion table for timer ticks/ns. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-08-27linux-generic: default state for pktio is STOPMaxim Uvarov
After open pktio remains stopped. Inside worker thread (after all configuration done it should be started.) In that patch I just start it everywhere to keep original logic and be easy for review. Putting it inside worker threads will require thread arguments change and understanding logic of current app. It's better to do further changes in separate patches per app. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-08-27Merge branch 'master' into api-nextMaxim Uvarov
2015-08-27example:generator:move verbose from worker to controlBalakrishna.Garapati
Signed-off-by: Balakrishna.Garapati <balakrishna.garapati@linaro.org> Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-08-19example:generator:option to supply core maskBalakrishna.Garapati
Signed-off-by: Balakrishna.Garapati <balakrishna.garapati@linaro.org> Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-08-18Merge branch 'master' into api-nextMaxim Uvarov
2015-08-18linux-generic: pktio: remove basic socket implementationNicolas Morey-Chaisemartin
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-and-Tested-by: Stuart Haslam <stuart.haslam@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-08-11Merge branch 'master' into api-nextMaxim Uvarov
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: example/timer/odp_timer_test.c
2015-08-06example: classifier: resolve text alignment issuesStuart Haslam
When the string containing the number of packets processed by one of the queues gets for be longer than a tab the alignment is messed up and the fields overlap with part of a previous value. Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org> Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-08-04example: timer: use ability to indicate that event was lostIvan Khoronzhuk
In case if for some reason one of the TMOs was lost, the test will be polling forever in order to take it and delete. It can be used to indicate that event was lost. Just abort the test if it cannot receive one of the "last" TMOs for some period. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-08-04example: timer: delete races while terminationIvan Khoronzhuk
Current implementation has at least two races that lead to several issues: - gbls->remain can overflow. One thread can decrement remain counter to 0. While another can decrement it once again and it will be > 0. After what some thread will loop very long time ... - Several threads can terminate the same timer and as result the same event. After out from the main loop a thread terminates a last timer it used. But a last timer saved in ttp for a thread can be received in another thread. So after leaving the main loop two threads can hold the same timer. - Some timer cannot be freed as several threads try to delete the same timer, as result one of the timer/tmo stay not freed after termination. - The test can send more events that requested. The receiving of requested number of tmos doesn't mean the test sent the same number. It rather sent more. This patch is intended to fix above drawbacks. The termination path must follow the next things: - An event can be in the following places: in a timer (waiting to be scheduled), in a queue for a thread to be scheduled, received in the main loop. - An event "holds" a timer, so when we receive an event we can delete it's timer. - a thread cannot delete timer w/o an event as it doesn't know who is owner of the event (and obvious the timer). - a thread shouldn't send events more than requested. - all threads have to be "held" in the loop till a last received event. The scheduler can assign event for any of the threads, so one thread can receive two last events for example. According to above, added several improvements: - don't send more timeouts that supposed to receive - free timer and tmo for a last received tmos = num of threads. - leave the main loop only if a last tmo/timer is free. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-31example: classifier: fix buffer size warningBalasubramanian Manoharan
Fixes: https://bugs.linaro.org/show_bug.cgi?id=1722 Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-30example:generator:printing verbose outputBalakrishna.Garapati
Signed-off-by: Balakrishna.Garapati <balakrishna.garapati@linaro.org> Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-27Merge branch 'master' into api-nextMaxim Uvarov
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: helper/test/odp_chksum.c include/odp/api/init.h platform/linux-generic/include/odp/plat/thrmask_types.h test/validation/cpumask/cpumask.h
2015-07-27example: ipsec: fix copy/paste error in READMEStuart Haslam
Instructions should include adding static ARP entry as per the instructions for the other end of the tunnel on line #138. Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-24example: classifier: fix string overflowBala Manoharan
Fixes: https://bugs.linaro.org/show_bug.cgi?id=1512 Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-24example:ipsec: Fix for Polled queuesNikhil Agarwal
This patch updates IPSEC application to create proper Pktin queues in poll mode of operation. PKTIN queue is created as polled queues if no scheduling parameters is passed to queue create API. Signed-off-by: Nikhil Agarwal <nikhil.agarwal@freescale.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-23api: helper: deleted odph_linux_cpumask_defaultPetri Savolainen
The linux specific helper was replaced by default cpumask calls (odp_cpumask_def_worker()) in the cpumask API. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Christophe Milard <christophe.milard@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: helper/linux.c
2015-07-23api: init: added thread type to local initPetri Savolainen
User needs to select the thread type (worker or control) of the initialized thread. Implementation may reserve HW direct access only to worker threads, while control threads share HW access, etc. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: helper/linux.c
2015-07-22configure: use stricter warningsMike Holmes
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-21api: pool: remove shm paramter from odp_pool_create()Bill Fischofer
This patch removes the 2nd parameter to odp_pool_create() because it has two major issues: 1. Applications have no way to know how big a shm area is required for a given pool since that information is implementation specific. So there's no portable means of using this parameter. 2. Some implementations (e.g., odp-dpdk) cannot accept an external memory area for pool creation since they need to control the memory themselves. Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: test/validation/pktio/pktio.c test/validation/pool/pool.c helper/test/odp_chksum.c
2015-07-20Merge branch 'master' into api-nextMaxim Uvarov
2015-07-17example: ipsec: Fix context state race condition inNikhil Agarwal
If the packet sumbitted for cyprto operation returns back to other thread before pre crypto thread has completed processing, ctx will has old state hence packet will be re-submitted for crypto operation. To fix this issue, update the ctx state before packet submission. Signed-off-by: Nikhil Agarwal <nikhil.agarwal@freescale.com> Reviewed-by: Steve Kordus <skordus@cisco.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-17test: do not use negative array indexMaxim Uvarov
odp_pktio_send() can return -1 error and that return code can be used as array index in code bellow. On error just increase drop counter and free packets. https://bugs.linaro.org/show_bug.cgi?id=1688 Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofe@linaro.org>
2015-07-16Merge branch 'master' into api-nextMaxim Uvarov
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: include/odp/api/packet_io.h platform/linux-generic/include/odp_packet_io_internal.h platform/linux-generic/odp_packet_io.c
2015-07-16queue: handle return value of odp_queue_enq()Zoltan Kiss
Unsent packet has to be released. If the event type is obvious from the context, use directly the relevant release functions, otherwise odp_event(free). Wider error handling is attempted, but this patch can't fix all the flaws in the many calling functions of odp_queue_enq() Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-16odp_timer_test: remove redundant free functionZoltan Kiss
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-15examples: ipsec: fix inner IP checksum computationAlexandru Badicioiu
Signed-off-by: Alexandru Badicioiu <alexandru.badicioiu@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-15example: use odp_queue_param_init routineBill Fischofer
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-14example:generator:print correct appl_modeBalakrishna.Garapati
Signed-off-by: Balakrishna.Garapati <balakrishna.garapati@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-13Merge branch 'master' into api-nextMaxim Uvarov
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: platform/linux-generic/Makefile.am
2015-07-09helper: convert to a libraryMike Holmes
Remove the need to build helper source files into the linux-generic library by converting helpers to be their own library. This removes the need for all other platforms to also build in the helpers which are optional just to run the tests. Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Christophe Milard <christophe.milard@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-08packet_io: release unsent packets after odp_pktio_send()Zoltan Kiss
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-08api: sched: removed GROUP_DEFAULTPetri Savolainen
User should care which group of thread will process events from a queue. Removed default group and use all threads group instead. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-07example: use odp_pool_param_init routineBill Fischofer
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-06queue: handle return value of odp_queue_enq()Zoltan Kiss
Unsent packet has to be released. If the event type is obvious from the context, use directly the relevant release functions, otherwise odp_event(free). Wider error handling is attempted, but this patch can't fix all the flaws in the many calling functions of odp_queue_enq() Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-06event: replace complicated buffer releases with odp_event_free()Zoltan Kiss
Instead of converting types let odp_event_free() to do the right thing. Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-06odp_timer_test: remove redundant free functionZoltan Kiss
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-06packet_io: release unsent packets after odp_pktio_send()Zoltan Kiss
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-03Merge branch 'master' into api-nextMaxim Uvarov
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: helper/linux.c test/validation/pool/pool.c
2015-06-29configurable binaries extensionNicolas Morey-Chaisemartin
Add $(EXEEXT) to all binary generated so platform can easily configure the binaries extension and use the LOG_COMPILER features of automake. This should have no visible effect unless EXEEXT is set by the configure Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Acked-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-06-16Merge branch 'master' into api-nextMaxim Uvarov
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: test/validation/pktio/pktio.c
2015-06-16helpers: fix udp checksum computationAlexandru Badicioiu
Signed-off-by: Alexandru Badicioiu <alexandru.badicioiu@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-06-12example: use SCNx32/PRIx32 macroNicolas Morey-Chaisemartin
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-06-12example: classifier: check sscanf return codeNicolas Morey-Chaisemartin
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>