Skip to content

Commit

Permalink
linux-gen: ishm: use pre-reserved single va memory
Browse files Browse the repository at this point in the history
Reserve single VA memory in global init instead of only allocating the
address space. Allocating only the address space doesn't work if shm blocks
are reserved after ODP process has been forked.

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>
  • Loading branch information
MatiasElo authored and muvarov committed Nov 23, 2018
1 parent f703d49 commit f913948
Show file tree
Hide file tree
Showing 8 changed files with 381 additions and 281 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ jobs:
- true
script:
- if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi
- docker run -i -t -v `pwd`:/odp
- docker run -i -t -v `pwd`:/odp --shm-size 8g
-e CC="${CC}"
${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_${ARCH}.sh
- stage: "build only"
Expand All @@ -224,7 +224,7 @@ jobs:
- true
script:
- if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi
- docker run -i -t -v `pwd`:/odp
- docker run -i -t -v `pwd`:/odp --shm-size 8g
-e CC="${CC}"
${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_${ARCH}.sh
- stage: "build only"
Expand All @@ -233,7 +233,7 @@ jobs:
- true
script:
- if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi
- docker run -i -t -v `pwd`:/odp
- 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"
Expand All @@ -242,7 +242,7 @@ jobs:
- true
script:
- if [ -z "${DOCKER_NAMESPACE}" ] ; then export DOCKER_NAMESPACE="opendataplane"; fi
- docker run -i -t -v `pwd`:/odp
- docker run -i -t -v `pwd`:/odp --shm-size 8g
-e CC="${CC}"
${DOCKER_NAMESPACE}/travis-odp-lng-ubuntu_16.04 /odp/scripts/ci/build_${ARCH}.sh
- stage: test
Expand Down
6 changes: 3 additions & 3 deletions platform/linux-generic/include/odp_ishmphy_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ extern "C" {

#include <stdint.h>

void *_odp_ishmphy_book_va(uintptr_t len, intptr_t align);
int _odp_ishmphy_unbook_va(void);
void *_odp_ishmphy_map(int fd, void *start, uint64_t size, int flags);
void *_odp_ishmphy_reserve_single_va(uint64_t len, int fd);
int _odp_ishmphy_free_single_va(void);
void *_odp_ishmphy_map(int fd, uint64_t size, uint64_t offset, int flags);
int _odp_ishmphy_unmap(void *start, uint64_t len, int flags);

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion platform/linux-generic/include/odp_shm_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ 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);
uint64_t offset, uint32_t flags, uint32_t user_flags);
int _odp_ishm_free_by_index(int block_index);
int _odp_ishm_lookup_by_name(const char *name);
int _odp_ishm_find_exported(const char *remote_name,
Expand Down
Loading

0 comments on commit f913948

Please sign in to comment.