This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 901de0794779a6f419f5229de045bf610ec2adc2 (commit) via 33c034c005f686cda95bc21ca4ed1aaf6d7eb539 (commit) via bfcb5801d210e1535e19e556698dd90337a3d4ac (commit) via e373d2a880ba8ab18fa47422920c34d48090714b (commit) from 2f1c802e45b2e860e641d84c15368cca6cc3454d (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 901de0794779a6f419f5229de045bf610ec2adc2 Author: Matias Elo matias.elo@nokia.com Date: Fri Nov 9 12:17:28 2018 +0200
linux-gen: ishm: allocate small shm blocks using normal pages
Only memory reservations larger than ISHM_HUGE_PAGE_LIMIT (64kB) are allocated using huge pages (if available). Smaller reservations are done using normal pages to conserve memory.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index 054ef6a0..9bf40eb3 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -125,6 +125,13 @@ */ #define ISHM_NB_FRAGMNTS (ISHM_MAX_NB_BLOCKS * 2 + 1)
+/* + * Memory reservations larger than ISHM_HUGE_PAGE_LIMIT (bytes) are allocated + * using huge pages (if available). Smaller reservations are done using normal + * pages to conserve memory. + */ +#define ISHM_HUGE_PAGE_LIMIT (64 * 1024) + /* * when a memory block is to be exported outside its ODP instance, * an block 'attribute file' is created in /dev/shm/odp-<pid>-shm-<name>. @@ -1092,7 +1099,7 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd,
/* Otherwise, Try first huge pages when possible and needed: */ if ((fd < 0) && page_hp_size && ((flags & _ODP_ISHM_USE_HP) || - size > page_sz)) { + size > ISHM_HUGE_PAGE_LIMIT)) { /* at least, alignment in VA should match page size, but user * can request more: If the user requirement exceeds the page * size then we have to make sure the block will be mapped at
commit 33c034c005f686cda95bc21ca4ed1aaf6d7eb539 Author: Matias Elo matias.elo@nokia.com Date: Mon Nov 12 14:51:28 2018 +0200
linux-gen: ishm: add internal _ODP_ISHM_USE_HP flag
Add internal shm flag for allocating shm memory always from huge pages. This is required by zero-copy dpdk packet pool. Internal _odp_shm_reserve() function is added for passing extra shm flags.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/include/odp_shm_internal.h b/platform/linux-generic/include/odp_shm_internal.h index 93146a51..a1bd2439 100644 --- a/platform/linux-generic/include/odp_shm_internal.h +++ b/platform/linux-generic/include/odp_shm_internal.h @@ -14,10 +14,13 @@ extern "C" { #include <sys/types.h> #include <inttypes.h>
+#include <odp/api/shared_memory.h> + /* flags available at ishm_reserve: */ #define _ODP_ISHM_SINGLE_VA 1 #define _ODP_ISHM_LOCK 2 -#define _ODP_ISHM_EXPORT 4 /*create export descr file in /tmp */ +#define _ODP_ISHM_EXPORT 4 /* create export descr file in /tmp */ +#define _ODP_ISHM_USE_HP 8 /* allocate memory from huge pages */
/** * Shared memory block info @@ -31,6 +34,9 @@ typedef struct _odp_ishm_info_t { uint32_t user_flags;/**< user specific flags */ } _odp_ishm_info_t;
+odp_shm_t _odp_shm_reserve(const char *name, uint64_t size, uint32_t align, + uint32_t flags, uint32_t extra_flags); + int _odp_ishm_reserve(const char *name, uint64_t size, int fd, uint32_t align, uint32_t flags, uint32_t user_flags); int _odp_ishm_free_by_index(int block_index); diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index e03f888f..054ef6a0 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -1023,7 +1023,7 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd, uint64_t page_sz; /* normal page size. usually 4K*/ uint64_t page_hp_size; /* huge page size */ uint32_t hp_align; - uint64_t len; /* mapped length */ + uint64_t len = 0; /* mapped length */ void *addr = NULL; /* mapping address */ int new_proc_entry; struct stat statbuf; @@ -1091,7 +1091,8 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd, }
/* Otherwise, Try first huge pages when possible and needed: */ - if ((fd < 0) && page_hp_size && (size > page_sz)) { + if ((fd < 0) && page_hp_size && ((flags & _ODP_ISHM_USE_HP) || + size > page_sz)) { /* at least, alignment in VA should match page size, but user * can request more: If the user requirement exceeds the page * size then we have to make sure the block will be mapped at diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 10382c4c..2262f355 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -22,6 +22,7 @@ #include <odp_ring_internal.h> #include <odp_global_data.h> #include <odp_libconfig_internal.h> +#include <odp_shm_internal.h>
#include <string.h> #include <stdio.h> @@ -378,6 +379,7 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params, uint32_t max_len; uint32_t ring_size; uint32_t num_extra = 0; + uint32_t extra_shm_flags = 0; int name_len; const char *postfix = "_uarea"; char uarea_name[ODP_POOL_NAME_LEN + sizeof(postfix)]; @@ -487,11 +489,16 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params, * headers. NOP if zero-copy is disabled. */ pool->block_offset = 0; if (params->type == ODP_POOL_PACKET) { - block_size = _odp_dpdk_pool_obj_size(pool, block_size); - if (!block_size) { + uint32_t dpdk_obj_size; + + dpdk_obj_size = _odp_dpdk_pool_obj_size(pool, block_size); + if (!dpdk_obj_size) { ODP_ERR("Calculating DPDK mempool obj size failed\n"); return ODP_POOL_INVALID; } + if (dpdk_obj_size != block_size) + extra_shm_flags |= _ODP_ISHM_USE_HP; + block_size = dpdk_obj_size; }
/* Allocate extra memory for skipping packet buffers which cross huge @@ -524,8 +531,8 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params, pool->ext_desc = NULL; pool->ext_destroy = NULL;
- shm = odp_shm_reserve(pool->name, pool->shm_size, - ODP_PAGE_SIZE, shmflags); + shm = _odp_shm_reserve(pool->name, pool->shm_size, + ODP_PAGE_SIZE, shmflags, extra_shm_flags);
pool->shm = shm;
diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index 7d405d13..d2f31458 100644 --- a/platform/linux-generic/odp_shared_memory.c +++ b/platform/linux-generic/odp_shared_memory.c @@ -44,6 +44,22 @@ static uint32_t get_ishm_flags(uint32_t flags) return f; }
+odp_shm_t _odp_shm_reserve(const char *name, uint64_t size, uint32_t align, + uint32_t flags, uint32_t extra_flags) +{ + int block_index; + uint32_t flgs = 0; /* internal ishm flags */ + + flgs = get_ishm_flags(flags); + flgs |= extra_flags; + + block_index = _odp_ishm_reserve(name, size, -1, align, flgs, flags); + if (block_index >= 0) + return to_handle(block_index); + else + return ODP_SHM_INVALID; +} + int odp_shm_capability(odp_shm_capability_t *capa) { memset(capa, 0, sizeof(odp_shm_capability_t)); @@ -58,16 +74,7 @@ int odp_shm_capability(odp_shm_capability_t *capa) odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, uint32_t flags) { - int block_index; - uint32_t flgs = 0; /* internal ishm flags */ - - flgs = get_ishm_flags(flags); - - block_index = _odp_ishm_reserve(name, size, -1, align, flgs, flags); - if (block_index >= 0) - return to_handle(block_index); - else - return ODP_SHM_INVALID; + return _odp_shm_reserve(name, size, align, flags, 0); }
odp_shm_t odp_shm_import(const char *remote_name,
commit bfcb5801d210e1535e19e556698dd90337a3d4ac Author: Matias Elo matias.elo@nokia.com Date: Mon Nov 12 13:36:27 2018 +0200
linux-gen: ishm: remove unused odp_shm_internal header
odp_shm_internal.h contents were not used so delete the file and rename odp_ishm_internal.h to odp_shm_internal.h.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index b973bc30..f21fbf70 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -99,7 +99,6 @@ noinst_HEADERS = \ include/odp_global_data.h \ include/odp_init_internal.h \ include/odp_ipsec_internal.h \ - include/odp_ishm_internal.h \ include/odp_ishmphy_internal.h \ include/odp_ishmpool_internal.h \ include/odp_libconfig_internal.h \ diff --git a/platform/linux-generic/include/odp_ishm_internal.h b/platform/linux-generic/include/odp_ishm_internal.h deleted file mode 100644 index 56c7f5a9..00000000 --- a/platform/linux-generic/include/odp_ishm_internal.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ODP_ISHM_INTERNAL_H_ -#define ODP_ISHM_INTERNAL_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include <sys/types.h> - -/* flags available at ishm_reserve: */ -#define _ODP_ISHM_SINGLE_VA 1 -#define _ODP_ISHM_LOCK 2 -#define _ODP_ISHM_EXPORT 4 /*create export descr file in /tmp */ - -/** - * Shared memory block info - */ -typedef struct _odp_ishm_info_t { - const char *name; /**< Block name */ - void *addr; /**< Block address */ - uint64_t size; /**< Block size in bytes */ - uint64_t page_size; /**< Memory page size */ - uint32_t flags; /**< _ODP_ISHM_* flags */ - uint32_t user_flags;/**< user specific flags */ -} _odp_ishm_info_t; - -int _odp_ishm_reserve(const char *name, uint64_t size, int fd, uint32_t align, - uint32_t flags, uint32_t user_flags); -int _odp_ishm_free_by_index(int block_index); -int _odp_ishm_free_by_name(const char *name); -int _odp_ishm_free_by_address(void *addr); -void *_odp_ishm_lookup_by_index(int block_index); -int _odp_ishm_lookup_by_name(const char *name); -int _odp_ishm_lookup_by_address(void *addr); -int _odp_ishm_find_exported(const char *remote_name, - pid_t external_odp_pid, - const char *local_name); -void *_odp_ishm_address(int block_index); -int _odp_ishm_info(int block_index, _odp_ishm_info_t *info); -int _odp_ishm_status(const char *title); -int _odp_ishm_cleanup_files(const char *dirpath); -void _odp_ishm_print(int block_index); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/odp_shm_internal.h b/platform/linux-generic/include/odp_shm_internal.h index ab58973b..93146a51 100644 --- a/platform/linux-generic/include/odp_shm_internal.h +++ b/platform/linux-generic/include/odp_shm_internal.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2018, Linaro Limited +/* Copyright (c) 2016-2018, Linaro Limited * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -11,13 +11,42 @@ extern "C" { #endif
-#include <odp/api/shared_memory.h> +#include <sys/types.h> +#include <inttypes.h>
-#define SHM_DEVNAME_MAXLEN (ODP_SHM_NAME_LEN + 16) -#define SHM_DEVNAME_FORMAT "/odp-%d-%s" /* /dev/shm/odp-<pid>-<name> */ +/* flags available at ishm_reserve: */ +#define _ODP_ISHM_SINGLE_VA 1 +#define _ODP_ISHM_LOCK 2 +#define _ODP_ISHM_EXPORT 4 /*create export descr file in /tmp */
-#define _ODP_SHM_PROC_NOCREAT (1 << 6) /**< Do not create shm if not exist */ -#define _ODP_SHM_O_EXCL (1 << 7) /**< Do not create shm if exist */ +/** + * Shared memory block info + */ +typedef struct _odp_ishm_info_t { + const char *name; /**< Block name */ + void *addr; /**< Block address */ + uint64_t size; /**< Block size in bytes */ + uint64_t page_size; /**< Memory page size */ + uint32_t flags; /**< _ODP_ISHM_* flags */ + uint32_t user_flags;/**< user specific flags */ +} _odp_ishm_info_t; + +int _odp_ishm_reserve(const char *name, uint64_t size, int fd, uint32_t align, + uint32_t flags, uint32_t user_flags); +int _odp_ishm_free_by_index(int block_index); +int _odp_ishm_free_by_name(const char *name); +int _odp_ishm_free_by_address(void *addr); +void *_odp_ishm_lookup_by_index(int block_index); +int _odp_ishm_lookup_by_name(const char *name); +int _odp_ishm_lookup_by_address(void *addr); +int _odp_ishm_find_exported(const char *remote_name, + pid_t external_odp_pid, + const char *local_name); +void *_odp_ishm_address(int block_index); +int _odp_ishm_info(int block_index, _odp_ishm_info_t *info); +int _odp_ishm_status(const char *title); +int _odp_ishm_cleanup_files(const char *dirpath); +void _odp_ishm_print(int block_index);
#ifdef __cplusplus } diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index 1a4ca947..e03f888f 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -60,7 +60,7 @@ #include <odp_debug_internal.h> #include <odp_align_internal.h> #include <odp_fdserver_internal.h> -#include <odp_ishm_internal.h> +#include <odp_shm_internal.h> #include <odp_ishmphy_internal.h> #include <odp_ishmpool_internal.h> #include <odp_libconfig_internal.h> diff --git a/platform/linux-generic/odp_ishmphy.c b/platform/linux-generic/odp_ishmphy.c index 94a20f8f..556c8e14 100644 --- a/platform/linux-generic/odp_ishmphy.c +++ b/platform/linux-generic/odp_ishmphy.c @@ -17,7 +17,7 @@ #include <odp/api/debug.h> #include <odp_debug_internal.h> #include <odp_align_internal.h> -#include <odp_ishm_internal.h> +#include <odp_shm_internal.h> #include <odp_ishmphy_internal.h>
#include <stdlib.h> diff --git a/platform/linux-generic/odp_ishmpool.c b/platform/linux-generic/odp_ishmpool.c index 46865371..a3a1c059 100644 --- a/platform/linux-generic/odp_ishmpool.c +++ b/platform/linux-generic/odp_ishmpool.c @@ -50,7 +50,7 @@ #include <odp_shm_internal.h> #include <odp_debug_internal.h> #include <odp_align_internal.h> -#include <odp_ishm_internal.h> +#include <odp_shm_internal.h> #include <odp_ishmpool_internal.h> #include <stdlib.h> #include <stdio.h> diff --git a/platform/linux-generic/odp_queue_scalable.c b/platform/linux-generic/odp_queue_scalable.c index 3acfc084..a6d7e2ed 100644 --- a/platform/linux-generic/odp_queue_scalable.c +++ b/platform/linux-generic/odp_queue_scalable.c @@ -25,7 +25,7 @@ #include <odp_queue_scalable_internal.h> #include <odp_schedule_if.h> #include <odp_timer_internal.h> -#include <odp_ishm_internal.h> +#include <odp_shm_internal.h> #include <odp_ishmpool_internal.h> #include <odp/api/plat/queue_inline_types.h> #include <odp_global_data.h> diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c index 11a0edf7..f3f43d4e 100644 --- a/platform/linux-generic/odp_schedule_scalable.c +++ b/platform/linux-generic/odp_schedule_scalable.c @@ -22,7 +22,7 @@
#include <odp_config_internal.h> #include <odp_debug_internal.h> -#include <odp_ishm_internal.h> +#include <odp_shm_internal.h> #include <odp_ishmpool_internal.h>
#include <odp_align_internal.h> diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index 9c9139bb..7d405d13 100644 --- a/platform/linux-generic/odp_shared_memory.c +++ b/platform/linux-generic/odp_shared_memory.c @@ -11,7 +11,7 @@ #include <odp/api/std_types.h> #include <odp/api/shared_memory.h> #include <odp/api/plat/strong_types.h> -#include <odp_ishm_internal.h> +#include <odp_shm_internal.h> #include <odp_init_internal.h> #include <odp_global_data.h> #include <string.h> diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c index fc565443..cd438ad3 100644 --- a/platform/linux-generic/pktio/ipc.c +++ b/platform/linux-generic/pktio/ipc.c @@ -11,7 +11,7 @@ #include <odp_packet_io_internal.h> #include <odp/api/system_info.h> #include <odp_shm_internal.h> -#include <odp_ishm_internal.h> +#include <odp_shm_internal.h>
#include <sys/mman.h> #include <sys/stat.h>
commit e373d2a880ba8ab18fa47422920c34d48090714b Author: Matias Elo matias.elo@nokia.com Date: Fri Nov 9 11:48:41 2018 +0200
linux-gen: ishm: remove _ODP_SHM_NO_HP flag
Reserving large shm blocks without huge pages increases page misses.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/include/odp_shm_internal.h b/platform/linux-generic/include/odp_shm_internal.h index 9827af75..ab58973b 100644 --- a/platform/linux-generic/include/odp_shm_internal.h +++ b/platform/linux-generic/include/odp_shm_internal.h @@ -18,7 +18,6 @@ extern "C" {
#define _ODP_SHM_PROC_NOCREAT (1 << 6) /**< Do not create shm if not exist */ #define _ODP_SHM_O_EXCL (1 << 7) /**< Do not create shm if exist */ -#define _ODP_SHM_NO_HP (1 << 8) /**< Do not use huge pages */
#ifdef __cplusplus } diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 901b5044..0d3545b6 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -11,7 +11,6 @@ #include <odp/api/queue.h> #include <odp/api/debug.h> #include <odp_init_internal.h> -#include <odp_shm_internal.h> #include <odp_debug_internal.h> #include <odp_packet_internal.h> #include <odp/api/packet_io.h> @@ -88,7 +87,7 @@ int odp_classification_init_global(void) cos_shm = odp_shm_reserve("_odp_shm_odp_cos_tbl", sizeof(cos_tbl_t), sizeof(cos_t), - _ODP_SHM_NO_HP); + 0);
if (cos_shm == ODP_SHM_INVALID) { ODP_ERR("shm allocation failed for shm_odp_cos_tbl"); @@ -109,7 +108,7 @@ int odp_classification_init_global(void) pmr_shm = odp_shm_reserve("_odp_shm_odp_pmr_tbl", sizeof(pmr_tbl_t), sizeof(pmr_t), - _ODP_SHM_NO_HP); + 0);
if (pmr_shm == ODP_SHM_INVALID) { ODP_ERR("shm allocation failed for shm_odp_pmr_tbl"); @@ -130,7 +129,7 @@ int odp_classification_init_global(void) queue_grp_shm = odp_shm_reserve("_odp_shm_cls_queue_grp_tbl", sizeof(_cls_queue_grp_tbl_t), sizeof(queue_entry_t *), - _ODP_SHM_NO_HP); + 0);
if (queue_grp_shm == ODP_SHM_INVALID) { ODP_ERR("shm allocation failed for queue_grp_tbl"); diff --git a/platform/linux-generic/odp_crypto_null.c b/platform/linux-generic/odp_crypto_null.c index 939b2fbb..4dd1f832 100644 --- a/platform/linux-generic/odp_crypto_null.c +++ b/platform/linux-generic/odp_crypto_null.c @@ -21,7 +21,6 @@ #include <odp/api/plat/thread_inlines.h> #include <odp_packet_internal.h> #include <odp/api/plat/queue_inlines.h> -#include <odp_shm_internal.h>
/* Inlined API functions */ #include <odp/api/plat/event_inlines.h> @@ -319,7 +318,7 @@ odp_crypto_init_global(void) /* Allocate our globally shared memory */ shm = odp_shm_reserve("_odp_crypto_pool_null", mem_size, ODP_CACHE_LINE_SIZE, - _ODP_SHM_NO_HP); + 0); if (ODP_SHM_INVALID == shm) { ODP_ERR("unable to allocate crypto pool\n"); return -1; diff --git a/platform/linux-generic/odp_crypto_openssl.c b/platform/linux-generic/odp_crypto_openssl.c index ec3e85bf..8feebefb 100644 --- a/platform/linux-generic/odp_crypto_openssl.c +++ b/platform/linux-generic/odp_crypto_openssl.c @@ -21,7 +21,6 @@ #include <odp/api/plat/thread_inlines.h> #include <odp_packet_internal.h> #include <odp/api/plat/queue_inlines.h> -#include <odp_shm_internal.h>
/* Inlined API functions */ #include <odp/api/plat/event_inlines.h> @@ -1859,7 +1858,7 @@ odp_crypto_init_global(void) /* Allocate our globally shared memory */ shm = odp_shm_reserve("_odp_crypto_pool_ssl", mem_size, ODP_CACHE_LINE_SIZE, - _ODP_SHM_NO_HP); + 0); if (ODP_SHM_INVALID == shm) { ODP_ERR("unable to allocate crypto pool\n"); return -1; diff --git a/platform/linux-generic/odp_ipsec_sad.c b/platform/linux-generic/odp_ipsec_sad.c index 9fb2da46..630af5a4 100644 --- a/platform/linux-generic/odp_ipsec_sad.c +++ b/platform/linux-generic/odp_ipsec_sad.c @@ -14,7 +14,6 @@ #include <odp_init_internal.h> #include <odp_debug_internal.h> #include <odp_ipsec_internal.h> -#include <odp_shm_internal.h> #include <odp_ring_mpmc_internal.h>
#include <odp/api/plat/atomic_inlines.h> @@ -141,7 +140,7 @@ int _odp_ipsec_sad_init_global(void) shm = odp_shm_reserve("_odp_ipsec_sa_table", sizeof(ipsec_sa_table_t), ODP_CACHE_LINE_SIZE, - _ODP_SHM_NO_HP); + 0); if (shm == ODP_SHM_INVALID) return -1;
diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index cf37bd9b..1a4ca947 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -1036,8 +1036,7 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd,
/* Get system page sizes: page_hp_size is 0 if no huge page available*/ page_sz = odp_sys_page_size(); - page_hp_size = user_flags & _ODP_SHM_NO_HP ? - 0 : odp_sys_huge_page_size(); + page_hp_size = odp_sys_huge_page_size();
/* grab a new entry: */ for (new_index = 0; new_index < ISHM_MAX_NB_BLOCKS; new_index++) { diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 1e0429f5..3a788f04 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -29,7 +29,6 @@ #include <odp/api/plat/time_inlines.h> #include <odp_pcapng.h> #include <odp/api/plat/queue_inlines.h> -#include <odp_shm_internal.h>
#include <string.h> #include <inttypes.h> @@ -69,7 +68,7 @@ int odp_pktio_init_global(void) shm = odp_shm_reserve("_odp_pktio_entries", sizeof(pktio_table_t), sizeof(pktio_entry_t), - _ODP_SHM_NO_HP); + 0); if (shm == ODP_SHM_INVALID) return -1;
diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index d08be437..10382c4c 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -20,7 +20,6 @@ #include <odp_config_internal.h> #include <odp_debug_internal.h> #include <odp_ring_internal.h> -#include <odp_shm_internal.h> #include <odp_global_data.h> #include <odp_libconfig_internal.h>
@@ -119,7 +118,7 @@ int odp_pool_init_global(void) shm = odp_shm_reserve("_odp_pool_table", sizeof(pool_table_t), ODP_CACHE_LINE_SIZE, - _ODP_SHM_NO_HP); + 0);
pool_tbl = odp_shm_addr(shm);
diff --git a/platform/linux-generic/odp_queue_basic.c b/platform/linux-generic/odp_queue_basic.c index 4e23fb53..c49db740 100644 --- a/platform/linux-generic/odp_queue_basic.c +++ b/platform/linux-generic/odp_queue_basic.c @@ -15,7 +15,6 @@ #include <odp_buffer_internal.h> #include <odp_pool_internal.h> #include <odp_init_internal.h> -#include <odp_shm_internal.h> #include <odp_timer_internal.h> #include <odp/api/shared_memory.h> #include <odp/api/schedule.h> @@ -138,7 +137,7 @@ static int queue_init_global(void) shm = odp_shm_reserve("_odp_queue_gbl", sizeof(queue_global_t), sizeof(queue_entry_t), - _ODP_SHM_NO_HP); + 0); if (shm == ODP_SHM_INVALID) return -1;
@@ -165,7 +164,7 @@ static int queue_init_global(void)
shm = odp_shm_reserve("_odp_queue_rings", mem_size, ODP_CACHE_LINE_SIZE, - _ODP_SHM_NO_HP); + 0);
if (shm == ODP_SHM_INVALID) { odp_shm_free(queue_glb->queue_gbl_shm); diff --git a/platform/linux-generic/odp_queue_lf.c b/platform/linux-generic/odp_queue_lf.c index ac8b4226..3e156a08 100644 --- a/platform/linux-generic/odp_queue_lf.c +++ b/platform/linux-generic/odp_queue_lf.c @@ -9,7 +9,6 @@ #include <odp/api/plat/atomic_inlines.h> #include <odp/api/shared_memory.h> #include <odp_queue_basic_internal.h> -#include <odp_shm_internal.h> #include <string.h> #include <stdio.h>
@@ -321,7 +320,7 @@ uint32_t queue_lf_init_global(uint32_t *queue_lf_size,
shm = odp_shm_reserve("_odp_queues_lf", sizeof(queue_lf_global_t), ODP_CACHE_LINE_SIZE, - _ODP_SHM_NO_HP); + 0); if (shm == ODP_SHM_INVALID) return 0;
diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 74942341..bc46d6a6 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -29,7 +29,6 @@ #include <odp_queue_basic_internal.h> #include <odp_libconfig_internal.h> #include <odp/api/plat/queue_inlines.h> -#include <odp_shm_internal.h>
/* No synchronization context */ #define NO_SYNC_CONTEXT ODP_SCHED_SYNC_PARALLEL @@ -403,7 +402,7 @@ static int schedule_init_global(void) shm = odp_shm_reserve("_odp_scheduler", sizeof(sched_global_t), ODP_CACHE_LINE_SIZE, - _ODP_SHM_NO_HP); + 0); if (shm == ODP_SHM_INVALID) { ODP_ERR("Schedule init: Shm reserve failed.\n"); return -1; diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c index a21728d8..11a0edf7 100644 --- a/platform/linux-generic/odp_schedule_scalable.c +++ b/platform/linux-generic/odp_schedule_scalable.c @@ -32,7 +32,6 @@ #include <odp_schedule_if.h> #include <odp_bitset.h> #include <odp_packet_io_internal.h> -#include <odp_shm_internal.h> #include <odp_timer_internal.h>
#include <limits.h> @@ -1778,7 +1777,7 @@ static int schedule_init_global(void)
shm = odp_shm_reserve("_odp_sched_scalable", sizeof(sched_global_t), - ODP_CACHE_LINE_SIZE, _ODP_SHM_NO_HP); + ODP_CACHE_LINE_SIZE, 0);
global = odp_shm_addr(shm); if (global == NULL) { diff --git a/platform/linux-generic/pktio/ring.c b/platform/linux-generic/pktio/ring.c index 6a354cb1..2cf0231c 100644 --- a/platform/linux-generic/pktio/ring.c +++ b/platform/linux-generic/pktio/ring.c @@ -80,7 +80,6 @@ #include <odp_packet_io_ring_internal.h> #include <odp_errno_define.h> #include <odp_global_data.h> -#include <odp_shm_internal.h>
#include <odp/api/plat/cpu_inlines.h>
@@ -164,7 +163,7 @@ int _ring_tailq_init(void)
/* Allocate globally shared memory */ shm = odp_shm_reserve("_odp_ring_global", sizeof(global_data_t), - ODP_CACHE_LINE_SIZE, _ODP_SHM_NO_HP); + ODP_CACHE_LINE_SIZE, 0); if (ODP_SHM_INVALID == shm) { ODP_ERR("Shm reserve failed for pktio ring\n"); return -1;
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/Makefile.am | 1 - platform/linux-generic/include/odp_ishm_internal.h | 54 ---------------------- platform/linux-generic/include/odp_shm_internal.h | 46 +++++++++++++++--- platform/linux-generic/odp_classification.c | 7 ++- platform/linux-generic/odp_crypto_null.c | 3 +- platform/linux-generic/odp_crypto_openssl.c | 3 +- platform/linux-generic/odp_ipsec_sad.c | 3 +- platform/linux-generic/odp_ishm.c | 17 +++++-- platform/linux-generic/odp_ishmphy.c | 2 +- platform/linux-generic/odp_ishmpool.c | 2 +- platform/linux-generic/odp_packet_io.c | 3 +- platform/linux-generic/odp_pool.c | 18 +++++--- platform/linux-generic/odp_queue_basic.c | 5 +- platform/linux-generic/odp_queue_lf.c | 3 +- platform/linux-generic/odp_queue_scalable.c | 2 +- platform/linux-generic/odp_schedule_basic.c | 3 +- platform/linux-generic/odp_schedule_scalable.c | 5 +- platform/linux-generic/odp_shared_memory.c | 29 +++++++----- platform/linux-generic/pktio/ipc.c | 2 +- platform/linux-generic/pktio/ring.c | 3 +- 20 files changed, 100 insertions(+), 111 deletions(-) delete mode 100644 platform/linux-generic/include/odp_ishm_internal.h
hooks/post-receive