aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include
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-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-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-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-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: 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: 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: 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: 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-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 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-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-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-01linux-gen: ring: volatile head and tail typesPetri Savolainen
Head and tail indexes were missing volatile specifier, which broke multi-producer and -consumer implementation. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Suggested-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-05-31linux-generic: implementation name is odp-linuxPetri Savolainen
Refer consistently to odp-linux as the implementation name. Linux-generic is implementation internal directory name. 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-05-26linux-generic: config: remove duplicate definesPetri Savolainen
Remove duplicate defines from odp_config_internal.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-05-26linux-generic: schedule: remove queue internal depenciesPetri Savolainen
Removed last dependcies to queue and buffer internals from schedule.c. Ordered queue implementation has still lots of dependencies on both, but is now contained into a separate source file to wait for clean up. 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-05-26linux-generic: schedule: move local struct into internal headerPetri Savolainen
Share struct definition between schedule.c and schedule_order.c, so that queue_entry_t references may be removed from schedule.c. 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-05-26linux-generic: schedule: rename schedule interface headerPetri Savolainen
Renamed odp_schedule_internal.h to odp_schedule_if.h, since it defines the interface. A new, truly internal header is needed for the scheduler. 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-05-26linux-generic: schedule: move ordered queue code to a new filePetri Savolainen
Moved ordered queue code from queue_internal.h and queue.c into a new file. Ordered queue type is a scheduler feature but the code contains lots of references to queue_entry_t. The code needs a clear interface towards queues, but is first contained into a separate file. 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-05-26linux-generic: schedule: start decouple from queue internalsPetri Savolainen
First steps in decoupling scheduler from queue internal definitions. Pass queue index instead of qentry pointer between queue and scheduler modules. Heavy users of qentry struct (enq, deq and ordered queue code) need more work and new interface functions to decouple. 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-05-26linux-generic: schedule: clean up dependency to config interfacePetri Savolainen
Changed global config #defines into function calls and a scheduler specific define (ORDERED_LOCKS_PER_QUEUE), which needs more work to get rid off. 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-05-26linux-generic: schedule: move schedule group mask into schedulerPetri Savolainen
Break dependency between scheduler and thread id/mask code. Schedule group data and implementation belong inside scheduler. 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-05-26linux-generic: schedule: clean interface towards pktioPetri Savolainen
Break scheduler dependency on pktio internal definitions. Moved pktio_poll function prototype into scheduler interface definition in odp_schedule_internal.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-05-26linux-generic: schedule: introduce scheduler interfacesPetri Savolainen
Start an effort to extract scheduler interfaces (towards and from the scheduler) into function pointer structures. When finished this will enable multiple scheduler implementations and build / init time selection of one. 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-05-26linux-generic: schedule: remove static function prototype from headerPetri Savolainen
schedule_release_context() is internal to odp_schedule.c file. 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-05-24linux-generic: include: drv: std_types.h: fix cyclic includeAnders Roxell
Reported-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-05-24linux-generic: traffic-mngr: 32-bit platform fixesBarry Spinney
Fixed some coverity warnings. Changed all 32-bit atomic variables to be 64 bit. Add PRIu64 and PRIX64 macros and other 32-bit platform fixes. Changed timer_wheel API to use uint64_t for user data instead of void *, which makes it easier to support 32-bit platforms. Added code to affinitize the tm_thread as well as the main thread. 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-05-23linux-generic: pktio: add pktio type specific print functionMatias Elo
Add new function pointer 'print' to pktio_if_ops_t. This can be used to print pktio type specific debug information. In case of netmap, it is used to print the current RSS configuration. rss_conf_print() output format was modified to be in line with odp_pktio_print(). 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-05-19linux-generic: packet: initialize only selected odp_packet_hdr_t membersMatias Elo
Using memset to initialize struct odp_packet_hdr_t contents to 0 has a significant overhead. Instead, initialize only the required members of the struct. 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-05-19linux-generic: buffer: ifdef ipc_addr_offset member from odp_buffer_hdr_tMatias Elo
Define ipc_addr_offset member of struct odp_buffer_hdr_t only if ipc pktio is enabled to reduce struct size. 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-05-19linux-generic: packet: remove payload_offset member from odp_packet_hdr_tMatias Elo
There is no way to read payload_offset in the ODP API, so don't save it. 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-05-19linux-generic: packet: remove vlan_s_tag and vlan_c_tag members from ↵Matias Elo
odp_packet_hdr_t There is no way to read vlan tags in the ODP API, so don't save them. 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>