Age | Commit message (Collapse) | Author |
|
It's more convenient to pass parameters in order, like t2 - t1,
when t2 is supposed to be more. Also it's needed to keep in sync
with time API which uses same order.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Conflicts:
test/performance/odp_scheduling.c
|
|
It's more convenient to pass parameters in order, like t2 - t1,
when t2 is supposed to be more.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
The word "cycle" is left from old API time names. The "cycle" is
ambiguous word, especially when it can be used for other purposes.
So better to use "tick" or "time" word or just "t" symbol.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Current time API supposes that frequency of counter is equal
to CPU frequency. But that's not always true, for instance,
in case if no access to CPU cycle counter, another hi-resolution
timer can be used, and it`s rate can be different from CPU
rate. There is no big difference in which cycles to measure
time, the better hi-resolution timer the better measurements.
So, unbind CPU cycle counter from time API by eliminating word
"cycle" as it's believed to be used with CPU.
Also add new opaque type for time odp_time_t, as it asks user to use
API and abstracts time from units. New odp_time_t requires several
additional API functions to be added:
odp_time_t odp_time_sum(odp_time_t t1, odp_time_t t2);
int odp_time_cmp(odp_time_t t1, odp_time_t t2);
uint64_t odp_time_to_u64(odp_time_t hdl);
Also added new definition that represents 0 ticks for time -
ODP_TIME_NULL. It can be used instead of odp_time_from_ns(0) for
comparison and initialization.
This patch changes only used time API, it doesn't change used var
names for simplicity.
This time API can be implemented with local timer counter, so
shouldn't be used between threads.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Conflicts:
platform/linux-generic/odp_time.c
|
|
There cannot be used direct comparison of timestamps of counter
that can overflow, better to compare ranges.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Separated receive and transmit drop counters to
help debugging the cause of dropped packets.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Increased burst size to 32. This improves packet rate about
15% with netmap, since system call rate is halved.
No harm to any implementation, since implementation decides
how many packets are returned. This is comparable to DPDK l2fwd
burst size.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Allocate cacheline aligned shared memory for per thread
statistics and simplify stats pointer references.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Queue mode works the same way as direct mode, but uses
odp_schedule_multi for packet input. This improves packet
rate about 40% (with netmap). Only scheduler overhead is now
added which makes it easy to compare direct vs. scheduler inputs
options.
Output through queues or TM can be added as a third mode later.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
More controlled startup sequence:
* Create and configure pktios
* Create and start workers
* Enable packet rx and tx
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Added command line option to disable packet error check. Error
check requires full packet parse. Max packet rate measurements
should be done with minimal feature set.
This change gives +10% packet rate increase in direct recv mode
with netmap.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Fixes: https://bugs.linaro.org/show_bug.cgi?id=1868
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
By default every packet's source MAC address is filled to
match the output port. Add option to disable this to enable
testing packet forwarding without touching the packets.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Previously only even numbers of ports were supported. Added
support for odd numbers of ports (including 1). Src-dst port
mappings are saved during initialization to minimize per
packet operations.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Application crashes if accuracy option is set to zero
(division by zero). Disable statistics printing if accuracy
<= 0.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Previously only atomic scheduler queues where supported.
This was a bottleneck when the number of worker threads was
increased. Added an option to choose scheduler queue sync
mode (none, atomic, ordered).
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
If the application is being run on a host connected to a
switch, not changing the ethernet destination may cause
loops. Added an option to change the destination ethernet
address. The destination addresses follow the format
02:00:00:00:00:XX where the final octet is the output
port number.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Use full default word in api to make function
name more clear.
https://bugs.linaro.org/show_bug.cgi?id=1745
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
|
|
New thread API call odp_thread_count_max() replaces the
preprocessor macro in the API. A macro is still used
internally.
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>
|
|
Use CPU cycle count API instead of time API to measure CPU
cycles.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
The -t command line argument specifies the length of time the application
should run before exiting, but this doesn't always work in queue mode as
the odp_schedule() call may not return if no packets are received.
Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Added new netmap pktio interface type which operates in the
same manner as the existing socket io interfaces. The code
is based on the odp-netmap branch.
Using netmap io requires netmap headers and loaded netmap
kernel module. Netmap can be installed from
https://github.com/luigirizzo/netmap. ODP netmap support is
enabled using --with-netmap-path=<netmap_dir> configuration
option.
If netmap kernel module is loaded when starting ODP
application netmap io will be used by default. If the module
is not found standard socket io is used. Netmap io can be
disabled with ODP_PKTIO_DISABLE_NETMAP environment variable.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-and-tested by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
When running l2fwd in a VM using SR-IOV the host may drop
packets if the source MAC address is not the same as that
of the VF NIC. Modify test application so that the source
MAC address is always filled correctly.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
The direct comparing of "cur_cycles" and "next_tx_cycles" is not
valid, as "next_tx_cycles" can be overflowed and comparison will
give wrong result. So use odp_time_diff_cycles() for that, as it
takes into account ticks overflow.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
The direct comparing of "cur_cycles" and "end_cycles" is not valid,
as "end_cycles" can be overflowed and comparison will give wrong
result. So use odp_time_diff_cycles() for that, as it takes in
account cycles overflow.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
l2fwd expects bunch of packets to be routed,
test if number of packets less then 100, and report
error to make check and mark test as failed.
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Remove several annoying initializations.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
After open pktio remains stopped. Inside worker thread (after all
configuration done it should be started.) In that patch I just start
it everywhere to keep original logic and be easy for review. Putting
it inside worker threads will require thread arguments change and
understanding logic of current app. It's better to do further changes
in separate patches per app.
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
|
|
Makes it possible to run make check from the tar source.
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Reviewed-and-tested-by: Mike Holmes <mike.holmes@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
|
|
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-and-Tested-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
|
|
Usually odp_generator exists when veth is destroyed, but not
always. Because cpu load impacts on other performance tests
we have to be sure that odp_generator is not running in background.
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Mike Holmes <mike.holmes@linaro.org>
|
|
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Conflicts:
example/timer/odp_timer_test.c
|
|
It's needed as pktio is not set in promisc mode.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Add a barrier between main and worker threads to be sure
worker statistics are initialized
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
The linux specific helper was replaced by default cpumask
calls (odp_cpumask_def_worker()) in the cpumask API.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Christophe Milard <christophe.milard@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Conflicts:
helper/linux.c
|
|
User needs to select the thread type (worker or control) of
the initialized thread. Implementation may reserve HW direct access
only to worker threads, while control threads share HW access, etc.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Conflicts:
helper/linux.c
|
|
That commit:
fd855d7 Merge branch 'master' into api-next
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Mike Holmes <mike.holmes@linaro.org>
|
|
This patch removes the 2nd parameter to odp_pool_create() because it has two
major issues:
1. Applications have no way to know how big a shm area is required for a given
pool since that information is implementation specific. So there's no portable
means of using this parameter.
2. Some implementations (e.g., odp-dpdk) cannot accept an external memory area
for pool creation since they need to control the memory themselves.
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>
Conflicts:
test/validation/pktio/pktio.c
test/validation/pool/pool.c
helper/test/odp_chksum.c
|
|
|
|
odp_pktio_send() can return -1 error and that return code
can be used as array index in code bellow. On error just
increase drop counter and free packets.
https://bugs.linaro.org/show_bug.cgi?id=1688
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofe@linaro.org>
|
|
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Conflicts:
include/odp/api/packet_io.h
platform/linux-generic/include/odp_packet_io_internal.h
platform/linux-generic/odp_packet_io.c
|
|
Unsent packet has to be released. If the event type is obvious from the
context, use directly the relevant release functions, otherwise
odp_event(free).
Wider error handling is attempted, but this patch can't fix all the flaws
in the many calling functions of odp_queue_enq()
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|
|
|
|
Unsent packet has to be released. If the event type is obvious from the
context, use directly the relevant release functions, otherwise
odp_event_free().
Wider error handling is attempted, but this patch can't fix all the flaws
in the many calling functions of odp_queue_enq()
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
|