Age | Commit message (Collapse) | Author |
|
Rename the rest of the global symbols in the static library that do
not have the "_odp_" prefix.
Fixes: https://github.com/OpenDataPlane/odp/issues/805
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Ensure that buffer and packet header sizes do not accidentally
grow to new cache lines when adding new struct fields. Removed
comments about data alignment as those may not be always valid
(e.g. 32 bit builds). Added debug prints for checking data
alignment on the same offsets.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
Add configuration file option for the maximum packet data length in bytes.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
|
|
Old implementation specific pool statistics can be removed now when the
pool API provides similar functionality.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
|
|
Implement new odp_pool_stats_reset() and odp_pool_stats() functions.
To minimize overhead, support for alloc_ops, free_ops, cache_alloc_ops, and
cache_free_ops counters can be disabled by setting CONFIG_POOL_STATISTICS
define (platform/linux-generic/include/odp_config_internal.h) to zero.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
|
|
Implement new odp_pool_index() and odp_pool_max_index() functions.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
|
|
Update odp_buffer_is_valid() to conform API spec change. Try to
avoid crash with corrupted buffer handles by checking that buffer
header pointer is on a valid range before accessing buffer header
fields.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
Implementation for the new vector pool type.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Use ODP_ALIGNED (GCC's aligned attribute) according to the GCC
documentation.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Convert multiplication operands, not the result, to uint64_t to avoid
overflow when calculating the number of extra buffers for skipping huge
page boundaries. An overflow would have required a pool size of gigabytes.
Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Format pool and uarea SHM names to be similar and include
pool index into the names. This helps debugging as pool names
are optional or may not be unique.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Added per thread counters for total number of events allocated
and freed (per pool). These are enabled when debugging (requires
--enable-debug). Results are printed on thread terminate
(requires --enable-debug-print).
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Implement new cache size parameters. Cache and burst sizes
are now defined per pool. Cache size value from config file
is used to initialize cache size parameters. Burst size value
from config file is used, when cache size is larger than 2x
burst size.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
Some API calls missed const qualifiers on read-only data
pointers. Added those and fixed implementation as well to
avoid build errors.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Stanislaw Kardach <skardach@marvell.com>
|
|
Implement the new packet align pool parameter with minimal
changes. Packet pools are aligned always to the base align,
so all application requests up to that value are supported.
Base align can be changed through the config file.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Stanislaw Kardach <skardach@marvell.com>
|
|
Global pointer is NULL, if init fails.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
Setup alignment according to config file options.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
Added packet and buffer data alignment options into
the config file. For packets, this is the segment base
address alignment. For buffers, this is minimum data
alignment, application alignment requirements are rounded
up to this value.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
Renamed global variable for better code readability. Use _odp
prefix as the name is visible to application when APIs
are inlined.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
At least one pool needs to be reserved from ODP_CONFIG_POOLS
for internal usage.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
Packet segmentation has been reimplemented using a linked list. The new
implementation is more simple and has the added benefit of reducing
packet and buffer header sizes:
odp_packet_hdr_t: 384B -> 256B
odp_buffer_hdr_t: 256B -> 64B
The dynamic packet reference implementation has been temporarily downgraded
to a simple packet copy.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Prefix internal init/term functions with underscore to improve code
readability.
Unused odp_timer_disarm_all() function declaration is removed.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Previously, config.h header was not included in install dir. This caused a
compilation failure when an application tried to include ODP helper
headers.
config.h has been moved to include/odp subdirectory to avoid naming
conflicts and unnecessary includes have been removed.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Reported-by: Mikko Parpala <mikko.parpala@nokia.com>
|
|
The blocks size is already rounded up by rte_mempool_calc_obj_size().
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Modify pool implementation to store buffer headers instead of indices. This
removes the need for pointer <-> index conversion in buffer alloc/free
functions.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Added new ring type ring_ptr_t, which uses the same implementation as old
ring_t, but stores pointers instead of indices. The old ring_t type is
renamed to ring_u32_t.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Add debug print when entire pool fits into thread local caches. Pool
starvation may occur if the pool is used by multiple threads.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Suggested-by: Mikko Kurikka <mikko.kurikka@nokia.com>
|
|
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Refactor local buffer caching into separate functions and optimize
implementation by caching buffer header pointers instead of indices.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Internal _ODP_ISHM_USE_HP flag is replaced with API ODP_SHM_HP flag. This
makes internal _odp_shm_reserve() wrapper function unnecessary.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Stanislaw Kardach <skardach@marvell.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Buffer and timeout header sizes are rounded up to cache line size, so the
following data can be cache line aligned without extra padding.
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>
|
|
Rename ODP_CONFIG_BUFFER_ALIGN_MIN to BUFFER_ALIGN_MIN and move it to
odp_pool.c as this value links closely to the buffer pool implementation.
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>
|
|
Calculate memory block size using pool type specific header.
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>
|
|
Add internal shm flag for allocating shm memory always from huge pages.
This is required by zero-copy dpdk packet pool. Internal _odp_shm_reserve()
function is added for passing extra shm flags.
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>
|
|
Reserving large shm blocks without huge pages increases page misses.
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>
|
|
This config is used to for maximum capability. The default
capability needs to be modest so that system memory limit is
not exceeded. User may increase maximum number of packets when
system memory size allows (and SHM single VA is not used).
Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Do also checks against maximum number of packets and
max packet headroom size.
Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Change from debug to error message on pool create checks.
These are slow path errors and it's helpful to see those
also when not debugging.
Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Ensure that ring size is larger than number of events to be
stored in there.
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>
|
|
Improved zero-copy DPDK pktio implementation which better adheres to DPDK
APIs. The new implementation reduces overhead by moving mbuf
initialization to ODP pool create and by using offsets instead of saved
pointers to do ODP packet / DPDK mbuf conversion.
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>
|
|
Some linux-generic internal shared memory allocations have
to be in normal pages due to small required data. Relaying
on odp_sys_huge_page_size() is not really correct, because
call returns default huge page size. But default huge page
size is definned in kernel boot parameter as:
default_hugepagesz=1G hugepagesz=1G hugepages=2
So in that case for small allocation linux-gen will create 1GB
huge page. This patch introduces internal flag to shm funtion
to allocate hp.
This patch remains allowing changes on top of it:
For now pools are in huge page. And for apps with small pool it's
big overhead of unused memory. We should take into account
odp_sys_huge_page_size_all() call and found best sized huge pages.
https://bugs.linaro.org/show_bug.cgi?id=3954
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
|
|
RW global data is allocated from shm to enable process mode support.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Reserve internal shm blocks using single VA flag when the reservation is
done after global init. Enables process mode support.
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>
|
|
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
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>
|
|
Make linux-gen platform code use inlined thread functions instead of
doing proper functions calls.
Signed-off-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>
|
|
Signed-off-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>
|
|
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>
|
|
No code change. Just move array definition several lines
up to make clang happy to generate valid code.
Fixes: https://bugs.linaro.org/show_bug.cgi?id=3611
Suggested-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
Reviewed-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|