aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic
AgeCommit message (Collapse)Author
2017-06-22linux-gen: socket: remove limits for maximum RX/TX burst sizeMatias Elo
backport of: 373f97f8 Remove unnecessary limits for maximum RX/TX burst size. Fixes: https://bugs.linaro.org/show_bug.cgi?id=3039 Signed-off-by: Matias Elo <matias.elo@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-08-01api: traffic_mngr: Add pktio interface to odp_tm_egress_t structBalasubramanian Manoharan
Replaces pktio interface as input to TM system instead of odp_pktout_queue_t.This creates an 1 to 1 mapping between a TM system and pktio interface. 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>
2016-08-01linux-generic: internal cache line sizeBrian Brooks
Define the ODP API for cache line size to the cache line size defined in the internal architecture directories. Prefix internal cache line size identifier with '_odp'. Signed-off-by: Brian Brooks <brian.brooks@linaro.org> Reviewed-by: Christophe Milard <christophe.milard@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-07-19linux-gen: scope ipc shared memory for packet pools onlyMaxim Uvarov
Instead of placing all allocation to shared memory, place only packets pool. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Mike Holmes <mike.holmes@linaro.org>
2016-07-15example: remove reference from linux-generic internal envsMaxim Uvarov
Make print for example more platform independent and move prints about pktio states in platform initialization code. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
2016-07-14linux-generic: pktio: remove doxygen for unused socket_id parameterBill Fischofer
The ODP version of the _ring_create() routine does not use a socket_id parameter, so remove the doxygen that refers to it to resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2413 Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-07-14linux-generic: tm: Add pthread_join call when destroyingBarry Spinney
Resolved a valgrind issue by adding pthread_join and pthread_attr_destroy calls when destroying a tm_system. Also resolve a todo by removing some code that was being #if'd out. Signed-off-by: Barry Spinney <spinney@mellanox.com> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-07-14linux-generic: tm: resolve todo in odp_name_table.cBarry Spinney
Resolved todo by just removing the comment. Signed-off-by: Barry Spinney <spinney@mellanox.com> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-07-05linux-gen: remove all dependencies to helperYi He
Remove all dependencies to helper by copying protocol header definitions into linux-generic, checked and decoupled all odph_* ODPH_* references. Signed-off-by: Yi He <yi.he@linaro.org> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-07-05linux-gen: std_types: remove extra c headersPetri Savolainen
Removed C header includes which are not needed for API definitions. ODP API depends on uint64_t, etc types in stdint.h, but not other C headers. As an exception, stdbool.h remains since 'true' and 'false' definitions may be used with odp_bool_t. It could be also removed later since true/false are not part of the API (where as uint64_t, etc types). Application needs to include other C library headers directly. ODP API does not specify which headers are included by odp_api.h. 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>
2016-07-05linux-gen: byteorder: remove dependency to linux headersPetri Savolainen
Platform specific API files included endian.h and asm/byteorder.h. These are Linux headers and should not be visible to application through odp_api.h. Used __ORDER_LITTLE_ENDIAN__, etc instead which are supported by both gcc and clang. 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>
2016-07-05linux-gen: cpumask: remove dependency to sched.hPetri Savolainen
Platform specific API files included sched.h for accessing cpu_set_t. This is problematic since application may need to include it also and possibly with GNU extension (with #define _GNU_SOURCE). Application should be able to include odp_api.h in any order relative to other headers, and with or without any (e.g. GNU) extensions. The odp_cpumask_t is defined with equal (or larger) size to Linux cpu_set_t and this is verified with build time asserts. Linux CPU_SET macros are used to access the mask as before. 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>
2016-07-05linux-generic: schedule: simplify wait logic to avoid clang issuesBill Fischofer
Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2387 by ensuring that t1 variable is seen as initialized in all paths in the SP Scheduler. Previous logic failed due to an apparent issue with clang. 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>
2016-06-30linux-generic: packet: copy user area as part of odp_packet_copy()Bill Fischofer
Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2310 by copying the user area as part of odp_packet_copy(). The copy fails if the user area size of the destination pool is not large enough to hold the source packet user area. Reported-by: Zoltan Kiss <zoltan.kiss@linaro.org> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Zoltan Kiss <zoltan.kiss@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-30linux-generic: ticketlock: remove odp_sync_stores for octeonRizwan Ansari
Removes odp_sync_stores() call for OCTEON, Octeon build will fail, As this api has been already replaced by odp_mb_full(). Signed-off-by: Rizwan Ansari <rizwan.ansari@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-23test: queue: add capability testPetri Savolainen
Test queue capability API and create the maximum number of queues. 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>
2016-06-23linux-gen: move platform tests into test suiteYi He
Move platform tests from odp/platform/linux-generic/test into test suite at odp/test/platform/linux-generic. Signed-off-by: Yi He <yi.he@linaro.org> Reviewed-by: Christophe Milard <christophe.milard@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-22linux-gen: tm: use directly ODP_PACKET_INVALIDPetri Savolainen
Removed INVALID_PKT define and used directly ODP_PACKET_INVALID, which makes it easier to e.g. grep for invalid packets over entire implementation. 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>
2016-06-22linux-gen: sched: remove dummy pool from SP schedulerPetri Savolainen
Dummy pool creation is not needed anymore since timer and TM bugs (zero as invalid handle) have been corrented. 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>
2016-06-22linux-gen: tm: correct invalid packet handle definitionsPetri Savolainen
TM code used zero as the invalid packet handle value. Use ODP_PACKET_INVALID instead, which currently has a non-zero value. This mismatch caused bugs when packet handle value was zero (first packet from pool 0). 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>
2016-06-16linux-gen: pktio loop: improve classifying segmented packetsMatias Elo
Make sure there is enough data for the packet parser in the case of a segmented packet. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-16linux-gen: packet: use packet_parser_t type argument with parser functionsMatias Elo
Modify packet parser functions to utilize new packet_parser_t structure. Renamed the main parser function _odp_parse_common() to packet_parse_common(). packet_parse_common() now takes also segment length as argument. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-16linux-gen: packet: add packet parser structureMatias Elo
Collect odp_packet_hdr_t members set by the packet parser inside a common structure packet_parser_t. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-16linux-gen: sched: add pktio_stop_finalize to scheduler interfacePetri Savolainen
Added pktio_stop_finalize() and related STOP_PENDING and CLOSE_PENDING pktio states. When a scheduled pktio interface is stopped, it's moved into STOP_PENDING state until the scheduler responses with a stop_finalize call. While stop is pending, interface may be closed and thus moved into CLOSE_PENDING state. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-16linux-gen: sched: use pktio index in scheduler interfacePetri Savolainen
Replaced pktio handle with pktio index in scheduler interface. Indexes are used in implementation internal interfaces for performance reasons. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-16linux-gen: sched: call pktio_start only oncePetri Savolainen
Pktio calls the scheduler interface function pktio_start once per odp_pktio_start(). Scheduler handles internally creation of multiple poll commands. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-16linux-gen: pktio: simplify state handlingPetri Savolainen
Removed 'int taken', so that 'enum state' is the only variable which holds pktio entry state. Added PKTIO_ prefix for better name space protection and code readability. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-15linux-generic: timer: correct definition of ODP_TIMEOUT_INVALIDBill Fischofer
Resolve bug https://bugs.linaro.org/show_bug.cgi?id=2316 by changing the typedef of ODP_TIMEOUT_INVALID to be 0xffffffff to be consistent with other buffer types. This enables pool 0 to be used as a timeout pool. Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-15linux-gen: sched: SP scheduler implementationPetri Savolainen
This is initial implementation of strict priority scheduler. SP scheduler will not be optimized for throughput, but for low latency processing of high priority events. Implementation may have limited support on various scheduler features (e.g. ordered queues) and low number of priorities, groups, etc. 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>
2016-06-15linux-gen: pktio: added debug printsPetri Savolainen
Added couple of debug prints for easier pktio debug. 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>
2016-06-15linux-gen: sched: add sched_cb_queue_empty callPetri Savolainen
Added a new scheduler interface function, which may be used to control empty queue scheduling. SP scheduler uses this to ensure that empty queues are not stored into scheduler queues. 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>
2016-06-15linux-gen: sched: add ordered enq to schedule_fn_tPetri Savolainen
Added ordered enqueue functions to scheduler interface. 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>
2016-06-14linux-generic: classification: use proper accessor to set packet lengthZoltan Kiss
And repurpose packet_set_len() for this, as it is no longer used. This was introduced by the following commit, and break compatibility with ODP-DPDK: bd18047a "linux-gen: pktio: don't allocate new packets in classifier" Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-10linux-gen: pktio: fix variable overwrite in pktin_recv_bufMatias Elo
Fix variable overwrite bug in pktin_recv_buf(). Signed-off-by: Matias Elo <matias.elo@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-07linux-generic: sched: bind default scheduler api callsPetri Savolainen
Bound default scheduler implementation API calls to API structure. 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>
2016-06-07linux-generic: sched: add skeleton for strict priorityPetri Savolainen
Added configuration option to use strict priority scheduler implementation instead of the default. 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>
2016-06-07linux-generic: sched: add sched params to queue initPetri Savolainen
Added scheduler parameters into queue init scheduler interface call. 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>
2016-06-07linux-generic: sched: add api interface structPetri Savolainen
Added scheduler interface structure for API functions. 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>
2016-06-07linux-generic: sched: add init functions to interfacePetri Savolainen
Added global/local init and term functions to the scheduler interface. 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>
2016-06-06linux-generic: tm: fix memory leaksBarry Spinney
Completed the implementation of the free_dynamic_tbl_entry() function. This required the addition of the num_freed field to the dynamic_tbl_t record type. Added code to free the root_node and the queue_num_tbl inside of tm_system_free(). Added numerous checks to handle the case of a tm_queue being destroyed and hence removed from the queue_num_tbl in the short time from when the queue_obj was obtained and used. Also hardened the input_work_queue from this same sort of issue by storing the queue_num instead of the queue_obj in the input_work_item_t record type. Signed-off-by: Barry Spinney <spinney@mellanox.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-06linux-generic: tm: fix an off by one errorBarry Spinney
The loop used to chop up and link together a large malloc'd memory block into many smaller timer_blk records looped once too many times. Signed-off-by: Barry Spinney <spinney@mellanox.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-06linux-generic: tm: completed implementing _odp_timer_wheel_destroyBarry Spinney
Previously _odp_timer_wheel_destroy() had one remaining TODO, which was to free the malloc'd "block_of_timer_blks". To do this required adding a new data structure to record the original malloc result, since previously this malloc'd result was then chopped up into many individual timer_blk records, and the original malloc result was no longer available. Signed-off-by: Barry Spinney <spinney@mellanox.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-06linux-generic: tm: fix compile error on 32-bit platformsBarry Spinney
Added an additional type cast using uintptr_t. Signed-off-by: Barry Spinney <spinney@mellanox.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-03linux-generic: dpdk: remove unnecessary rte_pktmbuf_reset callMatias Elo
rte_pktmbuf_reset() is already called inside rte_pktmbuf_alloc(), so no need to call it again. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-02linux-gen: pktio: don't allocate new packets in classifierMatias Elo
Don't allocate new packets inside of the internal classifier helpers _odp_packet_cls_enq() and _odp_packet_classifier(). Instead, save destination queue to the parsed packet header and return correct packet pool. This enables zero-copy packet classification. Added new internal pktio helper pktin_recv_buf(), which enqueues packets to classifier queues if necessary. All pktio types use now a common cls_classify_packet() helper function. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-02linux-gen: pktio: remove old single queue recv and send functionsMatias Elo
RX/TX locks are moved inside pktio implementations and pktios set packet header's input member. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-02linux-gen: packet: increase input flags bit field size to 64 bitsMatias Elo
Make room for more input flags. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-02linux-gen: netmap: handle modified _odp_packet_cls_enq() return values correctlyMatias Elo
Do not increase the count of received packets if classifier already handled the packet. Fixes odp_classifier example crashing with netmap pktio. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-02linux-generic: pktio: ring: add _ring_destroy()Yi He
Add _ring_destroy() to release shared memory allocated by _ring_create() calls. previously this was accomplished by manually odp_shm_lookup() and odp_shm_free(). Signed-off-by: Yi He <yi.he@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-06-02linux-generic: pktio: ipc: _ring_tailq_init() at global initYi He
Fix the uninitialized Q and RW lock which may cause occasional segmentation fault in _ring_create() etc. Signed-off-by: Yi He <yi.he@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>