aboutsummaryrefslogtreecommitdiff
path: root/platform
AgeCommit message (Collapse)Author
2015-12-31Merge branch 'next'v1.6.0.0Maxim Uvarov
2015-12-30linux-generic: validation: pktio: disable netmapStuart Haslam
Explicitly disable the netmap pktio type when attempting to test the socket based types. Without this on systems with netmap support enabled (the modules loaded) the socket interfaces may not be tested. Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-29api: sync: removed odp_sync_storesPetri Savolainen
Removed odp_sync_stores() implementation and replaced usage with odp_mb_full(), to minimize functional changes. Added minimal validation test function for the new memory barriers. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-29api: barrier: added memory barriersPetri Savolainen
Added new memory barriers. These follow C11 release / acquire specification and replaces odp_sync_stores(). Used GCC __atomic_thread_fence to implement all three barriers. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-29linux-generic: time: remove posix bleed through on odp_time_tBill Fischofer
The linux-generic implementation of odp_time_t makes use of POSIX APIs that are sensitive to the _POSIX_C_SOURCE level. Use an indirection mechanism so that these dependencies do not "bleed through" the ODP API. This means that ODP applications can be independent of _POSIX_C_SOURCE level. Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: platform/linux-generic/odp_time.c
2015-12-29validation: std_clib: added validation testsPetri Savolainen
Added validation tests for ODP std C library API. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-and-Tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-29api: clib: added standard c library apiPetri Savolainen
Some C library calls are often used in data plane code. This API enables possibility to HW optimized implementation of those. Added first memcpy and memset. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: platform/linux-generic/Makefile.am
2015-12-29api: hash: Added crc32 and crc32c hash functionsPeng
Signed-off-by: Peng <hepeng@ict.ac.cn> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: platform/linux-generic/Makefile.am test/validation/hash/hash.c test/validation/hash/hash.h
2015-12-29api/linux-generic: classification: rename odp_drop_e to odp_cls_drop_tBalasubramanian Manoharan
Changes drop policy enum name from odp_drop_e to odp_cls_drop_t Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-29api/validation/linux-generic: classification: implement class of service ↵Balasubramanian Manoharan
create api Implements odp_cls_cos_create() and odp_cls_cos_param_init() functions and replace odp_cos_create() function with odp_cls_cos_create() in validation and examples. Class of service create function now takes pool, queue, drop policy and name as input parameters. Adds class of service parameter structure odp_cls_cos_param_t and initialization function odp_cls_cos_param_init() Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-29api: time: add global time APIIvan Khoronzhuk
This patch adds global time API and implements it in linux-generic. 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-12-29api: time: add resolution and wait API callsIvan Khoronzhuk
This patch adds odp_time_local_res() and odp_time_wait_until(), odp_time_wait_ns() APIs. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Tested-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: platform/linux-generic/odp_time.c
2015-12-29linux-generic: align with new wall time APIIvan Khoronzhuk
The local time API supposes the time source is wall time. So correct linux-generic implementation. Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: platform/linux-generic/include/odp_internal.h
2015-12-29linux-generic: odp_time: don't use cpu cycle API to get timeIvan Khoronzhuk
The linux-generic time API implementation shouldn't depend on cpu cycle API wich is not stable enough to measure time period due to dynamic frequency scaling. Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: platform/linux-generic/Makefile.am platform/linux-generic/odp_time.c
2015-12-29linux-generic: schedule: use schedule time in nsIvan Khoronzhuk
In the schedule_loop the wait time is passed in units of scheduler time. At this moment there is no difference between wait time and odp_time, but in case if odp_time is smth different from uint64_t, it cannot be directly passed as uint64_t. So better to pass scheduler time as ns and convert them before entering a loop. Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-29fix: classification: add null check for pool assigned to CoSBalasubramanian Manoharan
Fixes a crash caused by pool not assigned to CoS. Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-and-Tested-by: Maxim Uvarov <maxim.uvarov@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-29linux-generic: classification: define pkt_addr as constMatias Elo
Fixes netmap "cast discards '__attribute__((const))'" build error. Define pkt_addr as const as classifier operations should be read-only to packet data. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-29linux-generic: packet: _odp_parse_common: arm build fixBalasubramanian Manoharan
Fixes arm build failure due to wrong typecast of 'const' variable Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-by: Maxim Uvarov <maxim.uvarov@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-29linux-generic: classification: implements odp_cls_cos_pool_set() apiBalasubramanian Manoharan
Adds support for configuring packet pool to a class-of-service. linux-generic packet parser is enhanced to parse a packet directly from a memory location rather than from odp_packet_t. packet receive code is modified to run packet classifier directly from the stream so that the packet can be allocated from the pool specified by the CoS. Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-29linux-generic: thread: removed internal max threads definePetri Savolainen
Replaced internal define with ODP_THREAD_COUNT_MAX. This fixes also the current make install issue. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-29api: doc: re-organize doxygen doc for synchronizerPetri Savolainen
Removed module synchronizer from doxygen documentation and introduced new modules for locks, atomics and barriers. Removed unnecessary group tagging from internal headers, which are not visible to doxygen anyway. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-29api: rwlock_recursive: added recursive rwlockPetri Savolainen
Added recursive read-write lock. It allows threads to read lock or write lock the rwlock multiple times without deadlocking. Mixing of read and write lock operations is not supported. ODP version of recursive rwlock enables porting legacy applications, which use these kind of locks. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: platform/linux-generic/Makefile.am
2015-12-29api: spinlock_recursive: added recursive spinlockPetri Savolainen
Applications can use recursive spinlocks to avoid deadlock from single thread acquiring the same lock multiple times. Recursive locks are used in legacy applications. ODP version of recursive spinlock enable porting of those applications. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: platform/linux-generic/Makefile.am
2015-12-29api: crypto: Add AES128-GCM supportNicolas Morey-Chaisemartin
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-29api: thread: added THREAD_COUNT_MAX definePetri Savolainen
Added maximum thread count define to enable static memory allocation. The API call returns dynamic maximum. Static and dynamic may be different application is build for binary compatibility. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-24linux-generic: init: return -1 when system_info is failedIvan Khoronzhuk
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-22api: pktio: add odp_pktio_print() APIMatias Elo
Add API function for printing implementation specific pktio debug information. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: platform/linux-generic/odp_packet_io.c
2015-12-22linux-generic: validation: pktio: report test as skipped when setup failsStuart Haslam
If setting up the veth interfaces used for validation testing of socket based pktios fails (e.g. CONFIG_VETH missing from the kernel), report the test as skipped. Previously the test would be run anyway, resulting in a lot of errors which aren't particularly easy to interpret. Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org> Reviewed-by: Christophe Milard <christophe.milard@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-17linux-generic: include netmap headers with -isystemStuart Haslam
The netmap header file has some dubious casts that generate errors when -Wcast-qual is enabled. Include it as a system header so that the compiler ignores those errors without having to ignore errors in our own source files. Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-17linux-generic: timer: include event_types instead of buffer_typesIvan Khoronzhuk
Timer API requires event types instead of buffer types. This patch corrects it. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Reviewed-by: Ola Liljedahl <ola.liljedahl@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-14linux-generic: fix tap compilationMaxim Uvarov
pktio/tap.c:267:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] } else if (retval != pkt_len) { Cc: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Ilya Maximets <i.maximets@samsung.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
2015-12-14linux-generic: pktio: add test for tap pktioIlya Maximets
Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Reviewed-and-tested-by: Stuart Haslam <stuart.haslam@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-14linux-generic: pktio: add tap pktio typeIlya Maximets
Creates a new pktio type that allows for creating and sending/receiving packets through TAP interface. It is intended for use as a simple conventional communication method between applications that use kernel network stack (ping, ssh, iperf, etc.) and ODP applications for the purpose of functional testing and can be used as it is with some of the existing example applications. To use this interface the name passed to odp_pktio_open() must begin with "tap:" and be in the format: tap:iface iface the name of TAP device to be created. TUN/TAP kernel module should be loaded to use this pktio. There should be no device named 'iface' in the system. The total length of the 'iface' is limited by IF_NAMESIZE. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Reviewed-and-tested-by: Stuart Haslam <stuart.haslam@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-11linux-generic: schedule: set sched_local.pool correctlyBill Fischofer
This corrects bug https://bugs.linaro.org/show_bug.cgi?id=1921 Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-09linux-generic: validation: run config testsStuart Haslam
Add the new config tests to the TESTS list so that they get run via "make check". Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org> Reviewed-and-Tested-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-08linux-generic: socket: set up __odp_errno on ioctl failuresIlya Maximets
Also debug output enhanced. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-08linux-generic: pktio: configuration functions check that interface is stoppedNicolas Morey-Chaisemartin
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-08linux-generic: pktio: check for pktio_start when started and pktio_stop when ↵Nicolas Morey-Chaisemartin
stopped Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-08linux-generic: pktio: check interface mode is compatible before receiving or ↵Nicolas Morey-Chaisemartin
sending Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-08queue: fix memory corruption in reorder_enq()Zoltan Kiss
reorder_prev is set to the address of the pointer origin_qe->s.reorder_head, which is wrong. If the linked list was empty, that won't be corrected, and reorder_prev->next points to the adjacent queue entry's status field. If that entry is used, that queue's metadata will be corrupted. This was found by running the chaos scheduler test with ODP-DPDK. Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-30Merge branch 'next'Maxim Uvarov
2015-11-30linux-generic: odp_timer: warn if tick is lateIvan Khoronzhuk
If tick is late then application should be warned about this. It means that actual timer resolution is worse than expected. The default timer resolution is set 10ms, that is equal to jiffy on most systems. The default resolution is set bearing in mind that on a CPU runs maximum two threads that ideally fits in 10ms. But user can change it to be smaller, in case if CPU0 is isolated and it handles only the timer ticks. This patch helps user to set correct timer resolution. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Reviewed-by: Ola Liljedahl <ola.liljedahl@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-30linux-generic: cpumask: warn that CPU0 is used by control and worker threadIvan Khoronzhuk
By default, all control threads execute on CPU 0 and odp_cpumask_default_control() returns this CPU. For reasons of performance, control and worker CPU's shouldn't overlap but for some scenarios it can be desirable to utilize all CPU's for worker threads. Thus we leave the decision of CPU allocation to the user but report when a CPU is used for both control and worker threads. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Reviewed-by: Ola Liljedahl <ola.liljedahl@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-27Merge branch 'master' into nextMaxim Uvarov
2015-11-25linux-generic: validation: add run-test script for post install testingStuart Haslam
Add a run-test script that replicates some of the "make check" functionality without depending on a whole load of Makefile gubbins. This makes it easier to perform on-target testing following a cross-build (as we want to do in CI) and gives a simple way to verify that all the required components do actually get installed correctly, using "make installcheck". ./configure --enable-test-vald --with-testdir DESTDIR=$(pwd)/test-install make install installcheck Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org> Reviewed-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-25validation: ability to specify test install directoryStuart Haslam
Previously if a build had been configured with validation tests enabled (--enable-test-vald) a subsequent "make install" would install the test binaries and scripts into /usr/local/bin without any way of separating them from the rest of the installed artefacts. This patch changes the default behaviour to not install test binaries or scripts and adds a configure parameter (--with-testdir) to explicitly enable installation. These changes are required in order to be able to package the tests separately (e.g. in OpenEmbedded) and also to enable post-install testing. Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org> Reviewed-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-25linux-generic: packet: add implementation for packet alloc/free multiNicolas Morey-Chaisemartin
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-25linux-generic: pool: add implementation for buffer alloc/free multiNicolas Morey-Chaisemartin
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-25linux-generic: pool: add buffer_alloc_multi functionNicolas Morey-Chaisemartin
For the moment just a simple wrapper around buffer_alloc to be used by odp_buffer_alloc_multi and odp_packet_alloc_multi Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-25api: crypto: add AES128-CBC encrypt/decrypt methodsNicolas Morey-Chaisemartin
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>