aboutsummaryrefslogtreecommitdiff
path: root/helper
AgeCommit message (Collapse)Author
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>
2016-02-08linux-generic: cpu: implemented pausePetri Savolainen
Implemented pause as an inline function in a cpu arch dependent header file. 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> Conflicts: platform/linux-generic/Makefile.am
2016-01-11helper: fix UDP checksum computationGrigore Ion
This patch fixes the following problems: - checksum computation for LE platforms - checksum computation for packets having the UDP length not a multiple of 2 - checksum computation in the test and the example applications Signed-off-by: Grigore Ion <ion.grigore@freescale.com> Reviewed-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-16helper: linux: add thread type in pthread_createHemant Agrawal
The exisiting helper routine only create the worker threads. However there is a need to use the same for creating the control thread as well. e.g. CLI thread. Signed-off-by: Hemant Agrawal <Hemant@freescale.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-07Revert "helper : Fix UDP checksum computation"Maxim Uvarov
This reverts commit 0043ff8f7dd86a0c1e143412ceb5a14c8ae9c727. Validation helper test fails. Revert root cause commit. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-07helper: fix strncpy in table supportMike Holmes
Fixes Bug 1905 - CID 154167: Calling strncpy with a maximum size argument of ODP_TABLE_NAME_LEN bytes on destination array tbl->name of size ODP_TABLE_NAME_LEN bytes might leave the destination string unterminated if the copied string is also of the maximum size ODP_TABLE_NAME_LEN. Make the copy leave one char for the null terminator. 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>
2015-12-07helper : Fix UDP checksum computationGrigore Ion
This patch fixes the following problems: - checksum computation for LE platforms - checksum is computed in the CPU endianness. The returned result must be converted to the BE ordering when it is used to update the UDP checksum in a packet. - checksum computation for packets having the UDP length not a multiple of 2. Signed-off-by: Grigore Ion <ion.grigore@freescale.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-12-03helper: unbind hash from platform strong typesMaxim Uvarov
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Tested-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
2015-12-03helper: strong types supportMaxim Uvarov
Add strong types support for helpers the same as we have for linux-generic. That should be useful for complex algorithms where type check is needed. Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Tested-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
2015-11-24remove hard platform linksMike Holmes
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> Reviewed-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-18helper: test: add odp_table to .gitignore fileBill Fischofer
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>
2015-11-18helper/lineartable.c: remove unused variableAnders Roxell
lineartable.c: In function 'odph_linear_table_lookup': lineartable.c:128:6: warning: unused variable 'idx' [-Wunused-variable] int idx; ^ Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Reviewed-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-18helper/hashtable.c: remove unused variableAnders Roxell
hashtable.c: In function 'odph_hash_table_create': hashtable.c:68:6: warning: unused variable 'idx' [-Wunused-variable] int idx, i; ^ hashtable.c: In function 'odph_hash_table_lookup': hashtable.c:151:6: warning: unused variable 'idx' [-Wunused-variable] int idx; ^ Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Reviewed-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-16helper: table: fix the doxygen warninghuanggaoyang
Signed-off-by: huanggaoyang <huanggaoyang1@huawei.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-13helper: table: fix the ci warninghuanggaoyang
Signed-off-by: huanggaoyang <huanggaoyang1@huawei.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-13helper: test: add a simple test case for hashtablehuanggaoyang
Signed-off-by: huanggaoyang <huanggaoyang1@huawei.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-13helper: add the new source files to Makefilehuanggaoyang
Signed-off-by: huanggaoyang <huanggaoyang1@huawei.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-13helper: table: add impl of lineartablehuanggaoyang
Signed-off-by: huanggaoyang <huanggaoyang1@huawei.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-13helper: table: add impl of hashtablehuanggaoyang
Signed-off-by: huanggaoyang <huanggaoyang1@huawei.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-13helper: add table apihuanggaoyang
Signed-off-by: huanggaoyang <huanggaoyang1@huawei.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-05helper: linux: checkpatch cleaning for helper/linux.cCarl Wallen
Cleaned helper/linux.c from any further old checkpatch errors. Signed-off-by: Carl Wallen <carl.wallen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-05helper: linux: examine the cause for child process terminationCarl Wallen
odph_linux_process_wait_n(): This patch helps catch child abnormal termination by breaking out of the wait()-loop on error. Examine what caused a forked child process to terminate. Do not wait() for other children if the termination status indicates error in the child, return -1 instead. Children that are not waited for will be terminated by the SIGTERM signal once the parent exits (requested by the prctl(PR_SET_PDEATHSIG, SIGTERM) call after child fork) even if the parent does not perform any explicit clean-up actions. Signed-off-by: Carl Wallen <carl.wallen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-11-05helper: linux: request SIGTERM if parent process diesCarl Wallen
Request SIGTERM be sent to forked child processes if the parent process dies. Signed-off-by: Carl Wallen <carl.wallen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-10-27validation: classification: added additional suite to test individual PMRsBalasubramanian Manoharan
Additional test suite is added to classification validation suite to test individual PMRs. This suite will test the defined PMRs by configuring pktio separately for every test case. Fixes: https://bugs.linaro.org/show_bug.cgi?id=1542 https://bugs.linaro.org/show_bug.cgi?id=1544 https://bugs.linaro.org/show_bug.cgi?id=1545 https://bugs.linaro.org/show_bug.cgi?id=1546 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> Conflicts: test/validation/classification/odp_classification_testsuites.h
2015-10-22api: rename odp_cpumask_def to _defaultMaxim Uvarov
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>
2015-08-11helper: fix installation path for includesNicolas Morey-Chaisemartin
Install path was broken when helper installation moved out of the platform side as they were install in the top includedir and not $(includedir)/odp/helper Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu> Reviewed-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
2015-07-27helper: test: chksum: catch errors in scan_ipMike Holmes
It is possible for scan_ip to return an error leaving the buf variable pointed to undefined. Check scan_ips return code. 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>
2015-07-27helper: linux: catch possible undefinedMike Holmes
It is possible that wait will return a valid pid but have failed to have set a status. Set a default status so that if this occurs the value will be known and not garbage. 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>