aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/odp
AgeCommit message (Collapse)Author
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-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-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: 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: 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-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-11-25api: crypto: move enums from platform types to odp and rename to fit the API ↵Nicolas Morey-Chaisemartin
format 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: time: unbind CPU cycles from time APIIvan Khoronzhuk
Current time API supposes that frequency of counter is equal to CPU frequency. But that's not always true, for instance, in case if no access to CPU cycle counter, another hi-resolution timer can be used, and it`s rate can be different from CPU rate. There is no big difference in which cycles to measure time, the better hi-resolution timer the better measurements. So, unbind CPU cycle counter from time API by eliminating word "cycle" as it's believed to be used with CPU. Also add new opaque type for time odp_time_t, as it asks user to use API and abstracts time from units. New odp_time_t requires several additional API functions to be added: odp_time_t odp_time_sum(odp_time_t t1, odp_time_t t2); int odp_time_cmp(odp_time_t t1, odp_time_t t2); uint64_t odp_time_to_u64(odp_time_t hdl); Also added new definition that represents 0 ticks for time - ODP_TIME_NULL. It can be used instead of odp_time_from_ns(0) for comparison and initialization. This patch changes only used time API, it doesn't change used var names for simplicity. This time API can be implemented with local timer counter, so shouldn't be used between threads. 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> Conflicts: platform/linux-generic/odp_time.c
2015-11-20linux-generic: config: increase ODP_CONFIG_SCHED_GRPS to 256Carl Wallen
Increase the ODP_CONFIG_SCHED_GRPS define from 16 to 256 to support a larger number of scheduling groups by default. Signed-off-by: Carl Wallen <carl.wallen@nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-10-29linux-generic: config: add missing syntax to enable doxygenBill Fischofer
Enable doxygen to document platform-specific config values 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-10-29api: config: replace defines with apisBill Fischofer
Move platform-specific #defines for limits from the public API to the platform directory and add public APIs for each of them. 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-10-29api: cpumask_types.h: doxygen: remove redundant textAnders Roxell
Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-10-29api: cpumask: don't use platform internal definesAnders Roxell
Applications that use an installed ODP will get the following compile error: .../odp_install/include/odp/plat/cpumask_types.h:26:33: fatal error: odp_config_internal.h: No such file or directory #include <odp_config_internal.h> Defines a new public API macro ODP_CPUMASK_SIZE that is the maximum number of CPUs that can be accessed in this system. Fixes bug: https://bugs.linaro.org/show_bug.cgi?id=1864 Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-10-27api: doc: remove broken doxygen referencePetri Savolainen
Reference caused warning when creating doxygen documentation. 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-10-22api: schedule: revise definition of ordered locksBill Fischofer
Revise the definition of odp_schedule_order_lock() and odp_schedule_order_unlock(). These APIs now take as an argument the index value of the ordered lock within the current context to be locked or unlocked. Because the API is changed, this patch also updates the linux-generic implementation of these APIs as well as the scheduler validation test that uses them. 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-10-22api: config: removed ODP_CONFIG_MAX_THREADSPetri Savolainen
New thread API call odp_thread_count_max() replaces the preprocessor macro in the API. A macro is still used internally. 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-09-16linux-generic: odp_schedule: fix odp_schdule_wait_timeIvan Khoronzhuk
Depending on resolution, a low nsec value could be converted to 0 cycles, wich was specified as ODP_SCHED_WAIT and would instruct a schedule call to wait forever. Also ODP_SCHED_NO_WAIT corresponds to 1 tick, it's rarely but can wait a little, when shced time has slower rate. It should correspond to schedule only once. So, change ODP_SCHED_NO_WAIT to 0 and ODP_SCHED_NO_WAIT to UINT64_MAX. 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-01linux-generic: schedule: implement scheduler groupsBill 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-09-01linux-generic: schedule: rename ordered lock typedefBill 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-08api: sched: added ordered context lockPetri Savolainen
Lock protects a critical section in ordered context processing. Threads enter the section in order. Added dummy typedef for not breaking the build. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-08api: sched: added schedule group create and destroyPetri Savolainen
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-08api: sched: added worker groupPetri Savolainen
The predefined group includes all worker threads and is automanically updated. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-08api: sched: moved scheduler types into new filePetri Savolainen
New file is used to avoid include loop between queue and scheduler api. Both include the new file. Signed-off-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-08api: sched: removed SYNC_DEFAULTPetri Savolainen
User should pick a synchronisation method and use SYNC_NONE if does not need synchronization. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-07linux-generic: pool: add odp_pool_type_t enumBill 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-07api: event: change to odp_event_type_tBill 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-06-25api: doc: doxygen grouping clean upPetri Savolainen
Cleaned Doxygen documentation grouping. Corrected wrong groupings and created new groups when needed. 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-06-16api: thrmask: added thread maskPetri Savolainen
Thread IDs and masks are used to control thread access to various resources. Linux generic implementation reuse cpumask implementation. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-03-25linux-generic: strongtypes: use named structs for C++Ola Liljedahl
Typedefs to anonymous structs creates problems for C++ programs: GCC: warning: ‘odp_crypto_op_params’ has a field ‘odp_crypto_op_params::pkt’ whose type uses the anonymous namespace error: anonymous type with no linkage used to declare function ‘<anonymous struct>* ppp_packet::get_queue() const’ with linkage CLANG: extern odp_pool_t tmo_pool; warning: variable 'tmo_pool' has internal linkage but is not defined When linking: undefined reference to `tmo_pool' The solution is to add a (unique) name to all structs used by the strong typing typedefs. Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-03-24barrier: allow platform to override odp_barrier_tJerin Jacob
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Bala Manoharan<bala.manoharan@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-03-24ticketlock: allow platform to override odp_ticketlock_tJerin Jacob
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Bala Manoharan<bala.manoharan@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-03-24rwlock: allow platform to override odp_rwlock_tJerin Jacob
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Bala Manoharan<bala.manoharan@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-03-24spinlock: allow platform to override odp_spinlock_tJerin Jacob
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Bala Manoharan<bala.manoharan@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-03-17linux-generic: strongtypes: add dummy struct var to keep c++ happyBill Fischofer
C++ doesn't like null structs so add a dummy variable to make it happy. Note that we only use these types as pseudo-pointers for strong typing so the contents of what they apparently point to is irrelevant since we never reference it. https://bugs.linaro.org/show_bug.cgi?id=1267 Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-and-tested-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-03-10api: pool: move platform includes to linux-genericTaras Kondratiuk
Do not include platform-specific header files from common API headers. Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Reviewed-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-02-27api: crypto: add error code for invalid IVTaras Kondratiuk
Add an error code for a case when a session is created without specifying an IV value, and then crypto operation is invoked without a valid override_iv_ptr. Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Reviewed-by: Robbie King <robking@cisco.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-02-26linux-generic: timer_types.h: correct doxygen groupingAnders Roxell
Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Reviewed-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-02-25api: errno: add api to public apiMike Holmes
The errno API was not exposed in the public interface. Make errno API visible as part of the ODP API. Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-02-18linux-generic: move api version to c fileMaxim Uvarov
odp_version_api_str() in odp api defined as non static function and there should be implementation in c file. Include required headers so that str macro unrolls to correct version string. https://bugs.linaro.org/show_bug.cgi?id=1194 Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
2015-02-11api: cpu: Added cpu.hPetri Savolainen
This file contains cpu related API calls. The calls are renames from odp_thread_cpu() and odp_sys_cpu_count(). Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-02-11linux-generic: strong_types: simplify castingTaras Kondratiuk
Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-02-08api: pool: move buffer allocation to buffer.hTaras Kondratiuk
Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-02-05linux-generic: shm: remove wrong include filesTaras Kondratiuk
Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>