Age | Commit message (Collapse) | Author |
|
ML need to use the function to set buffer subtypes.
Signed-off-by: Lifang Zhang <lifang.zhang@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
|
|
Added new user area parameters and capabilities to buffer,
timeout and vector events. Make event header initialization
simpler and more explicit that it covers type specific
headers as well.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
|
|
Inline odp_event_flow_id_set() function implementation.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
|
|
Inline odp_event_flow_id() function implementation.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
|
|
Add _ODP_ prefixes to implementation internal helper macros and collect
common macros into a single header file (odp_macros_internal.h). Unused
macros (DIV_ROUND_UP, odp_container_of) have been removed.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
|
|
Use common _odp_event_hdr_t in odp_buffer_hdr_t. Cache line alignment
constraint has been moved to odp_buffer_hdr_t.
The implementation internal scheduler and queue interfaces have been
modified to use event headers instead of buffer headers.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Fix "ISO C forbids zero-size array" errors when building with 'pedantic'
option.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
Scheduler interface header should be included only when needed.
Buffer internal header is included by many files, which do not
use scheduler interface.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@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>
|
|
Packet print function used buffer_snprint, which assumed
that event type is buffer and printed an error on packets.
Re-implemented buffer and packet print functions to not
use buffer_snprint.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
|
|
Instead of storing IPC packet data offset in odp_buffer_hdr_t, calculate
the offset on receive using odp_packet_hdr_t.seg_data pointer and remote
pool base address.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@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>
|
|
Fix checkpatch code style warnings.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Implement flow aware scheduling API with least possible changes.
Scheduler does not care about flow IDs, but synchronizes still
on queue level. This is functionally correct, but does provide
parallelism between different flows of a queue. So, application
does not benefit from using flows, but functions correctly.
Maximum number of flows per queue is limited to 256 just to
minimize number of bytes used in buffer header.
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>
|
|
Use inlined queue enqueue and dequeue functions instead of
internal interface versions. Removed functions from internal
interface. Original dequeue multi call remains for overriding
dequeue calls (e.g. packet input overrides queue dequeue
function but uses the original queue).
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>
|
|
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>
|
|
Change from linked list of bursts to a ring implementation.
Queues have maximum size but code is simpler and performance
is a bit better. This step helps in a potential future step to
implement queues with a lockless ring.
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>
|
|
Remove unnecessary union of user context u64/pointer. Rename
the field for better code readability.
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>
|
|
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>
|
|
* typedef struct { } ODP_ALIGN() test_t; is correct
* typedef struct ODP_ALIGN() {} test_t; is correct and
preferred from gcc standards
* typedef struct {} test_t ODP_ALIGN() discards align
Had segfauls on gcc-7 using that
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
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>
|
|
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>
|
|
Add inlined accessors for pool_t members pool_hdl and uarea_size. This
enables removing the matching members from odp_buffer_hdr_t, and thus
reduces per buffer overhead.
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>
|
|
Data size is constant for all buffers from the same pool, so there is no
need to store the value in the buffer 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>
|
|
Use separate defines for the maximum number of segments per packet
(CONFIG_PACKET_MAX_SEGS) and the number of segments stored in a packet
header (CONFIG_PACKET_SEGS_PER_HDR).
A separate define is also added for the maximum packet length.
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>
|
|
Pack most often used data into the first and the last cache line
of buffer header, and the first cache line of packet header.
Reduce offsets and head-/tailroom fields to 16 bits, since
those are in maximum as large as a segment, usually much
less. Pack header fields into correct alignments (when possible),
so that holes are avoided.
These changes reduce packet header size by one cache line.
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>
|
|
Implemented static references with a reference counter. Counter
is zero when not used (reference API not used).
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>
|
|
Pack most often used buffer header fields (including seg[0])
into the first cache line.
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>
|
|
Removed limitation to fixed number of segments
(CONFIG_PACKET_MAX_SEGS) per packet. Packet headers carrying
segment tables are now linked together with 'next_seg' pointer.
Last header containing a segment table is pointed by 'last_seg'
pointer. Other than the first segment are not referred directly
but with seg_entry_ functions.
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>
|
|
Since 39b3a1681097638 ("linux-gen: remove pktio ipc option from
configure") IPC pktio is enabled unconditionally. Drop define guarding
conditional compilation of several remaining bits.
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@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>
|
|
Implements experimental zero-copy mode for DPDK pktio. This can be enabled
with additional '--enable-dpdk-zero-copy' configure flag.
This feature has been put behind an extra configure flag as it doesn't
entirely adhere to the DPDK API and may behave unexpectedly with untested
DPDK NIC drivers. Zero-copy operation has been tested with pcap, ixgbe, and
i40e drivers.
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>
|
|
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>
|
|
Only packets used base_len of buffer header. Replace the struct
field with constant. This improves performance as the constant data
is not read any more and buffer header size is smaller.
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>
|
|
Optimized buffer and packet header struct cache usage by:
* removing unused fields
* packed remaining fields
* arrange fields for more optimal cache line usage
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>
|
|
Optimized concat operation to avoid packet copy when destination
packet has room to link source packet segments. Since concat uses
extend tail it was also modified to handle variable segment sizes.
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>
|
|
clang is more clever on setting and not using variables,
so it traps compilation. Also buffers header almost everywhere
reference by pointer so size of it should not impact on
performance.
Signed-off-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>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
|
|
Remove old ordered queue code. Replaced temporarily by atomic handling.
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>
|
|
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>
|
|
Improve performance by changing the first parameter of
buffer_alloc_multi() to pool pointer (from handle), to avoid
double lookup of the pool pointer. Pointer is available for
packet alloc calls already.
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>
|
|
Round up global pool allocations to a burst size. Cache any
extra buffers for future use. Prefetch buffers header which
very newly allocated from global pool and will be returned to
the caller.
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>
|
|
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>
|
|
Added main burst size configuration option (CONFIG_BURST_SIZE),
which helps to keep various burst sizes in sync. Increased common
burst size from 8 to 16. This increases scheduled queue throughput
about 30-40%.
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>
|
|
Added support for a buffer header to carry a burst of buffer
pointers. The buffer itself is the last one a burst. Burst are
built with a enq_multi call, so single enq operations do not
benefit from it.
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|