aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic
AgeCommit message (Collapse)Author
2015-05-11linux-generic: remove extraneous ASSERTsBill Fischofer
No need to check that odp_packet_hdr_t is 64 bit aligned because it's part of odp_packet_hdr_stride which is cache aligned. This assert fails in case of arm 64-32, so just remove it from code. Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-05-08linux-generic/odp_impl: add implementation version detailsMike Holmes
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-05-08api: packet: removed odp_packet_user_u64Petri Savolainen
Simplified the API by removing user_u64 option. User has now room for a pointer (or upto intptr_t sized variable) and a configurable sized user_area. Both can be used at the same time. User has to use the user_area when more space than sizeof(intptr_t) bytes is 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-05-08api: packet: rename user_data to user_areaPetri Savolainen
Term "area" highlights better that the per packet user area is fixed in size and position. E.g. odp_packet_data(), odp_packet_seg_data() return pointers which are (likely) modified during packet processing. 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-05-08linux-generic: support running with restricted cpu setStuart Haslam
odp_cpu_count() returns the number of online CPUs, but when running in a control group access may be restricted to only a subset of these. This combined with a lack of error handling in odph_linux_pthread_create() means a number of the applications create more threads than there are cores available to them, leading to deadlocks in odp_barrier_wait(). Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org> Reviewed-and-tested-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-05-08linux-generic: packet: add user metadata supportBill Fischofer
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-and-tested-by: Ciprian Barbu <ciprian.barbu@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-05-08linux-generic: pool: add user metadata supportBill Fischofer
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-and-tested-by: Ciprian Barbu <ciprian.barbu@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-05-08linux-generic: buffer: restructure user mdatadata fieldsBill Fischofer
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-and-tested-by: Ciprian Barbu <ciprian.barbu@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-05-08api/linux-generic/example/validation: remove odp_pmr_create_range() function ↵Balasubramanian Manoharan
definition This is combined commit of 4 following mailing list patches: linux-generic: classification: remove odp_pmr_create_range() function implementation. This patch removes the implementation of odp_pmr_create_range() function. Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> api: classification: remove odp_pmr_create_range() function definition. The support for a range based packet matching rule is not available in most of the hardwares and hence this API is removed. Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> validation: remove test case for odp_pmr_create_range() function This patch removes the validation suite test case for odp_pmr_create_range() function. Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> example: classifier: remove odp_pmr_create_range() support This patch removes support for odp_pmr_create_range() function in the classifier example application. Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-05-07linux-generic: use inttypes defines to print (u)int32_t valuesNicolas Morey-Chaisemartin
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-04-29linux-generic: packet_io: init l2 and l3 cos table spinlocksNicolas 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>
2015-04-23linux-generic: pool: initialize atomics during odp_pool_init_globalNicolas Morey-Chaisemartin
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-04-22linux-generic: pool: fix initialization of odp_buffer_hdr ref_countNicolas Morey-Chaisemartin
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-04-17linux-generic: pool: fix missing increment of blkallocs statBill Fischofer
Fixes Bug https://bugs.linaro.org/show_bug.cgi?id=1455 Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-04-17linux-generic: odp_linux: migrate helpers to helper dirMike Holmes
The odph helper src files do not belong in linux-generic, move them out to the helper directory. From the helper directory they may be more cleanly extended to support other execution environments beyond Linux. Clean up checkpatch whitespace warning in the migrated code. Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-04-16linux-generic: timer: check for zero timer resolutionOla Liljedahl
Fail to create timer pool with zero timer resolution. https://bugs.linaro.org/show_bug.cgi?id=1451 Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org> Reviewed-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-04-14validation: implement platform envMaxim Uvarov
Different platforms need different steps to set up pktio for testing. That might be veth devices for linux-generic, kernel modules and extended set up for dpdk and simple set pktio testing names for other platforms. This patch implements platform/test/pktio_env file which sets up global envs for pktio. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org> Reviewed-by: Anders Roxell <anders.roxell@linaro.org> Reviewed-and-tested-by: Mike Holmes <Mike.holmes@linaro.org>
2015-04-10linux-generic: use arch optimisations for timeMike Holmes
Switch to using configure time optimizations from compile time 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-04-08linux-generic: system_info: use global data structMike Holmes
Don't store ODP global data in multiple locations, gather global data into odp_global_data. Move the static odp_system_info into odp_global_data. Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-04-03linux-generic: pool: check for NULL params before dereferenceStuart Haslam
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-04-03linux-generic: pktio: fix SEGV after odp_pktio_inq_remdef()Stuart Haslam
Calling odp_pktio_inq_remdef() causes the pktio's inq_default to be set to ODP_QUEUE_INVALID, but when the scheduler later polls the pktio it fails to check the validity of inq_default and ends up passing a bogus pointer to queue_enq_multi(). Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org> Reviewed-by: Ciprian Barbu <ciprian.barbu@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-04-02linux-generic: timer: convert assert to ODP_ASSERTMike Holmes
ODP implementations should not call assert directly. Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-04-02linux-generic: debug_internal: assert prints conditionMike Holmes
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-04-01linux-generic: schedule: terminatePetri Savolainen
Added clean up for pending schedule commands and queue destroys. Added error detection of non empty queues and pre-scheduled events. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Ciprian Barbu <ciprian.barbu@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-04-01linux-generic: scheduler: restructured queue and pktio integrationPetri Savolainen
Scheduler runs by polling scheduler priority queues for schedule commands. There are two types of scheduler commands: queue dequeue and packet input poll. Packet input is polled directly when a poll command is received. From schduler point of view, the default packet input queue is like any other queue. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Ciprian Barbu <ciprian.barbu@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-03-27linux-generic: pktio check for NULL entryMaxim Uvarov
CID: 85427 https://bugs.linaro.org/show_bug.cgi?id=1175 get_pktio_entry() can return NULL entry then it can be derefenced inside is_free(entry). Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
2015-03-27linux-generic: linux: destroy used pthread attrMike Holmes
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-03-27linux-generic: fix incorrect pmr_term_value update in odp_pmr_create_xxx() ↵Balasubramanian Manoharan
function Fix for incorrect pmr_term_value update in odp_pmr_create_match() and odp_pmr_create_range() functions. Fixes https://bugs.linaro.org/show_bug.cgi?id=1381 Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-03-25linux-generic: linux: remove unused include assert.hMike Holmes
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> 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-24linux-generic: packet_socket: remove unused include assert.hMike Holmes
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-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-17linux-generic: queue: fix potential queue leakStuart Haslam
If schedule buffer allocation fails during odp_queue_create(), a scheduled or pktin queue may be incorrectly left in an allocated state. 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-03-12linux-generic: only print errors to stderrStuart Haslam
The default logger prints all log levels to stderr. To make things easier when debugging failures change it to print only errors to stderr and everything else to stdout. Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org> Reviewed-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-03-12linux-generic: odp_timer: set user_ptr for cancelled timeoutOla Liljedahl
Ensure that the timeout user_ptr and timer fields are set when the corresponding timer is immediately cancelled. https://bugs.linaro.org/show_bug.cgi?id=1313 Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-03-10linux-generic: linux: remove explicit buffer cache flushTaras Kondratiuk
_odp_flush_caches() is called from odp_term_local() now. Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-03-10linux-generic: mmap: jumbo frames supportMaxim Uvarov
Support for jumbo frames for linux-generic with unsegmented buffers. Test for pkio is also adjusted to work with 9*1024=9216 bytes packets. https://bugs.linaro.org/show_bug.cgi?id=509 Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-03-10linux-generic: linux: remove unused defineMike Holmes
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@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-03-06linux-generic: weak: move stdarg.h include from odp_debug_internal.hTaras Kondratiuk
stdarg.h is not needed in odp_debug_internal.h, but instead should be included in odp_weak.c. The change is needed to be able to reuse odp_weak.c from other platforms. Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-03-04linux-generic: thread: reuse thread idsPetri Savolainen
Scheduler validation test failed on a 28 thread machine since it creates and terminates many threads during a test run. Linux-generix implementation did not reuse thread IDs but run out of threads. Thread ids are protected with a lock and new alloc/free rutines reuse thread IDs. Fixes https://bugs.linaro.org/show_bug.cgi?id=1294 Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-02-27linux-generic: system: read hugepage size for all architecturesStuart Haslam
The odp_system test is failing for arm and arm64 because the implementation makes no attempt to determine availability of hugepages. https://bugs.linaro.org/show_bug.cgi?id=1289 Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org> Reviewed-by: Maxim Uvarov <maxim.uvarov@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-02-27linux-generic: time: fix c99 clock_gettimeMike Holmes
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-and-tested-by: Maxim Uvarov <maxim.uvarov@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-02-27linux-generic: odp_crypto_operation merge 2 ifsMaxim Uvarov
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-02-27linux-generic: handle copy error in odp_crypto_operationMaxim Uvarov
In that case _odp_packet_copy_to_packet can not return non 0. Because of code is on performance path just cast it to void to fix Coverity warning. https://bugs.linaro.org/show_bug.cgi?id=1054 CID 85004: Unchecked return value (CHECKED_RETURN) Calling "_odp_packet_copy_to_packet" without checking return value (as is done elsewhere 5 out of 6 times). Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-02-27linux-generic: crypto: check 'result' pointerTaras Kondratiuk
Check 'result' pointer before dereferencing it in case of synchronous operation. Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Reviewed-by: Robert King <robking@cisco.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>