[lng-odp] [PATCH v1 1/1] helper: iplookuptable fix puting values to table
From: Maxim Uvarov On putting values to table we have to validate input data and reject unaccepted data. Signed-off-by: Maxim Uvarov --- /** Email created from pull request 701 (muvarov:devel/master_iploopup) ** https://github.com/Linaro/odp/pull/701 ** Patch: https://github.com/Linaro/odp/pull/701.patch ** Base sha: 1adfa2e17b27032ff31bd8f361e05970ce186148 ** Merge commit sha: e0b5294f727aafbf91154ffe2a43a0736a1e6de3 **/ helper/iplookuptable.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/helper/iplookuptable.c b/helper/iplookuptable.c index 61f634022..b0141c311 100644 --- a/helper/iplookuptable.c +++ b/helper/iplookuptable.c @@ -585,24 +585,25 @@ prefix_insert_into_lx( odph_iplookup_table_impl *tbl, prefix_entry_t *entry, uint8_t cidr, odp_buffer_t nexthop, uint8_t level) { - uint8_t ret = 0; + int ret = 0; uint32_t i = 0, limit = (1 << (level - cidr)); prefix_entry_t *e = entry, *ne = NULL; for (i = 0; i < limit; i++, e++) { - if (e->child == 1) { - if (e->cidr > cidr) - continue; + if (e->cidr > cidr) + continue; + if (e->child == 1) { e->cidr = cidr; /* push to next level */ ne = (prefix_entry_t *)e->ptr; ret = prefix_insert_into_lx( tbl, ne, cidr, nexthop, cidr + 8); + if (ret == -1) + return -1; + if (ret == 0) + return ret; } else { - if (e->cidr > cidr) - continue; - e->child = 0; e->cidr = cidr; e->nexthop = nexthop; @@ -678,8 +679,9 @@ odph_iplookup_table_put_value(odph_table_t tbl, void *key, void *value) nexthop = *((odp_buffer_t *)value); - if (prefix->cidr == 0) + if (prefix->cidr == 0 || prefix->cidr == 255) return -1; + prefix->ip = prefix->ip & (0x << (IP_LENGTH - prefix->cidr)); /* insert into trie */
[lng-odp] [PATCH v1 0/1] helper: iplookuptable fix puting values to table
On putting values to table we have to validate input data and reject unaccepted data. Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org github /** Email created from pull request 701 (muvarov:devel/master_iploopup) ** https://github.com/Linaro/odp/pull/701 ** Patch: https://github.com/Linaro/odp/pull/701.patch ** Base sha: 1adfa2e17b27032ff31bd8f361e05970ce186148 ** Merge commit sha: e0b5294f727aafbf91154ffe2a43a0736a1e6de3 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 42 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v5 0/2] linux-gen: ishm: implement huge page cache
With this patch, ODP will pre-allocate several huge pages at init time. When memory is to be mapped into a huge page, one that was pre-allocated will be used, if available, this way ODP won't have to trap into the kernel to allocate huge pages. The idea with this implementation is to trick ishm into thinking that a file descriptor where to map the memory was provided, this way it it won't try to allocate one itself. This file descriptor is one of those previously allocated at init time. When the system is done with this file descriptor, instead of closing it, it is put back into the list of available huge pages, ready to be reused. A collateral effect of this patch is that memory is not zeroed out when it is reused. WARNING: This patch will not work when using process mode threads. For several reasons, this may not work when using ODP_ISHM_SINGLE_VA either, so for this case the list of pre-allocated files is not used. This patch should mitigate, if not solve, bug #3774: https://bugs.linaro.org/show_bug.cgi?id=3774 To pre-allocate huge pages, define the environment variable ODP_HP_CACHE, and possibly set it to the number of huge pages that should be pre-allocated, setting it to -1 will reserve up to 32 huge pages, which is currently a hard-coded limit. example usage: ODP_HP_CACHE=-1 ./test/validation/api/shmem/shmem_main Signed-off-by: Josep Puigdemont josep.puigdem...@linaro.org github /** Email created from pull request 685 (joseppc:fix/cache_huge_pages) ** https://github.com/Linaro/odp/pull/685 ** Patch: https://github.com/Linaro/odp/pull/685.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: 9826130fb2849a5c4088572ca285b00e358be707 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 309 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 159 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v5 2/2] linux-gen: ishm: make huge page cache size dynamic
From: Josep Puigdemont Signed-off-by: Josep Puigdemont --- /** Email created from pull request 685 (joseppc:fix/cache_huge_pages) ** https://github.com/Linaro/odp/pull/685 ** Patch: https://github.com/Linaro/odp/pull/685.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: 9826130fb2849a5c4088572ca285b00e358be707 **/ config/odp-linux-generic.conf | 16 --- platform/linux-generic/odp_ishm.c | 73 +++ 2 files changed, 56 insertions(+), 33 deletions(-) diff --git a/config/odp-linux-generic.conf b/config/odp-linux-generic.conf index 0dd2a6c13..bddc92dd4 100644 --- a/config/odp-linux-generic.conf +++ b/config/odp-linux-generic.conf @@ -18,14 +18,20 @@ odp_implementation = "linux-generic" config_file_version = "0.0.1" -# Internal shared memory allocator +# Shared memory options shm: { - # ODP will try to reserve as many huge pages as the number indicated - # here, up to 64. A zero value means that no pages should be reserved. + # Number of cached default size huge pages. These pages are allocated + # during odp_init_global() and freed back to the kernel in + # odp_term_global(). A value of zero means no pages are cached. + # No negative values should be used here, they are reserved for future + # implementations. + # + # ODP will reserve as many huge pages as possible, which may be less + # than requested here if the system does not have enough huge pages + # available. + # # When using process mode threads, this value should be set to 0 # because the current implementation won't work properly otherwise. - # These pages will only be freed when the application calls - # odp_term_global(). num_cached_hp = 0 } diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index aeda50bec..11fbe8ef0 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -239,15 +239,15 @@ typedef struct { } ishm_ftable_t; static ishm_ftable_t *ishm_ftbl; -#define HP_CACHE_SIZE 64 struct huge_page_cache { uint64_t len; + int max_fds; /* maximum amount requested of pre-allocated huge pages */ int total; /* amount of actually pre-allocated huge pages */ int idx; /* retrieve fd[idx] to get a free file descriptor */ - int fd[HP_CACHE_SIZE]; /* list of file descriptors */ + int fd[];/* list of file descriptors */ }; -static struct huge_page_cache hpc; +static struct huge_page_cache *hpc; #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON @@ -301,19 +301,14 @@ static void hp_init(void) char filename[ISHM_FILENAME_MAXLEN]; char dir[ISHM_FILENAME_MAXLEN]; int count; - - hpc.total = 0; - hpc.idx = -1; - hpc.len = odp_sys_huge_page_size(); + void *addr; if (!_odp_libconfig_lookup_ext_int("shm", NULL, "num_cached_hp", )) { return; } - if (count > HP_CACHE_SIZE) - count = HP_CACHE_SIZE; - else if (count <= 0) + if (count <= 0) return; ODP_DBG("Init HP cache with up to %d pages\n", count); @@ -339,55 +334,77 @@ static void hp_init(void) dir, odp_global_data.main_pid); + addr = mmap(NULL, + sizeof(struct huge_page_cache) + sizeof(int) * count, + PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); + if (addr == MAP_FAILED) { + ODP_ERR("Unable to mmap memory for huge page cache\n."); + return; + } + + hpc = addr; + + hpc->max_fds = count; + hpc->total = 0; + hpc->idx = -1; + hpc->len = odp_sys_huge_page_size(); + for (int i = 0; i < count; ++i) { int fd; - fd = hp_create_file(hpc.len, filename); - if (fd == -1) + fd = hp_create_file(hpc->len, filename); + if (fd == -1) { + do { + hpc->fd[i++] = -1; + } while (i < count); break; - hpc.total++; - hpc.fd[i] = fd; + } + hpc->total++; + hpc->fd[i] = fd; } - hpc.idx = hpc.total - 1; + hpc->idx = hpc->total - 1; ODP_DBG("HP cache has %d huge pages of size 0x%08" PRIx64 "\n", - hpc.total, hpc.len); + hpc->total, hpc->len); } static void hp_term(void) { - for (int i = 0; i < hpc.total; i++) { - if (hpc.fd[i] != -1) - close(hpc.fd[i]); + if (NULL == hpc) + return; + + for (int i = 0; i < hpc->total; i++) { + if (hpc->fd[i] != -1) + close(hpc->fd[i]);
[lng-odp] [PATCH v5 1/2] linux-gen: ishm: implement huge page cache
From: Josep Puigdemont With this patch, ODP will pre-allocate several huge pages at init time. When memory is to be mapped into a huge page, one that was pre-allocated will be used, if available, this way ODP won't have to trap into the kernel to allocate huge pages. The idea with this implementation is to trick ishm into thinking that a file descriptor where to map the memory was provided, this way it it won't try to allocate one itself. This file descriptor is one of those previously allocated at init time. When the system is done with this file descriptor, instead of closing it, it is put back into the list of available huge pages, ready to be reused. A collateral effect of this patch is that memory is not zeroed out when it is reused. WARNING: This patch will not work when using process mode threads. For several reasons, this may not work when using ODP_ISHM_SINGLE_VA either, so when this flag is set, the list of pre-allocated files is not used. By default ODP will not reserve any huge pages, to tell ODP to do that, update the ODP configuration file with something like this: shm: { num_cached_hp = 32 } Example usage: $ echo odp.config odp_implementation = "linux-generic" config_file_version = "0.0.1" shm: { num_cached_hp = 32 } $ ODP_CONFIG_FILE=odp.conf ./test/validation/api/shmem/shmem_main This patch solves bug #3774: https://bugs.linaro.org/show_bug.cgi?id=3774 Signed-off-by: Josep Puigdemont --- /** Email created from pull request 685 (joseppc:fix/cache_huge_pages) ** https://github.com/Linaro/odp/pull/685 ** Patch: https://github.com/Linaro/odp/pull/685.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: 9826130fb2849a5c4088572ca285b00e358be707 **/ config/odp-linux-generic.conf | 11 ++ platform/linux-generic/odp_ishm.c | 218 -- 2 files changed, 215 insertions(+), 14 deletions(-) diff --git a/config/odp-linux-generic.conf b/config/odp-linux-generic.conf index 85d5414ba..0dd2a6c13 100644 --- a/config/odp-linux-generic.conf +++ b/config/odp-linux-generic.conf @@ -18,6 +18,17 @@ odp_implementation = "linux-generic" config_file_version = "0.0.1" +# Internal shared memory allocator +shm: { + # ODP will try to reserve as many huge pages as the number indicated + # here, up to 64. A zero value means that no pages should be reserved. + # When using process mode threads, this value should be set to 0 + # because the current implementation won't work properly otherwise. + # These pages will only be freed when the application calls + # odp_term_global(). + num_cached_hp = 0 +} + # DPDK pktio options pktio_dpdk: { # Default options diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index 59d1fe534..aeda50bec 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #include @@ -164,7 +165,7 @@ typedef struct ishm_fragment { * will allocate both a block and a fragment. * Blocks contain only global data common to all processes. */ -typedef enum {UNKNOWN, HUGE, NORMAL, EXTERNAL} huge_flag_t; +typedef enum {UNKNOWN, HUGE, NORMAL, EXTERNAL, CACHED} huge_flag_t; typedef struct ishm_block { char name[ISHM_NAME_MAXLEN];/* name for the ishm block (if any) */ char filename[ISHM_FILENAME_MAXLEN]; /* name of the .../odp-* file */ @@ -238,6 +239,16 @@ typedef struct { } ishm_ftable_t; static ishm_ftable_t *ishm_ftbl; +#define HP_CACHE_SIZE 64 +struct huge_page_cache { + uint64_t len; + int total; /* amount of actually pre-allocated huge pages */ + int idx; /* retrieve fd[idx] to get a free file descriptor */ + int fd[HP_CACHE_SIZE]; /* list of file descriptors */ +}; + +static struct huge_page_cache hpc; + #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif @@ -245,6 +256,142 @@ static ishm_ftable_t *ishm_ftbl; /* prototypes: */ static void procsync(void); +static int hp_create_file(uint64_t len, const char *filename) +{ + int fd; + void *addr; + + if (len <= 0) { + ODP_ERR("Length is wrong\n"); + return -1; + } + + fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (fd < 0) { + ODP_ERR("Could not create cache file %s\n", filename); + return -1; + } + + /* remove file from file system */ + unlink(filename); + + if (ftruncate(fd, len) == -1) { + ODP_ERR("Could not truncate file: %s\n", strerror(errno)); + close(fd); + return -1; + } + + /* commit huge page */ + addr = _odp_ishmphy_map(fd, NULL, len, 0); + if (addr == NULL) { + /* no more pages available */ + close(fd); + return
[lng-odp] [PATCH v1 6/6] linux-gen: ring: change ring_deq return value
From: Petri Savolainen Return number of data values dequeued (0 or 1) instead of the data value. This improves error tolerance as there's no data value reserved to indicate empty ring. Also CPU may speculate further before the actual data value is actually needed. Signed-off-by: Petri Savolainen --- /** Email created from pull request 699 (psavol:master-sched-optim-clean-ups) ** https://github.com/Linaro/odp/pull/699 ** Patch: https://github.com/Linaro/odp/pull/699.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: 32d7a11f22e6f2e1e378b653993c5377d4116d8f **/ platform/linux-generic/include/odp_ring_internal.h | 10 -- platform/linux-generic/odp_schedule_basic.c| 8 +++- platform/linux-generic/odp_schedule_iquery.c | 5 ++--- platform/linux-generic/odp_schedule_sp.c | 3 +-- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/platform/linux-generic/include/odp_ring_internal.h b/platform/linux-generic/include/odp_ring_internal.h index 97673bef4..9a637afb3 100644 --- a/platform/linux-generic/include/odp_ring_internal.h +++ b/platform/linux-generic/include/odp_ring_internal.h @@ -18,9 +18,6 @@ extern "C" { #include #include -/* Ring empty, not a valid data value. */ -#define RING_EMPTY ((uint32_t)-1) - /* Ring of uint32_t data * * Ring stores head and tail counters. Ring indexes are formed from these @@ -59,7 +56,7 @@ static inline void ring_init(ring_t *ring) } /* Dequeue data from the ring head */ -static inline uint32_t ring_deq(ring_t *ring, uint32_t mask) +static inline uint32_t ring_deq(ring_t *ring, uint32_t mask, uint32_t *data) { uint32_t head, tail, new_head; @@ -73,7 +70,7 @@ static inline uint32_t ring_deq(ring_t *ring, uint32_t mask) tail = odp_atomic_load_acq_u32(>w_tail); if (head == tail) - return RING_EMPTY; + return 0; new_head = head + 1; @@ -83,7 +80,8 @@ static inline uint32_t ring_deq(ring_t *ring, uint32_t mask) /* Read data. CAS acquire-release ensures that data read * does not move above from here. */ - return ring->data[new_head & mask]; + *data = ring->data[new_head & mask]; + return 1; } /* Dequeue multiple data from the ring head. Num is smaller than ring size. */ diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 77fee74dd..a285edc3c 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -416,8 +416,7 @@ static int schedule_term_global(void) ring_t *ring = >prio_q[grp][i][j].ring; uint32_t qi; - while ((qi = ring_deq(ring, ring_mask)) != - RING_EMPTY) { + while (ring_deq(ring, ring_mask, )) { odp_event_t events[1]; int num; @@ -907,10 +906,9 @@ static inline int do_schedule_grp(odp_queue_t *out_queue, odp_event_t out_ev[], /* Get queue index from the priority queue */ ring = >prio_q[grp][prio][id].ring; - qi = ring_deq(ring, ring_mask); - /* Priority queue empty */ - if (qi == RING_EMPTY) { + if (ring_deq(ring, ring_mask, ) == 0) { + /* Priority queue empty */ i++; id++; continue; diff --git a/platform/linux-generic/odp_schedule_iquery.c b/platform/linux-generic/odp_schedule_iquery.c index f76942ff3..e1ef10c46 100644 --- a/platform/linux-generic/odp_schedule_iquery.c +++ b/platform/linux-generic/odp_schedule_iquery.c @@ -271,7 +271,7 @@ static int schedule_init_global(void) ring_init(>ring); for (k = 0; k < PKTIO_RING_SIZE; k++) - queue->cmd_index[k] = RING_EMPTY; + queue->cmd_index[k] = -1; } for (i = 0; i < NUM_PKTIO_CMD; i++) @@ -668,9 +668,8 @@ static inline void pktio_poll_input(void) for (i = 0; i < PKTIO_CMD_QUEUES; i++, hash = (hash + 1) % PKTIO_CMD_QUEUES) { ring = >pktio_poll.queues[hash].ring; - index = ring_deq(ring, PKTIO_RING_MASK); - if (odp_unlikely(index == RING_EMPTY)) + if (odp_unlikely(ring_deq(ring, PKTIO_RING_MASK, ) == 0)) continue; cmd = >pktio_poll.commands[index]; diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c index 8ddd1e94e..6b9431b69 100644 --- a/platform/linux-generic/odp_schedule_sp.c +++
[lng-odp] [PATCH v1 5/6] linux-gen: sched: stash ring pointer
From: Petri Savolainen Save ring pointer into stash to avoid table lookups when releasing the atomic context. Signed-off-by: Petri Savolainen --- /** Email created from pull request 699 (psavol:master-sched-optim-clean-ups) ** https://github.com/Linaro/odp/pull/699 ** Patch: https://github.com/Linaro/odp/pull/699.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: 32d7a11f22e6f2e1e378b653993c5377d4116d8f **/ platform/linux-generic/odp_schedule_basic.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 6ed1f8b49..77fee74dd 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -137,6 +137,7 @@ typedef struct ODP_ALIGNED_CACHE { uint16_tev_index; uint32_tqi; odp_queue_t queue; + ring_t *ring; odp_event_t ev[BURST_SIZE_MAX]; } stash; @@ -604,10 +605,7 @@ static void schedule_pktio_start(int pktio_index, int num_pktin, static inline void release_atomic(void) { uint32_t qi = sched_local.stash.qi; - int grp = sched->queue[qi].grp; - int prio = sched->queue[qi].prio; - int spread = sched->queue[qi].spread; - ring_t *ring = >prio_q[grp][prio][spread].ring; + ring_t *ring = sched_local.stash.ring; /* Release current atomic queue */ ring_enq(ring, sched->ring_mask, qi); @@ -990,8 +988,9 @@ static inline int do_schedule_grp(odp_queue_t *out_queue, odp_event_t out_ev[], } else if (sync_ctx == ODP_SCHED_SYNC_ATOMIC) { /* Hold queue during atomic access */ - sched_local.stash.qi = qi; - sched_local.sync_ctx = sync_ctx; + sched_local.stash.qi = qi; + sched_local.stash.ring = ring; + sched_local.sync_ctx = sync_ctx; } else { /* Continue scheduling the queue */ ring_enq(ring, ring_mask, qi);
[lng-odp] [PATCH v1 4/6] linux-gen: sched: remove queue_destroy_finalize callback
From: Petri Savolainen Scheduled queue dequeue function calls directly the scheduler queue destroy callback. Sched_queue_deq() usage is simpler when the extra round of callbacks is removed. Signed-off-by: Petri Savolainen --- /** Email created from pull request 699 (psavol:master-sched-optim-clean-ups) ** https://github.com/Linaro/odp/pull/699 ** Patch: https://github.com/Linaro/odp/pull/699.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: 32d7a11f22e6f2e1e378b653993c5377d4116d8f **/ .../include/odp_queue_basic_internal.h| 1 - platform/linux-generic/odp_queue_basic.c | 20 +++-- platform/linux-generic/odp_schedule_basic.c | 11 + platform/linux-generic/odp_schedule_iquery.c | 35 +++ platform/linux-generic/odp_schedule_sp.c | 43 ++- 5 files changed, 47 insertions(+), 63 deletions(-) diff --git a/platform/linux-generic/include/odp_queue_basic_internal.h b/platform/linux-generic/include/odp_queue_basic_internal.h index 46b747955..41ca424c7 100644 --- a/platform/linux-generic/include/odp_queue_basic_internal.h +++ b/platform/linux-generic/include/odp_queue_basic_internal.h @@ -113,7 +113,6 @@ static inline queue_entry_t *qentry_from_handle(odp_queue_t handle) void queue_spsc_init(queue_entry_t *queue, uint32_t queue_size); /* Functions for schedulers */ -void sched_queue_destroy_finalize(uint32_t queue_index); void sched_queue_set_status(uint32_t queue_index, int status); int sched_queue_deq(uint32_t queue_index, odp_event_t ev[], int num, int update_status); diff --git a/platform/linux-generic/odp_queue_basic.c b/platform/linux-generic/odp_queue_basic.c index 61cf8a56c..3f00cc118 100644 --- a/platform/linux-generic/odp_queue_basic.c +++ b/platform/linux-generic/odp_queue_basic.c @@ -353,19 +353,6 @@ static odp_queue_t queue_create(const char *name, return handle; } -void sched_queue_destroy_finalize(uint32_t queue_index) -{ - queue_entry_t *queue = qentry_from_index(queue_index); - - LOCK(queue); - - if (queue->s.status == QUEUE_STATUS_DESTROYED) { - queue->s.status = QUEUE_STATUS_FREE; - sched_fn->destroy_queue(queue_index); - } - UNLOCK(queue); -} - void sched_queue_set_status(uint32_t queue_index, int status) { queue_entry_t *queue = qentry_from_index(queue_index); @@ -720,7 +707,12 @@ int sched_queue_deq(uint32_t queue_index, odp_event_t ev[], int max_num, if (odp_unlikely(status < QUEUE_STATUS_READY)) { /* Bad queue, or queue has been destroyed. -* Scheduler finalizes queue destroy after this. */ +* Inform scheduler about a destroyed queue. */ + if (queue->s.status == QUEUE_STATUS_DESTROYED) { + queue->s.status = QUEUE_STATUS_FREE; + sched_fn->destroy_queue(queue_index); + } + UNLOCK(queue); return -1; } diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 46ae7f1c1..6ed1f8b49 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -402,11 +402,6 @@ static int schedule_init_global(void) return 0; } -static inline void queue_destroy_finalize(uint32_t qi) -{ - sched_queue_destroy_finalize(qi); -} - static int schedule_term_global(void) { int ret = 0; @@ -427,9 +422,6 @@ static int schedule_term_global(void) num = sched_queue_deq(qi, events, 1, 1); - if (num < 0) - queue_destroy_finalize(qi); - if (num > 0) ODP_ERR("Queue not empty\n"); } @@ -944,10 +936,9 @@ static inline int do_schedule_grp(odp_queue_t *out_queue, odp_event_t out_ev[], num = sched_queue_deq(qi, ev_tbl, max_deq, !pktin); - if (num < 0) { + if (odp_unlikely(num < 0)) { /* Destroyed queue. Continue scheduling the same * priority queue. */ - sched_queue_destroy_finalize(qi); continue; } diff --git a/platform/linux-generic/odp_schedule_iquery.c b/platform/linux-generic/odp_schedule_iquery.c index 7dde77844..f76942ff3 100644 --- a/platform/linux-generic/odp_schedule_iquery.c +++ b/platform/linux-generic/odp_schedule_iquery.c @@ -209,6 +209,7 @@ struct sched_thread_local { * in the same priority level. */ odp_rwlock_t lock; + int r_locked; queue_index_sparse_t indexes[NUM_SCHED_PRIO]; sparse_bitmap_iterator_t
[lng-odp] [PATCH v1 2/6] linux-gen: sched: clean up local data struct
From: Petri Savolainen Move stash variables into a struct. Use only 16 bits for thread id, which is enough for 64k threads. Signed-off-by: Petri Savolainen --- /** Email created from pull request 699 (psavol:master-sched-optim-clean-ups) ** https://github.com/Linaro/odp/pull/699 ** Patch: https://github.com/Linaro/odp/pull/699.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: 32d7a11f22e6f2e1e378b653993c5377d4116d8f **/ platform/linux-generic/odp_schedule_basic.c | 62 - 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index e329a8e8c..89c0a5c42 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -84,6 +84,10 @@ ODP_STATIC_ASSERT(CHECK_IS_POWER2(ODP_CONFIG_QUEUES), ODP_STATIC_ASSERT(CHECK_IS_POWER2(MAX_RING_SIZE), "Ring_size_is_not_power_of_two"); +/* Thread ID is saved into uint16_t variable */ +ODP_STATIC_ASSERT(ODP_THREAD_COUNT_MAX < (64 * 1024), + "Max_64k_threads_supported"); + /* Mask of queues per priority */ typedef uint8_t pri_mask_t; @@ -118,19 +122,22 @@ ODP_STATIC_ASSERT(sizeof(lock_called_t) == sizeof(uint32_t), "Lock_called_values_do_not_fit_in_uint32"); /* Scheduler local data */ -typedef struct { - int thr; - uint16_t stash_num; - uint16_t stash_index; +typedef struct ODP_ALIGNED_CACHE { + uint16_t thr; + uint16_t pause; uint16_t grp_round; uint16_t spread_round; - uint32_t stash_qi; - odp_queue_t stash_queue; - odp_event_t stash_ev[BURST_SIZE_MAX]; + + struct { + uint16_tnum_ev; + uint16_tev_index; + uint32_tqi; + odp_queue_t queue; + odp_event_t ev[BURST_SIZE_MAX]; + } stash; uint32_t grp_epoch; uint16_t num_grp; - uint16_t pause; uint8_t grp[NUM_SCHED_GRPS]; uint8_t spread_tbl[SPREAD_TBL_SIZE]; uint8_t grp_weight[GRP_WEIGHT_TBL_SIZE]; @@ -304,8 +311,8 @@ static void sched_local_init(void) memset(_local, 0, sizeof(sched_local_t)); sched_local.thr = odp_thread_id(); - sched_local.stash_queue = ODP_QUEUE_INVALID; - sched_local.stash_qi= PRIO_QUEUE_EMPTY; + sched_local.stash.queue = ODP_QUEUE_INVALID; + sched_local.stash.qi= PRIO_QUEUE_EMPTY; sched_local.ordered.src_queue = NULL_INDEX; spread = prio_spread_index(sched_local.thr); @@ -445,7 +452,7 @@ static int schedule_init_local(void) static int schedule_term_local(void) { - if (sched_local.stash_num) { + if (sched_local.stash.num_ev) { ODP_ERR("Locally pre-scheduled events exist.\n"); return -1; } @@ -618,9 +625,9 @@ static void schedule_pktio_start(int pktio_index, int num_pktin, static void schedule_release_atomic(void) { - uint32_t qi = sched_local.stash_qi; + uint32_t qi = sched_local.stash.qi; - if (qi != PRIO_QUEUE_EMPTY && sched_local.stash_num == 0) { + if (qi != PRIO_QUEUE_EMPTY && sched_local.stash.num_ev == 0) { int grp = sched->queue[qi].grp; int prio = sched->queue[qi].prio; int spread = sched->queue[qi].spread; @@ -629,7 +636,7 @@ static void schedule_release_atomic(void) /* Release current atomic queue */ ring_enq(ring, sched->ring_mask, qi); - sched_local.stash_qi = PRIO_QUEUE_EMPTY; + sched_local.stash.qi = PRIO_QUEUE_EMPTY; } } @@ -717,7 +724,8 @@ static void schedule_release_ordered(void) queue_index = sched_local.ordered.src_queue; - if (odp_unlikely((queue_index == NULL_INDEX) || sched_local.stash_num)) + if (odp_unlikely((queue_index == NULL_INDEX) || +sched_local.stash.num_ev)) return; release_ordered(); @@ -735,10 +743,10 @@ static inline int copy_from_stash(odp_event_t out_ev[], unsigned int max) { int i = 0; - while (sched_local.stash_num && max) { - out_ev[i] = sched_local.stash_ev[sched_local.stash_index]; - sched_local.stash_index++; - sched_local.stash_num--; + while (sched_local.stash.num_ev && max) { + out_ev[i] = sched_local.stash.ev[sched_local.stash.ev_index]; + sched_local.stash.ev_index++; + sched_local.stash.num_ev--; max--; i++; } @@ -889,7 +897,7 @@ static inline int do_schedule_grp(odp_queue_t *out_queue, odp_event_t out_ev[], int pktin; unsigned int max_deq = max_burst; int stashed = 1; - odp_event_t *ev_tbl =
[lng-odp] [PATCH v1 0/6] Scheduler optimizations and clean ups
Incremental optimizations and clean ups. Sched_perf test shows 4-20% improvement on some test cases, 0% on others. Improvement not visible with L2fwd as majority of cycles are on packet IO side. github /** Email created from pull request 699 (psavol:master-sched-optim-clean-ups) ** https://github.com/Linaro/odp/pull/699 ** Patch: https://github.com/Linaro/odp/pull/699.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: 32d7a11f22e6f2e1e378b653993c5377d4116d8f **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 50 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 145 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 261 lines checked to_send-p-002.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 213 lines checked to_send-p-003.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 29 lines checked to_send-p-004.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 83 lines checked to_send-p-005.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v1 1/6] linux-gen: queue: remove extra checks
From: Petri Savolainen Remove unnecessary checks from critical sections of scheduled queue enqueue and dequeue operations. Parallelism improves when the number of instructions and (potential) cache misses decreases when holding the lock. Signed-off-by: Petri Savolainen --- /** Email created from pull request 699 (psavol:master-sched-optim-clean-ups) ** https://github.com/Linaro/odp/pull/699 ** Patch: https://github.com/Linaro/odp/pull/699.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: 32d7a11f22e6f2e1e378b653993c5377d4116d8f **/ platform/linux-generic/odp_queue_basic.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/platform/linux-generic/odp_queue_basic.c b/platform/linux-generic/odp_queue_basic.c index 7e8b7e34d..61cf8a56c 100644 --- a/platform/linux-generic/odp_queue_basic.c +++ b/platform/linux-generic/odp_queue_basic.c @@ -681,12 +681,6 @@ static inline int _sched_queue_enq_multi(odp_queue_t handle, LOCK(queue); - if (odp_unlikely(queue->s.status < QUEUE_STATUS_READY)) { - UNLOCK(queue); - ODP_ERR("Bad queue status\n"); - return -1; - } - num_enq = ring_st_enq_multi(ring_st, queue->s.ring_data, queue->s.ring_mask, buf_idx, num); @@ -712,7 +706,7 @@ static inline int _sched_queue_enq_multi(odp_queue_t handle, int sched_queue_deq(uint32_t queue_index, odp_event_t ev[], int max_num, int update_status) { - int num_deq; + int num_deq, status; ring_st_t *ring_st; queue_entry_t *queue = qentry_from_index(queue_index); int status_sync = sched_fn->status_sync; @@ -722,7 +716,9 @@ int sched_queue_deq(uint32_t queue_index, odp_event_t ev[], int max_num, LOCK(queue); - if (odp_unlikely(queue->s.status < QUEUE_STATUS_READY)) { + status = queue->s.status; + + if (odp_unlikely(status < QUEUE_STATUS_READY)) { /* Bad queue, or queue has been destroyed. * Scheduler finalizes queue destroy after this. */ UNLOCK(queue); @@ -734,10 +730,10 @@ int sched_queue_deq(uint32_t queue_index, odp_event_t ev[], int max_num, if (num_deq == 0) { /* Already empty queue */ - if (update_status && queue->s.status == QUEUE_STATUS_SCHED) { + if (update_status && status == QUEUE_STATUS_SCHED) { queue->s.status = QUEUE_STATUS_NOTSCHED; - if (status_sync) + if (odp_unlikely(status_sync)) sched_fn->unsched_queue(queue->s.index); } @@ -746,7 +742,7 @@ int sched_queue_deq(uint32_t queue_index, odp_event_t ev[], int max_num, return 0; } - if (status_sync && queue->s.type == ODP_QUEUE_TYPE_SCHED) + if (odp_unlikely(status_sync)) sched_fn->save_context(queue->s.index); UNLOCK(queue);
[lng-odp] [PATCH v1 3/6] linux-gen: sched: single variable for sync context status
From: Petri Savolainen Use single thread local variable to keep track if a synchronization context is held and the type of the context (atomic or ordered). Performance is improved as sync context status is located on single (the first) cache line of sched_local_t. Signed-off-by: Petri Savolainen --- /** Email created from pull request 699 (psavol:master-sched-optim-clean-ups) ** https://github.com/Linaro/odp/pull/699 ** Patch: https://github.com/Linaro/odp/pull/699.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: 32d7a11f22e6f2e1e378b653993c5377d4116d8f **/ platform/linux-generic/odp_schedule_basic.c | 130 +++- 1 file changed, 72 insertions(+), 58 deletions(-) diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 89c0a5c42..46ae7f1c1 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -30,6 +30,9 @@ #include #include +/* No synchronization context */ +#define NO_SYNC_CONTEXT ODP_SCHED_SYNC_PARALLEL + /* Number of priority levels */ #define NUM_PRIO 8 @@ -124,7 +127,8 @@ ODP_STATIC_ASSERT(sizeof(lock_called_t) == sizeof(uint32_t), /* Scheduler local data */ typedef struct ODP_ALIGNED_CACHE { uint16_t thr; - uint16_t pause; + uint8_t pause; + uint8_t sync_ctx; uint16_t grp_round; uint16_t spread_round; @@ -241,9 +245,6 @@ static sched_global_t *sched; /* Thread local scheduler context */ static __thread sched_local_t sched_local; -/* Function prototypes */ -static inline void schedule_release_context(void); - static int read_config_file(sched_global_t *sched) { const char *str; @@ -311,6 +312,7 @@ static void sched_local_init(void) memset(_local, 0, sizeof(sched_local_t)); sched_local.thr = odp_thread_id(); + sched_local.sync_ctx= NO_SYNC_CONTEXT; sched_local.stash.queue = ODP_QUEUE_INVALID; sched_local.stash.qi= PRIO_QUEUE_EMPTY; sched_local.ordered.src_queue = NULL_INDEX; @@ -450,17 +452,6 @@ static int schedule_init_local(void) return 0; } -static int schedule_term_local(void) -{ - if (sched_local.stash.num_ev) { - ODP_ERR("Locally pre-scheduled events exist.\n"); - return -1; - } - - schedule_release_context(); - return 0; -} - static inline void grp_update_mask(int grp, const odp_thrmask_t *new_mask) { odp_thrmask_copy(>sched_grp[grp].mask, new_mask); @@ -565,14 +556,9 @@ static int schedule_init_queue(uint32_t queue_index, return 0; } -static inline int queue_is_atomic(uint32_t queue_index) +static inline uint8_t sched_sync_type(uint32_t queue_index) { - return sched->queue[queue_index].sync == ODP_SCHED_SYNC_ATOMIC; -} - -static inline int queue_is_ordered(uint32_t queue_index) -{ - return sched->queue[queue_index].sync == ODP_SCHED_SYNC_ORDERED; + return sched->queue[queue_index].sync; } static void schedule_destroy_queue(uint32_t queue_index) @@ -584,7 +570,7 @@ static void schedule_destroy_queue(uint32_t queue_index) sched->queue[queue_index].prio = 0; sched->queue[queue_index].spread = 0; - if (queue_is_ordered(queue_index) && + if ((sched_sync_type(queue_index) == ODP_SCHED_SYNC_ORDERED) && odp_atomic_load_u64(>order[queue_index].ctx) != odp_atomic_load_u64(>order[queue_index].next_ctx)) ODP_ERR("queue reorder incomplete\n"); @@ -623,21 +609,26 @@ static void schedule_pktio_start(int pktio_index, int num_pktin, } } -static void schedule_release_atomic(void) +static inline void release_atomic(void) { - uint32_t qi = sched_local.stash.qi; + uint32_t qi = sched_local.stash.qi; + int grp = sched->queue[qi].grp; + int prio = sched->queue[qi].prio; + int spread = sched->queue[qi].spread; + ring_t *ring = >prio_q[grp][prio][spread].ring; - if (qi != PRIO_QUEUE_EMPTY && sched_local.stash.num_ev == 0) { - int grp = sched->queue[qi].grp; - int prio = sched->queue[qi].prio; - int spread = sched->queue[qi].spread; - ring_t *ring = >prio_q[grp][prio][spread].ring; + /* Release current atomic queue */ + ring_enq(ring, sched->ring_mask, qi); - /* Release current atomic queue */ - ring_enq(ring, sched->ring_mask, qi); + /* We don't hold sync context anymore */ + sched_local.sync_ctx = NO_SYNC_CONTEXT; +} - sched_local.stash.qi = PRIO_QUEUE_EMPTY; - } +static void schedule_release_atomic(void) +{ + if (sched_local.sync_ctx == ODP_SCHED_SYNC_ATOMIC && + sched_local.stash.num_ev == 0) + release_atomic(); } static inline int ordered_own_turn(uint32_t queue_index) @@ -709,9 +700,11 @@ static
[lng-odp] [PATCH v1 1/1] helper: iplookuptable fix puting values to table
From: Maxim Uvarov On putting values to table we have to validate input data and reject unaccepted data. Signed-off-by: Maxim Uvarov --- /** Email created from pull request 700 (Linaro:devel/master_iploopup) ** https://github.com/Linaro/odp/pull/700 ** Patch: https://github.com/Linaro/odp/pull/700.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: ce64f0400605ea7b3298769a1ebce6fa7da611a9 **/ helper/iplookuptable.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/helper/iplookuptable.c b/helper/iplookuptable.c index 61f634022..b0141c311 100644 --- a/helper/iplookuptable.c +++ b/helper/iplookuptable.c @@ -585,24 +585,25 @@ prefix_insert_into_lx( odph_iplookup_table_impl *tbl, prefix_entry_t *entry, uint8_t cidr, odp_buffer_t nexthop, uint8_t level) { - uint8_t ret = 0; + int ret = 0; uint32_t i = 0, limit = (1 << (level - cidr)); prefix_entry_t *e = entry, *ne = NULL; for (i = 0; i < limit; i++, e++) { - if (e->child == 1) { - if (e->cidr > cidr) - continue; + if (e->cidr > cidr) + continue; + if (e->child == 1) { e->cidr = cidr; /* push to next level */ ne = (prefix_entry_t *)e->ptr; ret = prefix_insert_into_lx( tbl, ne, cidr, nexthop, cidr + 8); + if (ret == -1) + return -1; + if (ret == 0) + return ret; } else { - if (e->cidr > cidr) - continue; - e->child = 0; e->cidr = cidr; e->nexthop = nexthop; @@ -678,8 +679,9 @@ odph_iplookup_table_put_value(odph_table_t tbl, void *key, void *value) nexthop = *((odp_buffer_t *)value); - if (prefix->cidr == 0) + if (prefix->cidr == 0 || prefix->cidr == 255) return -1; + prefix->ip = prefix->ip & (0x << (IP_LENGTH - prefix->cidr)); /* insert into trie */
[lng-odp] [PATCH v1 0/1] helper: iplookuptable fix puting values to table
On putting values to table we have to validate input data and reject unaccepted data. Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org github /** Email created from pull request 700 (Linaro:devel/master_iploopup) ** https://github.com/Linaro/odp/pull/700 ** Patch: https://github.com/Linaro/odp/pull/700.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: ce64f0400605ea7b3298769a1ebce6fa7da611a9 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 42 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v1 0/1] linux-gen: ipsec: reject SA creation with ESN flag set
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsoleni...@linaro.org Fixes: https://bugs.linaro.org/show_bug.cgi?id=4002 github /** Email created from pull request 698 (lumag:ipsec-no-esn) ** https://github.com/Linaro/odp/pull/698 ** Patch: https://github.com/Linaro/odp/pull/698.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: 3f3193c9ef13ae0a8bb5489142b1fd1b70f12a45 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 10 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v1 1/1] linux-gen: ipsec: reject SA creation with ESN flag set
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov Fixes: https://bugs.linaro.org/show_bug.cgi?id=4002 --- /** Email created from pull request 698 (lumag:ipsec-no-esn) ** https://github.com/Linaro/odp/pull/698 ** Patch: https://github.com/Linaro/odp/pull/698.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: 3f3193c9ef13ae0a8bb5489142b1fd1b70f12a45 **/ platform/linux-generic/odp_ipsec_sad.c | 4 1 file changed, 4 insertions(+) diff --git a/platform/linux-generic/odp_ipsec_sad.c b/platform/linux-generic/odp_ipsec_sad.c index 11f37fd8f..3a066bbf9 100644 --- a/platform/linux-generic/odp_ipsec_sad.c +++ b/platform/linux-generic/odp_ipsec_sad.c @@ -289,6 +289,10 @@ odp_ipsec_sa_t odp_ipsec_sa_create(const odp_ipsec_sa_param_t *param) ipsec_sa->queue = param->dest_queue; ipsec_sa->mode = param->mode; ipsec_sa->flags = 0; + if (param->opt.esn) { + ODP_ERR("ESN is not supported!\n"); + return ODP_IPSEC_SA_INVALID; + } if (ODP_IPSEC_DIR_INBOUND == param->dir) { ipsec_sa->lookup_mode = param->inbound.lookup_mode; if (ODP_IPSEC_LOOKUP_DSTADDR_SPI == ipsec_sa->lookup_mode) {
[lng-odp] [PATCH v1 1/1] linux-gen: ipsec: fix sliding window shifts
From: Dmitry Eremin-Solenikov If shift is greater than window bit-width, bit shift results in undefined behaviour. Rewrite code to excplicitly set the mask in such cases. Signed-off-by: Dmitry Eremin-Solenikov Fixes: https://bugs.linaro.org/show_bug.cgi?id=3999 --- /** Email created from pull request 697 (lumag:ipsec-seq) ** https://github.com/Linaro/odp/pull/697 ** Patch: https://github.com/Linaro/odp/pull/697.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: ec1eaa3b88c25979551791e3eb7f43ee6b10deed **/ platform/linux-generic/odp_ipsec_sad.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/platform/linux-generic/odp_ipsec_sad.c b/platform/linux-generic/odp_ipsec_sad.c index 11f37fd8f..3c19939e4 100644 --- a/platform/linux-generic/odp_ipsec_sad.c +++ b/platform/linux-generic/odp_ipsec_sad.c @@ -701,18 +701,17 @@ int _odp_ipsec_sa_replay_update(ipsec_sa_t *ipsec_sa, uint32_t seq, if (seq + IPSEC_ANTIREPLAY_WS <= max_seq) { status->error.antireplay = 1; return -1; - } - - if (seq > max_seq) { + } else if (seq >= max_seq + IPSEC_ANTIREPLAY_WS) { + mask = 1; + max_seq = seq; + } else if (seq > max_seq) { mask <<= seq - max_seq; mask |= 1; max_seq = seq; + } else if (mask & (1U << (max_seq - seq))) { + status->error.antireplay = 1; + return -1; } else { - if (mask & (1U << (max_seq - seq))) { - status->error.antireplay = 1; - return -1; - } - mask |= (1U << (max_seq - seq)); }
[lng-odp] [PATCH v1 0/1] linux-gen: ipsec: fix sliding window shifts
If shift is greater than window bit-width, bit shift results in undefined behaviour. Rewrite code to excplicitly set the mask in such cases. Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsoleni...@linaro.org Fixes: https://bugs.linaro.org/show_bug.cgi?id=3999 github /** Email created from pull request 697 (lumag:ipsec-seq) ** https://github.com/Linaro/odp/pull/697 ** Patch: https://github.com/Linaro/odp/pull/697.patch ** Base sha: 33fbc04b6373960ec3f84de4e7e7b34c49d71508 ** Merge commit sha: ec1eaa3b88c25979551791e3eb7f43ee6b10deed **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 25 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v2 1/1] linux-generic : fix wrong spelling
From: Seungha Son Signed-off-by: Seungha Son --- /** Email created from pull request 696 (linuxias:master) ** https://github.com/Linaro/odp/pull/696 ** Patch: https://github.com/Linaro/odp/pull/696.patch ** Base sha: 6d48d7f7f684b8aa87f7eb4f922d45be345ed771 ** Merge commit sha: cd15d0aa1e4e33600e609842df5d81a5304643f8 **/ platform/linux-generic/odp_ishm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index 59d1fe534..f0d8ef645 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -17,7 +17,7 @@ * Internal shared memory is mainly meant to be used internaly within ODP * (hence its name), but may also be allocated by odp applications and drivers, * in the future (through these interfaces). - * To guarrentee this full pointer shareability (when reserved with the + * To guarantee this full pointer shareability (when reserved with the * _ODP_ISHM_SINGLE_VA flag) internal shared memory is handled as follows: * At global_init time, a huge virtual address space reservation is performed. * Note that this is just reserving virtual space, not physical memory. @@ -84,7 +84,7 @@ * * This is the number of separate ISHM areas that can be reserved concurrently * (Note that freeing such blocks may take time, or possibly never happen - * if some of the block ownwers never procsync() after free). This number + * if some of the block owners never procsync() after free). This number * should take that into account) */ #define ISHM_MAX_NB_BLOCKS 128
[lng-odp] [PATCH v2 0/1] linux-generic : fix wrong spelling
Signed-off-by: Seungha Son linux...@gmail.com github /** Email created from pull request 696 (linuxias:master) ** https://github.com/Linaro/odp/pull/696 ** Patch: https://github.com/Linaro/odp/pull/696.patch ** Base sha: 6d48d7f7f684b8aa87f7eb4f922d45be345ed771 ** Merge commit sha: cd15d0aa1e4e33600e609842df5d81a5304643f8 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 16 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v4 1/2] linux-gen: ishm: implement huge page cache
From: Josep Puigdemont With this patch, ODP will pre-allocate several huge pages at init time. When memory is to be mapped into a huge page, one that was pre-allocated will be used, if available, this way ODP won't have to trap into the kernel to allocate huge pages. The idea with this implementation is to trick ishm into thinking that a file descriptor where to map the memory was provided, this way it it won't try to allocate one itself. This file descriptor is one of those previously allocated at init time. When the system is done with this file descriptor, instead of closing it, it is put back into the list of available huge pages, ready to be reused. A collateral effect of this patch is that memory is not zeroed out when it is reused. WARNING: This patch will not work when using process mode threads. For several reasons, this may not work when using ODP_ISHM_SINGLE_VA either, so when this flag is set, the list of pre-allocated files is not used. By default ODP will not reserve any huge pages, to tell ODP to do that, update the ODP configuration file with something like this: shm: { num_cached_hp = 32 } Example usage: $ echo odp.config odp_implementation = "linux-generic" config_file_version = "0.0.1" shm: { num_cached_hp = 32 } $ ODP_CONFIG_FILE=odp.conf ./test/validation/api/shmem/shmem_main This patch solves bug #3774: https://bugs.linaro.org/show_bug.cgi?id=3774 Signed-off-by: Josep Puigdemont --- /** Email created from pull request 685 (joseppc:fix/cache_huge_pages) ** https://github.com/Linaro/odp/pull/685 ** Patch: https://github.com/Linaro/odp/pull/685.patch ** Base sha: 6d48d7f7f684b8aa87f7eb4f922d45be345ed771 ** Merge commit sha: 71e95a3d2ddb0df6ba6f0e3a62bf6aa98afbb035 **/ config/odp-linux-generic.conf | 11 ++ platform/linux-generic/odp_ishm.c | 218 -- 2 files changed, 215 insertions(+), 14 deletions(-) diff --git a/config/odp-linux-generic.conf b/config/odp-linux-generic.conf index 85d5414ba..0dd2a6c13 100644 --- a/config/odp-linux-generic.conf +++ b/config/odp-linux-generic.conf @@ -18,6 +18,17 @@ odp_implementation = "linux-generic" config_file_version = "0.0.1" +# Internal shared memory allocator +shm: { + # ODP will try to reserve as many huge pages as the number indicated + # here, up to 64. A zero value means that no pages should be reserved. + # When using process mode threads, this value should be set to 0 + # because the current implementation won't work properly otherwise. + # These pages will only be freed when the application calls + # odp_term_global(). + num_cached_hp = 0 +} + # DPDK pktio options pktio_dpdk: { # Default options diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index 59d1fe534..aeda50bec 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #include @@ -164,7 +165,7 @@ typedef struct ishm_fragment { * will allocate both a block and a fragment. * Blocks contain only global data common to all processes. */ -typedef enum {UNKNOWN, HUGE, NORMAL, EXTERNAL} huge_flag_t; +typedef enum {UNKNOWN, HUGE, NORMAL, EXTERNAL, CACHED} huge_flag_t; typedef struct ishm_block { char name[ISHM_NAME_MAXLEN];/* name for the ishm block (if any) */ char filename[ISHM_FILENAME_MAXLEN]; /* name of the .../odp-* file */ @@ -238,6 +239,16 @@ typedef struct { } ishm_ftable_t; static ishm_ftable_t *ishm_ftbl; +#define HP_CACHE_SIZE 64 +struct huge_page_cache { + uint64_t len; + int total; /* amount of actually pre-allocated huge pages */ + int idx; /* retrieve fd[idx] to get a free file descriptor */ + int fd[HP_CACHE_SIZE]; /* list of file descriptors */ +}; + +static struct huge_page_cache hpc; + #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif @@ -245,6 +256,142 @@ static ishm_ftable_t *ishm_ftbl; /* prototypes: */ static void procsync(void); +static int hp_create_file(uint64_t len, const char *filename) +{ + int fd; + void *addr; + + if (len <= 0) { + ODP_ERR("Length is wrong\n"); + return -1; + } + + fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (fd < 0) { + ODP_ERR("Could not create cache file %s\n", filename); + return -1; + } + + /* remove file from file system */ + unlink(filename); + + if (ftruncate(fd, len) == -1) { + ODP_ERR("Could not truncate file: %s\n", strerror(errno)); + close(fd); + return -1; + } + + /* commit huge page */ + addr = _odp_ishmphy_map(fd, NULL, len, 0); + if (addr == NULL) { + /* no more pages available */ + close(fd); + return
[lng-odp] [PATCH v4 2/2] linux-gen: ishm: make huge page cache size dynamic
From: Josep Puigdemont Signed-off-by: Josep Puigdemont --- /** Email created from pull request 685 (joseppc:fix/cache_huge_pages) ** https://github.com/Linaro/odp/pull/685 ** Patch: https://github.com/Linaro/odp/pull/685.patch ** Base sha: 6d48d7f7f684b8aa87f7eb4f922d45be345ed771 ** Merge commit sha: 71e95a3d2ddb0df6ba6f0e3a62bf6aa98afbb035 **/ config/odp-linux-generic.conf | 2 +- platform/linux-generic/odp_ishm.c | 73 +++ 2 files changed, 46 insertions(+), 29 deletions(-) diff --git a/config/odp-linux-generic.conf b/config/odp-linux-generic.conf index 0dd2a6c13..318af0ad7 100644 --- a/config/odp-linux-generic.conf +++ b/config/odp-linux-generic.conf @@ -21,7 +21,7 @@ config_file_version = "0.0.1" # Internal shared memory allocator shm: { # ODP will try to reserve as many huge pages as the number indicated - # here, up to 64. A zero value means that no pages should be reserved. + # here. A zero value means that no pages should be reserved. # When using process mode threads, this value should be set to 0 # because the current implementation won't work properly otherwise. # These pages will only be freed when the application calls diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index aeda50bec..11fbe8ef0 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -239,15 +239,15 @@ typedef struct { } ishm_ftable_t; static ishm_ftable_t *ishm_ftbl; -#define HP_CACHE_SIZE 64 struct huge_page_cache { uint64_t len; + int max_fds; /* maximum amount requested of pre-allocated huge pages */ int total; /* amount of actually pre-allocated huge pages */ int idx; /* retrieve fd[idx] to get a free file descriptor */ - int fd[HP_CACHE_SIZE]; /* list of file descriptors */ + int fd[];/* list of file descriptors */ }; -static struct huge_page_cache hpc; +static struct huge_page_cache *hpc; #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON @@ -301,19 +301,14 @@ static void hp_init(void) char filename[ISHM_FILENAME_MAXLEN]; char dir[ISHM_FILENAME_MAXLEN]; int count; - - hpc.total = 0; - hpc.idx = -1; - hpc.len = odp_sys_huge_page_size(); + void *addr; if (!_odp_libconfig_lookup_ext_int("shm", NULL, "num_cached_hp", )) { return; } - if (count > HP_CACHE_SIZE) - count = HP_CACHE_SIZE; - else if (count <= 0) + if (count <= 0) return; ODP_DBG("Init HP cache with up to %d pages\n", count); @@ -339,55 +334,77 @@ static void hp_init(void) dir, odp_global_data.main_pid); + addr = mmap(NULL, + sizeof(struct huge_page_cache) + sizeof(int) * count, + PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); + if (addr == MAP_FAILED) { + ODP_ERR("Unable to mmap memory for huge page cache\n."); + return; + } + + hpc = addr; + + hpc->max_fds = count; + hpc->total = 0; + hpc->idx = -1; + hpc->len = odp_sys_huge_page_size(); + for (int i = 0; i < count; ++i) { int fd; - fd = hp_create_file(hpc.len, filename); - if (fd == -1) + fd = hp_create_file(hpc->len, filename); + if (fd == -1) { + do { + hpc->fd[i++] = -1; + } while (i < count); break; - hpc.total++; - hpc.fd[i] = fd; + } + hpc->total++; + hpc->fd[i] = fd; } - hpc.idx = hpc.total - 1; + hpc->idx = hpc->total - 1; ODP_DBG("HP cache has %d huge pages of size 0x%08" PRIx64 "\n", - hpc.total, hpc.len); + hpc->total, hpc->len); } static void hp_term(void) { - for (int i = 0; i < hpc.total; i++) { - if (hpc.fd[i] != -1) - close(hpc.fd[i]); + if (NULL == hpc) + return; + + for (int i = 0; i < hpc->total; i++) { + if (hpc->fd[i] != -1) + close(hpc->fd[i]); } - hpc.total = 0; - hpc.idx = -1; - hpc.len = 0; + hpc->total = 0; + hpc->idx = -1; + hpc->len = 0; } static int hp_get_cached(uint64_t len) { int fd; - if (hpc.idx < 0 || len != hpc.len) + if (NULL == hpc || hpc->idx < 0 || len != hpc->len) return -1; - fd = hpc.fd[hpc.idx]; - hpc.fd[hpc.idx--] = -1; + fd = hpc->fd[hpc->idx]; + hpc->fd[hpc->idx--] = -1; return fd; } static int hp_put_cached(int fd) { - if (odp_unlikely(++hpc.idx >= hpc.total)) { -
[lng-odp] [PATCH v4 0/2] linux-gen: ishm: implement huge page cache
With this patch, ODP will pre-allocate several huge pages at init time. When memory is to be mapped into a huge page, one that was pre-allocated will be used, if available, this way ODP won't have to trap into the kernel to allocate huge pages. The idea with this implementation is to trick ishm into thinking that a file descriptor where to map the memory was provided, this way it it won't try to allocate one itself. This file descriptor is one of those previously allocated at init time. When the system is done with this file descriptor, instead of closing it, it is put back into the list of available huge pages, ready to be reused. A collateral effect of this patch is that memory is not zeroed out when it is reused. WARNING: This patch will not work when using process mode threads. For several reasons, this may not work when using ODP_ISHM_SINGLE_VA either, so for this case the list of pre-allocated files is not used. This patch should mitigate, if not solve, bug #3774: https://bugs.linaro.org/show_bug.cgi?id=3774 To pre-allocate huge pages, define the environment variable ODP_HP_CACHE, and possibly set it to the number of huge pages that should be pre-allocated, setting it to -1 will reserve up to 32 huge pages, which is currently a hard-coded limit. example usage: ODP_HP_CACHE=-1 ./test/validation/api/shmem/shmem_main Signed-off-by: Josep Puigdemont josep.puigdem...@linaro.org github /** Email created from pull request 685 (joseppc:fix/cache_huge_pages) ** https://github.com/Linaro/odp/pull/685 ** Patch: https://github.com/Linaro/odp/pull/685.patch ** Base sha: 6d48d7f7f684b8aa87f7eb4f922d45be345ed771 ** Merge commit sha: 71e95a3d2ddb0df6ba6f0e3a62bf6aa98afbb035 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 309 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 142 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v1 0/1] linux-gen: ishm: don't initialize anonymous mappings
Anonymous mappings are automatically initalized to zero. >From the mmap manual: "MAP_ANONYMOUS: The mapping is not backed by any file; its contents are initialized to zero." Signed-off-by: Josep Puigdemont josep.puigdem...@linaro.org github /** Email created from pull request 695 (joseppc:fix/no-init-mmap-anonymous) ** https://github.com/Linaro/odp/pull/695 ** Patch: https://github.com/Linaro/odp/pull/695.patch ** Base sha: 6d48d7f7f684b8aa87f7eb4f922d45be345ed771 ** Merge commit sha: 2287a4ca0a06b738b59a5b1421d0a429df26 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 14 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v1 1/1] linux-gen: ishm: don't initialize anonymous mappings
From: Josep Puigdemont Anonymous mappings are automatically initalized to zero. >From the mmap manual: "MAP_ANONYMOUS: The mapping is not backed by any file; its contents are initialized to zero." Signed-off-by: Josep Puigdemont --- /** Email created from pull request 695 (joseppc:fix/no-init-mmap-anonymous) ** https://github.com/Linaro/odp/pull/695 ** Patch: https://github.com/Linaro/odp/pull/695.patch ** Base sha: 6d48d7f7f684b8aa87f7eb4f922d45be345ed771 ** Merge commit sha: 2287a4ca0a06b738b59a5b1421d0a429df26 **/ platform/linux-generic/odp_ishm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index 59d1fe534..07ce4d534 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -1508,7 +1508,6 @@ int _odp_ishm_init_global(const odp_init_t *init) goto init_glob_err1; } ishm_tbl = addr; - memset(ishm_tbl, 0, sizeof(ishm_table_t)); ishm_tbl->dev_seq = 0; ishm_tbl->odpthread_cnt = 0; odp_spinlock_init(_tbl->lock); @@ -1521,7 +1520,6 @@ int _odp_ishm_init_global(const odp_init_t *init) goto init_glob_err2; } ishm_ftbl = addr; - memset(ishm_ftbl, 0, sizeof(ishm_ftable_t)); /* *reserve the address space for _ODP_ISHM_SINGLE_VA reserved blocks,
[lng-odp] [PATCH v3 0/2] linux-gen: ishm: implement huge page cache
With this patch, ODP will pre-allocate several huge pages at init time. When memory is to be mapped into a huge page, one that was pre-allocated will be used, if available, this way ODP won't have to trap into the kernel to allocate huge pages. The idea with this implementation is to trick ishm into thinking that a file descriptor where to map the memory was provided, this way it it won't try to allocate one itself. This file descriptor is one of those previously allocated at init time. When the system is done with this file descriptor, instead of closing it, it is put back into the list of available huge pages, ready to be reused. A collateral effect of this patch is that memory is not zeroed out when it is reused. WARNING: This patch will not work when using process mode threads. For several reasons, this may not work when using ODP_ISHM_SINGLE_VA either, so for this case the list of pre-allocated files is not used. This patch should mitigate, if not solve, bug #3774: https://bugs.linaro.org/show_bug.cgi?id=3774 To pre-allocate huge pages, define the environment variable ODP_HP_CACHE, and possibly set it to the number of huge pages that should be pre-allocated, setting it to -1 will reserve up to 32 huge pages, which is currently a hard-coded limit. example usage: ODP_HP_CACHE=-1 ./test/validation/api/shmem/shmem_main Signed-off-by: Josep Puigdemont josep.puigdem...@linaro.org github /** Email created from pull request 685 (joseppc:fix/cache_huge_pages) ** https://github.com/Linaro/odp/pull/685 ** Patch: https://github.com/Linaro/odp/pull/685.patch ** Base sha: 6d48d7f7f684b8aa87f7eb4f922d45be345ed771 ** Merge commit sha: 72e8f7c6b712af7da295dbcf41b222e016ee5cc4 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 308 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 134 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v3 1/2] linux-gen: ishm: implement huge page cache
From: Josep Puigdemont With this patch, ODP will pre-allocate several huge pages at init time. When memory is to be mapped into a huge page, one that was pre-allocated will be used, if available, this way ODP won't have to trap into the kernel to allocate huge pages. The idea with this implementation is to trick ishm into thinking that a file descriptor where to map the memory was provided, this way it it won't try to allocate one itself. This file descriptor is one of those previously allocated at init time. When the system is done with this file descriptor, instead of closing it, it is put back into the list of available huge pages, ready to be reused. A collateral effect of this patch is that memory is not zeroed out when it is reused. WARNING: This patch will not work when using process mode threads. For several reasons, this may not work when using ODP_ISHM_SINGLE_VA either, so when this flag is set, the list of pre-allocated files is not used. By default ODP will not reserve any huge pages, to tell ODP to do that, update the ODP configuration file with something like this: ishm: { num_reserved_hp = 32 } Example usage: $ echo odp.config odp_implementation = "linux-generic" config_file_version = "0.0.1" ishm: { num_reserved_hp = 32 } $ ODP_CONFIG_FILE=odp.conf ./test/validation/api/shmem/shmem_main This patch solves bug #3774: https://bugs.linaro.org/show_bug.cgi?id=3774 Signed-off-by: Josep Puigdemont --- /** Email created from pull request 685 (joseppc:fix/cache_huge_pages) ** https://github.com/Linaro/odp/pull/685 ** Patch: https://github.com/Linaro/odp/pull/685.patch ** Base sha: 6d48d7f7f684b8aa87f7eb4f922d45be345ed771 ** Merge commit sha: 72e8f7c6b712af7da295dbcf41b222e016ee5cc4 **/ config/odp-linux-generic.conf | 10 ++ platform/linux-generic/odp_ishm.c | 218 -- 2 files changed, 214 insertions(+), 14 deletions(-) diff --git a/config/odp-linux-generic.conf b/config/odp-linux-generic.conf index 85d5414ba..d1be5040e 100644 --- a/config/odp-linux-generic.conf +++ b/config/odp-linux-generic.conf @@ -18,6 +18,16 @@ odp_implementation = "linux-generic" config_file_version = "0.0.1" +# Internal shared memory allocator +ishm: { + # ODP will try to reserve as many huge pages as the number indicated + # here, up to 64. Zero or a negative value means that no pages should + # be reserved. + # These pages will only be freed when the application call + # odp_term_global(). + num_reserved_hp = 0 +} + # DPDK pktio options pktio_dpdk: { # Default options diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index 59d1fe534..b1009355d 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #include @@ -164,7 +165,7 @@ typedef struct ishm_fragment { * will allocate both a block and a fragment. * Blocks contain only global data common to all processes. */ -typedef enum {UNKNOWN, HUGE, NORMAL, EXTERNAL} huge_flag_t; +typedef enum {UNKNOWN, HUGE, NORMAL, EXTERNAL, CACHED} huge_flag_t; typedef struct ishm_block { char name[ISHM_NAME_MAXLEN];/* name for the ishm block (if any) */ char filename[ISHM_FILENAME_MAXLEN]; /* name of the .../odp-* file */ @@ -238,6 +239,16 @@ typedef struct { } ishm_ftable_t; static ishm_ftable_t *ishm_ftbl; +#define HP_CACHE_SIZE 64 +struct huge_page_cache { + uint64_t len; + int total; /* amount of actually pre-allocated huge pages */ + int idx; /* retrieve fd[idx] to get a free file descriptor */ + int fd[HP_CACHE_SIZE]; /* list of file descriptors */ +}; + +static struct huge_page_cache hpc; + #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif @@ -245,6 +256,142 @@ static ishm_ftable_t *ishm_ftbl; /* prototypes: */ static void procsync(void); +static int hp_create_file(uint64_t len, const char *filename) +{ + int fd; + void *addr; + + if (len <= 0) { + ODP_ERR("Length is wrong\n"); + return -1; + } + + fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (fd < 0) { + ODP_ERR("Could not create cache file %s\n", filename); + return -1; + } + + /* remove file from file system */ + unlink(filename); + + if (ftruncate(fd, len) == -1) { + ODP_ERR("Could not truncate file: %s\n", strerror(errno)); + close(fd); + return -1; + } + + /* commit huge page */ + addr = _odp_ishmphy_map(fd, NULL, len, 0); + if (addr == NULL) { + /* no more pages available */ + close(fd); + return -1; + } + _odp_ishmphy_unmap(addr, len, 0); + + ODP_DBG("Created HP cache file %s, fd: %d\n",
[lng-odp] [PATCH v3 2/2] linux-gen: ishm: make huge page cache size dynamic
From: Josep Puigdemont Signed-off-by: Josep Puigdemont --- /** Email created from pull request 685 (joseppc:fix/cache_huge_pages) ** https://github.com/Linaro/odp/pull/685 ** Patch: https://github.com/Linaro/odp/pull/685.patch ** Base sha: 6d48d7f7f684b8aa87f7eb4f922d45be345ed771 ** Merge commit sha: 72e8f7c6b712af7da295dbcf41b222e016ee5cc4 **/ platform/linux-generic/odp_ishm.c | 73 +++ 1 file changed, 45 insertions(+), 28 deletions(-) diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index b1009355d..dd82c329a 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -239,15 +239,15 @@ typedef struct { } ishm_ftable_t; static ishm_ftable_t *ishm_ftbl; -#define HP_CACHE_SIZE 64 struct huge_page_cache { uint64_t len; + int max_fds; /* maximum amount requested of pre-allocated huge pages */ int total; /* amount of actually pre-allocated huge pages */ int idx; /* retrieve fd[idx] to get a free file descriptor */ - int fd[HP_CACHE_SIZE]; /* list of file descriptors */ + int fd[];/* list of file descriptors */ }; -static struct huge_page_cache hpc; +static struct huge_page_cache *hpc; #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON @@ -301,19 +301,14 @@ static void hp_init(void) char filename[ISHM_FILENAME_MAXLEN]; char dir[ISHM_FILENAME_MAXLEN]; int count; - - hpc.total = 0; - hpc.idx = -1; - hpc.len = odp_sys_huge_page_size(); + void *addr; if (!_odp_libconfig_lookup_ext_int("ishm", NULL, "num_reserved_hp", )) { return; } - if (count > HP_CACHE_SIZE) - count = HP_CACHE_SIZE; - else if (count <= 0) + if (count <= 0) return; ODP_DBG("Init HP cache with up to %d pages\n", count); @@ -339,55 +334,77 @@ static void hp_init(void) dir, odp_global_data.main_pid); + addr = mmap(NULL, + sizeof(struct huge_page_cache) + sizeof(int) * count, + PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); + if (addr == MAP_FAILED) { + ODP_ERR("Unable to mmap memory for huge page cache\n."); + return; + } + + hpc = addr; + + hpc->max_fds = count; + hpc->total = 0; + hpc->idx = -1; + hpc->len = odp_sys_huge_page_size(); + for (int i = 0; i < count; ++i) { int fd; - fd = hp_create_file(hpc.len, filename); - if (fd == -1) + fd = hp_create_file(hpc->len, filename); + if (fd == -1) { + do { + hpc->fd[i++] = -1; + } while (i < count); break; - hpc.total++; - hpc.fd[i] = fd; + } + hpc->total++; + hpc->fd[i] = fd; } - hpc.idx = hpc.total - 1; + hpc->idx = hpc->total - 1; ODP_DBG("HP cache has %d huge pages of size 0x%08" PRIx64 "\n", - hpc.total, hpc.len); + hpc->total, hpc->len); } static void hp_term(void) { - for (int i = 0; i < hpc.total; i++) { - if (hpc.fd[i] != -1) - close(hpc.fd[i]); + if (NULL == hpc) + return; + + for (int i = 0; i < hpc->total; i++) { + if (hpc->fd[i] != -1) + close(hpc->fd[i]); } - hpc.total = 0; - hpc.idx = -1; - hpc.len = 0; + hpc->total = 0; + hpc->idx = -1; + hpc->len = 0; } static int hp_get_cached(uint64_t len) { int fd; - if (hpc.idx < 0 || len != hpc.len) + if (NULL == hpc || hpc->idx < 0 || len != hpc->len) return -1; - fd = hpc.fd[hpc.idx]; - hpc.fd[hpc.idx--] = -1; + fd = hpc->fd[hpc->idx]; + hpc->fd[hpc->idx--] = -1; return fd; } static int hp_put_cached(int fd) { - if (odp_unlikely(++hpc.idx >= hpc.total)) { - hpc.idx--; + if (NULL == hpc || odp_unlikely(++hpc->idx >= hpc->total)) { + hpc->idx--; ODP_ERR("Trying to put more FD than allowed: %d\n", fd); return -1; } - hpc.fd[hpc.idx] = fd; + hpc->fd[hpc->idx] = fd; return 0; }
[lng-odp] [PATCH v5 2/3] linux-gen: x86: as a last resort parse max cpu freq from bogomips value
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: a057d7593fa6375352a84ec9ce2c997b6581b790 **/ .../arch/x86/odp_sysinfo_parse.c | 30 +++ 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c index 504aa3efa..5084e6b5f 100644 --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c @@ -15,34 +15,54 @@ int cpuinfo_parser(FILE *file, system_info_t *sysinfo) char str[1024]; char *pos, *pos_end; double ghz = 0.0; + double mhz = 0.0; uint64_t hz; int id = 0; + bool freq_set = false; strcpy(sysinfo->cpu_arch_str, "x86"); while (fgets(str, sizeof(str), file) != NULL && id < CONFIG_NUM_CPU) { pos = strstr(str, "model name"); if (pos) { + freq_set = false; + /* Copy model name between : and @ characters */ pos = strchr(str, ':'); pos_end = strchr(str, '@'); - if (pos == NULL || pos_end == NULL) + if (pos == NULL) continue; - *(pos_end - 1) = '\0'; + if (pos_end != NULL) + *(pos_end - 1) = '\0'; + strncpy(sysinfo->model_str[id], pos + 2, MODEL_STR_SIZE - 1); if (sysinfo->cpu_hz_max[id]) { + freq_set = true; id++; continue; } /* max frequency needs to be set */ - if (sscanf(pos_end, "@ %lfGHz", ) == 1) { + if (pos_end != NULL && + sscanf(pos_end, "@ %lfGHz", ) == 1) { hz = (uint64_t)(ghz * 10.0); - sysinfo->cpu_hz_max[id] = hz; + sysinfo->cpu_hz_max[id++] = hz; + freq_set = true; + } + } else if (!freq_set && + strstr(str, "bogomips") != NULL) { + pos = strchr(str, ':'); + if (pos == NULL) + continue; + + if (sscanf(pos + 2, "%lf", ) == 1) { + /* On typical x86 BogoMIPS is freq * 2 */ + hz = (uint64_t)(mhz * 100.0 / 2); + sysinfo->cpu_hz_max[id++] = hz; + freq_set = true; } - id++; } }
[lng-odp] [PATCH v5 3/3] validation: system: 0 is valid huge page size
From: Dmitry Eremin-Solenikov If system does not support huge pages, odp_sys_huge_page_size() will return 0, which should not be rejected by test. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: a057d7593fa6375352a84ec9ce2c997b6581b790 **/ test/validation/api/system/system.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/validation/api/system/system.c b/test/validation/api/system/system.c index 75fd26f31..f016a2ded 100644 --- a/test/validation/api/system/system.c +++ b/test/validation/api/system/system.c @@ -216,7 +216,11 @@ static void system_test_odp_sys_huge_page_size(void) uint64_t page; page = odp_sys_huge_page_size(); - CU_ASSERT(0 < page); + if (page == 0) + /* Not an error, but just to be sure to hit logs */ + LOG_ERR("Huge pages do not seem to be supported\n"); + else + CU_ASSERT(page % ODP_PAGE_SIZE == 0); } static void system_test_odp_sys_huge_page_size_all(void)
[lng-odp] [PATCH v5 0/3] Two fxes for sysinfo
github /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: a057d7593fa6375352a84ec9ce2c997b6581b790 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 11 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 59 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 12 lines checked to_send-p-002.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v5 1/3] linux-gen: sysinfo: return 0 if hugepages are not supported
From: Dmitry Eremin-Solenikov Per API return 0 from odp_sys_huge_page_size_all() if hugepages are not supported/detected. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: a057d7593fa6375352a84ec9ce2c997b6581b790 **/ platform/linux-generic/odp_system_info.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index bca02ba14..608fa51e5 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -442,8 +442,9 @@ int odp_sys_huge_page_size_all(uint64_t size[], int num) /* See: kernel.org: hugetlbpage.txt */ dir = opendir("/sys/kernel/mm/hugepages"); if (!dir) { - ODP_ERR("Failed to open huge page directory\n"); - return -1; + ODP_PRINT("Failed to open /sys/kernel/mm/hugepages: %s\n", + strerror(errno)); + return 0; } while ((entry = readdir(dir)) != NULL) {
[lng-odp] [PATCH v3 1/1] travis: add ubuntu 18.04 compilation test
From: Maxim Uvarov Signed-off-by: Maxim Uvarov --- /** Email created from pull request 689 (muvarov:devel/master_u18) ** https://github.com/Linaro/odp/pull/689 ** Patch: https://github.com/Linaro/odp/pull/689.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: d99b7ce145703f3cc45aa31026d10c02b861f999 **/ .travis.yml | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 26431ff19..f2b97e4f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,6 +43,7 @@ env: # 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=a733c34c-5f5c-4ff1-af4b-e9f5edb1ab5e +- UBUNTU_VERS="16.04" matrix: - CONF="" - CONF="--disable-abi-compat" @@ -61,6 +62,7 @@ env: - CONF="--disable-host-optimization --disable-abi-compat" - CONF="--enable-pcapng-support" - CONF="--without-openssl" +- CONF="" UBUNTU_VERS="18.04" compiler: - gcc @@ -85,14 +87,14 @@ script: docker run -i -t -v `pwd`:/odp -e CC="${CC}" -e CONF="${CONF}" - ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_${CROSS_ARCH}.sh ; + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_${UBUNTU_VERS} /odp/scripts/ci/build_${CROSS_ARCH}.sh ; else echo "Running test" ; docker run --privileged -i -t -v `pwd`:/odp --shm-size 8g -e CC="${CC}" -e CONF="${CONF}" - ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/check.sh ; + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_${UBUNTU_VERS} /odp/scripts/ci/check.sh ; fi jobs: include:
[lng-odp] [PATCH v3 0/1] travis: add ubuntu 18.04 compilation test
Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org github /** Email created from pull request 689 (muvarov:devel/master_u18) ** https://github.com/Linaro/odp/pull/689 ** Patch: https://github.com/Linaro/odp/pull/689.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: d99b7ce145703f3cc45aa31026d10c02b861f999 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 30 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v2 5/5] validation: scheduler: increase wait tolerance timeout to 150 msec
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 694 (lumag:timer) ** https://github.com/Linaro/odp/pull/694 ** Patch: https://github.com/Linaro/odp/pull/694.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: dc2fc3943e99a8bb113f9e34a27d9bf1b521ed5b **/ test/validation/api/scheduler/scheduler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c index 069220393..0e7e6c578 100644 --- a/test/validation/api/scheduler/scheduler.c +++ b/test/validation/api/scheduler/scheduler.c @@ -47,7 +47,7 @@ #define CHAOS_PTR_TO_NDX(p) ((uint64_t)(uint32_t)(uintptr_t)p) #define CHAOS_NDX_TO_PTR(n) ((void *)(uintptr_t)n) -#define ODP_WAIT_TOLERANCE (60 * ODP_TIME_MSEC_IN_NS) +#define ODP_WAIT_TOLERANCE (150 * ODP_TIME_MSEC_IN_NS) /* Test global variables */ typedef struct {
[lng-odp] [PATCH v2 2/5] validation: scheduler: print debug diagnostics on test_wait failure
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 694 (lumag:timer) ** https://github.com/Linaro/odp/pull/694 ** Patch: https://github.com/Linaro/odp/pull/694.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: dc2fc3943e99a8bb113f9e34a27d9bf1b521ed5b **/ test/validation/api/scheduler/scheduler.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c index 2e44d3248..069220393 100644 --- a/test/validation/api/scheduler/scheduler.c +++ b/test/validation/api/scheduler/scheduler.c @@ -185,8 +185,19 @@ static void scheduler_test_wait_time(void) upper_limit = odp_time_local_from_ns(5 * ODP_TIME_SEC_IN_NS + ODP_WAIT_TOLERANCE); - CU_ASSERT(odp_time_cmp(diff, lower_limit) >= 0); - CU_ASSERT(odp_time_cmp(diff, upper_limit) <= 0); + if (odp_time_cmp(diff, lower_limit) <= 0) { + fprintf(stderr, "Exceed lower limit: " + "diff is %" PRIu64 ", lower_limit %" PRIu64 "\n", + odp_time_to_ns(diff), odp_time_to_ns(lower_limit)); + CU_FAIL("Exceed lower limit\n"); + } + + if (odp_time_cmp(diff, upper_limit) >= 0) { + fprintf(stderr, "Exceed upper limit: " + "diff is %" PRIu64 ", upper_limit %" PRIu64 "\n", + odp_time_to_ns(diff), odp_time_to_ns(upper_limit)); + CU_FAIL("Exceed upper limit\n"); + } CU_ASSERT_FATAL(odp_queue_destroy(queue) == 0); }
[lng-odp] [PATCH v2 4/5] validation: timer: be more tolerant wrt delays
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 694 (lumag:timer) ** https://github.com/Linaro/odp/pull/694 ** Patch: https://github.com/Linaro/odp/pull/694.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: dc2fc3943e99a8bb113f9e34a27d9bf1b521ed5b **/ test/validation/api/timer/timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index e0f068823..b1b760dce 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -334,8 +334,8 @@ static void timer_test_queue_type(odp_queue_type_t queue_type) tim = odp_timeout_timer(tmo); tick = odp_timeout_tick(tmo); - CU_ASSERT(diff_period > (period_ns - (4 * res_ns))); - CU_ASSERT(diff_period < (period_ns + (4 * res_ns))); + CU_ASSERT(diff_period > (period_ns - (5 * res_ns))); + CU_ASSERT(diff_period < (period_ns + (5 * res_ns))); LOG_DBG("timeout tick %" PRIu64 ", " "timeout period %" PRIu64 "\n",
[lng-odp] [PATCH v2 3/5] validation: time: be more tolerant wrt delays
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 694 (lumag:timer) ** https://github.com/Linaro/odp/pull/694 ** Patch: https://github.com/Linaro/odp/pull/694.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: dc2fc3943e99a8bb113f9e34a27d9bf1b521ed5b **/ test/validation/api/time/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/validation/api/time/time.c b/test/validation/api/time/time.c index 27ddc97fd..38c0906ba 100644 --- a/test/validation/api/time/time.c +++ b/test/validation/api/time/time.c @@ -14,7 +14,7 @@ #define BUSY_LOOP_CNT_LONG 60 /* used for t > 4 sec */ #define MIN_TIME_RATE 32000 #define MAX_TIME_RATE 150 -#define DELAY_TOLERANCE2000/* deviation for delay */ +#define DELAY_TOLERANCE4000/* deviation for delay */ #define WAIT_SECONDS3 static uint64_t local_res;
[lng-odp] [PATCH v2 1/5] validation: time: fix c error
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 694 (lumag:timer) ** https://github.com/Linaro/odp/pull/694 ** Patch: https://github.com/Linaro/odp/pull/694.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: dc2fc3943e99a8bb113f9e34a27d9bf1b521ed5b **/ test/validation/api/time/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/validation/api/time/time.c b/test/validation/api/time/time.c index e24012285..27ddc97fd 100644 --- a/test/validation/api/time/time.c +++ b/test/validation/api/time/time.c @@ -413,7 +413,7 @@ static void time_test_wait_ns(void) if (odp_time_cmp(diff, upper_limit) > 0) { fprintf(stderr, "Exceed upper limit: " "diff is %" PRIu64 ", upper_limit %" PRIu64 "\n", - odp_time_to_ns(diff), odp_time_to_ns(lower_limit)); + odp_time_to_ns(diff), odp_time_to_ns(upper_limit)); CU_FAIL("Exceed upper limit\n"); } }
[lng-odp] [PATCH v2 0/5] Time-related test fixes
An attempt to fix https://bugs.linaro.org/show_bug.cgi?id=3987 github /** Email created from pull request 694 (lumag:timer) ** https://github.com/Linaro/odp/pull/694 ** Patch: https://github.com/Linaro/odp/pull/694.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: dc2fc3943e99a8bb113f9e34a27d9bf1b521ed5b **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 8 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 21 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 8 lines checked to_send-p-002.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 10 lines checked to_send-p-003.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 8 lines checked to_send-p-004.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v4 3/3] validation: system: 0 is valid huge page size
From: Dmitry Eremin-Solenikov If system does not support huge pages, odp_sys_huge_page_size() will return 0, which should not be rejected by test. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: e9faf7a05e0ad39aa6fc47d412584fd97d85c724 **/ test/validation/api/system/system.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/validation/api/system/system.c b/test/validation/api/system/system.c index 75fd26f31..f016a2ded 100644 --- a/test/validation/api/system/system.c +++ b/test/validation/api/system/system.c @@ -216,7 +216,11 @@ static void system_test_odp_sys_huge_page_size(void) uint64_t page; page = odp_sys_huge_page_size(); - CU_ASSERT(0 < page); + if (page == 0) + /* Not an error, but just to be sure to hit logs */ + LOG_ERR("Huge pages do not seem to be supported\n"); + else + CU_ASSERT(page % ODP_PAGE_SIZE == 0); } static void system_test_odp_sys_huge_page_size_all(void)
[lng-odp] [PATCH v4 2/3] linux-gen: x86: as a last resort parse max cpu freq from bogomips value
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: e9faf7a05e0ad39aa6fc47d412584fd97d85c724 **/ .../arch/x86/odp_sysinfo_parse.c | 30 +++ 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c index 504aa3efa..5084e6b5f 100644 --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c @@ -15,34 +15,54 @@ int cpuinfo_parser(FILE *file, system_info_t *sysinfo) char str[1024]; char *pos, *pos_end; double ghz = 0.0; + double mhz = 0.0; uint64_t hz; int id = 0; + bool freq_set = false; strcpy(sysinfo->cpu_arch_str, "x86"); while (fgets(str, sizeof(str), file) != NULL && id < CONFIG_NUM_CPU) { pos = strstr(str, "model name"); if (pos) { + freq_set = false; + /* Copy model name between : and @ characters */ pos = strchr(str, ':'); pos_end = strchr(str, '@'); - if (pos == NULL || pos_end == NULL) + if (pos == NULL) continue; - *(pos_end - 1) = '\0'; + if (pos_end != NULL) + *(pos_end - 1) = '\0'; + strncpy(sysinfo->model_str[id], pos + 2, MODEL_STR_SIZE - 1); if (sysinfo->cpu_hz_max[id]) { + freq_set = true; id++; continue; } /* max frequency needs to be set */ - if (sscanf(pos_end, "@ %lfGHz", ) == 1) { + if (pos_end != NULL && + sscanf(pos_end, "@ %lfGHz", ) == 1) { hz = (uint64_t)(ghz * 10.0); - sysinfo->cpu_hz_max[id] = hz; + sysinfo->cpu_hz_max[id++] = hz; + freq_set = true; + } + } else if (!freq_set && + strstr(str, "bogomips") != NULL) { + pos = strchr(str, ':'); + if (pos == NULL) + continue; + + if (sscanf(pos + 2, "%lf", ) == 1) { + /* On typical x86 BogoMIPS is freq * 2 */ + hz = (uint64_t)(mhz * 100.0 / 2); + sysinfo->cpu_hz_max[id++] = hz; + freq_set = true; } - id++; } }
[lng-odp] [PATCH v4 1/3] linux-gen: sysinfo: return 0 if hugepages are not supported
From: Dmitry Eremin-Solenikov Per API return 0 from odp_sys_huge_page_size_all() if hugepages are not supported/detected. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: e9faf7a05e0ad39aa6fc47d412584fd97d85c724 **/ platform/linux-generic/odp_system_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index bca02ba14..2ac8b32bb 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -443,7 +443,7 @@ int odp_sys_huge_page_size_all(uint64_t size[], int num) dir = opendir("/sys/kernel/mm/hugepages"); if (!dir) { ODP_ERR("Failed to open huge page directory\n"); - return -1; + return 0; } while ((entry = readdir(dir)) != NULL) {
[lng-odp] [PATCH v4 0/3] Two fxes for sysinfo
github /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: e9faf7a05e0ad39aa6fc47d412584fd97d85c724 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 8 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 59 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 12 lines checked to_send-p-002.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v1 2/4] validation: time: be more tolerant wrt delays
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 694 (lumag:timer) ** https://github.com/Linaro/odp/pull/694 ** Patch: https://github.com/Linaro/odp/pull/694.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: 27864f6260e216acae7cc113756aae21161a4fe4 **/ test/validation/api/time/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/validation/api/time/time.c b/test/validation/api/time/time.c index 27ddc97fd..38c0906ba 100644 --- a/test/validation/api/time/time.c +++ b/test/validation/api/time/time.c @@ -14,7 +14,7 @@ #define BUSY_LOOP_CNT_LONG 60 /* used for t > 4 sec */ #define MIN_TIME_RATE 32000 #define MAX_TIME_RATE 150 -#define DELAY_TOLERANCE2000/* deviation for delay */ +#define DELAY_TOLERANCE4000/* deviation for delay */ #define WAIT_SECONDS3 static uint64_t local_res;
[lng-odp] [PATCH v1 3/4] validation: scheduler: print debug diagnostics on test_wait failure
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 694 (lumag:timer) ** https://github.com/Linaro/odp/pull/694 ** Patch: https://github.com/Linaro/odp/pull/694.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: 27864f6260e216acae7cc113756aae21161a4fe4 **/ test/validation/api/scheduler/scheduler.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c index 2e44d3248..069220393 100644 --- a/test/validation/api/scheduler/scheduler.c +++ b/test/validation/api/scheduler/scheduler.c @@ -185,8 +185,19 @@ static void scheduler_test_wait_time(void) upper_limit = odp_time_local_from_ns(5 * ODP_TIME_SEC_IN_NS + ODP_WAIT_TOLERANCE); - CU_ASSERT(odp_time_cmp(diff, lower_limit) >= 0); - CU_ASSERT(odp_time_cmp(diff, upper_limit) <= 0); + if (odp_time_cmp(diff, lower_limit) <= 0) { + fprintf(stderr, "Exceed lower limit: " + "diff is %" PRIu64 ", lower_limit %" PRIu64 "\n", + odp_time_to_ns(diff), odp_time_to_ns(lower_limit)); + CU_FAIL("Exceed lower limit\n"); + } + + if (odp_time_cmp(diff, upper_limit) >= 0) { + fprintf(stderr, "Exceed upper limit: " + "diff is %" PRIu64 ", upper_limit %" PRIu64 "\n", + odp_time_to_ns(diff), odp_time_to_ns(upper_limit)); + CU_FAIL("Exceed upper limit\n"); + } CU_ASSERT_FATAL(odp_queue_destroy(queue) == 0); }
[lng-odp] [PATCH v1 4/4] validation: timer: be more tolerant wrt delays
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 694 (lumag:timer) ** https://github.com/Linaro/odp/pull/694 ** Patch: https://github.com/Linaro/odp/pull/694.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: 27864f6260e216acae7cc113756aae21161a4fe4 **/ test/validation/api/timer/timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index e0f068823..b1b760dce 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -334,8 +334,8 @@ static void timer_test_queue_type(odp_queue_type_t queue_type) tim = odp_timeout_timer(tmo); tick = odp_timeout_tick(tmo); - CU_ASSERT(diff_period > (period_ns - (4 * res_ns))); - CU_ASSERT(diff_period < (period_ns + (4 * res_ns))); + CU_ASSERT(diff_period > (period_ns - (5 * res_ns))); + CU_ASSERT(diff_period < (period_ns + (5 * res_ns))); LOG_DBG("timeout tick %" PRIu64 ", " "timeout period %" PRIu64 "\n",
[lng-odp] [PATCH v1 1/4] validation: time: fix c error
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 694 (lumag:timer) ** https://github.com/Linaro/odp/pull/694 ** Patch: https://github.com/Linaro/odp/pull/694.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: 27864f6260e216acae7cc113756aae21161a4fe4 **/ test/validation/api/time/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/validation/api/time/time.c b/test/validation/api/time/time.c index e24012285..27ddc97fd 100644 --- a/test/validation/api/time/time.c +++ b/test/validation/api/time/time.c @@ -413,7 +413,7 @@ static void time_test_wait_ns(void) if (odp_time_cmp(diff, upper_limit) > 0) { fprintf(stderr, "Exceed upper limit: " "diff is %" PRIu64 ", upper_limit %" PRIu64 "\n", - odp_time_to_ns(diff), odp_time_to_ns(lower_limit)); + odp_time_to_ns(diff), odp_time_to_ns(upper_limit)); CU_FAIL("Exceed upper limit\n"); } }
[lng-odp] [PATCH v1 0/4] Time-related test fixes
An attempt to fix https://bugs.linaro.org/show_bug.cgi?id=3987 github /** Email created from pull request 694 (lumag:timer) ** https://github.com/Linaro/odp/pull/694 ** Patch: https://github.com/Linaro/odp/pull/694.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: 27864f6260e216acae7cc113756aae21161a4fe4 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 8 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 8 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 21 lines checked to_send-p-002.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 10 lines checked to_send-p-003.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v2 0/1] linux-gen: odp_shm_print_all() refine shm stats print
github /** Email created from pull request 686 (muvarov:devel/master_shm_print_all) ** https://github.com/Linaro/odp/pull/686 ** Patch: https://github.com/Linaro/odp/pull/686.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: 2c557397820d67b1fcb7c7283da5506a114da186 **/ /github checkpatch.pl WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line) #10: name flag range user_len unused seq ref fd file total: 0 errors, 1 warnings, 0 checks, 63 lines checked to_send-p-000.patch has style problems, please review. If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. /checkpatch.pl
[lng-odp] [PATCH v2 1/1] linux-gen: odp_shm_print_all: refine output spreadsheet
From: Maxim Uvarov Refine output print to make output spreadsheet more readable: Memory allocation status: name flag range user_len unused seq ref fd file 0 odp_thread_globals..N 0x7f59e1b74000-0x7f59e1b75000 3472 624 1 1 3 (none) 1 _odp_pool_table ..N 0x7f59bf40d000-0x7f59c0514000 17850432 4032 1 1 4 (none) 2 _odp_queue_gbl..N 0x7f59e1ab-0x7f59e1b11000 393344 3968 1 1 5 (none) 3 _odp_queue_rings ..N 0x7f59bd40d000-0x7f59bf40d000 33554432 0 1 1 6 (none) 4 odp_queues_lf ..N 0x7f59e1a9f000-0x7f59e1ab 67648 1984 1 1 7 (none) 5 odp_scheduler ..N 0x7f59bcbb9000-0x7f59bd40d000 8730624 2048 1 1 9 (none) 6 odp_pktio_entries S.N 0x7f59c060-0x7f59c0651000 327744 4032 1 1 10 (none) 7 crypto_pool ..N 0x7f59e1b6f000-0x7f59e1b74000 19800 680 1 1 11 (none) 8 shm_odp_cos_tbl ..N 0x7f59e1a9a000-0x7f59e1a9f000 20480 0 1 1 12 (none) 9 shm_odp_pmr_tbl ..N 0x7f59e1a7e000-0x7f59e1a9a000 114688 0 1 1 13 (none) 10 shm_odp_cls_queue_grp_tbl ..N 0x7f59e1b6b000-0x7f59e1b6f000 16384 0 1 1 14 (none) 11 pool_ring_0 ..N 0x7f59bc7b8000-0x7f59bcbb9000 4194432 3968 1 1 15 (none) 12 ipsec_status_pool ..N 0x7f59e19be000-0x7f59e1a7e000 786432 0 1 1 16 (none) 13 ipsec_sa_table..N 0x7f59e19bd000-0x7f59e19be000 2112 1984 1 1 17 (none) 14 test_shmem..N 0x7f59e19bb000-0x7f59e19bd000 4120 4072 7 1 18 (none) TOTAL: 66113536 27392 (63MB) (0MB) Signed-off-by: Maxim Uvarov --- /** Email created from pull request 686 (muvarov:devel/master_shm_print_all) ** https://github.com/Linaro/odp/pull/686 ** Patch: https://github.com/Linaro/odp/pull/686.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: 2c557397820d67b1fcb7c7283da5506a114da186 **/ platform/linux-generic/odp_ishm.c | 33 ++- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index fc2f948cc..59d1fe534 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -1730,6 +1730,8 @@ int _odp_ishm_status(const char *title) int nb_blocks = 0; int single_va_blocks = 0; int max_name_len = 0; + uint64_t lost_total = 0; /* statistics for total unused memory */ + uint64_t len_total = 0; /* statistics for total allocated memory */ odp_spinlock_lock(_tbl->lock); procsync(); @@ -1747,10 +1749,10 @@ int _odp_ishm_status(const char *title) max_name_len = str_len; } - ODP_PRINT("ishm blocks allocated at: %s\n", title); - - ODP_PRINT("%-*s flag lenuser_len seq ref startfd" - " file\n", max_name_len, "name"); + ODP_PRINT("%s\n", title); + ODP_PRINT("%-*s flag %-29s %-08s %-08s %-3s %-3s %-3s file\n", + max_name_len, "name", "range", "user_len", "unused", + "seq", "ref", "fd"); /* display block table: 1 line per entry +1 extra line if mapped here */ for (i = 0; i < ISHM_MAX_NB_BLOCKS; i++) { @@ -1780,23 +1782,36 @@ int _odp_ishm_status(const char *title) huge = '?'; } proc_index = procfind_block(i); - ODP_PRINT("%2i %-*s %s%c 0x%-08lx %-8lu %-3lu %-3lu", + lost_total += ishm_tbl->block[i].len - + ishm_tbl->block[i].user_len; + len_total += ishm_tbl->block[i].len; + ODP_PRINT("%2i %-*s %s%c 0x%-08lx-0x%08lx %-08ld %-08ld %-3lu %-3lu", i, max_name_len, ishm_tbl->block[i].name, flags, huge, - ishm_tbl->block[i].len, + ishm_proctable->entry[proc_index].start, + (uintptr_t)ishm_proctable->entry[proc_index].start + + ishm_tbl->block[i].len, ishm_tbl->block[i].user_len, + ishm_tbl->block[i].len - ishm_tbl->block[i].user_len, ishm_tbl->block[i].seq, ishm_tbl->block[i].refcnt); if (proc_index < 0) continue; - ODP_PRINT("%-08lx %-3d", - ishm_proctable->entry[proc_index].start, + ODP_PRINT(" %-3d",
[lng-odp] [PATCH v2 0/2] Two fxes for sysinfo
github /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: e81a26cbc48048931817e90079842e469b3191c0 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 8 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 59 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v2 2/2] linux-gen: x86: as a last resort parse max cpu freq from bogomips value
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: e81a26cbc48048931817e90079842e469b3191c0 **/ .../arch/x86/odp_sysinfo_parse.c | 30 +++ 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c index 504aa3efa..5084e6b5f 100644 --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c @@ -15,34 +15,54 @@ int cpuinfo_parser(FILE *file, system_info_t *sysinfo) char str[1024]; char *pos, *pos_end; double ghz = 0.0; + double mhz = 0.0; uint64_t hz; int id = 0; + bool freq_set = false; strcpy(sysinfo->cpu_arch_str, "x86"); while (fgets(str, sizeof(str), file) != NULL && id < CONFIG_NUM_CPU) { pos = strstr(str, "model name"); if (pos) { + freq_set = false; + /* Copy model name between : and @ characters */ pos = strchr(str, ':'); pos_end = strchr(str, '@'); - if (pos == NULL || pos_end == NULL) + if (pos == NULL) continue; - *(pos_end - 1) = '\0'; + if (pos_end != NULL) + *(pos_end - 1) = '\0'; + strncpy(sysinfo->model_str[id], pos + 2, MODEL_STR_SIZE - 1); if (sysinfo->cpu_hz_max[id]) { + freq_set = true; id++; continue; } /* max frequency needs to be set */ - if (sscanf(pos_end, "@ %lfGHz", ) == 1) { + if (pos_end != NULL && + sscanf(pos_end, "@ %lfGHz", ) == 1) { hz = (uint64_t)(ghz * 10.0); - sysinfo->cpu_hz_max[id] = hz; + sysinfo->cpu_hz_max[id++] = hz; + freq_set = true; + } + } else if (!freq_set && + strstr(str, "bogomips") != NULL) { + pos = strchr(str, ':'); + if (pos == NULL) + continue; + + if (sscanf(pos + 2, "%lf", ) == 1) { + /* On typical x86 BogoMIPS is freq * 2 */ + hz = (uint64_t)(mhz * 100.0 / 2); + sysinfo->cpu_hz_max[id++] = hz; + freq_set = true; } - id++; } }
[lng-odp] [PATCH v2 1/2] linux-gen: sysinfo: return 0 if hugepages are not supported
From: Dmitry Eremin-Solenikov Per API return 0 from odp_sys_huge_page_size_all() if hugepages are not supported/detected. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: e81a26cbc48048931817e90079842e469b3191c0 **/ platform/linux-generic/odp_system_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index bca02ba14..2ac8b32bb 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -443,7 +443,7 @@ int odp_sys_huge_page_size_all(uint64_t size[], int num) dir = opendir("/sys/kernel/mm/hugepages"); if (!dir) { ODP_ERR("Failed to open huge page directory\n"); - return -1; + return 0; } while ((entry = readdir(dir)) != NULL) {
[lng-odp] [PATCH v2 1/3] include: abi: set ODP_CACHE_LINE_SIZE to 128 on ppc64le
From: Dmitry Eremin-Solenikov POWER8 has 128-byte cache lines Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 692 (lumag:ppc64le-cache) ** https://github.com/Linaro/odp/pull/692 ** Patch: https://github.com/Linaro/odp/pull/692.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: f8a74b1a2c166d0c4225802cfcce30538c375d69 **/ include/odp/arch/power64-linux/odp/api/abi/cpu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/odp/arch/power64-linux/odp/api/abi/cpu.h b/include/odp/arch/power64-linux/odp/api/abi/cpu.h index 90bb87875..9e3338d60 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/cpu.h +++ b/include/odp/arch/power64-linux/odp/api/abi/cpu.h @@ -5,4 +5,5 @@ */ #define _ODP_NEED_GENERIC_CPU_PAUSE +#define ODP_CACHE_LINE_SIZE 128 #include
[lng-odp] [PATCH v2 3/3] linux-gen: fix pktio private size on 128-byte cache machines
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 692 (lumag:ppc64le-cache) ** https://github.com/Linaro/odp/pull/692 ** Patch: https://github.com/Linaro/odp/pull/692.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: f8a74b1a2c166d0c4225802cfcce30538c375d69 **/ platform/linux-generic/include/odp_packet_io_internal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 080850783..53db2c907 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -53,6 +53,8 @@ struct pktio_if_ops; #if defined(ODP_NETMAP) #define PKTIO_PRIVATE_SIZE 74752 +#elif defined(ODP_PKTIO_DPDK) && ODP_CACHE_LINE_SIZE == 128 +#define PKTIO_PRIVATE_SIZE 10240 #elif defined(ODP_PKTIO_DPDK) #define PKTIO_PRIVATE_SIZE 5632 #else
[lng-odp] [PATCH v2 2/3] linux-gen: abi: set ODP_CACHE_LINE_SIZE to 128 on ppc64le
From: Dmitry Eremin-Solenikov POWER8 has 128-byte cache lines Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 692 (lumag:ppc64le-cache) ** https://github.com/Linaro/odp/pull/692 ** Patch: https://github.com/Linaro/odp/pull/692.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: f8a74b1a2c166d0c4225802cfcce30538c375d69 **/ platform/linux-generic/arch/powerpc/odp/api/abi/cpu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/linux-generic/arch/powerpc/odp/api/abi/cpu.h b/platform/linux-generic/arch/powerpc/odp/api/abi/cpu.h index 90bb87875..9e3338d60 100644 --- a/platform/linux-generic/arch/powerpc/odp/api/abi/cpu.h +++ b/platform/linux-generic/arch/powerpc/odp/api/abi/cpu.h @@ -5,4 +5,5 @@ */ #define _ODP_NEED_GENERIC_CPU_PAUSE +#define ODP_CACHE_LINE_SIZE 128 #include
[lng-odp] [PATCH v1 2/2] linux-gen: x86: as a last resort parse max cpu freq from bogomips value
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: 1585363355b8a72a90dd174216db95a06e062bad **/ .../arch/x86/odp_sysinfo_parse.c | 28 +++ 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c index 504aa3efa..7ae5474c2 100644 --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c @@ -15,34 +15,52 @@ int cpuinfo_parser(FILE *file, system_info_t *sysinfo) char str[1024]; char *pos, *pos_end; double ghz = 0.0; + double mhz = 0.0; uint64_t hz; int id = 0; + bool freq_set = false; strcpy(sysinfo->cpu_arch_str, "x86"); while (fgets(str, sizeof(str), file) != NULL && id < CONFIG_NUM_CPU) { pos = strstr(str, "model name"); if (pos) { + freq_set = false; + /* Copy model name between : and @ characters */ pos = strchr(str, ':'); pos_end = strchr(str, '@'); - if (pos == NULL || pos_end == NULL) + if (pos == NULL) continue; - *(pos_end - 1) = '\0'; + if (pos_end != NULL) + *(pos_end - 1) = '\0'; + strncpy(sysinfo->model_str[id], pos + 2, MODEL_STR_SIZE - 1); if (sysinfo->cpu_hz_max[id]) { + freq_set = true; id++; continue; } /* max frequency needs to be set */ - if (sscanf(pos_end, "@ %lfGHz", ) == 1) { + if (pos_end != NULL && sscanf(pos_end, "@ %lfGHz", ) == 1) { hz = (uint64_t)(ghz * 10.0); - sysinfo->cpu_hz_max[id] = hz; + sysinfo->cpu_hz_max[id++] = hz; + freq_set = true; + } + } else if (!freq_set && (pos = strstr(str, "bogomips")) != NULL) { + pos = strchr(str, ':'); + if (pos == NULL) + continue; + + if (sscanf(pos + 2, "%lf", ) == 1) { + /* On typical x86 BogoMIPS is freq * 2 */ + hz = (uint64_t)(mhz * 100.0 / 2); + sysinfo->cpu_hz_max[id++] = hz; + freq_set = true; } - id++; } }
[lng-odp] [PATCH v2 0/3] Fix PPC64le cache line issues
github /** Email created from pull request 692 (lumag:ppc64le-cache) ** https://github.com/Linaro/odp/pull/692 ** Patch: https://github.com/Linaro/odp/pull/692.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: f8a74b1a2c166d0c4225802cfcce30538c375d69 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 5 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 5 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 8 lines checked to_send-p-002.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v1 1/2] linux-gen: sysinfo: return 0 if hugepages are not supported
From: Dmitry Eremin-Solenikov Per API return 0 from odp_sys_huge_page_size_all() if hugepages are not supported/detected. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: 1585363355b8a72a90dd174216db95a06e062bad **/ platform/linux-generic/odp_system_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index bca02ba14..2ac8b32bb 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -443,7 +443,7 @@ int odp_sys_huge_page_size_all(uint64_t size[], int num) dir = opendir("/sys/kernel/mm/hugepages"); if (!dir) { ODP_ERR("Failed to open huge page directory\n"); - return -1; + return 0; } while ((entry = readdir(dir)) != NULL) {
[lng-odp] [PATCH v1 0/2] Two fxes for sysinfo
github /** Email created from pull request 693 (lumag:fix-cpu_max_hz) ** https://github.com/Linaro/odp/pull/693 ** Patch: https://github.com/Linaro/odp/pull/693.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: 1585363355b8a72a90dd174216db95a06e062bad **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 8 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. WARNING: line over 80 characters #60: FILE: platform/linux-generic/arch/x86/odp_sysinfo_parse.c:48: + if (pos_end != NULL && sscanf(pos_end, "@ %lfGHz", ) == 1) { WARNING: line over 80 characters #66: FILE: platform/linux-generic/arch/x86/odp_sysinfo_parse.c:53: + } else if (!freq_set && (pos = strstr(str, "bogomips")) != NULL) { ERROR: do not use assignment in if condition #66: FILE: platform/linux-generic/arch/x86/odp_sysinfo_parse.c:53: + } else if (!freq_set && (pos = strstr(str, "bogomips")) != NULL) { total: 1 errors, 2 warnings, 0 checks, 57 lines checked to_send-p-001.patch has style problems, please review. If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. /checkpatch.pl
[lng-odp] [PATCH v1 3/3] linux-gen: fix pktio private size on 128-byte cache machines
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 692 (lumag:ppc64le-cache) ** https://github.com/Linaro/odp/pull/692 ** Patch: https://github.com/Linaro/odp/pull/692.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: f4a8c89ac59d5420cd107b44c742c4e51d3d086a **/ platform/linux-generic/include/odp_packet_io_internal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 080850783..53db2c907 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -53,6 +53,8 @@ struct pktio_if_ops; #if defined(ODP_NETMAP) #define PKTIO_PRIVATE_SIZE 74752 +#elif defined(ODP_PKTIO_DPDK) && ODP_CACHE_LINE_SIZE == 128 +#define PKTIO_PRIVATE_SIZE 10240 #elif defined(ODP_PKTIO_DPDK) #define PKTIO_PRIVATE_SIZE 5632 #else
[lng-odp] [PATCH v1 1/3] include: abi: set ODP_CACHE_LINE_SIZE to 128 on ppc64le
From: Dmitry Eremin-Solenikov POWER8 has 128-byte cache lines Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 692 (lumag:ppc64le-cache) ** https://github.com/Linaro/odp/pull/692 ** Patch: https://github.com/Linaro/odp/pull/692.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: f4a8c89ac59d5420cd107b44c742c4e51d3d086a **/ include/odp/arch/power64-linux/odp/api/abi/cpu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/odp/arch/power64-linux/odp/api/abi/cpu.h b/include/odp/arch/power64-linux/odp/api/abi/cpu.h index 90bb87875..9e3338d60 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/cpu.h +++ b/include/odp/arch/power64-linux/odp/api/abi/cpu.h @@ -5,4 +5,5 @@ */ #define _ODP_NEED_GENERIC_CPU_PAUSE +#define ODP_CACHE_LINE_SIZE 128 #include
[lng-odp] [PATCH v1 2/3] linux-gen: abi: set ODP_CACHE_LINE_SIZE to 128 on ppc64le
From: Dmitry Eremin-Solenikov POWER8 has 128-byte cache lines Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 692 (lumag:ppc64le-cache) ** https://github.com/Linaro/odp/pull/692 ** Patch: https://github.com/Linaro/odp/pull/692.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: f4a8c89ac59d5420cd107b44c742c4e51d3d086a **/ platform/linux-generic/arch/powerpc/odp/api/abi/cpu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/linux-generic/arch/powerpc/odp/api/abi/cpu.h b/platform/linux-generic/arch/powerpc/odp/api/abi/cpu.h index 90bb87875..9e3338d60 100644 --- a/platform/linux-generic/arch/powerpc/odp/api/abi/cpu.h +++ b/platform/linux-generic/arch/powerpc/odp/api/abi/cpu.h @@ -5,4 +5,5 @@ */ #define _ODP_NEED_GENERIC_CPU_PAUSE +#define ODP_CACHE_LINE_SIZE 128 #include
[lng-odp] [PATCH v1 0/3] Fix PPC64le cache line issues
github /** Email created from pull request 692 (lumag:ppc64le-cache) ** https://github.com/Linaro/odp/pull/692 ** Patch: https://github.com/Linaro/odp/pull/692.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: f4a8c89ac59d5420cd107b44c742c4e51d3d086a **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 5 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 5 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 8 lines checked to_send-p-002.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v2 1/1] travis: add ubuntu 18.04 compilation test
From: Maxim Uvarov Signed-off-by: Maxim Uvarov --- /** Email created from pull request 689 (muvarov:devel/master_u18) ** https://github.com/Linaro/odp/pull/689 ** Patch: https://github.com/Linaro/odp/pull/689.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: 64aa8cd6f9bc74e2a75b9e9893c8ea8fb9d3e8d3 **/ .travis.yml | 9 + 1 file changed, 9 insertions(+) diff --git a/.travis.yml b/.travis.yml index 26431ff19..5bd09a2a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -187,6 +187,15 @@ jobs: - docker run -i -t -v `pwd`:/odp -e CC="${CC}" ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_${ARCH}.sh +- stage: test + env: ARCH=x86_64 CC=clang UBUNTU_VERS="18.04" + install: + - true + script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi + - docker run -i -t -v `pwd`:/odp + -e CC="${CC}" + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_${UBUNTU_VERS} /odp/scripts/ci/build_${ARCH}.sh - stage: test canfail: yes env: TEST=checkpatch
[lng-odp] [PATCH v2 0/1] travis: add ubuntu 18.04 compilation test
Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org github /** Email created from pull request 689 (muvarov:devel/master_u18) ** https://github.com/Linaro/odp/pull/689 ** Patch: https://github.com/Linaro/odp/pull/689.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: 64aa8cd6f9bc74e2a75b9e9893c8ea8fb9d3e8d3 **/ /github checkpatch.pl ERROR: trailing whitespace #26: FILE: .travis.yml:190: +- stage: test $ total: 1 errors, 0 warnings, 0 checks, 15 lines checked NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or scripts/cleanfile to_send-p-000.patch has style problems, please review. If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. /checkpatch.pl
[lng-odp] [PATCH v1 0/1] abi: align ODP_CPUMASK_SIZE with kernel cpu_set_t
Depends on kernel compile configuration size of cpu set may differ. Fixes: https://bugs.linaro.org/show_bug.cgi?id=3983 Reported-by: Robert Perper rper...@litespeedtech.com Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org github /** Email created from pull request 690 (muvarov:devel/master_cpuset) ** https://github.com/Linaro/odp/pull/690 ** Patch: https://github.com/Linaro/odp/pull/690.patch ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0 ** Merge commit sha: d30146a4266af9e67d0d0de3be9e2b8345d97430 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 10 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v1 1/1] travis: add ubuntu 18.04 compilation test
From: Maxim Uvarov Signed-off-by: Maxim Uvarov --- /** Email created from pull request 689 (muvarov:devel/master_u18) ** https://github.com/Linaro/odp/pull/689 ** Patch: https://github.com/Linaro/odp/pull/689.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: 8c12f66e8db6b96c872b6edc65f0dc9f8de34e6a **/ .travis.yml | 9 + 1 file changed, 9 insertions(+) diff --git a/.travis.yml b/.travis.yml index 26431ff19..7e486700c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -169,6 +169,15 @@ jobs: - docker run -i -t -v `pwd`:/odp -e CC="${CC}" ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_${ARCH}.sh +- stage: "build only" + env: ARCH=x86_64 CC=clang UBUNTU_VERS="18.04" + install: + - true + script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi + - docker run -i -t -v `pwd`:/odp + -e CC="${CC}" + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_${UBUNTU_VERS} /odp/scripts/ci/build_${ARCH}.sh - stage: "build only" env: ARCH=arm64 install:
[lng-odp] [PATCH v1 0/1] travis: add ubuntu 18.04 compilation test
Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org github /** Email created from pull request 689 (muvarov:devel/master_u18) ** https://github.com/Linaro/odp/pull/689 ** Patch: https://github.com/Linaro/odp/pull/689.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: 8c12f66e8db6b96c872b6edc65f0dc9f8de34e6a **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 15 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v2 3/3] test: sched_perf: total events per second
From: Petri Savolainen Added result for events per second over all workers. Signed-off-by: Petri Savolainen --- /** Email created from pull request 687 (psavol:master-test-sched-perf-options) ** https://github.com/Linaro/odp/pull/687 ** Patch: https://github.com/Linaro/odp/pull/687.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: 742c63f02e193181bd9172aeb63cf6d3d1de2e40 **/ test/performance/odp_sched_perf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/performance/odp_sched_perf.c b/test/performance/odp_sched_perf.c index d80f77494..bbd76c86c 100644 --- a/test/performance/odp_sched_perf.c +++ b/test/performance/odp_sched_perf.c @@ -564,6 +564,9 @@ static void print_stat(test_global_t *global) (1000.0 * rounds_ave) / nsec_ave); printf(" events per sec: %.3f M\n\n", (1000.0 * events_ave) / nsec_ave); + + printf("TOTAL events per sec: %.3f M\n\n", + (1000.0 * events_sum) / nsec_ave); } int main(int argc, char **argv)
[lng-odp] [PATCH v2 1/3] test: sched_perf: total number of queues option
From: Petri Savolainen Change -q option to be the total number of queues with events. There's no need to limit the number of queues to a multiple of worker thread count. Also, add an option for number of dummy (empty) queues. This enables testing scheduler performance when all created queues are not used. Signed-off-by: Petri Savolainen --- /** Email created from pull request 687 (psavol:master-test-sched-perf-options) ** https://github.com/Linaro/odp/pull/687 ** Patch: https://github.com/Linaro/odp/pull/687.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: 742c63f02e193181bd9172aeb63cf6d3d1de2e40 **/ test/performance/odp_sched_perf.c | 42 +++ 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/test/performance/odp_sched_perf.c b/test/performance/odp_sched_perf.c index ac2b9005b..d5fceede9 100644 --- a/test/performance/odp_sched_perf.c +++ b/test/performance/odp_sched_perf.c @@ -14,12 +14,12 @@ #include #include -#define MAX_QUEUES_PER_CPU 1024 -#define MAX_QUEUES (ODP_THREAD_COUNT_MAX * MAX_QUEUES_PER_CPU) +#define MAX_QUEUES (256 * 1024) typedef struct test_options_t { uint32_t num_cpu; uint32_t num_queue; + uint32_t num_dummy; uint32_t num_event; uint32_t num_round; uint32_t max_burst; @@ -60,10 +60,11 @@ static void print_usage(void) "Usage: odp_sched_perf [options]\n" "\n" " -c, --num_cpu Number of CPUs (worker threads). 0: all available CPUs. Default: 1.\n" - " -q, --num_queueNumber of queues per CPU. Default: 1.\n" - " -e, --num_eventNumber of events per queue\n" + " -q, --num_queueNumber of queues. Default: 1.\n" + " -d, --num_dummyNumber of empty queues. Default: 0.\n" + " -e, --num_eventNumber of events per queue. Default: 100.\n" " -r, --num_roundNumber of rounds\n" - " -b, --burstMaximum number of events per operation\n" + " -b, --burstMaximum number of events per operation. Default: 100.\n" " -t, --type Queue type. 0: parallel, 1: atomic, 2: ordered. Default: 0.\n" " -h, --help This help\n" "\n"); @@ -78,6 +79,7 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) static const struct option longopts[] = { {"num_cpu", required_argument, NULL, 'c'}, {"num_queue", required_argument, NULL, 'q'}, + {"num_dummy", required_argument, NULL, 'd'}, {"num_event", required_argument, NULL, 'e'}, {"num_round", required_argument, NULL, 'r'}, {"burst", required_argument, NULL, 'b'}, @@ -86,10 +88,11 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) {NULL, 0, NULL, 0} }; - static const char *shortopts = "+c:q:e:r:b:t:h"; + static const char *shortopts = "+c:q:d:e:r:b:t:h"; test_options->num_cpu= 1; test_options->num_queue = 1; + test_options->num_dummy = 0; test_options->num_event = 100; test_options->num_round = 10; test_options->max_burst = 100; @@ -108,6 +111,9 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) case 'q': test_options->num_queue = atoi(optarg); break; + case 'd': + test_options->num_dummy = atoi(optarg); + break; case 'e': test_options->num_event = atoi(optarg); break; @@ -129,15 +135,15 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) } } - if (test_options->num_queue > MAX_QUEUES_PER_CPU) { - printf("Error: Too many queues per worker. Max supported %i\n.", - MAX_QUEUES_PER_CPU); + if ((test_options->num_queue + test_options->num_dummy) > MAX_QUEUES) { + printf("Error: Too many queues. Max supported %i\n.", + MAX_QUEUES); ret = -1; } - test_options->tot_queue = test_options->num_queue * - test_options->num_cpu; - test_options->tot_event = test_options->tot_queue * + test_options->tot_queue = test_options->num_queue + + test_options->num_dummy; + test_options->tot_event = test_options->num_queue * test_options->num_event; return ret; @@ -182,6 +188,7 @@ static int create_pool(test_global_t *global) test_options_t *test_options = >test_options;
[lng-odp] [PATCH v2 0/3] Add options to sched_perf test application
Add options for better control of queue usage in the test. github /** Email created from pull request 687 (psavol:master-test-sched-perf-options) ** https://github.com/Linaro/odp/pull/687 ** Patch: https://github.com/Linaro/odp/pull/687.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: 742c63f02e193181bd9172aeb63cf6d3d1de2e40 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 115 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 153 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 9 lines checked to_send-p-002.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v1 2/2] travis: let after_failure task print logs
From: Maxim Uvarov current print logs are not executed due to set -e, let after_failure task print logs if return code is not zero. Signed-off-by: Maxim Uvarov --- /** Email created from pull request 688 (muvarov:devel/master_travis) ** https://github.com/Linaro/odp/pull/688 ** Patch: https://github.com/Linaro/odp/pull/688.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: 49a6fd7f7a454239a65b37aefb94d5188e9744d1 **/ scripts/ci/coverage.sh | 16 1 file changed, 16 deletions(-) diff --git a/scripts/ci/coverage.sh b/scripts/ci/coverage.sh index 2f285e95c..18e2e9806 100755 --- a/scripts/ci/coverage.sh +++ b/scripts/ci/coverage.sh @@ -22,25 +22,9 @@ mount -t hugetlbfs nodev /mnt/huge export CI="true" ODP_SCHEDULER=basicmake check -if [ $? -ne 0 ]; then - find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done -fi - ODP_SCHEDULER=sp make check -if [ $? -ne 0 ]; then - find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done -fi - ODP_SCHEDULER=iquery make check -if [ $? -ne 0 ]; then - find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done -fi - ODP_SCHEDULER=scalable make check -if [ $? -ne 0 ]; then - find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done -fi - bash <(curl -s https://codecov.io/bash) -X coveragepy
[lng-odp] [PATCH v1 1/2] travis: set CI for distcheck
From: Maxim Uvarov on distcheck TM test is called but it can fail under Travis. Signed-off-by: Maxim Uvarov --- /** Email created from pull request 688 (muvarov:devel/master_travis) ** https://github.com/Linaro/odp/pull/688 ** Patch: https://github.com/Linaro/odp/pull/688.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: 49a6fd7f7a454239a65b37aefb94d5188e9744d1 **/ scripts/ci/distcheck.sh | 4 1 file changed, 4 insertions(+) diff --git a/scripts/ci/distcheck.sh b/scripts/ci/distcheck.sh index 4f3802451..c6e0f4ea8 100755 --- a/scripts/ci/distcheck.sh +++ b/scripts/ci/distcheck.sh @@ -14,4 +14,8 @@ make distcheck make clean +# Ignore possible failures there because these tests depends on measurements +# and systems might differ in performance. +export CI="true" + make distcheck DISTCHECK__CONFIGURE_FLAGS=--disable-abi-compat
[lng-odp] [PATCH v1 0/2] travis: set CI for distcheck and fix coverage log prints
github /** Email created from pull request 688 (muvarov:devel/master_travis) ** https://github.com/Linaro/odp/pull/688 ** Patch: https://github.com/Linaro/odp/pull/688.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: 49a6fd7f7a454239a65b37aefb94d5188e9744d1 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 8 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 25 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v1 3/3] test: sched_perf: total events per second
From: Petri Savolainen Added result for events per second over all workers. Signed-off-by: Petri Savolainen --- /** Email created from pull request 687 (psavol:master-test-sched-perf-options) ** https://github.com/Linaro/odp/pull/687 ** Patch: https://github.com/Linaro/odp/pull/687.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: b10a9d3318c78101ad4c590deb3d4be6ad7b3cc1 **/ test/performance/odp_sched_perf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/performance/odp_sched_perf.c b/test/performance/odp_sched_perf.c index ba16623c9..9bbcde0b7 100644 --- a/test/performance/odp_sched_perf.c +++ b/test/performance/odp_sched_perf.c @@ -554,6 +554,9 @@ static void print_stat(test_global_t *global) (1000.0 * rounds_ave) / nsec_ave); printf(" events per sec: %.3f M\n\n", (1000.0 * events_ave) / nsec_ave); + + printf("TOTAL events per sec: %.3f M\n\n", + (1000.0 * events_sum) / nsec_ave); } int main(int argc, char **argv)
[lng-odp] [PATCH v1 1/3] test: sched_perf: total number of queues option
From: Petri Savolainen Change -q option to be the total number of queues with events. There's no need to limit the number of queues to a multiple of worker thread count. Also, add an option for number of dummy (empty) queues. This enables testing scheduler performance when all created queues are not used. Signed-off-by: Petri Savolainen --- /** Email created from pull request 687 (psavol:master-test-sched-perf-options) ** https://github.com/Linaro/odp/pull/687 ** Patch: https://github.com/Linaro/odp/pull/687.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: b10a9d3318c78101ad4c590deb3d4be6ad7b3cc1 **/ test/performance/odp_sched_perf.c | 42 +++ 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/test/performance/odp_sched_perf.c b/test/performance/odp_sched_perf.c index ac2b9005b..d5fceede9 100644 --- a/test/performance/odp_sched_perf.c +++ b/test/performance/odp_sched_perf.c @@ -14,12 +14,12 @@ #include #include -#define MAX_QUEUES_PER_CPU 1024 -#define MAX_QUEUES (ODP_THREAD_COUNT_MAX * MAX_QUEUES_PER_CPU) +#define MAX_QUEUES (256 * 1024) typedef struct test_options_t { uint32_t num_cpu; uint32_t num_queue; + uint32_t num_dummy; uint32_t num_event; uint32_t num_round; uint32_t max_burst; @@ -60,10 +60,11 @@ static void print_usage(void) "Usage: odp_sched_perf [options]\n" "\n" " -c, --num_cpu Number of CPUs (worker threads). 0: all available CPUs. Default: 1.\n" - " -q, --num_queueNumber of queues per CPU. Default: 1.\n" - " -e, --num_eventNumber of events per queue\n" + " -q, --num_queueNumber of queues. Default: 1.\n" + " -d, --num_dummyNumber of empty queues. Default: 0.\n" + " -e, --num_eventNumber of events per queue. Default: 100.\n" " -r, --num_roundNumber of rounds\n" - " -b, --burstMaximum number of events per operation\n" + " -b, --burstMaximum number of events per operation. Default: 100.\n" " -t, --type Queue type. 0: parallel, 1: atomic, 2: ordered. Default: 0.\n" " -h, --help This help\n" "\n"); @@ -78,6 +79,7 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) static const struct option longopts[] = { {"num_cpu", required_argument, NULL, 'c'}, {"num_queue", required_argument, NULL, 'q'}, + {"num_dummy", required_argument, NULL, 'd'}, {"num_event", required_argument, NULL, 'e'}, {"num_round", required_argument, NULL, 'r'}, {"burst", required_argument, NULL, 'b'}, @@ -86,10 +88,11 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) {NULL, 0, NULL, 0} }; - static const char *shortopts = "+c:q:e:r:b:t:h"; + static const char *shortopts = "+c:q:d:e:r:b:t:h"; test_options->num_cpu= 1; test_options->num_queue = 1; + test_options->num_dummy = 0; test_options->num_event = 100; test_options->num_round = 10; test_options->max_burst = 100; @@ -108,6 +111,9 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) case 'q': test_options->num_queue = atoi(optarg); break; + case 'd': + test_options->num_dummy = atoi(optarg); + break; case 'e': test_options->num_event = atoi(optarg); break; @@ -129,15 +135,15 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) } } - if (test_options->num_queue > MAX_QUEUES_PER_CPU) { - printf("Error: Too many queues per worker. Max supported %i\n.", - MAX_QUEUES_PER_CPU); + if ((test_options->num_queue + test_options->num_dummy) > MAX_QUEUES) { + printf("Error: Too many queues. Max supported %i\n.", + MAX_QUEUES); ret = -1; } - test_options->tot_queue = test_options->num_queue * - test_options->num_cpu; - test_options->tot_event = test_options->tot_queue * + test_options->tot_queue = test_options->num_queue + + test_options->num_dummy; + test_options->tot_event = test_options->num_queue * test_options->num_event; return ret; @@ -182,6 +188,7 @@ static int create_pool(test_global_t *global) test_options_t *test_options = >test_options;
[lng-odp] [PATCH v1 2/3] test: sched_perf: add event forward option
From: Petri Savolainen Added -f option to enable event forwarding between queues. By default, an event is sent back to the queue it was received from. When forwaring is enabled, it's sent to the next queue. Signed-off-by: Petri Savolainen --- /** Email created from pull request 687 (psavol:master-test-sched-perf-options) ** https://github.com/Linaro/odp/pull/687 ** Patch: https://github.com/Linaro/odp/pull/687.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: b10a9d3318c78101ad4c590deb3d4be6ad7b3cc1 **/ test/performance/odp_sched_perf.c | 36 ++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/test/performance/odp_sched_perf.c b/test/performance/odp_sched_perf.c index d5fceede9..ba16623c9 100644 --- a/test/performance/odp_sched_perf.c +++ b/test/performance/odp_sched_perf.c @@ -24,6 +24,7 @@ typedef struct test_options_t { uint32_t num_round; uint32_t max_burst; int queue_type; + int forward; uint32_t tot_queue; uint32_t tot_event; @@ -66,6 +67,7 @@ static void print_usage(void) " -r, --num_roundNumber of rounds\n" " -b, --burstMaximum number of events per operation. Default: 100.\n" " -t, --type Queue type. 0: parallel, 1: atomic, 2: ordered. Default: 0.\n" + " -f, --forward 0: Keep event in the original queue, 1: Forward event to the next queue. Default: 0.\n" " -h, --help This help\n" "\n"); } @@ -84,11 +86,12 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) {"num_round", required_argument, NULL, 'r'}, {"burst", required_argument, NULL, 'b'}, {"type", required_argument, NULL, 't'}, + {"forward", required_argument, NULL, 'f'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; - static const char *shortopts = "+c:q:d:e:r:b:t:h"; + static const char *shortopts = "+c:q:d:e:r:b:t:f:h"; test_options->num_cpu= 1; test_options->num_queue = 1; @@ -97,6 +100,7 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) test_options->num_round = 10; test_options->max_burst = 100; test_options->queue_type = 0; + test_options->forward= 0; while (1) { opt = getopt_long(argc, argv, shortopts, longopts, _index); @@ -126,6 +130,9 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) case 't': test_options->queue_type = atoi(optarg); break; + case 'f': + test_options->forward = atoi(optarg); + break; case 'h': /* fall through */ default: @@ -194,6 +201,7 @@ static int create_pool(test_global_t *global) uint32_t max_burst = test_options->max_burst; uint32_t tot_queue = test_options->tot_queue; uint32_t tot_event = test_options->tot_event; + int forward = test_options->forward; printf("\nScheduler performance test\n"); printf(" num cpu %u\n", num_cpu); @@ -204,6 +212,7 @@ static int create_pool(test_global_t *global) printf(" max burst size %u\n", max_burst); printf(" total events %u\n", tot_event); printf(" num rounds %u\n", num_round); + printf(" forward events %i\n", forward ? 1 : 0); if (odp_pool_capability(_capa)) { printf("Error: Pool capa failed.\n"); @@ -298,6 +307,19 @@ static int create_queues(test_global_t *global) for (i = 0; i < num_queue; i++) { queue = global->queue[i]; + if (test_options->forward) { + uint32_t next = i + 1; + + if (next == num_queue) + next = 0; + + if (odp_queue_context_set(queue, >queue[next], + sizeof(odp_queue_t))) { + printf("Error: Context set failed %u\n", i); + return -1; + } + } + for (j = 0; j < num_event; j++) { buf = odp_buffer_alloc(pool); @@ -349,10 +371,12 @@ static int test_sched(void *arg) uint64_t events, enqueues; odp_time_t t1, t2; odp_queue_t queue; + odp_queue_t *next; test_global_t *global = arg; test_options_t *test_options = >test_options; uint32_t num_round = test_options->num_round; uint32_t max_burst = test_options->max_burst; + int forward = test_options->forward;
[lng-odp] [PATCH v1 0/3] Add options to sched_perf test application
Add options for better control of queue usage in the test. github /** Email created from pull request 687 (psavol:master-test-sched-perf-options) ** https://github.com/Linaro/odp/pull/687 ** Patch: https://github.com/Linaro/odp/pull/687.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: b10a9d3318c78101ad4c590deb3d4be6ad7b3cc1 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 115 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 110 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 9 lines checked to_send-p-002.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v1 1/2] linux-gen: odp_shm_print_all: print user len also in hex
From: Maxim Uvarov Original code prints len in hex and actual len in dec. That is hard to compare. Print both lens in hexadecimal. Signed-off-by: Maxim Uvarov --- /** Email created from pull request 686 (muvarov:devel/master_shm_print_all) ** https://github.com/Linaro/odp/pull/686 ** Patch: https://github.com/Linaro/odp/pull/686.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: f69e295240994a3f642957c1a78d208242d066dd **/ platform/linux-generic/odp_ishm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index fc2f948cc..131dd7057 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -1780,7 +1780,7 @@ int _odp_ishm_status(const char *title) huge = '?'; } proc_index = procfind_block(i); - ODP_PRINT("%2i %-*s %s%c 0x%-08lx %-8lu %-3lu %-3lu", + ODP_PRINT("%2i %-*s %s%c 0x%-08lx 0x%-08lx %-3lu %-3lu", i, max_name_len, ishm_tbl->block[i].name, flags, huge, ishm_tbl->block[i].len,
[lng-odp] [PATCH v1 2/2] linux-gen: shm: odp_shm_print_all add total counters
From: Maxim Uvarov Add total allocated and total lost counters. That also requires a little bit cleanup format string so output spreadshet looks more nicely. Signed-off-by: Maxim Uvarov --- /** Email created from pull request 686 (muvarov:devel/master_shm_print_all) ** https://github.com/Linaro/odp/pull/686 ** Patch: https://github.com/Linaro/odp/pull/686.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: f69e295240994a3f642957c1a78d208242d066dd **/ platform/linux-generic/odp_ishm.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index 131dd7057..effac7d6d 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -1730,6 +1730,8 @@ int _odp_ishm_status(const char *title) int nb_blocks = 0; int single_va_blocks = 0; int max_name_len = 0; + uint64_t lost_total = 0; /* statistics for total unused memory */ + uint64_t len_total = 0; /* statistics for total allocated memory */ odp_spinlock_lock(_tbl->lock); procsync(); @@ -1747,10 +1749,10 @@ int _odp_ishm_status(const char *title) max_name_len = str_len; } - ODP_PRINT("ishm blocks allocated at: %s\n", title); - - ODP_PRINT("%-*s flag lenuser_len seq ref startfd" - " file\n", max_name_len, "name"); + ODP_PRINT("%s\n", title); + ODP_PRINT("%-*s flag %-08s %-08s %-08s %-3s %-3s %-08s %-3s file\n", + max_name_len, "name", "len", "user_len", "lost", + "seq", "ref", "start", "fd"); /* display block table: 1 line per entry +1 extra line if mapped here */ for (i = 0; i < ISHM_MAX_NB_BLOCKS; i++) { @@ -1780,23 +1782,30 @@ int _odp_ishm_status(const char *title) huge = '?'; } proc_index = procfind_block(i); - ODP_PRINT("%2i %-*s %s%c 0x%-08lx 0x%-08lx %-3lu %-3lu", + lost_total += ishm_tbl->block[i].len - + ishm_tbl->block[i].user_len; + len_total += ishm_tbl->block[i].len; + ODP_PRINT("%2i %-*s %s%c 0x%-08lx 0x%-08lx 0x%-08lx %-3lu %-3lu", i, max_name_len, ishm_tbl->block[i].name, flags, huge, ishm_tbl->block[i].len, ishm_tbl->block[i].user_len, + ishm_tbl->block[i].len - ishm_tbl->block[i].user_len, ishm_tbl->block[i].seq, ishm_tbl->block[i].refcnt); if (proc_index < 0) continue; - ODP_PRINT("%-08lx %-3d", + ODP_PRINT(" 0x%-08lx %-3d", ishm_proctable->entry[proc_index].start, ishm_proctable->entry[proc_index].fd); - ODP_PRINT("%s\n", ishm_tbl->block[i].filename); + ODP_PRINT("%s\n", ishm_tbl->block[i].filename[0] ? + ishm_tbl->block[i].filename : "(none)"); } + ODP_PRINT("TOTAL: %41s%-08lx 0x%-08lx\n", + "0x", len_total, lost_total); /* display the virtual space allocations... : */ ODP_PRINT("\nishm virtual space:\n");
[lng-odp] [PATCH v1 0/2] linux-gen: odp_shm_print_all() refine shm stats print
github /** Email created from pull request 686 (muvarov:devel/master_shm_print_all) ** https://github.com/Linaro/odp/pull/686 ** Patch: https://github.com/Linaro/odp/pull/686.patch ** Base sha: 97fc51b1e5b3fcea9db99ba63c10bda47f79341a ** Merge commit sha: f69e295240994a3f642957c1a78d208242d066dd **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 8 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 55 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v2 1/1] linux-gen: ishm: implement huge page cache
From: Josep Puigdemont With this patch, ODP will pre-allocate several huge pages at init time. When memory is to be mapped into a huge page, one that was pre-allocated will be used, if available, this way ODP won't have to trap into the kernel to allocate huge pages. The idea with this implementation is to trick ishm into thinking that a file descriptor where to map the memory was provided, this way it it won't try to allocate one itself. This file descriptor is one of those previously allocated at init time. When the system is done with this file descriptor, instead of closing it, it is put back into the list of available huge pages, ready to be reused. A collateral effect of this patch is that memory is not zeroed out when it is reused. WARNING: This patch will not work when using process mode threads. For several reasons, this may not work when using ODP_ISHM_SINGLE_VA either, so for this case the list of pre-allocated files is not used. This patch should mitigate, if not solve, bug #3774: https://bugs.linaro.org/show_bug.cgi?id=3774 To pre-allocate huge pages, define the environment variable ODP_HP_CACHE, and possibly set it to the number of huge pages that should be pre-allocated, setting it to -1 will reserve up to 32 huge pages, which is currently a hard-coded limit. example usage: ODP_HP_CACHE=-1 ./test/validation/api/shmem/shmem_main Signed-off-by: Josep Puigdemont --- /** Email created from pull request 685 (joseppc:fix/cache_huge_pages) ** https://github.com/Linaro/odp/pull/685 ** Patch: https://github.com/Linaro/odp/pull/685.patch ** Base sha: 96e6c6409bfe8e5f276f136c4e10454f112cd662 ** Merge commit sha: fef12aa722655975b08b8f82c4cf4081abc6c072 **/ platform/linux-generic/odp_ishm.c | 206 -- 1 file changed, 192 insertions(+), 14 deletions(-) diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index fc2f948cc..1de116ed8 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -164,7 +164,7 @@ typedef struct ishm_fragment { * will allocate both a block and a fragment. * Blocks contain only global data common to all processes. */ -typedef enum {UNKNOWN, HUGE, NORMAL, EXTERNAL} huge_flag_t; +typedef enum {UNKNOWN, HUGE, NORMAL, EXTERNAL, CACHED} huge_flag_t; typedef struct ishm_block { char name[ISHM_NAME_MAXLEN];/* name for the ishm block (if any) */ char filename[ISHM_FILENAME_MAXLEN]; /* name of the .../odp-* file */ @@ -238,6 +238,17 @@ typedef struct { } ishm_ftable_t; static ishm_ftable_t *ishm_ftbl; +#define HP_CACHE_SIZE 32 +struct huge_page_cache { + uint64_t len; + int total; /* index in fd that's the highest allocated */ + int idx; /* retrieve fd[idx] to get a free file descriptor */ + unsigned int seq_num; + int fd[HP_CACHE_SIZE]; /* list of file descriptors */ +}; + +static struct huge_page_cache hpc; + #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif @@ -245,6 +256,132 @@ static ishm_ftable_t *ishm_ftbl; /* prototypes: */ static void procsync(void); +static int hp_create_file(uint64_t len, unsigned int seq_num) +{ + char filename[ISHM_FILENAME_MAXLEN]; + char dir[ISHM_FILENAME_MAXLEN]; + int fd; + void *addr; + + if (len <= 0) { + ODP_ERR("Length is wrong\n"); + return -1; + } + + if (!odp_global_data.hugepage_info.default_huge_page_dir) { + ODP_ERR("No huge page dir\n"); + return -1; + } + + snprintf(dir, ISHM_FILENAME_MAXLEN, "%s/%s", +odp_global_data.hugepage_info.default_huge_page_dir, +odp_global_data.uid); + + if (mkdir(dir, 0744) != 0) { + if (errno != EEXIST) { + ODP_ERR("Failed to creatr dir: %s\n", strerror(errno)); + return -1; + } + } + + snprintf(filename, ISHM_FILENAME_MAXLEN, +"%s/odp-%d-ishm_cached-%04x", +dir, +odp_global_data.main_pid, +seq_num++); + + fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (fd < 0) { + ODP_ERR("Could not create cache file %s\n", filename); + return -1; + } + + /* remove file from file system */ + unlink(filename); + + if (ftruncate(fd, len) == -1) { + ODP_ERR("Could not truncate file: %s\n", strerror(errno)); + close(fd); + return -1; + } + + /* commit huge page */ + addr = _odp_ishmphy_map(fd, NULL, len, 0); + if (addr == NULL) { + /* no more pages available */ + close(fd); + return -1; + } + _odp_ishmphy_unmap(addr, len, 0); + + ODP_DBG("Created HP cache file %s, fd: %d\n", filename, fd); + + return fd;
[lng-odp] [PATCH v2 0/1] linux-gen: ishm: implement huge page cache
With this patch, ODP will pre-allocate several huge pages at init time. When memory is to be mapped into a huge page, one that was pre-allocated will be used, if available, this way ODP won't have to trap into the kernel to allocate huge pages. The idea with this implementation is to trick ishm into thinking that a file descriptor where to map the memory was provided, this way it it won't try to allocate one itself. This file descriptor is one of those previously allocated at init time. When the system is done with this file descriptor, instead of closing it, it is put back into the list of available huge pages, ready to be reused. A collateral effect of this patch is that memory is not zeroed out when it is reused. WARNING: This patch will not work when using process mode threads. For several reasons, this may not work when using ODP_ISHM_SINGLE_VA either, so for this case the list of pre-allocated files is not used. This patch should mitigate, if not solve, bug #3774: https://bugs.linaro.org/show_bug.cgi?id=3774 To pre-allocate huge pages, define the environment variable ODP_HP_CACHE, and possibly set it to the number of huge pages that should be pre-allocated, setting it to -1 will reserve up to 32 huge pages, which is currently a hard-coded limit. example usage: ODP_HP_CACHE=-1 ./test/validation/api/shmem/shmem_main Signed-off-by: Josep Puigdemont josep.puigdem...@linaro.org github /** Email created from pull request 685 (joseppc:fix/cache_huge_pages) ** https://github.com/Linaro/odp/pull/685 ** Patch: https://github.com/Linaro/odp/pull/685.patch ** Base sha: 96e6c6409bfe8e5f276f136c4e10454f112cd662 ** Merge commit sha: fef12aa722655975b08b8f82c4cf4081abc6c072 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 268 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v1] [RFC 1/1] linux-gen: ishm: implement huge page cache
From: Josep Puigdemont With this patch, ODP will pre-allocate several huge pages at init time. When memory is to be mapped into a huge page, one that was pre-allocated will be used, if available, this way ODP won't have to trap into the kernel to allocate huge pages. The idea with this implementation is to trick ishm into thinking that a file descriptor where to map the memory was provided, this way it it won't try to allocate one itself. This file descriptor is one of those previously allocated at init time. When the system is done with this file descriptor, instead of closing it, it is put back into the list of available huge pages, ready to be reused. A collateral effect of this patch is that memory is not zeroed out when it is reused. WARNING: This patch will not work when using process mode threads. For several reasons, this may not work when using ODP_ISHM_SINGLE_VA either, so for this case the list of pre-allocated files is not used. This patch should mitigate, if not solve, bug #3774: https://bugs.linaro.org/show_bug.cgi?id=3774 To pre-allocate huge pages, define the environment variable ODP_HP_CACHE, and possibly set it to the number of huge pages that should be pre-allocated, setting it to -1 will reserve up to 32 huge pages, which is currently a hard-coded limit. example usage: ODP_HP_CACHE=-1 ./test/validation/api/shmem/shmem_main Signed-off-by: Josep Puigdemont --- /** Email created from pull request 685 (joseppc:fix/cache_huge_pages) ** https://github.com/Linaro/odp/pull/685 ** Patch: https://github.com/Linaro/odp/pull/685.patch ** Base sha: 96e6c6409bfe8e5f276f136c4e10454f112cd662 ** Merge commit sha: 234eeff23bccdae2b1e1ca6565fef76c06ae60ca **/ platform/linux-generic/odp_ishm.c | 201 +++--- 1 file changed, 187 insertions(+), 14 deletions(-) diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index fc2f948cc..01b089d3a 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -164,7 +164,7 @@ typedef struct ishm_fragment { * will allocate both a block and a fragment. * Blocks contain only global data common to all processes. */ -typedef enum {UNKNOWN, HUGE, NORMAL, EXTERNAL} huge_flag_t; +typedef enum {UNKNOWN, HUGE, NORMAL, EXTERNAL, CACHED} huge_flag_t; typedef struct ishm_block { char name[ISHM_NAME_MAXLEN];/* name for the ishm block (if any) */ char filename[ISHM_FILENAME_MAXLEN]; /* name of the .../odp-* file */ @@ -238,6 +238,16 @@ typedef struct { } ishm_ftable_t; static ishm_ftable_t *ishm_ftbl; +#define HP_CACHE_SIZE 32 +struct huge_page_cache { + uint64_t len; + int total; /* index in fd that's the highest allocated */ + int idx; /* retrieve fd[idx] to get a free file descriptor */ + unsigned int seq_num; + int fd[HP_CACHE_SIZE]; /* list of file descriptors */ +}; +static struct huge_page_cache hpc; + #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif @@ -245,6 +255,130 @@ static ishm_ftable_t *ishm_ftbl; /* prototypes: */ static void procsync(void); +static int hp_create_file(uint64_t len, unsigned int seq_num) +{ + char filename[ISHM_FILENAME_MAXLEN]; + char dir[ISHM_FILENAME_MAXLEN]; + int fd; + void *addr; + + if (len <= 0) { + ODP_ERR("Length is wrong\n"); + return -1; + } + + if (!odp_global_data.hugepage_info.default_huge_page_dir) { + ODP_ERR("No huge page dir\n"); + return -1; + } + + snprintf(dir, ISHM_FILENAME_MAXLEN, "%s/%s", +odp_global_data.hugepage_info.default_huge_page_dir, +odp_global_data.uid); + + if (mkdir(dir, 0744) != 0) { + if (errno != EEXIST) { + ODP_ERR("Failed to creatr dir: %s\n", strerror(errno)); + return -1; + } + } + + snprintf(filename, ISHM_FILENAME_MAXLEN, +"%s/odp-%d-ishm_cached-%04x", +dir, +odp_global_data.main_pid, +seq_num++); + + fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (fd < 0) { + ODP_ERR("Could not create cache file %s\n", filename); + return -1; + } + + /* remove file from file system */ + unlink(filename); + + if (ftruncate(fd, len) == -1) { + ODP_ERR("Could not truncate file: %s\n", strerror(errno)); + close(fd); + return -1; + } + + /* commit huge page */ + addr = _odp_ishmphy_map(fd, NULL, len, 0); + if (addr == NULL) { + /* no more pages available */ + close(fd); + return -1; + } + _odp_ishmphy_unmap(addr, len, 0); + + ODP_PRINT("Created HP cache file %s, fd: %d\n", filename, fd); + + return fd;
[lng-odp] [PATCH v1] [RFC 0/1] linux-gen: ishm: implement huge page cache
With this patch, ODP will pre-allocate several huge pages at init time. When memory is to be mapped into a huge page, one that was pre-allocated will be used, if available, this way ODP won't have to trap into the kernel to allocate huge pages. The idea with this implementation is to trick ishm into thinking that a file descriptor where to map the memory was provided, this way it it won't try to allocate one itself. This file descriptor is one of those previously allocated at init time. When the system is done with this file descriptor, instead of closing it, it is put back into the list of available huge pages, ready to be reused. A collateral effect of this patch is that memory is not zeroed out when it is reused. WARNING: This patch will not work when using process mode threads. For several reasons, this may not work when using ODP_ISHM_SINGLE_VA either, so for this case the list of pre-allocated files is not used. This patch should mitigate, if not solve, bug #3774: https://bugs.linaro.org/show_bug.cgi?id=3774 To pre-allocate huge pages, define the environment variable ODP_HP_CACHE, and possibly set it to the number of huge pages that should be pre-allocated, setting it to -1 will reserve up to 32 huge pages, which is currently a hard-coded limit. example usage: ODP_HP_CACHE=-1 ./test/validation/api/shmem/shmem_main Signed-off-by: Josep Puigdemont josep.puigdem...@linaro.org github /** Email created from pull request 685 (joseppc:fix/cache_huge_pages) ** https://github.com/Linaro/odp/pull/685 ** Patch: https://github.com/Linaro/odp/pull/685.patch ** Base sha: 96e6c6409bfe8e5f276f136c4e10454f112cd662 ** Merge commit sha: 234eeff23bccdae2b1e1ca6565fef76c06ae60ca **/ /github checkpatch.pl CHECK: Please use a blank line after function/struct/union/enum declarations #73: FILE: platform/linux-generic/odp_ishm.c:249: +}; +static struct huge_page_cache hpc; WARNING: Missing a blank line after declarations #217: FILE: platform/linux-generic/odp_ishm.c:937: + int fd = ishm_proctable->entry[proc_index].fd; + if (block->huge == CACHED) WARNING: line over 80 characters #264: FILE: platform/linux-generic/odp_ishm.c:1089: + addr = do_map(new_index, len, hp_align, flags, HUGE, ); total: 0 errors, 2 warnings, 1 checks, 263 lines checked to_send-p-000.patch has style problems, please review. If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. /checkpatch.pl
[lng-odp] [PATCH v5 8/8] ci: do compile-after-install test
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 681 (lumag:travis-xenial) ** https://github.com/Linaro/odp/pull/681 ** Patch: https://github.com/Linaro/odp/pull/681.patch ** Base sha: 6ce60cac1fea6d65803740f5f9b6627abf6814b3 ** Merge commit sha: 8c5d835ef3fbc6ab78503945fef582f7c60ac2c9 **/ scripts/ci/build.sh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh index 6fca1cc28..995c797b2 100755 --- a/scripts/ci/build.sh +++ b/scripts/ci/build.sh @@ -6,6 +6,17 @@ cd "$(dirname "$0")"/../.. ./configure \ --host=${TARGET_ARCH} --build=x86_64-linux-gnu \ --enable-dpdk \ + --prefix=/opt/odp \ ${CONF} make -j 8 + +make install + +pushd ${HOME} +${CC} ${CFLAGS} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst_dynamic `PKG_CONFIG_PATH=/opt/odp/lib/pkgconfig:${PKG_CONFIG_PATH} pkg-config --cflags --libs libodp-linux` +if [ -z "$TARGET_ARCH" ] +then + LD_LIBRARY_PATH="/opt/odp/lib:$LD_LIBRARY_PATH" ./odp_hello_inst_dynamic +fi +popd
[lng-odp] [PATCH v5 7/8] ci: move build stage to common script
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 681 (lumag:travis-xenial) ** https://github.com/Linaro/odp/pull/681 ** Patch: https://github.com/Linaro/odp/pull/681.patch ** Base sha: 6ce60cac1fea6d65803740f5f9b6627abf6814b3 ** Merge commit sha: 8c5d835ef3fbc6ab78503945fef582f7c60ac2c9 **/ scripts/ci/build.sh | 11 +++ scripts/ci/build_arm64.sh | 11 ++- scripts/ci/build_armhf.sh | 11 ++- scripts/ci/build_i386.sh| 11 ++- scripts/ci/build_powerpc.sh | 12 scripts/ci/build_x86_64.sh | 8 +--- 6 files changed, 22 insertions(+), 42 deletions(-) create mode 100755 scripts/ci/build.sh diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh new file mode 100755 index 0..6fca1cc28 --- /dev/null +++ b/scripts/ci/build.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +cd "$(dirname "$0")"/../.. +./bootstrap +./configure \ + --host=${TARGET_ARCH} --build=x86_64-linux-gnu \ + --enable-dpdk \ + ${CONF} + +make -j 8 diff --git a/scripts/ci/build_arm64.sh b/scripts/ci/build_arm64.sh index c38385d97..647dd29cf 100755 --- a/scripts/ci/build_arm64.sh +++ b/scripts/ci/build_arm64.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -TARGET_ARCH=aarch64-linux-gnu +export TARGET_ARCH=aarch64-linux-gnu if [ "${CC#clang}" != "${CC}" ] ; then export CC="clang --target=${TARGET_ARCH}" export CXX="clang++ --target=${TARGET_ARCH}" @@ -11,11 +11,4 @@ else fi export CPPFLAGS="-I/usr/include/${TARGET_ARCH}/dpdk" -cd "$(dirname "$0")"/../.. -./bootstrap -./configure \ - --host=${TARGET_ARCH} --build=x86_64-linux-gnu \ - --enable-dpdk \ - ${CONF} - -make -j 8 +exec "$(dirname "$0")"/build.sh diff --git a/scripts/ci/build_armhf.sh b/scripts/ci/build_armhf.sh index 74d47ad12..837561f83 100755 --- a/scripts/ci/build_armhf.sh +++ b/scripts/ci/build_armhf.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -TARGET_ARCH=arm-linux-gnueabihf +export TARGET_ARCH=arm-linux-gnueabihf if [ "${CC#clang}" != "${CC}" ] ; then export CC="clang --target=${TARGET_ARCH}" export CXX="clang++ --target=${TARGET_ARCH}" @@ -13,11 +13,4 @@ export CPPFLAGS="-I/usr/include/${TARGET_ARCH}/dpdk" export CFLAGS="-march=armv7-a" export CXXFLAGS="-march=armv7-a" -cd "$(dirname "$0")"/../.. -./bootstrap -./configure \ - --host=${TARGET_ARCH} --build=x86_64-linux-gnu \ - --enable-dpdk \ - ${CONF} - -make -j 8 +exec "$(dirname "$0")"/build.sh diff --git a/scripts/ci/build_i386.sh b/scripts/ci/build_i386.sh index 177df6304..17b6bf668 100755 --- a/scripts/ci/build_i386.sh +++ b/scripts/ci/build_i386.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -TARGET_ARCH=i686-linux-gnu +export TARGET_ARCH=i686-linux-gnu if [ "${CC#clang}" != "${CC}" ] ; then export CC="clang --target=${TARGET_ARCH}" export CXX="clang++ --target=${TARGET_ARCH}" @@ -12,11 +12,4 @@ else fi export CPPFLAGS="-I/usr/include/i386-linux-gnu/dpdk" -cd "$(dirname "$0")"/../.. -./bootstrap -./configure \ - --host=${TARGET_ARCH} --build=x86_64-linux-gnu \ - --enable-dpdk \ - ${CONF} - -make -j 8 +exec "$(dirname "$0")"/build.sh diff --git a/scripts/ci/build_powerpc.sh b/scripts/ci/build_powerpc.sh index 962a6a465..a213ee1d3 100755 --- a/scripts/ci/build_powerpc.sh +++ b/scripts/ci/build_powerpc.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -TARGET_ARCH=powerpc-linux-gnu +export TARGET_ARCH=powerpc-linux-gnu if [ "${CC#clang}" != "${CC}" ] ; then export CC="clang --target=${TARGET_ARCH}" export CXX="clang++ --target=${TARGET_ARCH}" @@ -9,11 +9,7 @@ else export CC="${TARGET_ARCH}-gcc" export CXX="${TARGET_ARCH}-g++" fi +# No DPDK on PowerPC +export CONF="${CONF} --disable-dpdk" -cd "$(dirname "$0")"/../.. -./bootstrap -./configure \ - --host=${TARGET_ARCH} --build=x86_64-linux-gnu \ - ${CONF} - -make -j 8 +exec "$(dirname "$0")"/build.sh diff --git a/scripts/ci/build_x86_64.sh b/scripts/ci/build_x86_64.sh index 2ed2e005a..01182fd90 100755 --- a/scripts/ci/build_x86_64.sh +++ b/scripts/ci/build_x86_64.sh @@ -5,10 +5,4 @@ if [ "${CC#clang}" != "${CC}" ] ; then export CXX="clang++" fi -cd "$(dirname "$0")"/../.. -./bootstrap -./configure \ - --enable-dpdk \ - ${CONF} - -make -j 8 +exec "$(dirname "$0")"/build.sh
[lng-odp] [PATCH v5 6/8] ci: rewrite coverage and distcheck scripts to follow other build scripts
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 681 (lumag:travis-xenial) ** https://github.com/Linaro/odp/pull/681 ** Patch: https://github.com/Linaro/odp/pull/681.patch ** Base sha: 6ce60cac1fea6d65803740f5f9b6627abf6814b3 ** Merge commit sha: 8c5d835ef3fbc6ab78503945fef582f7c60ac2c9 **/ scripts/ci/coverage.sh | 27 +-- scripts/ci/distcheck.sh | 22 +++--- 2 files changed, 16 insertions(+), 33 deletions(-) diff --git a/scripts/ci/coverage.sh b/scripts/ci/coverage.sh index 51ee277e2..2f285e95c 100755 --- a/scripts/ci/coverage.sh +++ b/scripts/ci/coverage.sh @@ -1,21 +1,11 @@ #!/bin/bash set -e -# CC LD AR CXX has to be predifubed -# - -export PKG_CONFIG_PATH="$HOME/cunit-install/x86_64/lib/pkgconfig:${PKG_CONFIG_PATH}" - -CWD=$(dirname "$0") -TDIR=`mktemp -d -p ~` - -cd ${TDIR} -echo 1000 | tee /proc/sys/vm/nr_hugepages -mkdir -p /mnt/huge -mount -t hugetlbfs nodev /mnt/huge +if [ "${CC#clang}" != "${CC}" ] ; then + export CXX="clang++" +fi -git clone ${CWD}/../../ odp -cd ./odp +cd "$(dirname "$0")"/../.. ./bootstrap ./configure \ CFLAGS="-O0 -coverage $CLFAGS" CXXFLAGS="-O0 -coverage $CXXFLAGS" LDFLAGS="--coverage $LDFLAGS" \ @@ -23,7 +13,11 @@ cd ./odp export CCACHE_DISABLE=1 make -j $(nproc) -# ignore possible failures there because these tests depends on measurements +echo 1000 | tee /proc/sys/vm/nr_hugepages +mkdir -p /mnt/huge +mount -t hugetlbfs nodev /mnt/huge + +# Ignore possible failures there because these tests depends on measurements # and systems might differ in performance. export CI="true" @@ -50,7 +44,4 @@ fi bash <(curl -s https://codecov.io/bash) -X coveragepy -cd ~ -rm -rf ${TDIR} - umount /mnt/huge diff --git a/scripts/ci/distcheck.sh b/scripts/ci/distcheck.sh index 22013473b..4f3802451 100755 --- a/scripts/ci/distcheck.sh +++ b/scripts/ci/distcheck.sh @@ -1,25 +1,17 @@ #!/bin/bash set -e -# CC LD AR CXX has to be predifubed -# +if [ "${CC#clang}" != "${CC}" ] ; then + export CXX="clang++" +fi -export PKG_CONFIG_PATH="$HOME/cunit-install/x86_64/lib/pkgconfig:${PKG_CONFIG_PATH}" - -CWD=$(dirname "$0") -TDIR=`mktemp -d -p ~` - -cd ${TDIR} -git clone ${CWD}/../../ odp -cd ./odp +cd "$(dirname "$0")"/../.. ./bootstrap -./configure --enable-user-guides +./configure \ + --enable-user-guides -make clean make distcheck make clean -make distcheck DISTCHECK__CONFIGURE_FLAGS=--disable-abi-compat -cd ~ -rm -rf ${TDIR} +make distcheck DISTCHECK__CONFIGURE_FLAGS=--disable-abi-compat
[lng-odp] [PATCH v5 5/8] travis: restore quick build-only testing
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 681 (lumag:travis-xenial) ** https://github.com/Linaro/odp/pull/681 ** Patch: https://github.com/Linaro/odp/pull/681.patch ** Base sha: 6ce60cac1fea6d65803740f5f9b6627abf6814b3 ** Merge commit sha: 8c5d835ef3fbc6ab78503945fef582f7c60ac2c9 **/ .travis.yml| 35 --- scripts/ci/build_x86_64.sh | 11 --- scripts/ci/check.sh| 17 + 3 files changed, 49 insertions(+), 14 deletions(-) create mode 100755 scripts/ci/check.sh diff --git a/.travis.yml b/.travis.yml index 851d47ab0..26431ff19 100644 --- a/.travis.yml +++ b/.travis.yml @@ -92,7 +92,7 @@ script: -v `pwd`:/odp --shm-size 8g -e CC="${CC}" -e CONF="${CONF}" - ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_x86_64.sh ; + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/check.sh ; fi jobs: include: @@ -152,12 +152,41 @@ jobs: true fi - stage: "build only" - env: Ubuntu16.04_arm64 + env: ARCH=x86_64 + install: + - true + script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi + - docker run -i -t -v `pwd`:/odp + -e CC="${CC}" + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_${ARCH}.sh +- stage: "build only" + env: ARCH=x86_64 CC=clang + install: + - true + script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi + - docker run -i -t -v `pwd`:/odp + -e CC="${CC}" + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_${ARCH}.sh +- stage: "build only" + env: ARCH=arm64 + install: + - true + script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi + - docker run -i -t -v `pwd`:/odp + -e CC="${CC}" + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_${ARCH}.sh +- stage: "build only" + env: ARCH=i386 + install: + - true script: - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - docker run -i -t -v `pwd`:/odp -e CC="${CC}" - ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_arm64.sh + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_${ARCH}.sh - stage: test canfail: yes env: TEST=checkpatch diff --git a/scripts/ci/build_x86_64.sh b/scripts/ci/build_x86_64.sh index b9b170659..2ed2e005a 100755 --- a/scripts/ci/build_x86_64.sh +++ b/scripts/ci/build_x86_64.sh @@ -12,14 +12,3 @@ cd "$(dirname "$0")"/../.. ${CONF} make -j 8 - -echo 1000 | tee /proc/sys/vm/nr_hugepages -mkdir -p /mnt/huge -mount -t hugetlbfs nodev /mnt/huge - -# Ignore possible failures there because these tests depends on measurements -# and systems might differ in performance. -export CI="true" -make check - -umount /mnt/huge diff --git a/scripts/ci/check.sh b/scripts/ci/check.sh new file mode 100755 index 0..431686802 --- /dev/null +++ b/scripts/ci/check.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -e + +"`dirname "$0"`"/build_x86_64.sh + +cd "$(dirname "$0")"/../.. + +echo 1000 | tee /proc/sys/vm/nr_hugepages +mkdir -p /mnt/huge +mount -t hugetlbfs nodev /mnt/huge + +# Ignore possible failures there because these tests depends on measurements +# and systems might differ in performance. +export CI="true" +make check + +umount /mnt/huge
[lng-odp] [PATCH v5 2/8] travis: switch to unified 16.04 image
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 681 (lumag:travis-xenial) ** https://github.com/Linaro/odp/pull/681 ** Patch: https://github.com/Linaro/odp/pull/681.patch ** Base sha: 6ce60cac1fea6d65803740f5f9b6627abf6814b3 ** Merge commit sha: 8c5d835ef3fbc6ab78503945fef582f7c60ac2c9 **/ .travis.yml | 131 scripts/ci/build_arm64.sh | 48 - scripts/ci/build_armhf.sh | 52 -- scripts/ci/build_dpdk.sh| 88 scripts/ci/build_i386.sh| 31 +++-- scripts/ci/build_powerpc.sh | 31 +++-- scripts/ci/build_x86_64.sh | 31 +++-- 7 files changed, 82 insertions(+), 330 deletions(-) delete mode 100755 scripts/ci/build_dpdk.sh diff --git a/.travis.yml b/.travis.yml index 23629d538..4853b48c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,16 +20,7 @@ stages: - "build only" - test -addons: -apt: -packages: -- gcc -- clang-3.8 -- automake autoconf libtool libssl-dev graphviz mscgen -- libconfig-dev -- codespell -- libpcap-dev -- libnuma-dev +#addons: #coverity_scan: #project: #name: "$TRAVIS_REPO_SLUG" @@ -42,9 +33,7 @@ cache: ccache: true pip: true directories: -- dpdk - netmap -- $HOME/cunit-install - $HOME/doxygen-install env: @@ -54,10 +43,17 @@ env: # 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=a733c34c-5f5c-4ff1-af4b-e9f5edb1ab5e -- DPDK_VERS="17.11.3" matrix: - CONF="" - CONF="--disable-abi-compat" +- CROSS_ARCH="arm64" +- CROSS_ARCH="armhf" +- CROSS_ARCH="powerpc" +- CROSS_ARCH="i386" +- CROSS_ARCH="arm64" CONF="--disable-abi-compat" +- CROSS_ARCH="armhf" CONF="--disable-abi-compat" +- CROSS_ARCH="powerpc" CONF="--disable-abi-compat" +- CROSS_ARCH="i386" CONF="--disable-abi-compat" - CONF="--enable-deprecated" - CONF="--enable-dpdk-zero-copy --disable-static-applications" - CONF="--disable-static-applications" @@ -65,7 +61,6 @@ env: - CONF="--disable-host-optimization --disable-abi-compat" - CONF="--enable-pcapng-support" - CONF="--without-openssl" -- DPDK_SHARED="y" CONF="--disable-static-applications" compiler: - gcc @@ -75,12 +70,11 @@ install: - sudo apt-get install linux-headers-`uname -r` script: - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi -- if [ "${CC#clang}" != "${CC}" ] ; then LD="" CXX=clang++; fi - if [ -n "${CROSS_ARCH}" ] ; then docker run -i -t -v `pwd`:/odp - -e CC="${CC}" -e LD="${LD}" -e CXX="${CXX}" - -e CONF="${CONF}" -e DPDK_SHARED="${DPDK_SHARED}" - ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_14.04.05 /odp/scripts/ci/build_${CROSS_ARCH}.sh ; + -e CC="${CC}" + -e CONF="${CONF}" + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_${CROSS_ARCH}.sh ; else echo "compilling netmap"; CDIR=`pwd` ; @@ -94,9 +88,9 @@ script: echo "Running test" ; docker run --privileged -i -t -v `pwd`:/odp --shm-size 8g - -e CC="${CC}" -e LD="${LD}" -e CXX="${CXX}" - -e CONF="${CONF}" -e DPDK_SHARED="${DPDK_SHARED}" - ${DOCKER_NAMESPACE}/travis-odp-lng-x86 /odp/scripts/ci/build_x86_64.sh ; + -e CC="${CC}" + -e CONF="${CONF}" + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_x86_64.sh ; fi jobs: include: @@ -108,9 +102,9 @@ jobs: - docker run --privileged -i -t -v `pwd`:/odp --shm-size 8g -e CODECOV_TOKEN="${CODECOV_TOKEN}" - -e CC="${CC}" -e LD="${LD}" -e CXX="${CXX}" + -e CC="${CC}" -e CONF="${CONF}" - ${DOCKER_NAMESPACE}/travis-odp-lng-x86 /odp/scripts/ci/coverage.sh + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/coverage.sh - stage: test env: TEST=distcheck compiler: gcc @@ -118,12 +112,18 @@ jobs:
[lng-odp] [PATCH v5 1/8] travis: fix DOCKER_NAMESPACE variable setting
From: Dmitry Eremin-Solenikov First, original commit missed one quote mark. Second, conditional ifs do not work in env: part of .travis.yml. Set DOCKER_NAMESPACE properly. Signed-off-by: Dmitry Eremin-Solenikov Fixes: 989df5d2f97ab4711328b11282dcc743f5740e00 --- /** Email created from pull request 681 (lumag:travis-xenial) ** https://github.com/Linaro/odp/pull/681 ** Patch: https://github.com/Linaro/odp/pull/681.patch ** Base sha: 6ce60cac1fea6d65803740f5f9b6627abf6814b3 ** Merge commit sha: 8c5d835ef3fbc6ab78503945fef582f7c60ac2c9 **/ .travis.yml | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d1520aa1a..23629d538 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,7 +55,6 @@ env: # you need generated new one at https://codecov.io specific for your repo. - CODECOV_TOKEN=a733c34c-5f5c-4ff1-af4b-e9f5edb1ab5e - DPDK_VERS="17.11.3" -- if [ -z "${DOCKER_NAMESPACE} ] ; then export DOCKER_NAMESPACE="opendataplane"; fi matrix: - CONF="" - CONF="--disable-abi-compat" @@ -75,6 +74,7 @@ compiler: install: - sudo apt-get install linux-headers-`uname -r` script: +- if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - if [ "${CC#clang}" != "${CC}" ] ; then LD="" CXX=clang++; fi - if [ -n "${CROSS_ARCH}" ] ; then docker run -i -t -v `pwd`:/odp @@ -104,6 +104,7 @@ jobs: env: TEST=coverage compiler: gcc script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - docker run --privileged -i -t -v `pwd`:/odp --shm-size 8g -e CODECOV_TOKEN="${CODECOV_TOKEN}" @@ -114,6 +115,7 @@ jobs: env: TEST=distcheck compiler: gcc script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - docker run --privileged -i -t -v `pwd`:/odp --shm-size 8g -e CC="${CC}" -e LD="${LD}" -e CXX="${CXX}" @@ -150,6 +152,7 @@ jobs: - stage: "build only" env: Ubuntu14.04_arm64 script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - docker run -i -t -v `pwd`:/odp ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_14.04.05 /odp/scripts/ci/build_arm64.sh - stage: test @@ -174,6 +177,7 @@ jobs: compiler: gcc env: CROSS_ARCH="i386" script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - docker run --privileged -i -t -v `pwd`:/odp -e CC="${CC}" -e LD="${LD}" -e CXX="${CXX}" @@ -183,6 +187,7 @@ jobs: compiler: clang env: CROSS_ARCH="i386" script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - docker run --privileged -i -t -v `pwd`:/odp -e CC="${CC}" -e LD="${LD}" -e CXX="${CXX}" @@ -210,6 +215,7 @@ jobs: compiler: gcc env: CROSS_ARCH="i386" CONF="--disable-abi-compat" script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - docker run --privileged -i -t -v `pwd`:/odp -e CC="${CC}" -e LD="${LD}" -e CXX="${CXX}" @@ -219,6 +225,7 @@ jobs: compiler: clang env: CROSS_ARCH="i386" CONF="--disable-abi-compat" script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - docker run --privileged -i -t -v `pwd`:/odp -e CC="${CC}" -e LD="${LD}" -e CXX="${CXX}"
[lng-odp] [PATCH v5 4/8] travis: move netmap to install stage
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 681 (lumag:travis-xenial) ** https://github.com/Linaro/odp/pull/681 ** Patch: https://github.com/Linaro/odp/pull/681.patch ** Base sha: 6ce60cac1fea6d65803740f5f9b6627abf6814b3 ** Merge commit sha: 8c5d835ef3fbc6ab78503945fef582f7c60ac2c9 **/ .travis.yml | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4853b48c5..851d47ab0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,14 +68,7 @@ compiler: install: - sudo apt-get install linux-headers-`uname -r` -script: -- if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi -- if [ -n "${CROSS_ARCH}" ] ; then - docker run -i -t -v `pwd`:/odp - -e CC="${CC}" - -e CONF="${CONF}" - ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_${CROSS_ARCH}.sh ; - else +- if [ -z "${CROSS_ARCH}" ] ; then echo "compilling netmap"; CDIR=`pwd` ; git -c advice.detachedHead=false clone -q --depth=1 --single-branch --branch=v11.2 https://github.com/luigirizzo/netmap.git; @@ -85,6 +78,15 @@ script: popd; sudo insmod ./netmap/LINUX/netmap.ko; CONF="$CONF --with-netmap-path=/odp/netmap"; + fi +script: +- if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi +- if [ -n "${CROSS_ARCH}" ] ; then + docker run -i -t -v `pwd`:/odp + -e CC="${CC}" + -e CONF="${CONF}" + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_${CROSS_ARCH}.sh ; + else echo "Running test" ; docker run --privileged -i -t -v `pwd`:/odp --shm-size 8g
[lng-odp] [PATCH v5 0/8] Travis: use Ubuntu 16.04 Docker image
This depends on Linaro/odp-docker-images#1 github /** Email created from pull request 681 (lumag:travis-xenial) ** https://github.com/Linaro/odp/pull/681 ** Patch: https://github.com/Linaro/odp/pull/681.patch ** Base sha: 6ce60cac1fea6d65803740f5f9b6627abf6814b3 ** Merge commit sha: 8c5d835ef3fbc6ab78503945fef582f7c60ac2c9 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 63 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 443 lines checked to_send-p-001.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 11 lines checked to_send-p-002.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 30 lines checked to_send-p-003.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 71 lines checked to_send-p-004.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 76 lines checked to_send-p-005.patch has no obvious style problems and is ready for submission. total: 0 errors, 0 warnings, 0 checks, 104 lines checked to_send-p-006.patch has no obvious style problems and is ready for submission. WARNING: line over 80 characters #34: FILE: scripts/ci/build.sh:17: +${CC} ${CFLAGS} ${OLDPWD}/example/hello/odp_hello.c -o odp_hello_inst_dynamic `PKG_CONFIG_PATH=/opt/odp/lib/pkgconfig:${PKG_CONFIG_PATH} pkg-config --cflags --libs libodp-linux` total: 0 errors, 1 warnings, 0 checks, 17 lines checked to_send-p-007.patch has style problems, please review. If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. /checkpatch.pl
[lng-odp] [PATCH v5 3/8] m4: odp_dpdk: pass CFLAGS and LDFLAGS to CC when locating libdpdk.so
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 681 (lumag:travis-xenial) ** https://github.com/Linaro/odp/pull/681 ** Patch: https://github.com/Linaro/odp/pull/681.patch ** Base sha: 6ce60cac1fea6d65803740f5f9b6627abf6814b3 ** Merge commit sha: 8c5d835ef3fbc6ab78503945fef582f7c60ac2c9 **/ m4/odp_dpdk.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/m4/odp_dpdk.m4 b/m4/odp_dpdk.m4 index 2ef5253c8..1072bf2dc 100644 --- a/m4/odp_dpdk.m4 +++ b/m4/odp_dpdk.m4 @@ -121,9 +121,9 @@ AC_DEFUN([ODP_DPDK], [dnl AS_IF([test "x$1" = "xsystem"], [dnl DPDK_CPPFLAGS="-isystem /usr/include/dpdk" DPDK_LDFLAGS="" -DPDK_LIB_PATH="`$CC --print-file-name=libdpdk.so`" +DPDK_LIB_PATH="`$CC $CFLAGS $LDFLAGS --print-file-name=libdpdk.so`" if test "$DPDK_LIB_PATH" = "libdpdk.so" ; then - DPDK_LIB_PATH="`$CC --print-file-name=libdpdk.a`" + DPDK_LIB_PATH="`$CC $CFLAGS $LDFLAGS --print-file-name=libdpdk.a`" AS_IF([test "$DPDK_LIB_PATH" = "libdpdk.a"], [AC_MSG_FAILURE([Could not locate system DPDK library directory])]) else
[lng-odp] [PATCH v1 1/1] travis: fix DOCKER_NAMESPACE variable setting
From: Dmitry Eremin-Solenikov First, original commit missed one quote mark. Second, conditional ifs do not work in env: part of .travis.yml. Set DOCKER_NAMESPACE properly. Signed-off-by: Dmitry Eremin-Solenikov Fixes: 989df5d2f97ab4711328b11282dcc743f5740e00 --- /** Email created from pull request 684 (lumag:docker-ns-fix) ** https://github.com/Linaro/odp/pull/684 ** Patch: https://github.com/Linaro/odp/pull/684.patch ** Base sha: 989df5d2f97ab4711328b11282dcc743f5740e00 ** Merge commit sha: e3810b543a5dd8cc9bdef2b98f0d6f696b6e6194 **/ .travis.yml | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d1520aa1a..23629d538 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,7 +55,6 @@ env: # you need generated new one at https://codecov.io specific for your repo. - CODECOV_TOKEN=a733c34c-5f5c-4ff1-af4b-e9f5edb1ab5e - DPDK_VERS="17.11.3" -- if [ -z "${DOCKER_NAMESPACE} ] ; then export DOCKER_NAMESPACE="opendataplane"; fi matrix: - CONF="" - CONF="--disable-abi-compat" @@ -75,6 +74,7 @@ compiler: install: - sudo apt-get install linux-headers-`uname -r` script: +- if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - if [ "${CC#clang}" != "${CC}" ] ; then LD="" CXX=clang++; fi - if [ -n "${CROSS_ARCH}" ] ; then docker run -i -t -v `pwd`:/odp @@ -104,6 +104,7 @@ jobs: env: TEST=coverage compiler: gcc script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - docker run --privileged -i -t -v `pwd`:/odp --shm-size 8g -e CODECOV_TOKEN="${CODECOV_TOKEN}" @@ -114,6 +115,7 @@ jobs: env: TEST=distcheck compiler: gcc script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - docker run --privileged -i -t -v `pwd`:/odp --shm-size 8g -e CC="${CC}" -e LD="${LD}" -e CXX="${CXX}" @@ -150,6 +152,7 @@ jobs: - stage: "build only" env: Ubuntu14.04_arm64 script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - docker run -i -t -v `pwd`:/odp ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_14.04.05 /odp/scripts/ci/build_arm64.sh - stage: test @@ -174,6 +177,7 @@ jobs: compiler: gcc env: CROSS_ARCH="i386" script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - docker run --privileged -i -t -v `pwd`:/odp -e CC="${CC}" -e LD="${LD}" -e CXX="${CXX}" @@ -183,6 +187,7 @@ jobs: compiler: clang env: CROSS_ARCH="i386" script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - docker run --privileged -i -t -v `pwd`:/odp -e CC="${CC}" -e LD="${LD}" -e CXX="${CXX}" @@ -210,6 +215,7 @@ jobs: compiler: gcc env: CROSS_ARCH="i386" CONF="--disable-abi-compat" script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - docker run --privileged -i -t -v `pwd`:/odp -e CC="${CC}" -e LD="${LD}" -e CXX="${CXX}" @@ -219,6 +225,7 @@ jobs: compiler: clang env: CROSS_ARCH="i386" CONF="--disable-abi-compat" script: + - if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi - docker run --privileged -i -t -v `pwd`:/odp -e CC="${CC}" -e LD="${LD}" -e CXX="${CXX}"
[lng-odp] [PATCH v1 0/1] travis: fix DOCKER_NAMESPACE variable setting
First, original commit missed one quote mark. Second, conditional ifs do not work in env: part of .travis.yml. Set DOCKER_NAMESPACE properly. Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsoleni...@linaro.org Fixes: 989df5d github /** Email created from pull request 684 (lumag:docker-ns-fix) ** https://github.com/Linaro/odp/pull/684 ** Patch: https://github.com/Linaro/odp/pull/684.patch ** Base sha: 989df5d2f97ab4711328b11282dcc743f5740e00 ** Merge commit sha: e3810b543a5dd8cc9bdef2b98f0d6f696b6e6194 **/ /github checkpatch.pl total: 0 errors, 0 warnings, 0 checks, 63 lines checked to_send-p-000.patch has no obvious style problems and is ready for submission. /checkpatch.pl
[lng-odp] [PATCH v3 4/6] m4: odp_dpdk: pass CFLAGS and LDFLAGS to CC when locating libdpdk.so
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 681 (lumag:travis-xenial) ** https://github.com/Linaro/odp/pull/681 ** Patch: https://github.com/Linaro/odp/pull/681.patch ** Base sha: 989df5d2f97ab4711328b11282dcc743f5740e00 ** Merge commit sha: 1bf5f265227e822d9820026c932d9c4fc22f2156 **/ m4/odp_dpdk.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/m4/odp_dpdk.m4 b/m4/odp_dpdk.m4 index 2ef5253c8..1072bf2dc 100644 --- a/m4/odp_dpdk.m4 +++ b/m4/odp_dpdk.m4 @@ -121,9 +121,9 @@ AC_DEFUN([ODP_DPDK], [dnl AS_IF([test "x$1" = "xsystem"], [dnl DPDK_CPPFLAGS="-isystem /usr/include/dpdk" DPDK_LDFLAGS="" -DPDK_LIB_PATH="`$CC --print-file-name=libdpdk.so`" +DPDK_LIB_PATH="`$CC $CFLAGS $LDFLAGS --print-file-name=libdpdk.so`" if test "$DPDK_LIB_PATH" = "libdpdk.so" ; then - DPDK_LIB_PATH="`$CC --print-file-name=libdpdk.a`" + DPDK_LIB_PATH="`$CC $CFLAGS $LDFLAGS --print-file-name=libdpdk.a`" AS_IF([test "$DPDK_LIB_PATH" = "libdpdk.a"], [AC_MSG_FAILURE([Could not locate system DPDK library directory])]) else
[lng-odp] [PATCH v3 2/6] travis: switch to unified 16.04 image
From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 681 (lumag:travis-xenial) ** https://github.com/Linaro/odp/pull/681 ** Patch: https://github.com/Linaro/odp/pull/681.patch ** Base sha: 989df5d2f97ab4711328b11282dcc743f5740e00 ** Merge commit sha: 1bf5f265227e822d9820026c932d9c4fc22f2156 **/ .travis.yml | 127 scripts/ci/build_arm64.sh | 50 -- scripts/ci/build_armhf.sh | 54 +-- scripts/ci/build_dpdk.sh| 88 - scripts/ci/build_i386.sh| 32 - scripts/ci/build_powerpc.sh | 33 -- scripts/ci/build_x86_64.sh | 32 +++-- 7 files changed, 90 insertions(+), 326 deletions(-) delete mode 100755 scripts/ci/build_dpdk.sh diff --git a/.travis.yml b/.travis.yml index 54586fa57..4c028566d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,16 +20,7 @@ stages: - "build only" - test -addons: -apt: -packages: -- gcc -- clang-3.8 -- automake autoconf libtool libssl-dev graphviz mscgen -- libconfig-dev -- codespell -- libpcap-dev -- libnuma-dev +#addons: #coverity_scan: #project: #name: "$TRAVIS_REPO_SLUG" @@ -42,9 +33,7 @@ cache: ccache: true pip: true directories: -- dpdk - netmap -- $HOME/cunit-install - $HOME/doxygen-install env: @@ -54,11 +43,18 @@ env: # 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=a733c34c-5f5c-4ff1-af4b-e9f5edb1ab5e -- DPDK_VERS="17.11.3" - if [ -z "${DOCKER_NAMESPACE} ] ; then export DOCKER_NAMESPACE="opendataplane"; fi matrix: - CONF="" - CONF="--disable-abi-compat" +- CROSS_ARCH="arm64" +- CROSS_ARCH="armhf" +- CROSS_ARCH="powerpc" +- CROSS_ARCH="i386" +- CROSS_ARCH="arm64" CONF="--disable-abi-compat" +- CROSS_ARCH="armhf" CONF="--disable-abi-compat" +- CROSS_ARCH="powerpc" CONF="--disable-abi-compat" +- CROSS_ARCH="i386" CONF="--disable-abi-compat" - CONF="--enable-deprecated" - CONF="--enable-dpdk-zero-copy --disable-static-applications" - CONF="--disable-static-applications" @@ -66,7 +62,6 @@ env: - CONF="--disable-host-optimization --disable-abi-compat" - CONF="--enable-pcapng-support" - CONF="--without-openssl" -- DPDK_SHARED="y" CONF="--disable-static-applications" compiler: - gcc @@ -75,12 +70,11 @@ compiler: install: - sudo apt-get install linux-headers-`uname -r` script: -- if [ "${CC#clang}" != "${CC}" ] ; then CXX=clang++; fi - if [ -n "${CROSS_ARCH}" ] ; then docker run -i -t -v `pwd`:/odp - -e CC="${CC}" -e CXX="${CXX}" - -e CONF="${CONF}" -e DPDK_SHARED="${DPDK_SHARED}" - ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_14.04.05 /odp/scripts/ci/build_${CROSS_ARCH}.sh ; + -e CC="${CC}" + -e CONF="${CONF}" + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_${CROSS_ARCH}.sh ; else echo "compilling netmap"; CDIR=`pwd` ; @@ -94,9 +88,9 @@ script: echo "Running test" ; docker run --privileged -i -t -v `pwd`:/odp --shm-size 8g - -e CC="${CC}" -e CXX="${CXX}" - -e CONF="${CONF}" -e DPDK_SHARED="${DPDK_SHARED}" - ${DOCKER_NAMESPACE}/travis-odp-lng-x86 /odp/scripts/ci/build_x86_64.sh ; + -e CC="${CC}" + -e CONF="${CONF}" + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_x86_64.sh ; fi jobs: include: @@ -107,21 +101,27 @@ jobs: - docker run --privileged -i -t -v `pwd`:/odp --shm-size 8g -e CODECOV_TOKEN="${CODECOV_TOKEN}" - -e CC="${CC}" -e CXX="${CXX}" + -e CC="${CC}" -e CONF="${CONF}" - ${DOCKER_NAMESPACE}/travis-odp-lng-x86 /odp/scripts/ci/coverage.sh + ${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/coverage.sh - stage: test env: TEST=distcheck compiler: gcc script: - docker run --privileged