aboutsummaryrefslogtreecommitdiff
path: root/helper
AgeCommit message (Collapse)Author
2017-01-12helper: cuckootable: add missing return codesMaxim Uvarov
add missing return codes for non void functions. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
2017-01-12api: byteorder: avoid bitfield order doxygen omissionsBill Fischofer
Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2402 by assigning explicit values to ODP_LITTLE_ENDIAN_BITFIELD and ODP_BIT_ENDIAN_BITFIELD to avoid Doxygen warnings. This makes these consistent with the usage for ODP_BIG_ENDIAN and ODP_LITTLE_ENDIAN. Also define the summary variable ODP_BITFIELD_ORDER which can be used similar to ODP_BYTE_ORDER for an explicit test of bitfield endianness. Note that this requires tests of these fields to change from #ifdef to #if. 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>
2017-01-12helper: test: gitignore add iplookuptableChristophe Milard
Obviously a miss from commit: c4aefb88d31452b3add8cf16f9eef152525c3e93 Signed-off-by: Christophe Milard <christophe.milard@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2017-01-12helper: test: add validation test of ip lookup tableRu Jia
Signed-off-by: Ru Jia <jiaru@ict.ac.cn> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2017-01-12helper: table: add impl of ip lookup tableRu Jia
This is an implementation of the 16,8,8 ip lookup (longest prefix matching) algorithm. The key of the table is 32-bit IPv4 address. Signed-off-by: Ru Jia <jiaru@ict.ac.cn> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2017-01-12helper: test: add test of cuckoo hash tableRu Jia
This test program consists of basic validation tests and performance tests. Signed-off-by: Ru Jia <jiaru@ict.ac.cn> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2017-01-12helper: table: add impl of cuckoo hash tableRu Jia
Signed-off-by: Ru Jia <jiaru@ict.ac.cn> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2017-01-09helper: fix odph_ipv4_csum functions for L3 offset 0Joe Savage
Fix a bug where odph_ipv4_csum_{valid, update} would interpret an L3 offset of zero as a sign that the packet has no L3 offset. Signed-off-by: Joe Savage <joe.savage@arm.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-12-29helper: do not break odp_term_global protocolStanislaw Kardach
As per API documentation, odp_term_global() should be a final ODP call when terminating the ODP application in a controlled way. Therefore ODP threads or sub-processes created using ODP helper API should not call this function but leave it to the main application thread/process. Signed-off-by: Stanislaw Kardach <kda@semihalf.com> Reviewed-by: Christophe Milard <christophe.milard@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-12-09helper: remove unused variableMike Holmes
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-10-26fix out of tree buildMaxim Uvarov
Commit: eebd6b0 configure: the version cannot use a script Did generation of version.h which is done in $dest_dir. Includes paths have to be corrected accordingly. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-and tested-by: Mike Holmes <mike.holmes@linaro.org>
2016-09-07linux-generic: configure: add conditional shared library supportBill Fischofer
Add support for the --enable-shared=[yes|no] configure options. --enable-shared=yes is the default and results in suppressing the use of inlines for ODP API functions to enhance ABI compatibility at potentially some performance cost. When --enable-shared=no is specified, inlines are allowed to boost performance at the possible loss of ABI compatibility. This patch addresses Bug https://bugs.linaro.org/show_bug.cgi?id=2490 Note: This patch is a port of the corresponding enhancements made to odp-dpdk with a few changes, mainly that inlines are now part of the odp/api/plat directory, and all ODP APIs are now treated uniformly with regard to whether inlining is permitted. Suggested-by: Zoltan Kiss <zoltan.kiss@linaro.org> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Balakrishna Garapati <balakrishna.garapati@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-08-02helper: fixing helper prefix in chksum.cKhalil Blaiech
Add odph_ prefix to udp_or_tcp_hdr_t and rename structure odph_l4_hdr_t. Signed-off-by: Khalil Blaiech <kblaiech@mellanox.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-07-15helper/test/Makefile: don't install testsAnders Roxell
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>
2016-07-05linux-gen: std_types: remove extra c headersPetri Savolainen
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>
2016-07-01configure: split up libodphelper SO-version from libodpAnders Roxell
The libodphelper and libopd need to track their evolving ABI independently and so there needs to be two separate version numbers. 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-06-15helper: linux: correct pthread join retval checkPetri Savolainen
Helper defines that pthread exit status is NULL on error, but checks for != NULL. Both NULL and !NULL were returned on failure. Defined that both process and pthread return !0 (!NULL) on failure. 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-06-09helper: chksum: fix type casting for C++ includeOriol Arcas
Helper's chksum.h had a void* to uint16_t* casting, which is not legal in C++ (Clang and GCC). Signed-off-by: Oriol Arcas <oriol@starflownetworks.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-05-27helper: linux: odp thread cpu affinity APIsYi He
Provide helper APIs to set and get cpu affinity in ODP threads, and set cpu affinity to the 1st available control cpu for all odp test/validation programs in odp_cunit_common library. Signed-off-by: Yi He <yi.he@linaro.org> Reviewed-by: Christophe Milard <christophe.milard@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-05-24helper: fix doxygen comments for odpthread creation parametersChristophe Milard
Signed-off-by: Christophe Milard <christophe.milard@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-05-23helper/test: add missing scripts to EXTRA_DISTAnders Roxell
Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-05-23helper: test: adding odpthread functions testsChristophe Milard
Simple tests testing odph_odpthreads_create() and odph_odpthreads_join() are added. A single test binary, odpthreads, is added. This program creates odp threads as pthreads or linux processes, dependng on its calling args. Two calling scripts are added to create ODP threads as either processes, or threads. Signed-off-by: Christophe Milard <christophe.milard@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Brian Brooks <brian.brooks@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-05-23helpers: linux: creating functions to handle odpthreadsChristophe Milard
odph_linux_pthread_t and odph_linux_process_t are joined, creating odph_odpthread_t. Tests should be using the latter only so that the actual implementation of the ODP thread don't leak in the test itself. (odph_odpthread_t is opaque to the test, and is common to both thread and process omplementation of ODP threads) Two functions, odph_odpthreads_create and odph_odpthreads_join are then created to create and termindate odp threads. These functions create the odp threads either as linux processes or as linux threads, depending on the command line arguments (flag odph_proc for processes). Signed-off-by: Christophe Milard <christophe.milard@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Brian Brooks <brian.brooks@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-05-23helpers: adding command line argument parsingChristophe Milard
A function (odph_merge_getopt_options()) to merge command line arguments is added. This function can be called by intermediate clients (e.g c_unit_common) before calling odph_parse_options(). The new function, odph_parse_options() is also added to parse options meant for the helpers out of a the command line. This parse function picks up options altering the behaviour of the helpers out of the command line, and also checks for unknown options (i.e. options not belonging to the caller set of options or to the helpers.) No helper options are definied (yet). Signed-off-by: Christophe Milard <christophe.milard@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Brian Brooks <brian.brooks@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-05-10helper: add chksum documentation sectionMike Holmes
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
2016-05-10helper: add strong types documentation sectionMike Holmes
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
2016-05-10helper: add linux documentation sectionMike Holmes
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
2016-05-03helper: chksum add ipv3 and udp fieldsMaxim Uvarov
Chksum routines updated to serarch l4 and udp flags set in the packets. Because there is syntetic allocated packet we need also set required bits. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
2016-04-29helper: add a more complete and correct checksum implementationBarry Spinney
This patch adds a file called chksum.c which implements a complete TCP/UDP over either IPv4 or IPV6 checksum generation / verification capability. In addition it can deal with any form of packet segmentation including tiny segments, segments not aligned to a 2 byte boundary, etc. Signed-off-by: Barry Spinney <spinney@mellanox.com> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-04-29linux-generic: packet: fix number of parsing bugs, some vlan_hdr_t relatedBarry Spinney
This patch fixes a bug in parse_ipv6 caused because the IPv6 payload length does not include the IPv6 header and a bug in parse_udp where l4_offset was subtracted from l3_offset instead of the other way around. Also fixed some bugs related to incorrect vlan_hdr_t. The corrected vlan header then required some fixes to odp_classification.c and the classifier validation test code. Also added ODPH_IPV6ADDR_LEN. Finally made a number of cosmetic changes to satisfy checkpatch. Signed-off-by: Barry Spinney <spinney@mellanox.com> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-04-27api: config: replace pool config with pool capabilityPetri Savolainen
Removed pool configuration API from config.h and moved to use pool capability API instead. Removed entire all config validation tests, since all config APIs will move to various capability APIs. 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-25api: packet: rename and add copy functionsPetri Savolainen
Added packet copy functions: * partial packet copy * data copy data from another packet * data copy within packet * data move within packet (allow overlap) Renamed copydata_in and _out functions, so that "to/from memory" functions are clearly distinctive from the new packet copy functions. 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-04-22helper: add VLANHDR and IP_TOS constantsBarry Spinney
Signed-off-by: Barry Spinney <spinney@mellanox.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-04-15api: debug: promote ODP_STATIC_ASSERT() to be an ODP APIBill Fischofer
Convert the formerly internal _ODP_STATIC_ASSERT() macro to be a full ODP API named ODP_STATIC_ASSERT(). This provides a wrapper around any platform-specific compile-time assertion macro. 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-04-11api: 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-03-30configure: move test_helper 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-29helper/Makefile: add SO-version to helper libAnders Roxell
Packaging require a shared object version number. For now make it the same as libodp. 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 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-04helpers: remove odp_ prefix for tests source filesMaxim Uvarov
Prefixed were removed for validation test suite and to be consistent we need to do the same for helpers. 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-03tests: use parse mac and ip address helpersPetri Savolainen
Convert some of the examples and tests to use MAC and IPv4 address parse functions instead of implementing those multiple times. There are still some examples to convert, but those would require a bit more effort. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Juha-Matti Tilli <juha-matti.tilli@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-03helper: remove odp_ definitionsPetri Savolainen
Many helper files included ODP internal headers and defined types or functions with odp_ prefix. A helper can be consider as part of application - from ODP headers it may include only odp.h and it must not define anything with odp_ prefix. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Juha-Matti Tilli <juha-matti.tilli@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-03helper: ip: added ipv4 address parsePetri Savolainen
IPv4 address parse function is commonly needed by test applications. A common parse function harmonizes the definition IPv4 address as a command line parameter. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Juha-Matti Tilli <juha-matti.tilli@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-03-03helper: eth: added mac address parsePetri Savolainen
Ethernet MAC address parse function is commonly needed by test applications. A common parse function harmonizes the definition of MAC address as a command line parameter. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Juha-Matti Tilli <juha-matti.tilli@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-02-18helper: remove ring codeMaxim Uvarov
Remove ring and dead api-next code. In api-next pktio ipc patches moved ring code to linux-generic and updated that test case to the latest odp api. If we ipc pktio will be accepted to master than current api-next ring test will be used. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by Mike Holmes <mike.holmes@linaro.org>
2016-02-16helper: linux: remove unnecessary cpumask copyPetri Savolainen
Copies are redundant since cpumask APIs are defined with const specifier. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-02-16helper: linux: correct cpumask usagePetri Savolainen
Use Linux cpu_set_t instead of odp_cpumask_t when passing cpus to Linux system calls. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-02-08api: endian: rename endian types with odp_ prefixChristophe Milard
The following types: uint16le_t, uint16be_t, uint32le_t, uint32be_t, uint64le_t, uint64be_t, uint16sum_t, uint32sum_t defined in the api and in platform/linux-generic/include/odp/plat/byteorder_types.h were not odp_* prefixed and could create name clash with an applications. This patch prefixes those with odp_*, suppressing "int" for shortness. e.g. uint16le_t becomes odp_u16le_t Also modifies files using these types, of course. Signed-off-by: Christophe Milard <christophe.milard@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2016-02-08helper: deleted odph_pausePetri Savolainen
Deleted odph_pause() and replaced usage with odp_cpu_pause() calls. 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>