aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2016-04-21validation: rwlock: add tests for new trylock rwlock and rwlock_recursive apisBill Fischofer
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-04-21test: allow more than one control cpuGary S. Robertson
A second issue was discovered in the validation test code after fixing bug 2027 and creating default cpumasks containing all installed CPUs. See Linaro BUG 2027 for details. https://bugs.linaro.org/show_bug.cgi?id=2027 The cpumask validation test expected exactly one control CPU and returned an error otherwise. This change considers one or more control CPUs to be correct. Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-04-21test: correct worker count calculationGary S. Robertson
During the process of addressing Linaro BUG 2027 which relates to inaccurate reporting of available CPUs by ODP linux-generic when running atop a kernel compiled with NO_HZ_FULL support, a number of instances were encountered in the validation and performance test software where incorrect methods were used to determine the proper (or maximum) number of worker threads to create. See Linaro BUG 2027 for details. https://bugs.linaro.org/show_bug.cgi?id=2027 The use of odp_cpu_count() for this purpose is incorrect and deprecated... odp_cpumask_default_worker() should always be used to determine the set and number of CPUs available for creating worker threads. The use of odp_cpu_count() for this purpose in conjunction with the correct means of determining available CPUs resulted in some tests hanging in calls to odp_barrier_wait() as the barriers were initialized to expect threads on ALL CPUs rather than on worker CPUs alone... and there were too few worker threads created to satisfy the barriers. The changes below correct all instances I could find of this deprecated technique and allowed all tests to complete successfully with the BUG 2027 patch applied. (BTW they also run correctly without that patch after the application of the modifications included here.) Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-04-21api: init: add instance handlePetri Savolainen
Added opaque odp_instance_t handle for storing ODP instance ID. Global init generates instance ID which is used to identify an ODP instance in the system. Instance ID allows to launch multiple separate ODP applications (without name space clash). Application threads define in odp_init_local() call which instance they join. Simultaneously, a thread may belong to only single instance and thus odp_term_local() call does not need instance handle parameter. Currently, linux-generic implementation supports only single instance. Linux helper pthread and process create APIs were updated with instance handle through a new type (odph_linux_thr_param_t). Process API calls were missing thread type selection. A params type decreases number of parameters needed (from 6 to 3 for pthreads) and reduces need for future function prototype changes (if e.g. new parameters need to be added). 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-04-20validation: time: shorten test durationPetri Savolainen
Time test duration was almost a minute on a 2.6GHz CPU. Combined local and global time monotonity tests, so that the there is only single run of the long wait loop. Shortened wait test time to 3 seconds and long loop into roughly 14 seconds on a 2.6GHz CPU. There should be enough head room to keep loop duration over 4 seconds even with higher CPU frequencies. 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>
2016-04-18validation: scheduler: correct pause/resume sequenceIvan Khoronzhuk
When test for single thread is finished the following test for many threads can be started, and for some implementations can happen that future one event can arrive to main thread, as it was requested in previous test. As result one event can be lost for rest threads. So, it's better to pause scheduling for main thread when it doesn't participate in the multi-threaded test. Also move pause/resume test closer to beginning, because it's used in tests before. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-04-12test: performance: Avoid possible out-of-bounds memory accessBalakrishna Garapati
Resolving https://bugs.linaro.org/show_bug.cgi?id=2136 by initializing definite number of worker threads. Signed-off-by: Balakrishna Garapati <balakrishna.garapati@linaro.org> Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-04-07validation: configure: move cflags guards to test/m4Maxim Uvarov
Move cflags guards to test/m4 to fix cunit library search. This fixes build failure with --with-cunit-path= option. https://bugs.linaro.org/show_bug.cgi?id=2161 Reported-by: Brian Brooks <brian.brooks@linaro.org> Suggested-by: Anders Roxell <anders.roxell@linaro.org> Reviewed-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-04-06validation: pktio: fix statistics testMatias Elo
Stop trying to schedule new packets if all sent packets have already been received. Signed-off-by: Matias Elo <matias.elo@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-31test: run only memcheckMike Holmes
valgrind can run many tools, however they tend to result in the code never passing currently, start out stabilizing the results for the memory leek checking first and add more tools later. Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-30configure: move test_vald to its own m4 fileAnders Roxell
Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Tested-and-reviewed-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-30configure: move test_cpp to its own m4 fileAnders Roxell
Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Tested-and-reviewed-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-30configure: move test_perf to its own m4 fileAnders Roxell
Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Tested-and-reviewed-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-29rename libodphelper to libodphelper-linuxAnders Roxell
Rename to unify the library names for different implementations. Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Reviewed-by: Ricardo Salveti <ricardo.salveti@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-29rename libodp to libodp-linuxAnders Roxell
Rename to unify the library names for different implementations. Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Reviewed-by: Ricardo Salveti <ricardo.salveti@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-28test:performance:initialize undefined valuesBalakrishna Garapati
Signed-off-by: Balakrishna Garapati <balakrishna.garapati@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-28test:performance:add break statement to switch(opt)Balakrishna Garapati
Signed-off-by: Balakrishna Garapati <balakrishna.garapati@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-22validation: timer: don't access non-existing timersZoltan Kiss
Since e5c85d3f "validation: timer: handle early exhaustion of pool" the workers can handle if object caches retain packets, but with enough threads it can happen that a late starting thread won't be able to allocate any. This for loop should take that into account and not trying to access tt[0].ev. Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-22validation: pktio: add more debug log to pktio_pkt_seq()Zoltan Kiss
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-18validation: timer: replace %d by PRIu32Nicolas Morey-Chaisemartin
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-18performance: scheduling: cleanly destroy resourcesMaxim Uvarov
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
2016-03-18test: l2fwd: change destination mac addresses by defaultMatias Elo
With the previous default settings only the source addresses of forwarded packets were changed. This caused forwarded packets' destination and source addresses being the same when only one interface was used. Fix this by changing the destination mac addresses by default. This change has negligible effect to throughput performance. 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>
2016-03-15validation: performance: remove deprecated odp_atomic testsMatias Elo
Removed deprecated odp_atomic performance tests. Valid tests are located in test/validation/atomic/atomic.c. 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>
2016-03-04validation: classification: add test case for odp_cos_drop() functionBalasubramanian Manoharan
Fixes: https://bugs.linaro.org/show_bug.cgi?id=2016 Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-by: Mike Holmes <Mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-04validation: tm: miscellaneous cleanup and fixes for tm cunit testsBill Fischofer
Add missing odp_pktin/out_queue_config() calls for interfaces and streamline link status processing to enable the TM Cunit test to run properly with the latest PktIO changes. 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>
2016-03-04validation: tm: fix arm compilationMaxim Uvarov
traffic_mngr.c: In function 'test_shaper_bw': traffic_mngr.c:1635:5: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint64_t' [-Werror=format=] expected_rcv_gap_us, min_rcv_gap, max_rcv_gap); Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-04validation: tm: add cunit test for traffic mngrBarry 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-03-04validation: pktio: fix type on defining pktiout modeMaxim Uvarov
pktio.c:562:31: error: implicit conversion from enumeration type 'enum odp_pktout_mode_t' to different enumeration type 'odp_pktin_mode_t' (aka 'enum odp_pktin_mode_t') [-Werror,-Wenum-conversion] odp_pktin_mode_t out_mode = ODP_PKTOUT_MODE_DIRECT; Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
2016-03-04test: l2fwd: add event queue packet outputPetri Savolainen
Added packet output mode selection and support for event queue mode. Direct mode is still the default. 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-03-04validation: pktio: add output event queue testsPetri Savolainen
Added validation test cases for packet output through event queues (ODP_PKTOUT_MODE_QUEUE). 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-03-04validation: pktio: replace pktio_test_jumbo() with pktio_test_recv_mtu()Matias Elo
One should not try to send larger than MTU sized packets and expect the operation to succeed. Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Matias Elo <matias.elo@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-04validation: pktio: set packet mac addresses and checksum in statistics testMatias Elo
Set test packets' mac addresses and checksums in pktio_test_statistics_counters() to enable testing with real world interfaces. Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Matias Elo <matias.elo@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-04validation: pktio: check if configuring promisc mode is supported before testingMatias Elo
Test if configuring promisc mode is supported by the interface before running tests. Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Matias Elo <matias.elo@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-04performance: crypto: add odp_crypto to .gitignore fileBill Fischofer
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-04api: pktio: rename pktio_send_queue to pktout_sendPetri Savolainen
Now when old API has been removed, the new queue based send function name can be shortened. Used prefix odp_pktout since output queue type is odp_pktout_queue_t and all other API calls related to output queues are prefixed with odp_pktout_queue (not odp_pktio_). Renamed: odp_pktio_send_queue() => odp_pktout_send() 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-03-04api: pktio: rename pktio_recv_queue to pktin_recvPetri Savolainen
Now when old API has been removed, the new queue based recv function name can be shortened. Used prefix odp_pktin since input queue type is odp_pktin_queue_t and all other API calls related to input queues are prefixed with odp_pktin_queue (not odp_pktio_). Renamed: odp_pktio_recv_queue() => odp_pktin_recv() 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-03-04validation: pktio: port to use new pktio apiPetri Savolainen
Ported the test from old single queue pktio API to the new API. 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-03-04validataion: packet: add tests for broadcast and multicast flagsBill 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>
2016-03-04test: performance: crypto: measure crypto operation performanceAlexandru Badicioiu
Measures the time required to launch and get the result of ODP crypto operations in async and sync API mode with configurable payload size, crypto algorithms and iteration number. Both asynchronous scheduled and polled are supported. In scheduled mode a separate worker thread is used to get the crypto completion events. Output packet can be reused as the input of the next operation or a new packet can be allocated for each operation. Based on a previous work : https://lists.linaro.org/pipermail/lng-odp/2014-September/003251.html. Signed-off-by: Alexandru Badicioiu <alexandru.badicioiu@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-04api: pktio: changed odp_pktio_mtu() return value to uint32_tMatias Elo
C specification defines minimum int size to be 16 bits, which would lead to maximum MTU value of 32767. This may not be enough for some link layers (e.g. ATM, virtual interfaces). Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Matias Elo <matias.elo@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-04validation: pktio: assign MAC address if one loop pktio is usedIvan Khoronzhuk
In case of one loop pktio the MAC address is not set in the packets but should be. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-04validation: classifier: port to use new pktio apiPetri Savolainen
Ported the test from old single queue pktio API to the new API. 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-03-04test: pktio_perf: finalize port to use new pktio apiPetri Savolainen
Port packet transmit side to use the new API. This was missing from the original pktio_perf port patch. 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-03-04test: l2fwd: utilize pktio param defaultsPetri Savolainen
Simplify pktio param setup by utilizing default values. 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-03-04test: pktio_perf: port to use new pktio apiPetri Savolainen
Ported odp_pktio_perf test from old single queue pktio API to the new API. To minimize porting effort, configured to use only single queue (default config). 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-03-04test: l2fwd: add option to give destination MACJuha-Matti Tilli
Added option (--dst_addr or -r) to l2fwd that allows the user to specify what destination MAC addresses to use per port. The MAC addresses are separated by commas and the number of MAC addresses, if given, must be equal to the number of interfaces. This makes it much easier to test l2fwd with TRex, which wants you to have the MAC address of the destination interface. Signed-off-by: Juha-Matti Tilli <juha-matti.tilli@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-04api: move include/odp.h to include/odp_api.hChristophe Milard
odp.h actually describes the applicatiion interface of ODP and is logicaly moved to odp_api.h. Applications now includes <odp_api.h>. This simplifies the addition of other ODP interfaces (e.g. drivers may include odp_drv.h in the future.) 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>
2016-03-04api 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>
2016-03-03api/linux-generic/example: classification: add pmr create apiBalasubramanian Manoharan
Packet match rule creation is modified to include source and destination class of service. Removes the ability to add any class of service directly with pktio. If a PMR needs to be applied at the pktio level the same should be applied to default class of service. Packet match rule destroy function is updated to removes the link between the source and destination class of service. odp_pmr_match_set_t handle is removed and pmr create function is modified to take number of terms and composite rule is created by providing more than one term. Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-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-03-03linux-generic: version: added implementation name stringPetri Savolainen
Added missing implementation of implementation name string and call it from validation tests and couple of other apps. 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>