aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include/odp_buffer_inlines.h
AgeCommit message (Collapse)Author
2018-05-10linux-gen: buffer: remove buffer_inlines header filePetri Savolainen
Moved odp_buffer_inlines.h content to odp_buffer_internal.h and removed the file. Other xxx_inlines.h headers do not contain internal functions but only code for API function inlining. Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2018-03-07linux-gen: sched: optimize atomic packet input queue throughputPetri Savolainen
When packet input queue is atomic, packets received from packet input are passed directly to the application. Other queue types may have events stashed on other threads, so for those incoming packets are always enqueued (to maintain packet order). 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>
2017-12-27linux-gen: event: move event subtype to packet headerMatias Elo
Event subtype is only used by packets, so move subtype to packet header to optimize cache usage. This change fixes the ~30% performance penalty in l2fwd (zero-copy dpdk pktio) caused by the initialization of event subtype. Signed-off-by: Matias Elo <matias.elo@nokia.com> 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>
2017-12-27linux-generic: events subtype implementationDmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2017-07-13linux-gen: queue: avoid extra conversionsPetri Savolainen
Conversions are not needed as event handles are buffer header pointers. 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>
2017-07-13linux-gen: buffer: change buffer handle to pointerPetri Savolainen
Changed buffer, event and timeout handles to be pointers. Packet handles are already pointers. This enabled code optimization as some conversions may be removed and remaining once are just type casts. 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>
2017-01-12linux-gen: packet: added support for segmented packetsPetri Savolainen
Added support for multi-segmented packets. The first segments is the packet descriptor, which contains all metadata and pointers to other segments. 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>
2017-01-12linux-gen: pool: clean up pool inlines functionsPetri Savolainen
Removed odp_pool_to_entry(), which was a duplicate of pool_entry_from_hdl(). Renamed odp_buf_to_hdr() to buf_hdl_to_hdr(), which describes more accurately the internal function. Inlined pool_entry(), pool_entry_from_hdl() and buf_hdl_to_hdr(), which are used often and also outside of pool.c. Renamed odp_buffer_pool_headroom() and _tailroom() to simply pool_headroom() and _tailroom(), since those are internal functions (not API as previous names hint). Also moved those into pool.c, since inlining is not needed for functions that are called only in (netmap) init phase. 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>
2017-01-12linux-gen: pool: reimplement pool with ringPetri Savolainen
Used the ring data structure to implement pool. Also buffer structure was simplified to enable future driver interface. Every buffer includes a packet header, so each buffer can be used as a packet head or segment. Segmentation was disabled and segment size was fixed to a large number (64kB) to limit the number of modification in the commit. 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-26linux-gen: pool: optimize thread local buffer cacheMatias Elo
Optimize local buffer cache performance which is critical to many use cases - including packet IO. Main parts of the optimization are: * Local cache implemented as an array of buf_hdr pointers, instead of a linked list (which causes a lot of cache misses) * Alloc and free N buffers per operation All above steps are needed to demonstrate the performance upgrade. Some related pool functions (get_buf(), ret_buf(), etc) were moved from pool header to c source file, since those were actual local to the c source file. Also some unused pool variables are removed also. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> 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>
2015-07-27Merge branch 'master' into api-nextMaxim Uvarov
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: helper/test/odp_chksum.c include/odp/api/init.h platform/linux-generic/include/odp/plat/thrmask_types.h test/validation/cpumask/cpumask.h
2015-07-20linux-generic: buffer: remove unneeded division/module when mapping within ↵Nicolas Morey-Chaisemartin
the first segment This adds a fast case when trying to map a buffer within the first segment, which is always the case for non jumbo frames in the current linux-generic implementation. This shows a sligh performance gain (mesure with pktio_perf). Before: Maximum packet rate: 1108398 PPS (388 Mbps) Maximum packet rate: 1116210 PPS (391 Mbps) Maximum packet rate: 1207031 PPS (423 Mbps) Maximum packet rate: 1121093 PPS (393 Mbps) Maximum packet rate: 1194335 PPS (419 Mbps) After: Maximum packet rate: 1331054 PPS (467 Mbps) Maximum packet rate: 1172851 PPS (411 Mbps) Maximum packet rate: 1156250 PPS (405 Mbps) Maximum packet rate: 1228515 PPS (431 Mbps) Maximum packet rate: 1314453 PPS (461 Mbps) 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-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-07-01linux-generic: buffers: correct segment length calculation for packetsBill Fischofer
Fix for Bug https://bugs.linaro.org/show_bug.cgi?id=1661 Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Review-and-tested-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-06-16linux-generic: crypto: eliminate buffer type hack for completionsBill Fischofer
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Reported-by: Christophe Milard <christophe.milard@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-05-13linux-generic: buffer: init all the odp_buffer_bits_t struct to avoid ↵Nicolas Morey-Chaisemartin
valgrind warnings odp_buffer_encode_handle initializes only the useful bits but not all of them which causes error in valgrind: ==1192== Conditional jump or move depends on uninitialised value(s) ==1192== at 0x40CB01: odp_timeout_alloc (odp_timer.c:861) ==1192== by 0x402A2A: test_timeout_pool_alloc (odp_timer.c:72) ==1192== by 0x4C17406: ??? (in /usr/lib64/libcunit.so.1.0.1) ==1192== by 0x4C17762: ??? (in /usr/lib64/libcunit.so.1.0.1) ==1192== by 0x4C17A95: CU_run_all_tests (in /usr/lib64/libcunit.so.1.0.1) ==1192== by 0x401E25: main (odp_cunit_common.c:77) ==1192== Uninitialised value was created by a stack allocation ==1192== at 0x4074EC: odp_pool_create (odp_pool.c:153) This mainly happens when testing odp_buffer_t vs ODP_BUFFER_INVALID. The test works but it fills the test logs with warnings. By setting the wholme odp_buffer_t at 0, the errors disappear. Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-02-25linux-generic: buffers: remove obsolete debugging codeBill Fischofer
Remove obsolete debugging code. https://bugs.linaro.org/show_bug.cgi?id=1165 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-02-20linux-generic: pools: rename odp_buffer_pool files to odp_poolBill Fischofer
Signed-off-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-04linux-generic: pool: add strong typing supportBill Fischofer
Signed-off-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-04linux-generic: buffers: add strong typing supportBill Fischofer
Signed-off-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-01-27api: config: Renamed ODP_CONFIG_BUFFER_POOLSPetri Savolainen
Replaced ODP_CONFIG_BUFFER_POOLS with ODP_CONFIG_POOLS. 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-01-27api: pool: Rename pool params and remove buffer typesPetri Savolainen
* Renamed odp_buffer_pool_param_t to odp_pool_param_t * Moved buffer pool parameters into "buf" struct * Left other structs for other types (pkt and tmo) to be added and implemented * Pool type field is common to all pool types * Removed buffer types and use ODP_EVENT_XXX for event type and ODP_POOL_XXX for pool type instead. So event types may not be assosiated to a pool (and may not have a corresponding pool type). 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-01-07linux-generic:odp_buffer_inlines.h:make self-sufficientOla Liljedahl
Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org> Reviewed-by: Stuart Haslam <stuart.haslam@arm.com> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
2015-01-06linux-generic: bugfix: correct seglen calculationBill Fischofer
seglen computation did not account for seg_offset Signed-off-by: Geoffrey Blake <geoffrey.blake@arm.com> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
2014-12-16api: packet: add segmentation and copy APIBill Fischofer
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2014-12-16api: buffer: change pool createBill Fischofer
Modify pool create API to be able to specify number of buffers directly. Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> 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>