This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, api-next has been updated via 9fbdbe9a6a86705339858a906ea66f076cc66785 (commit) via b8867b0a5ea5eeb8b0b7a95e36025c95738f48b3 (commit) via 6ad530311e9cbd5fd77b958e78921e80fbbfa943 (commit) via aa3bbe4da1639ac4649c7d34ae75b0230ade70b2 (commit) via 022cf4a7136c7369ee5f29f5d245ac8d052135e6 (commit) via c87d5cc8d70e6e4291d18b101882ea2ddded236e (commit) via 7539b2f3ce69085518ca596fba0261a19247b2d8 (commit) via 1c0488456166888148bf191960691d076f5a9c2e (commit) via 10cd6d5e4294d3a35a366e564fbc57abde732e85 (commit) via 0a62e1c5b92a5170aa807cc8803f42698b23f4c8 (commit) via 62108ed367a2718e0f0e2d7d8682b5c83d504670 (commit) via 4afed247a6ee3058aa6dc3e66ed0bd5acff9ce97 (commit) via 25ed19ceb50d77614644f6d4a28a0b23dbf1e94f (commit) via 810fbc9420e23f55e9038410f7f9d6e593537ff3 (commit) via 04b0be7579f77821418c0c7c524950af6aeab6a6 (commit) via 6ccae3b2720a4ad84d3e50aa5851f64eb3d83b3c (commit) via dd494a2b6a22f0516ce8890df05de826377fdae2 (commit) via 0bd1a1cea75d3788c062933e635849c35a0c6099 (commit) via 94071c18d342614d16b0a14f16f85119563dd70d (commit) via 54593e175a71f5716aa50e5a03be8c30bc15c550 (commit) via 7df357dd591cce23f76221945091a019c0caa7ec (commit) via a51c171ebe9e9b0aaced13bc0956bdb38c8cfc7b (commit) via 0d6c0804640151f8aa9970cc74f1fef28a11fac1 (commit) via b17aeea11a9bac1f5d55463e81904af12c99b4c7 (commit) via ffabb755ea070ee33fd23a88d920b832da5521e1 (commit) via f603483a31d03e5647c409f8ce71d72ebaadd93b (commit) via 29889bf258fc52ae7c950c11eb17503883cff47e (commit) via 88ed645e7378b955c580ec2b8ce9b846a5fb48f0 (commit) via 722fd6f8286722d30d50c00769fa4fcad5935dd2 (commit) via bbabb79cfaf5e28ec9e804b95a23605038b39d39 (commit) via c14ec3dc896e0dd14d0491f09f81ce09e9d53bc2 (commit) via 50ebc616ddd9d05651923134d7bfaa02c103fbce (commit) via 1ff6b7a7e44e7d7376920f1e1ee81dbf28f95563 (commit) via c15da68b8dc3187c1929ff7d7705a0958856cbad (commit) via 16dd00616f73f7e49c53e4b0ea957ac789125b25 (commit) via a5609cc551f4bc71fb69746f3d6cafaf64b87fbf (commit) via 03aafc317489232bab7e9048f9bd96a24e6f598d (commit) via 19a457a86880a6bc33afe891a6204752bde70088 (commit) via 7025b1b430237cddc10a0338c7b120d23b7985a8 (commit) via 0f18e317ede15081828deca1ff61d65b72e12926 (commit) from 0b6dec84249c688b00c3044064ed6645aff696fb (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 9fbdbe9a6a86705339858a906ea66f076cc66785 Merge: 0b6dec8 b8867b0 Author: Maxim Uvarov maxim.uvarov@linaro.org Date: Tue Feb 7 17:35:24 2017 +0300
Merge branch 'master' into api-next
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --cc .travis.yml index a6f770c,5b9a29a..2fd7ef6 --- a/.travis.yml +++ b/.travis.yml @@@ -11,17 -13,52 +13,52 @@@ env global: # COVERITY_SCAN_TOKEN # ** specific to your project ** + # Note: + # You should have a github account and travis linked travis account. + # The secure key to be filled below is the 685 character long encrypted + # token you can find as follow from your coverity dashboard + # (at https://scan.coverity.com/dashboard): + # Click on the github project (<you>/odp) + # Click on "submit build" + # Click on "Configure Travis CI" + # Look at the COVERITY_SCAN_TOKEN in the env: global: section + # of the configuration example. + # copy the secure:<key> below + # - secure: "xxxx" + # + # By default Linaro CODECOV_TOKEN token is used. It's ok to use it to see + # for individual commit validation. But you you want to track tests history + # you need generated new one at https://codecov.io specific for your repo. + - CODECOV_TOKEN=8e1c0fd8-62ff-411e-a79f-5839f6662c11
- language: c - compiler: clang - sudo: required + matrix: + include: + - compiler: gcc-4.8 + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-4.8 + env: MY_CF="-O0 -coverage" MY_LDF="--coverage" DOCOV=1 + - compiler: clang + addons: + apt: + packages: + - clang
before_install: + - echo 1000 | sudo tee /proc/sys/vm/nr_hugepages + - sudo mkdir -p /mnt/huge + - sudo mount -t hugetlbfs nodev /mnt/huge + - sudo apt-get -qq update - - sudo apt-get install automake autoconf libtool libssl-dev graphviz mscgen doxygen + - sudo apt-get install automake autoconf libtool libssl-dev graphviz mscgen doxygen libconfig-dev - sudo apt-get install libpcap-dev linux-headers-`uname -r` + - sudo pip install coverage - gem install asciidoctor + - PATH=${PATH//:./node_modules/.bin/}
# Install cunit for the validation tests because distro version is too old and fails C99 compile - export CUNIT_VERSION=2.1-3 diff --cc platform/Makefile.inc index 57026d0,7059d91..874cf88 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@@ -61,19 -60,28 +61,41 @@@ odpapispecinclude_HEADERS = $(top_builddir)/include/odp/api/spec/version.h \ $(top_srcdir)/include/odp/api/spec/traffic_mngr.h
+odpdrvspecincludedir= $(includedir)/odp/drv/spec +odpdrvspecinclude_HEADERS = \ + $(top_srcdir)/include/odp/drv/spec/align.h \ + $(top_srcdir)/include/odp/drv/spec/atomic.h \ + $(top_srcdir)/include/odp/drv/spec/barrier.h \ + $(top_srcdir)/include/odp/drv/spec/byteorder.h \ + $(top_srcdir)/include/odp/drv/spec/compiler.h \ + $(top_srcdir)/include/odp/drv/spec/driver.h \ + $(top_srcdir)/include/odp/drv/spec/shm.h \ + $(top_srcdir)/include/odp/drv/spec/spinlock.h \ + $(top_srcdir)/include/odp/drv/spec/std_types.h \ + $(top_srcdir)/include/odp/drv/spec/sync.h + + odpapiabidefaultincludedir= $(includedir)/odp/arch/default/api/abi + odpapiabidefaultinclude_HEADERS = \ + $(top_srcdir)/include/odp/arch/default/api/abi/buffer.h \ + $(top_srcdir)/include/odp/arch/default/api/abi/classification.h \ + $(top_srcdir)/include/odp/arch/default/api/abi/crypto.h \ + $(top_srcdir)/include/odp/arch/default/api/abi/event.h \ + $(top_srcdir)/include/odp/arch/default/api/abi/packet.h \ + $(top_srcdir)/include/odp/arch/default/api/abi/pool.h \ + $(top_srcdir)/include/odp/arch/default/api/abi/queue.h \ + $(top_srcdir)/include/odp/arch/default/api/abi/shared_memory.h + + odpapiabiarchincludedir= $(includedir)/odp/arch/@ARCH_ABI@/odp/api/abi + odpapiabiarchinclude_HEADERS = \ + $(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/buffer.h \ + $(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/classification.h \ + $(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/crypto.h \ + $(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/event.h \ + $(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/packet.h \ + $(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/pool.h \ + $(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/queue.h \ + $(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/shared_memory.h + EXTRA_DIST = \ arch/arm/odp/api/cpu_arch.h \ arch/arm/odp_cpu_arch.c \ diff --cc platform/linux-generic/Makefile.am index 90024bd,576fedf..66ff53d --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@@ -6,9 -6,9 +6,10 @@@ include $(top_srcdir)/platform/@with_pl
AM_CFLAGS += -I$(srcdir)/include AM_CFLAGS += -I$(top_srcdir)/include + AM_CFLAGS += -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ AM_CFLAGS += -I$(top_builddir)/include AM_CFLAGS += -Iinclude +AM_CFLAGS += -DSYSCONFDIR="@sysconfdir@"
include_HEADERS = \ $(top_srcdir)/include/odp.h \ diff --cc platform/linux-generic/_ishmpool.c index df6e49e,0000000..064d78e mode 100644,000000..100644 --- a/platform/linux-generic/_ishmpool.c +++ b/platform/linux-generic/_ishmpool.c @@@ -1,811 -1,0 +1,807 @@@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* This file gathers the buddy and slab allocation functionality provided + * by _ishm. + * _odp_ishmpool_create() can be used to create a pool for buddy/slab + * allocation. _odp_ishmpool_create() will allocate a memory area using + * ishm_reserve() for both the control part (needed for tracking + * allocation/free...) and the user memory itself (part of which will be given + * at each ishmpool_alloc()). + * The element size provided at pool creation time determines whether + * to pool will of type buddy or slab. + * For buddy, all allocations are rounded to the nearest power of 2. + * + * The implementation of the buddy allocator is very traditional: it + * maintains N lists of free buffers. + * The control part actually contains these N queue heads, (N-M are actually + * used), the free buffers themselves being used for chaining (the chaining info + * is in the buffers: as they are "free" they should not be touched by the + * user). The control part also contains a array of bytes for remembering + * the size (actually the order) of the allocated buffers: + * There are 2^(N-M) such bytes, this number being the maximum number of + * allocated buffers (when all allocation are <= 2^M bytes) + * Buddy allocators handle fragmentation by splitting or merging blocks by 2. + * They guarantee a minimum efficiency of 50%, at worse case fragmentation. + * + * Slab implementation is even simpler, all free elements being queued in + * one single queue at init, taken from this queue when allocated and + * returned to this same queue when freed. + * + * The reason for not using malloc() is that malloc does not guarantee + * memory sharability between ODP threads (regardless of their implememtation) + * which ishm_reserve() can do. see the comments around + * _odp_ishmbud_pool_create() and ishm_reserve() for more details. + * + * This file is divided in 3 sections: the first one regroups functions + * needed by the buddy allocation. + * The second one regroups the functions needed by the slab allocator. + * The third section regroups the common functions exported externally. + */ + +#include <odp_posix_extensions.h> +#include <odp_internal.h> +#include <odp/api/spinlock.h> +#include <odp/api/align.h> +#include <odp/api/debug.h> +#include <odp/drv/shm.h> +#include <odp_shm_internal.h> +#include <odp_debug_internal.h> +#include <odp_align_internal.h> +#include <_ishm_internal.h> +#include <_ishmpool_internal.h> +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <inttypes.h> + +#define BUDDY_MIN_SIZE 32 /* minimal buddy allocation size */ + +typedef _odp_ishm_pool_t pool_t; /* for shorter writing */ + +/* array of ishm block index used for pools. only used for pool + * lookup by name */ +#define MAX_NB_POOL 100 +static int pool_blk_idx[MAX_NB_POOL]; + +/* section 1: functions for buddy allocation: */ + +/* free buddy blocks contains the following structure, used to link the + * free blocks together. + */ +typedef struct bblock_t { + struct bblock_t *next; + uint32_t order; +} bblock_t; + +/* value set in the 'order' table when the block is not allocated: */ +#define BBLOCK_FREE 0 + +/* compute ceil(log2(size)) */ +static uint8_t clog2(uint64_t size) +{ + uint64_t sz; + uint32_t bit; + uint8_t res; + + sz = size; /* we start by computing res = log2(sz)... */ + res = 0; + for (bit = 32; bit ; bit >>= 1) { + if (sz >= ((uint64_t)1 << bit)) { + sz >>= bit; + res += bit; + } + } + if (((uint64_t)1 << res) < size) /* ...and then ceil(x) */ + res++; + + return res; +} + +/* + * given a bblock address, and an order value, returns the address + * of the buddy bblock (the other "half") + */ +static inline bblock_t *get_bblock_buddy(pool_t *bpool, bblock_t *addr, + uint8_t order) +{ + uintptr_t b; + + b = ((uintptr_t)addr - (uintptr_t)bpool->ctrl.user_addr); + b ^= 1 << order; + return (void *)(b + (uintptr_t)bpool->ctrl.user_addr); +} + +/* + * given a buddy block address, return its number (used for busy flags): + */ +static inline uintptr_t get_bblock_nr(pool_t *bpool, void *addr) +{ + uintptr_t b; + uint8_t min_order; + + min_order = bpool->ctrl.min_order; + b = ((uintptr_t)addr - (uintptr_t)bpool->ctrl.user_addr) >> min_order; + return b; +} + +/* remove bblock from the list for bblocks of rank order. The bblock to be + * removed is really expected to be on the list: not finding it is an error */ +static inline void remove_from_list(pool_t *bpool, uint8_t order, + bblock_t *bblock) +{ + bblock_t *curr; /* current bblock (when parsing list) */ + bblock_t *prev; /* previous bblock (when parsing list) */ + + curr = bpool->ctrl.free_heads[order]; + if (!curr) + goto remove_from_list_error; + + if (curr == bblock) { + bpool->ctrl.free_heads[order] = curr->next; + return; + } + + while (curr) { + if (curr == bblock) { + prev->next = curr->next; + return; + } + prev = curr; + curr = curr->next; + } + +remove_from_list_error: + ODP_ERR("List corrupted\n"); +} + +/* + * create a buddy memory pool of given size (actually nearest power of 2), + * where allocation will never be smaller than min_alloc. + * returns a pointer to the created buddy_pool + * The allocated area contains: + * - The _odp_ishm_pool_ctrl_t structure + * - The array of ((order - min_order) of free list heads + * - The array of 'order' values, remembering sizes of allocated bblocks + * - alignment to cache line + * - The user memory + */ +static pool_t *_odp_ishmbud_pool_create(const char *pool_name, int store_idx, + uint64_t size, + uint64_t min_alloc, int flags) +{ + uint8_t order; /* pool order = ceil(log2(size)) */ + uint8_t min_order; /* pool min_order = ceil(log2(min_alloc))*/ + uint32_t max_nb_bblock; /* max number of bblock, when smallest */ + uint32_t control_sz; /* size of control area */ + uint32_t free_head_sz; /* mem area needed for list heads */ + uint32_t saved_order_sz; /* mem area to remember given sizes */ + uint64_t user_sz; /* 2^order bytes */ + uint64_t total_sz; /* total size to request */ + int blk_idx; /* as returned by _ishm_resrve() */ + pool_t *bpool; + int i; + bblock_t *first_block; + + /* a bblock_t must fit in the buffers for linked chain! */ + if (min_alloc < sizeof(bblock_t)) + min_alloc = sizeof(bblock_t); + + /* pool order is such that 2^order = size. same for min_order */ + order = clog2(size); + min_order = clog2(min_alloc); + + /* check parameters obvious wishes: */ + if (order >= 64) + return NULL; + if (order < min_order) + return NULL; + + /* at worst case, all bblocks have smallest (2^min_order) size */ + max_nb_bblock = (1 << (order - min_order)); + + /* space needed for the control area (padded to cache line size)*/ - control_sz = - ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(_odp_ishm_pool_ctrl_t)); ++ control_sz = ROUNDUP_CACHE_LINE(sizeof(_odp_ishm_pool_ctrl_t)); + + /* space needed for 'order' free bblock list heads: */ + /* Note that only lists from min_order to order are really used.*/ - free_head_sz = ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(void *) * - (order + 1)); ++ free_head_sz = ROUNDUP_CACHE_LINE(sizeof(void *) * (order + 1)); + + /* space needed for order -i.e. size- storage of alloc'd bblock:*/ - saved_order_sz = ODP_CACHE_LINE_SIZE_ROUNDUP(max_nb_bblock * - sizeof(uint8_t)); ++ saved_order_sz = ROUNDUP_CACHE_LINE(max_nb_bblock * sizeof(uint8_t)); + + /* space needed for user area is 2^order bytes: */ + user_sz = 1 << order; + + total_sz = control_sz + + free_head_sz + + saved_order_sz + + user_sz; + + /* allocate required memory: */ + blk_idx = _odp_ishm_reserve(pool_name, total_sz, -1, + ODP_CACHE_LINE_SIZE, flags, 0); + if (blk_idx < 0) { + ODP_ERR("_odp_ishm_reserve failed."); + return NULL; + } + + bpool = _odp_ishm_address(blk_idx); + if (bpool == NULL) { + ODP_ERR("_odp_ishm_address failed."); + return NULL; + } + + /* store in pool array (needed for look up): */ + pool_blk_idx[store_idx] = blk_idx; + + /* remember block index, needed when pool is destroyed */ + bpool->ctrl.ishm_blk_idx = blk_idx; + + /* remember element size: 0 means unknown size, i.e. buddy alloation*/ + bpool->ctrl.element_sz = 0; + + /* prepare mutex: */ + odp_spinlock_init(&bpool->ctrl.lock); + + /* initialise pointers and things... */ + bpool->ctrl.order = order; + bpool->ctrl.min_order = min_order; + bpool->ctrl.free_heads = + (void *)((uintptr_t)bpool + control_sz); + bpool->ctrl.alloced_order = + (uint8_t *)((uintptr_t)bpool->ctrl.free_heads + free_head_sz); + bpool->ctrl.user_addr = + (void *)((uintptr_t)bpool->ctrl.alloced_order + saved_order_sz); + + /* initialize all free list to NULL, except the top biggest element:*/ + for (i = 0; i < (order - min_order); i++) + bpool->ctrl.free_heads[i] = NULL; + bpool->ctrl.free_heads[order] = bpool->ctrl.user_addr; + first_block = (bblock_t *)bpool->ctrl.user_addr; + first_block->next = NULL; + first_block->order = order; + + /* set all 'order' of allocated bblocks to free: */ + memset(bpool->ctrl.alloced_order, BBLOCK_FREE, saved_order_sz); + + return bpool; +} + +/* allocated memory from the given buddy pool */ +static void *_odp_ishmbud_alloc(pool_t *bpool, uint64_t size) +{ + uint32_t rq_order; /* requested order */ + uint32_t try_order; + bblock_t *bblock; + bblock_t *buddy; + uintptr_t nr; + + /* if size is zero or too big reject: */ + if ((!size) && (size > (1U << bpool->ctrl.order))) { + ODP_ERR("Invalid alloc size (0 or larger than whole pool)\n"); + return NULL; + } + + /* compute ceil(log2(size)), to get the requested block order: */ + rq_order = clog2(size); + + /* make sure the requested order is bigger (or same) as minimum! */ + if (rq_order < bpool->ctrl.min_order) + rq_order = bpool->ctrl.min_order; + + /* mutex from here: */ + odp_spinlock_lock(&bpool->ctrl.lock); + + /* now, start trying to allocate a bblock of rq_order. If that + * fails keep trying larger orders until pool order is reached */ + bblock = NULL; + for (try_order = rq_order; try_order <= bpool->ctrl.order; + try_order++) { + if (bpool->ctrl.free_heads[try_order]) { + /* remove from list: */ + bblock = + (bblock_t *)(bpool->ctrl.free_heads[try_order]); + bpool->ctrl.free_heads[try_order] = bblock->next; + break; + } + } + + if (!bblock) { + odp_spinlock_unlock(&bpool->ctrl.lock); + ODP_ERR("Out of memory. (Buddy pool full)\n"); + return NULL; + } + + /* OK: we got a block, but possibbly too large (if try_order>rq_order) + * return the extra halves to the pool hence splitting the bblock at + * each 'extra' order: */ + while (try_order-- > rq_order) { + /* split: */ + buddy = (bblock_t *)((uintptr_t)bblock + (1 << try_order)); + buddy->order = try_order; + /* add to list: */ + buddy->next = bpool->ctrl.free_heads[try_order]; + bpool->ctrl.free_heads[try_order] = buddy; + /* mark as free (non allocated block get size 0): */ + nr = get_bblock_nr(bpool, buddy); + bpool->ctrl.alloced_order[nr] = BBLOCK_FREE; + } + + /* remember the size if the allocated block: */ + nr = get_bblock_nr(bpool, bblock); + bpool->ctrl.alloced_order[nr] = rq_order; + + /* and return the allocated block! */ + odp_spinlock_unlock(&bpool->ctrl.lock); + return (void *)bblock; +} + +/* free a previously allocated buffer from a given buddy pool */ +static int _odp_ishmbud_free(pool_t *bpool, void *addr) +{ + uintptr_t user_start; /* start of user area */ + uintptr_t user_stop; /* stop of user area */ + uintptr_t mask; /* 2^min_order - 1 */ + bblock_t *bblock; /* bblock being freed */ + bblock_t *buddy; /* buddy bblock of bblock being freed */ + uint8_t order; /* order of block being freed */ + uintptr_t nr; /* block number */ + + /* freeing NULL is regarded as OK, though without any effect: */ + if (!addr) + return 0; + + user_start = (uintptr_t)bpool->ctrl.user_addr; + user_stop = user_start + ((uintptr_t)1 << bpool->ctrl.order); + mask = ((uintptr_t)1 << bpool->ctrl.min_order) - 1; + + /* some sanity checks: check that given address is within pool and + * that relative address has 2^min_order granularity: */ + if (((uintptr_t)addr < user_start) || + ((uintptr_t)addr > user_stop) || + (((uintptr_t)addr - user_start) & mask)) { + ODP_ERR("Invalid address to be freed\n"); + return -1; + } + + /* mutex from here: */ + odp_spinlock_lock(&bpool->ctrl.lock); + + /* collect saved block order and make sure bblock was allocated */ + bblock = (bblock_t *)addr; + nr = get_bblock_nr(bpool, bblock); + order = bpool->ctrl.alloced_order[nr]; + if (order == BBLOCK_FREE) { + ODP_ERR("Double free error\n"); + odp_spinlock_unlock(&bpool->ctrl.lock); + return -1; + } + + /* this looks like a valid free, mark at least this as free: */ + bpool->ctrl.alloced_order[nr] = BBLOCK_FREE; + + /* go up in orders, trying to merge buddies... */ + while (order < bpool->ctrl.order) { + buddy = get_bblock_buddy(bpool, bblock, order); + /*if buddy is not free: no further merge possible */ + nr = get_bblock_nr(bpool, buddy); + if (bpool->ctrl.alloced_order[nr] != BBLOCK_FREE) + break; + /*merge only bblock of same order:*/ + if (buddy->order != order) + break; + /*merge: remove buddy from free list: */ + remove_from_list(bpool, order, buddy); + /*merge: make sure we point at start of block: */ + if (bblock > buddy) + bblock = buddy; + /*merge: size of bloack has dubbled: increse order: */ + order++; + } + + /* insert the bblock into its correct free block list: */ + bblock->next = bpool->ctrl.free_heads[order]; + bpool->ctrl.free_heads[order] = bblock; + + /* remember the (possibly now merged) block order: */ + bblock->order = order; + + odp_spinlock_unlock(&bpool->ctrl.lock); + return 0; +} + +/* print buddy pool status and performs sanity checks */ +static int _odp_ishmbud_pool_status(const char *title, pool_t *bpool) +{ + uint8_t order, pool_order, pool_min_order; + uint64_t free_q_nb_bblocks[64]; + uint64_t allocated_nb_bblocks[64]; + uint64_t free_q_nb_bblocks_bytes[64]; + uint64_t allocated_nb_bblocks_bytes[64]; + uint64_t total_bytes_free; + uint64_t total_bytes_allocated; + uint64_t nr; + bblock_t *bblock; + int res = 0; + + odp_spinlock_lock(&bpool->ctrl.lock); + + pool_order = bpool->ctrl.order; + pool_min_order = bpool->ctrl.min_order; + + ODP_DBG("\n%s\n", title); + ODP_DBG("Pool Type: BUDDY\n"); + ODP_DBG("pool size: %" PRIu64 " (bytes)\n", (1UL << pool_order)); + ODP_DBG("pool order: %d\n", (int)pool_order); + ODP_DBG("pool min_order: %d\n", (int)pool_min_order); + + /* a pool wholse order is more than 64 cannot even be reached on 64 + * bit machines! */ + if (pool_order > 64) { + odp_spinlock_unlock(&bpool->ctrl.lock); + return -1; + } + + total_bytes_free = 0; + total_bytes_allocated = 0; + + /* for each queue */ + for (order = pool_min_order; order <= pool_order; order++) { + free_q_nb_bblocks[order] = 0; + free_q_nb_bblocks_bytes[order] = 0; + allocated_nb_bblocks[order] = 0; + allocated_nb_bblocks_bytes[order] = 0; + + /* get the number of buffs in the free queue for this order: */ + bblock = bpool->ctrl.free_heads[order]; + while (bblock) { + free_q_nb_bblocks[order]++; + free_q_nb_bblocks_bytes[order] += (1 << order); + bblock = bblock->next; + } + + total_bytes_free += free_q_nb_bblocks_bytes[order]; + + /* get the number of allocated buffers of this order */ + for (nr = 0; + nr < (1U << (pool_order - pool_min_order)); nr++) { + if (bpool->ctrl.alloced_order[nr] == order) + allocated_nb_bblocks[order]++; + } + + allocated_nb_bblocks_bytes[order] = + allocated_nb_bblocks[order] * (1 << order); + + total_bytes_allocated += allocated_nb_bblocks_bytes[order]; + + ODP_DBG("Order %d => Free: %" PRIu64 " buffers " + "(%" PRIu64" bytes) " + "Allocated %" PRIu64 " buffers (%" PRIu64 " bytes) " + "Total: %" PRIu64 " bytes\n", + (int)order, free_q_nb_bblocks[order], + free_q_nb_bblocks_bytes[order], + allocated_nb_bblocks[order], + allocated_nb_bblocks_bytes[order], + free_q_nb_bblocks_bytes[order] + + allocated_nb_bblocks_bytes[order]); + } + + ODP_DBG("Allocated space: %" PRIu64 " (bytes)\n", + total_bytes_allocated); + ODP_DBG("Free space: %" PRIu64 " (bytes)\n", total_bytes_free); + + if (total_bytes_free + total_bytes_allocated != (1U << pool_order)) { + ODP_DBG("Lost bytes on this pool!\n"); + res = -1; + } + + if (res) + ODP_DBG("Pool inconsistent!\n"); + + odp_spinlock_unlock(&bpool->ctrl.lock); + return res; +} + +/* section 2: functions for slab allocation: */ + +/* free slab blocks contains the following structure, used to link the + * free blocks together. + */ +typedef struct sblock_t { + struct sblock_t *next; +} sblock_t; + +/* + * create a slab memory pool of given size (rounded up to the nearest integer + * number of element, where each element has size 'elt_size'). + * returns a pointer to the created slab pool. + * The allocated area contains: + * - The _odp_ishm_pool_ctrl_t structure + * - alignment to cache line + * - The user memory + */ +static pool_t *_odp_ishmslab_pool_create(const char *pool_name, int store_idx, + uint64_t size, + uint64_t elt_size, int flags) +{ + uint32_t nb_sblock; /* number of elements in the pool */ + uint32_t control_sz; /* size of control area */ + uint64_t total_sz; /* total size to request */ + uint64_t user_sz; /* 2^order bytes */ + int blk_idx; /* as returned by _ishm_reserve() */ + pool_t *spool; + unsigned int i; + sblock_t *block; + + /* a sblock_t must fit in the buffers for linked chain! */ + if (elt_size < sizeof(bblock_t)) { + elt_size = sizeof(bblock_t); + size = size * (sizeof(bblock_t) / elt_size + + ((sizeof(bblock_t) % elt_size) ? 1 : 0)); + } + + /* nb of element fitting in the pool is just ceil(size/elt_size)*/ + nb_sblock = (size / elt_size) + ((size % elt_size) ? 1 : 0); + + /* space needed for the control area (padded to cache line size)*/ - control_sz = - ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(_odp_ishm_pool_ctrl_t)); ++ control_sz = ROUNDUP_CACHE_LINE(sizeof(_odp_ishm_pool_ctrl_t)); + + /* space needed for user area is : */ + user_sz = nb_sblock * elt_size; + + total_sz = control_sz + + user_sz; + + /* allocate required memory: */ + blk_idx = _odp_ishm_reserve(pool_name, total_sz, -1, + ODP_CACHE_LINE_SIZE, flags, 0); + if (blk_idx < 0) { + ODP_ERR("_odp_ishm_reserve failed."); + return NULL; + } + + spool = _odp_ishm_address(blk_idx); + if (spool == NULL) { + ODP_ERR("_odp_ishm_address failed."); + return NULL; + } + + /* store in pool array (needed for look up): */ + pool_blk_idx[store_idx] = blk_idx; + + /* remember block index, needed when pool is destroyed */ + spool->ctrl.ishm_blk_idx = blk_idx; + + /* remember element (sblock) size and their number: */ + spool->ctrl.element_sz = elt_size; + spool->ctrl.nb_elem = nb_sblock; + + /* prepare mutex: */ + odp_spinlock_init(&spool->ctrl.lock); + + /* initialise pointers and things... */ + spool->ctrl.user_addr = + (void *)((uintptr_t)spool + control_sz); + + /* initialise the free list with the list of all elements:*/ + spool->ctrl.free_head = spool->ctrl.user_addr; + for (i = 0; i < nb_sblock - 1; i++) { + block = (sblock_t *)((uintptr_t)spool->ctrl.user_addr + + i * (uintptr_t)elt_size); + block->next = (sblock_t *)((uintptr_t)block + + (uintptr_t)elt_size); + } + block = (sblock_t *)((uintptr_t)spool->ctrl.user_addr + + (nb_sblock - 1) * (uintptr_t)elt_size); + block->next = NULL; + + return spool; +} + +/* allocated memory from the given slab pool */ +static void *_odp_ishmslab_alloc(pool_t *spool, uint64_t size) +{ + void *ret; + sblock_t *block; + + if (size > spool->ctrl.element_sz) + return NULL; + + odp_spinlock_lock(&spool->ctrl.lock); + ret = spool->ctrl.free_head; + if (!ret) { + odp_spinlock_unlock(&spool->ctrl.lock); + ODP_ERR("Out of memory. (Slab pool full)\n"); + return NULL; + } + + block = (sblock_t *)ret; + spool->ctrl.free_head = block->next; + + odp_spinlock_unlock(&spool->ctrl.lock); + return ret; +} + +/* free a previously allocated buffer from a given slab pool */ +static int _odp_ishmslab_free(pool_t *spool, void *addr) +{ + uintptr_t user_start; /* start of user area */ + uintptr_t user_stop; /* stop of user area */ + sblock_t *block; + + /* freeing NULL is regarded as OK, though without any effect: */ + if (!addr) + return 0; + + user_start = (uintptr_t)spool->ctrl.user_addr; + user_stop = user_start + spool->ctrl.element_sz * spool->ctrl.nb_elem; + + /* some sanity checks: check that given address is within pool and + * that relative address has element_sz granularity: */ + if (((uintptr_t)addr < user_start) || + ((uintptr_t)addr > user_stop) || + (((uintptr_t)addr - user_start) % spool->ctrl.element_sz)) { + ODP_ERR("Invalid address to be freed\n"); + return -1; + } + + odp_spinlock_lock(&spool->ctrl.lock); + block = (sblock_t *)addr; + block->next = (sblock_t *)spool->ctrl.free_head; + spool->ctrl.free_head = addr; + odp_spinlock_unlock(&spool->ctrl.lock); + + return 0; +} + +/* print slab pool status and performs sanity checks */ +static int _odp_ishmslab_pool_status(const char *title, pool_t *spool) +{ + sblock_t *sblock; + uint64_t nb_free_elts; /* number of free elements */ + + odp_spinlock_lock(&spool->ctrl.lock); + + ODP_DBG("\n%s\n", title); + ODP_DBG("Pool Type: FIXED SIZE\n"); + ODP_DBG("pool size: %" PRIu64 " (bytes)\n", + spool->ctrl.nb_elem * spool->ctrl.element_sz); + + /* count the number of free elements in the free list: */ + nb_free_elts = 0; + sblock = (sblock_t *)spool->ctrl.free_head; + while (sblock) { + nb_free_elts++; + sblock = sblock->next; + } + + ODP_DBG("%" PRIu64 "/%" PRIu64 " available elements.\n", + nb_free_elts, spool->ctrl.nb_elem); + + odp_spinlock_unlock(&spool->ctrl.lock); + return 0; +} + +/* section 3: common, external functions: */ + +/* create a pool: either with fixed alloc size (if max_alloc/min_alloc<2) or + * of variable block size (if max_alloc == 0) */ +pool_t *_odp_ishm_pool_create(const char *pool_name, uint64_t size, + uint64_t min_alloc, uint64_t max_alloc, int flags) +{ + int store_idx; + uint64_t real_pool_sz; + + if (min_alloc > max_alloc) { + ODP_ERR("invalid parameter: min_alloc > max_alloc"); + return NULL; + } + + /* search for a free index in pool_blk_idx for the pool */ + for (store_idx = 0; store_idx < MAX_NB_POOL; store_idx++) { + if (pool_blk_idx[store_idx] < 0) + break; + } + if (store_idx == MAX_NB_POOL) { + ODP_ERR("Max number of pool reached (MAX_NB_POOL)"); + return NULL; + } + + if ((min_alloc == 0) || ((max_alloc / min_alloc) > 2)) { + /* alloc variation is not constant enough: we go for a buddy + * allocator. The pool efficiency may go as low as 50% + * so we double the required size to make sure we can satisfy + * the user request */ + real_pool_sz = 2 * size; + return _odp_ishmbud_pool_create(pool_name, store_idx, + real_pool_sz, + BUDDY_MIN_SIZE, flags); + } else { + /* min and max are close enough so we go for constant size + * allocator: + * make sure the pool can fit the required size, even when + * only min_alloc allocation are performed: */ + real_pool_sz = ((size / min_alloc) + + ((size % min_alloc) ? 1 : 0)) + * max_alloc; + return _odp_ishmslab_pool_create(pool_name, store_idx, + real_pool_sz, + max_alloc, flags); + } +} + +/* destroy a pool. everything goes away. no operation on the pool should + * follow. */ +int _odp_ishm_pool_destroy(pool_t *pool) +{ + int store_idx; + + for (store_idx = 0; store_idx < MAX_NB_POOL; store_idx++) { + if (pool_blk_idx[store_idx] == pool->ctrl.ishm_blk_idx) { + pool_blk_idx[store_idx] = -1; + break; + } + } + + return _odp_ishm_free_by_index(pool->ctrl.ishm_blk_idx); +} + +/* allocated a buffer from a pool */ +void *_odp_ishm_pool_alloc(_odp_ishm_pool_t *pool, uint64_t size) +{ + if (!pool->ctrl.element_sz) + return _odp_ishmbud_alloc(pool, size); + else + return _odp_ishmslab_alloc(pool, size); +} + +/* free a previously allocated buffer from a pool */ +int _odp_ishm_pool_free(_odp_ishm_pool_t *pool, void *addr) +{ + if (!pool->ctrl.element_sz) + return _odp_ishmbud_free(pool, addr); + else + return _odp_ishmslab_free(pool, addr); +} + +/* Print a pool status */ +int _odp_ishm_pool_status(const char *title, _odp_ishm_pool_t *pool) +{ + if (!pool->ctrl.element_sz) + return _odp_ishmbud_pool_status(title, pool); + else + return _odp_ishmslab_pool_status(title, pool); +} + +void _odp_ishm_pool_init(void) +{ + int i; + + for (i = 0; i < MAX_NB_POOL; i++) + pool_blk_idx[i] = -1; +} + +_odp_ishm_pool_t *_odp_ishm_pool_lookup(const char *pool_name) +{ + int block_idx; + int store_idx; + + /* search for a _ishm block with the given name */ + block_idx = _odp_ishm_lookup_by_name(pool_name); + if (block_idx < 0) + return NULL; + + /* a block with that name exists: make sure it is within + * the registered pools */ + for (store_idx = 0; store_idx < MAX_NB_POOL; store_idx++) { + if (pool_blk_idx[store_idx] == block_idx) + return _odp_ishm_address(block_idx); + } + + return NULL; +} diff --cc platform/linux-generic/include/odp/api/plat/event_types.h index abaa770,a1aa0e4..0f51783 --- a/platform/linux-generic/include/odp/api/plat/event_types.h +++ b/platform/linux-generic/include/odp/api/plat/event_types.h @@@ -38,15 -39,8 +39,9 @@@ typedef enum odp_event_type_t ODP_EVENT_PACKET = 2, ODP_EVENT_TIMEOUT = 3, ODP_EVENT_CRYPTO_COMPL = 4, + ODP_EVENT_IPSEC_RESULT = 5 } odp_event_type_t;
- /** Get printable format of odp_event_t */ - static inline uint64_t odp_event_to_u64(odp_event_t hdl) - { - return _odp_pri(hdl); - } - /** * @} */ diff --cc platform/linux-generic/odp_packet.c index 170965a,024f694..3aadc4d --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@@ -1709,11 -1496,9 +1709,11 @@@ int odp_packet_align(odp_packet_t *pkt if (align > ODP_CACHE_LINE_SIZE) return -1;
+ ODP_ASSERT(odp_packet_has_ref(*pkt) == 0); + if (seglen >= len) { misalign = align <= 1 ? 0 : - ODP_ALIGN_ROUNDUP(uaddr, align) - uaddr; + ROUNDUP_ALIGN(uaddr, align) - uaddr; if (misalign == 0) return 0; shift = align - misalign; diff --cc test/common_plat/validation/Makefile.inc index ffba620,0000000..3972ab4 mode 100644,000000..100644 --- a/test/common_plat/validation/Makefile.inc +++ b/test/common_plat/validation/Makefile.inc @@@ -1,16 -1,0 +1,16 @@@ +include $(top_srcdir)/test/Makefile.inc + +COMMON_DIR = $(top_builddir)/test/common_plat/common + +#the following option ensure that option '-I.' is not passed to gcc, +#therefore distinguishing between '#include "X"' and '#include <X>'. +#It allows common filenames (such as 'errno.h') to be used locally. +AUTOMAKE_OPTIONS = nostdinc + +AM_CFLAGS += -I$(top_srcdir)/test/common_plat/common +AM_LDFLAGS += -static + +LIBCUNIT_COMMON = $(COMMON_DIR)/libcunit_common.la +LIBCPUMASK_COMMON = $(COMMON_DIR)/libcpumask_common.la +LIBTHRMASK_COMMON = $(COMMON_DIR)/libthrmask_common.la - LIBODP = $(LIB)/libodphelper-linux.la $(LIB)/libodp-linux.la ++LIBODP = $(LIB)/libodphelper-linux-generic.la $(LIB)/libodp-linux.la
-----------------------------------------------------------------------
Summary of changes: .codecov.yml | 25 + .travis.yml | 70 +- DEPENDENCIES | 4 +- configure.ac | 51 +- example/Makefile.inc | 3 +- example/classifier/odp_classifier.c | 4 +- example/generator/odp_generator.c | 6 +- example/hello/odp_hello.c | 34 +- example/ipsec/odp_ipsec.c | 6 +- example/ipsec/odp_ipsec_fwd_db.h | 1 - example/ipsec/odp_ipsec_loop_db.h | 1 - example/ipsec/odp_ipsec_misc.h | 4 +- example/ipsec/odp_ipsec_stream.c | 4 +- example/l2fwd_simple/odp_l2fwd_simple.c | 4 +- example/l3fwd/odp_l3fwd.c | 6 +- example/l3fwd/odp_l3fwd_db.h | 2 +- example/packet/odp_pktio.c | 4 +- example/switch/odp_switch.c | 4 +- example/time/time_global_test.c | 5 +- example/timer/odp_timer_test.c | 4 +- helper/Makefile.am | 36 +- helper/chksum.c | 4 +- helper/cuckootable.c | 52 +- helper/hashtable.c | 44 +- helper/include/odp/helper/odph_api.h | 39 + helper/{ => include/odp/helper}/odph_cuckootable.h | 0 helper/{ => include/odp/helper}/odph_hashtable.h | 0 .../{ => include/odp/helper}/odph_iplookuptable.h | 0 helper/{ => include/odp/helper}/odph_lineartable.h | 0 .../helper/platform/linux-generic/threads_extn.h | 112 ++ helper/include/odp/helper/{linux.h => threads.h} | 78 - helper/iplookuptable.c | 61 +- helper/lineartable.c | 29 +- helper/m4/configure.m4 | 14 + helper/odph_debug.h | 4 - helper/platform/linux-generic/thread.c | 313 ++++ helper/test/Makefile.am | 43 +- helper/test/chksum.c | 22 +- helper/test/cuckootable.c | 6 +- helper/test/iplookuptable.c | 6 +- helper/test/linux-generic/Makefile.am | 5 + helper/test/{ => linux-generic}/process.c | 16 +- helper/test/{ => linux-generic}/thread.c | 16 +- helper/test/odpthreads.c | 20 +- helper/test/parse.c | 89 +- helper/test/table.c | 15 +- helper/{linux.c => threads.c} | 242 +-- .../odp/arch/arm32-linux/odp/api/abi/buffer.h | 7 +- .../arch/arm32-linux/odp/api/abi/classification.h | 7 +- .../odp/arch/arm32-linux/odp/api/abi/crypto.h | 7 +- .../odp/arch/arm32-linux/odp/api/abi/event.h | 7 +- .../odp/arch/arm32-linux/odp/api/abi/packet.h | 7 +- .../odp/arch/arm32-linux/odp/api/abi/pool.h | 7 +- .../odp/arch/arm32-linux/odp/api/abi/queue.h | 7 +- .../arch/arm32-linux/odp/api/abi/shared_memory.h | 7 +- .../odp/arch/arm64-linux/odp/api/abi/buffer.h | 7 +- .../arch/arm64-linux/odp/api/abi/classification.h | 7 +- .../odp/arch/arm64-linux/odp/api/abi/crypto.h | 7 +- .../odp/arch/arm64-linux/odp/api/abi/event.h | 7 +- .../odp/arch/arm64-linux/odp/api/abi/packet.h | 7 +- .../odp/arch/arm64-linux/odp/api/abi/pool.h | 7 +- .../odp/arch/arm64-linux/odp/api/abi/queue.h | 7 +- .../arch/arm64-linux/odp/api/abi/shared_memory.h | 7 +- include/odp/arch/default/api/abi/buffer.h | 38 + include/odp/arch/default/api/abi/classification.h | 40 + include/odp/arch/default/api/abi/crypto.h | 36 + include/odp/arch/default/api/abi/event.h | 42 + include/odp/arch/default/api/abi/packet.h | 47 + include/odp/arch/default/api/abi/pool.h | 43 + include/odp/arch/default/api/abi/queue.h | 35 + include/odp/arch/default/api/abi/shared_memory.h | 35 + .../odp/arch/mips64-linux/odp/api/abi/buffer.h | 7 +- .../arch/mips64-linux/odp/api/abi/classification.h | 7 +- .../odp/arch/mips64-linux/odp/api/abi/crypto.h | 7 +- .../odp/arch/mips64-linux/odp/api/abi/event.h | 7 +- .../odp/arch/mips64-linux/odp/api/abi/packet.h | 7 +- .../odp/arch/mips64-linux/odp/api/abi/pool.h | 7 +- .../odp/arch/mips64-linux/odp/api/abi/queue.h | 7 +- .../arch/mips64-linux/odp/api/abi/shared_memory.h | 7 +- .../odp/arch/power64-linux/odp/api/abi/buffer.h | 7 +- .../power64-linux/odp/api/abi/classification.h | 7 +- .../odp/arch/power64-linux/odp/api/abi/crypto.h | 7 +- .../odp/arch/power64-linux/odp/api/abi/event.h | 7 +- .../odp/arch/power64-linux/odp/api/abi/packet.h | 7 +- .../odp/arch/power64-linux/odp/api/abi/pool.h | 7 +- .../odp/arch/power64-linux/odp/api/abi/queue.h | 7 +- .../arch/power64-linux/odp/api/abi/shared_memory.h | 7 +- .../odp/arch/x86_32-linux/odp/api/abi/buffer.h | 7 +- .../arch/x86_32-linux/odp/api/abi/classification.h | 7 +- .../odp/arch/x86_32-linux/odp/api/abi/crypto.h | 7 +- .../odp/arch/x86_32-linux/odp/api/abi/event.h | 7 +- .../odp/arch/x86_32-linux/odp/api/abi/packet.h | 7 +- .../odp/arch/x86_32-linux/odp/api/abi/pool.h | 7 +- .../odp/arch/x86_32-linux/odp/api/abi/queue.h | 7 +- .../arch/x86_32-linux/odp/api/abi/shared_memory.h | 7 +- .../odp/arch/x86_64-linux/odp/api/abi/buffer.h | 7 +- .../arch/x86_64-linux/odp/api/abi/classification.h | 7 +- .../odp/arch/x86_64-linux/odp/api/abi/crypto.h | 7 +- .../odp/arch/x86_64-linux/odp/api/abi/event.h | 7 +- .../odp/arch/x86_64-linux/odp/api/abi/packet.h | 7 +- .../odp/arch/x86_64-linux/odp/api/abi/pool.h | 7 +- .../odp/arch/x86_64-linux/odp/api/abi/queue.h | 7 +- .../arch/x86_64-linux/odp/api/abi/shared_memory.h | 7 +- ...inux.pc.in => libodphelper-linux-generic.pc.in} | 4 +- platform/Makefile.inc | 22 + platform/linux-generic/Makefile.am | 1 + platform/linux-generic/_ishm.c | 13 +- platform/linux-generic/_ishmphy.c | 42 +- platform/linux-generic/_ishmpool.c | 12 +- platform/linux-generic/arch/arm/odp/api/cpu_arch.h | 6 + .../linux-generic/include/odp/api/classification.h | 9 +- .../include/odp/api/plat/buffer_types.h | 23 +- .../include/odp/api/plat/classification_types.h | 34 +- .../include/odp/api/plat/crypto_types.h | 21 +- .../include/odp/api/plat/event_types.h | 19 +- .../include/odp/api/plat/packet_types.h | 26 +- .../include/odp/api/plat/pool_types.h | 21 +- .../include/odp/api/plat/queue_types.h | 25 +- .../include/odp/api/plat/shared_memory_types.h | 16 +- platform/linux-generic/include/odp/api/queue.h | 4 + .../linux-generic/include/odp_align_internal.h | 108 +- .../include/odp_classification_datamodel.h | 19 +- .../include/odp_classification_inlines.h | 52 +- platform/linux-generic/include/odp_packet_dpdk.h | 2 +- .../linux-generic/include/odp_packet_internal.h | 5 + .../linux-generic/include/odp_packet_io_internal.h | 2 +- platform/linux-generic/include/odp_packet_netmap.h | 2 +- platform/linux-generic/include/odp_pool_internal.h | 1 + .../linux-generic/include/odp_queue_internal.h | 2 +- platform/linux-generic/include/protocols/ip.h | 14 +- platform/linux-generic/odp_buffer.c | 5 + platform/linux-generic/odp_classification.c | 39 +- platform/linux-generic/odp_crypto.c | 10 + platform/linux-generic/odp_event.c | 5 + platform/linux-generic/odp_packet.c | 16 +- platform/linux-generic/odp_pool.c | 12 +- platform/linux-generic/odp_queue.c | 5 + platform/linux-generic/odp_schedule.c | 8 +- platform/linux-generic/odp_schedule_sp.c | 7 +- platform/linux-generic/odp_shared_memory.c | 6 + platform/linux-generic/odp_timer.c | 9 +- platform/linux-generic/odp_traffic_mngr.c | 5 +- platform/linux-generic/pktio/dpdk.c | 14 +- platform/linux-generic/pktio/netmap.c | 37 +- test/Makefile.inc | 3 +- test/common_plat/common/odp_cunit_common.c | 2 +- .../common_plat/miscellaneous/odp_api_from_cpp.cpp | 2 +- test/common_plat/performance/.gitignore | 2 + test/common_plat/performance/Makefile.am | 15 +- .../common_plat/performance/dummy_crc.h | 46 +- test/common_plat/performance/odp_bench_packet.c | 1611 ++++++++++++++++++++ test/common_plat/performance/odp_crypto.c | 2 +- test/common_plat/performance/odp_l2fwd.c | 4 +- test/common_plat/performance/odp_pktio_ordered.c | 1342 ++++++++++++++++ .../performance/odp_pktio_ordered_run.sh | 42 + test/common_plat/performance/odp_pktio_perf.c | 5 +- test/common_plat/performance/odp_sched_latency.c | 2 +- test/common_plat/performance/odp_scheduling.c | 2 +- .../common_plat/performance}/udp64.pcap | Bin test/common_plat/validation/Makefile.inc | 2 +- test/common_plat/validation/api/Makefile.inc | 17 +- .../validation/api/classification/classification.h | 21 + .../api/classification/odp_classification_common.c | 153 +- .../classification/odp_classification_test_pmr.c | 296 +++- .../api/classification/odp_classification_tests.c | 46 +- .../classification/odp_classification_testsuites.h | 15 +- test/common_plat/validation/api/pktio/pktio.c | 4 +- test/common_plat/validation/api/timer/timer.c | 2 +- .../validation/api/traffic_mngr/traffic_mngr.c | 6 +- test/linux-generic/Makefile.inc | 3 +- test/linux-generic/mmap_vlan_ins/mmap_vlan_ins.c | 30 +- test/linux-generic/mmap_vlan_ins/mmap_vlan_ins.sh | 15 +- test/linux-generic/pktio_ipc/ipc_common.h | 5 +- test/linux-generic/ring/ring_stress.c | 2 +- 174 files changed, 5201 insertions(+), 1339 deletions(-) create mode 100644 .codecov.yml create mode 100644 helper/include/odp/helper/odph_api.h rename helper/{ => include/odp/helper}/odph_cuckootable.h (100%) rename helper/{ => include/odp/helper}/odph_hashtable.h (100%) rename helper/{ => include/odp/helper}/odph_iplookuptable.h (100%) rename helper/{ => include/odp/helper}/odph_lineartable.h (100%) create mode 100644 helper/include/odp/helper/platform/linux-generic/threads_extn.h rename helper/include/odp/helper/{linux.h => threads.h} (74%) create mode 100644 helper/platform/linux-generic/thread.c create mode 100644 helper/test/linux-generic/Makefile.am rename helper/test/{ => linux-generic}/process.c (84%) rename helper/test/{ => linux-generic}/thread.c (84%) rename helper/{linux.c => threads.c} (66%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm32-linux/odp/api/abi/buffer.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm32-linux/odp/api/abi/classification.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm32-linux/odp/api/abi/crypto.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm32-linux/odp/api/abi/event.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm32-linux/odp/api/abi/packet.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm32-linux/odp/api/abi/pool.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm32-linux/odp/api/abi/queue.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm32-linux/odp/api/abi/shared_memory.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm64-linux/odp/api/abi/buffer.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm64-linux/odp/api/abi/classification.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm64-linux/odp/api/abi/crypto.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm64-linux/odp/api/abi/event.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm64-linux/odp/api/abi/packet.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm64-linux/odp/api/abi/pool.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm64-linux/odp/api/abi/queue.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/arm64-linux/odp/api/abi/shared_memory.h (56%) create mode 100644 include/odp/arch/default/api/abi/buffer.h create mode 100644 include/odp/arch/default/api/abi/classification.h create mode 100644 include/odp/arch/default/api/abi/crypto.h create mode 100644 include/odp/arch/default/api/abi/event.h create mode 100644 include/odp/arch/default/api/abi/packet.h create mode 100644 include/odp/arch/default/api/abi/pool.h create mode 100644 include/odp/arch/default/api/abi/queue.h create mode 100644 include/odp/arch/default/api/abi/shared_memory.h copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/mips64-linux/odp/api/abi/buffer.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/mips64-linux/odp/api/abi/classification.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/mips64-linux/odp/api/abi/crypto.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/mips64-linux/odp/api/abi/event.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/mips64-linux/odp/api/abi/packet.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/mips64-linux/odp/api/abi/pool.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/mips64-linux/odp/api/abi/queue.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/mips64-linux/odp/api/abi/shared_memory.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/power64-linux/odp/api/abi/buffer.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/power64-linux/odp/api/abi/classification.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/power64-linux/odp/api/abi/crypto.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/power64-linux/odp/api/abi/event.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/power64-linux/odp/api/abi/packet.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/power64-linux/odp/api/abi/pool.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/power64-linux/odp/api/abi/queue.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/power64-linux/odp/api/abi/shared_memory.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_32-linux/odp/api/abi/buffer.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_32-linux/odp/api/abi/classification.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_32-linux/odp/api/abi/crypto.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_32-linux/odp/api/abi/event.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_32-linux/odp/api/abi/packet.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_32-linux/odp/api/abi/pool.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_32-linux/odp/api/abi/queue.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_32-linux/odp/api/abi/shared_memory.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_64-linux/odp/api/abi/buffer.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_64-linux/odp/api/abi/classification.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_64-linux/odp/api/abi/crypto.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_64-linux/odp/api/abi/event.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_64-linux/odp/api/abi/packet.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_64-linux/odp/api/abi/pool.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_64-linux/odp/api/abi/queue.h (56%) copy test/common_plat/validation/api/ipsec/ipsec_main.c => include/odp/arch/x86_64-linux/odp/api/abi/shared_memory.h (56%) rename pkgconfig/{libodphelper-linux.pc.in => libodphelper-linux-generic.pc.in} (72%) copy platform/linux-generic/odp_hash.c => test/common_plat/performance/dummy_crc.h (96%) create mode 100644 test/common_plat/performance/odp_bench_packet.c create mode 100644 test/common_plat/performance/odp_pktio_ordered.c create mode 100755 test/common_plat/performance/odp_pktio_ordered_run.sh copy {example/l2fwd_simple => test/common_plat/performance}/udp64.pcap (100%)
hooks/post-receive