aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/odp_traffic_mngr_internal.h
AgeCommit message (Collapse)Author
2024-03-28linux-gen: tm: make is_idle atomicJere Leppänen
Change the type of tm_system_s.is_idle to odp_atomic_u32_t in order to avoid a data race reported by GCC thread sanitizer. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2024-03-18linux-gen: update copyright formatMatias Elo
Update all implementation files to use the new shorter copyright format: /* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) <YEAR> <COPYRIGHT HOLDER> */ Inherited DPDK copyright messages have also been updated to utilize SPDX format and now list the original source files. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
2022-02-08linux-gen: remove odp_api.h includes from implementationMatias Elo
Don't include odp_api.h header inside the implementation files as it unnecessarily includes all API headers. The remaining includes have been cleaned up and grouped. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2022-01-21linux-gen: tm: remove unused odp_queue_t instanceJanne Peltonen
tm_queue_obj contains an instance of odp_queue_t but the ODP queue is not used for anything. The queue seems to be a leftover from very early revisions and has been unused since 0d6d0923b. Remove the queue and associated code. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
2021-07-12linux-gen: tm: add implementation for queue statisticsMatias Elo
Add implementation for the new odp_tm_queue_stats() function. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2021-07-09linux-gen: tm: support unordered enqueue and enq multiNithin Dabilpuram
Add support for unordered enqueue and enq multi API. Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
2020-09-25linux-gen: traffic_mngr: enable reuse of internal queue object indicesMatias Elo
The previous implementation used a simple counter for internal tm_queue_obj_t indices. If an application creates and destroys TM queues dynamically the implementation would eventually run out of valid object indices. Fix this by using _odp_int_pkt_queue_t as index. Fixes: https://github.com/OpenDataPlane/odp/issues/981 Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
2018-12-03linux-gen: traffic_mngr: allocate profile objects from shmMatias Elo
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>
2018-12-03linux-gen: traffic_mngr: store input_work_queue inside tm_system_tMatias Elo
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>
2018-12-03linux-gen: traffic_mngr: store root node inside tm_system_tMatias Elo
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>
2018-12-03linux-gen: traffic_mngr: store tm_queue_obj_t array inside tm_system_tMatias Elo
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>
2018-12-03linux-gen: traffic_mngr: allocate tm_node_obj_t from shmMatias Elo
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>
2018-12-03linux-gen: traffic_mngr: move tm_wred_node_t inside tm_node_obj_tMatias Elo
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>
2018-12-03linux-gen: traffic_mngr: move tm_schedulers_obj_t inside tm_node_obj_tMatias Elo
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>
2018-12-03linux-gen: traffic_mngr: allocate tm_system_group_t from shmMatias Elo
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>
2018-12-03linux-gen: traffic_mngr: allocate tm_queue_obj_t from shmMatias Elo
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>
2018-12-03linux-gen: traffic_mngr: move tm_wred_node_t inside tm_queue_obj_tMatias Elo
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>
2018-12-03linux-gen: traffic_mngr: use static array for odp_tm_systemsMatias Elo
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>
2018-08-20linux-gen: queue: remove internal queue handle conversionsPetri Savolainen
Use odp_queue_t as internal queue handle. This simplifies internal queue interface as intermediate type (void *q_int) and additional conversions (from_ext() and to_ext()) are not needed. Queue handle stores pointer to queue entry as before. Conversion is a simple cast (nop as an inline function) for both queue implementations. 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>
2018-05-30linux-gen: queue: remove abstract internal queue typePetri Savolainen
Implementation internal (queue) references are pointers. Remove additional (abstract) type from queue interface. Other modules use void pointer as (abstract) queue reference. Abstract type added complexity and confusion, as queue handles had three different formats API handle, internal abstract type and queue structure pointer. Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> Reviewed-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2018-05-28linux-gen: init: split odp_internal.hPetri Savolainen
odp_internal.h contained code for three different purposes. Split file into three different headers, so that it's no more a place for random type/function prototype additions. New files are: * odp_init_internal.h which holds global/local init function prototypes * odp_global_data.h which defines global data structure * odp_sysinfo_internal.h which contains system info internal function prototypes 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>
2018-02-26update Linaro Copyrights to 2018 yearMaxim Uvarov
Using simple commands: find . -not -path .git -type f -exec \ sed -i -E 's/ (201[0-9]), Linaro/ \1-2018, Linaro/g' {} + find . -not -path .git -type f -exec \ sed -i -E 's/ (201[0-9])(-201[0-9]), Linaro/ \1-2018, Linaro/g' {} + Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
2018-02-12linux-gen: move common macros to odp_macros_internal.hMykyta Iziumtsev
Gather macros needed for upcoming mediated devices in one location. Fix signed vs. unsigned comparisons caused by incorrect MIN / MAX usage. Signed-off-by: Mykyta Iziumtsev <mykyta.iziumtsev@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2017-07-11linux-generic: queue: modular queue interfaceHonnappa Nagarahalli
Created abstract queue type. Queue APIs and functions towards the internal components are converted into function pointers. Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2016-12-09linux-generic: move tm system barrier to tm groupXuelin Shi
since tm thread is handling tm group, move the thread based barrier to tm group. otherwise, packet cannot get into the second tm system in the same group. Signed-off-by: Xuelin Shi <forrest.shi@linaro.org> Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-08-11linux-generic: tm: made tm thread creation more flexibleBarry Spinney
These changes add a new concept called the tm_system_group. This new entity collects together a set of tm_systems that all share some common resources - eg. share the service 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-07-27api: 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-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-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-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-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-03api: tm: changes to split TOS marking into two separate callsBarry Spinney
This patch adds a new marking_colors_supported and marking_colors_needed arrays. Also splits the TOS marking function - which previously could specify ECN or DSCP marking into two separate calls. Also improved the documentation. Also this patch updates the linux-generic odp_traffic_mngr.c implementation to this latest API. In addition a few bugs were fixed in the marking implementations. Signed-off-by: Barry Spinney <spinney@mellanox.com> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-04-25api: tm: define and implement revised api definitionsBarry Spinney
Normally we would split this into four separate parts, but because they are interdependent, they need to be in the same patch for bisectability. API changes: 1) Add VLAN and IP TOS marking functions. 2) Added the requirements and capabilities architecture. Added separate record types for describing ODP application requirements vs TM implementation capabilities. This also involved adding per level requirements and capabilities. 3) Egress parameters are now separate from the requirements 4) Doxygen formatting cleanup. 5) Added _destroy functions for all of the profiles. 6) Added odp_tm_node_disconnect and odp_tm_queue_disconnect fcns. 7) Added odp_tm_node_info, odp_tm_queue_info and odp_tm_node_fanin_info functions and associated record types. 8) Removed the odp_tm_periodic_update fcn. linux-generic implementation changes: Only changes were implementing the new and revised API changes. validation test changes: 1) Replaced the printf with test_debug.h LOG_ERR. 2) Added a lot more LOG_ERR calls for debugging - especially for errors in test termination code. 3) Changed create_tm_system to use the new capabilities and requirements API architecture. 4) Added lots of code to destroy tm_queues, tm_nodes and profiles. example changes: 1) Changed create_tm_system to use the new capabilities and requirements API architecture. 2) Renamed Kbps and Mbps to KBPS MBPS. 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-02-26linux-generic: tm: fix numerous bugs in timer wheel and main tm implementationBarry Spinney
Signed-off-by: Barry Spinney <spinney@ezchip.com> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-02-11api and linux-generic: make room for new apiChristophe Milard
This is about making the current structure clearer so that other interfaces can be added to ODP: The ODP API specification (platform agnostic) is moved from include/odp/api to include/odp/api/spec. The ODP API platform definition (for linux generic) is moved from platform/linux-generic/include/odp to platform/linux-generic/include/odp/api Include statements are adjusted accordinaly. This patch has been done by a script which is given with the cover-letter of this patch series. Signed-off-by: Christophe Milard <christophe.milard@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-01linux-generic: tm: use intermediate casts to avoid strict warningsBill Fischofer
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-24linux-generic: tm: implement traffic managerBill Fischofer
Signed-off-by: Barry Spinney <spinney@ezchip.com> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>