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, devel/native-drivers has been updated via 217b610fa1c7c14e0e8f4a33a94dba6f50c79328 (commit) via 02017cd3036f7f81bd63d664fb71ef2378b3a53b (commit) via c6719fb9fb34d4f75a6754dae77ab61856e266fe (commit) via 364303253e5ae774e5ade928bae4ee67e210e693 (commit) via 63fd88635cc10caaa02fdccd3f52c9494487bdd2 (commit) via 75f3d60e6b31544bb9b273364b2cce502262c1f8 (commit) via 61d636209fe064bca7e645af3938739290020875 (commit) via 29e1c5d318822f1ab14e9d82b75f66159f42efcc (commit) via 2d187fd4a4039778ca8ed78dc23ea1da436d427b (commit) via b920c02af3e0c179435db03c71694ace2a62c4f1 (commit) via 59877869efeb29038ba82a4b4771f5864438f8a8 (commit) via 19fe9172ee1fd069a2db86c554db41cbfc69c42d (commit) via 80b0d616f750e824a4bf0b0f3406ea3a3173ae0e (commit) via 00c7441fae53949dd87855d48102f932f8f64537 (commit) via ff5ecde9f73158f00df5df7da6f6ceb9ad4fe0f2 (commit) via cb4d057c0f35fbd9855c4b4a08481aab69be3e07 (commit) via f47262a495ce304a924a3c5eb00eb349faeb3666 (commit) via 9126cea4346f5b715e335a54b9d72ec89533187a (commit) via 8c1cb083f8bacd0c1fe56a759591ff7e0633be37 (commit) via 0e8647378bfbe730101e5f089e134356dea00cda (commit) from 121a1e14d0b3b205420df876587ec1e8ef4cf723 (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 217b610fa1c7c14e0e8f4a33a94dba6f50c79328 Merge: 02017cd3 63fd8863 Author: Josep Puigdemont josep.puigdemont@linaro.org Date: Wed Dec 20 11:11:00 2017 +0100
Merge remote-tracking branch 'origin/caterpillar' into devel/native-drivers
commit 02017cd3036f7f81bd63d664fb71ef2378b3a53b Author: Josep Puigdemont josep.puigdemont@linaro.org Date: Tue Dec 19 12:50:18 2017 +0100
odp_init: initialize physmem.
Signed-off-by: Josep Puigdemont josep.puigdemont@linaro.org
diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index 37bfcbf6..f4097370 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -74,6 +74,7 @@ enum init_stage { CLASSIFICATION_INIT, TRAFFIC_MNGR_INIT, NAME_TABLE_INIT, + PHYSMEM_INIT, PCI_INIT, DRIVER_INIT, IPSEC_EVENTS_INIT, diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 9b8bb75d..86b87f33 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -24,6 +24,7 @@ #include <errno.h> #include <sys/types.h> #include <pwd.h> +#include <pktio/physmem/physmem.h>
/* the name of the ODP configuration file: */ #define CONFIGURATION_FILE_ENV_NONE "none" @@ -223,6 +224,12 @@ int odp_init_global(odp_instance_t *instance, } stage = NAME_TABLE_INIT;
+ if (physmem_block_init_global()) { + ODP_ERR("ODP PHYSMEM init failed.\n"); + goto init_failed; + } + stage = PHYSMEM_INIT; + if (_odp_pci_init_global()) { ODP_ERR("ODP pci init failed.\n"); goto init_failed; @@ -305,6 +312,13 @@ int _odp_term_global(enum init_stage stage) } /* Fall through */
+ case PHYSMEM_INIT: + if (physmem_block_term_global()) { + ODP_ERR("PHYSMEM term failed\n"); + rc = -1; + } + /* Fall through */ + case NAME_TABLE_INIT: if (_odp_int_name_tbl_term_global()) { ODP_ERR("Name table term failed.\n");
commit c6719fb9fb34d4f75a6754dae77ab61856e266fe Author: Josep Puigdemont josep.puigdemont@linaro.org Date: Mon Dec 18 13:21:51 2017 +0100
odp_init: PCI_INIT was not in the right order.
Signed-off-by: Josep Puigdemont josep.puigdemont@linaro.org
diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index b2a27ba6..37bfcbf6 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -74,11 +74,11 @@ enum init_stage { CLASSIFICATION_INIT, TRAFFIC_MNGR_INIT, NAME_TABLE_INIT, + PCI_INIT, DRIVER_INIT, IPSEC_EVENTS_INIT, IPSEC_SAD_INIT, MODULES_INIT, - PCI_INIT, ALL_INIT /* All init stages completed */ };
diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index c93475f0..9b8bb75d 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -217,18 +217,18 @@ int odp_init_global(odp_instance_t *instance, } stage = TRAFFIC_MNGR_INIT;
- if (_odp_pci_init_global()) { - ODP_ERR("ODP pci init failed.\n"); - goto init_failed; - } - stage = PCI_INIT; - if (_odp_int_name_tbl_init_global()) { ODP_ERR("ODP name table init failed\n"); goto init_failed; } stage = NAME_TABLE_INIT;
+ if (_odp_pci_init_global()) { + ODP_ERR("ODP pci init failed.\n"); + goto init_failed; + } + stage = PCI_INIT; + if (_odpdrv_driver_init_global()) { ODP_ERR("ODP drivers init failed\n"); goto init_failed;
commit 364303253e5ae774e5ade928bae4ee67e210e693 Author: Josep Puigdemont josep.puigdemont@linaro.org Date: Sat Dec 16 10:22:28 2017 +0100
physmem: reserve memory for mapping automatically
Signed-off-by: Josep Puigdemont josep.puigdemont@linaro.org
diff --git a/platform/linux-generic/pktio/physmem/physmem.c b/platform/linux-generic/pktio/physmem/physmem.c index b426c21d..297ff2fa 100644 --- a/platform/linux-generic/pktio/physmem/physmem.c +++ b/platform/linux-generic/pktio/physmem/physmem.c @@ -88,6 +88,7 @@ static int alloc_hugepage(struct hugepage_info *hp) perror("mmap"); close(hp->fd); unlink(hp->filename); + hp->fd = 0; return -1; }
@@ -422,26 +423,61 @@ void physmem_block_free(struct physmem_block *block) unlock_list(); }
-int physmem_block_map(struct physmem_block *block, void *anchor_addr) +static int reserve_va_area(struct physmem_block *block) { void *addr; + void *addr_aligned; + uintptr_t align, len; + + if (block == NULL) + return -1; + + len = block->size; + align = block->hp_size; + + addr = mmap(NULL, len + align, PROT_NONE, + MAP_SHARED | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); + if (addr == MAP_FAILED) { + ODP_ERR("Failed to reserve VA memory\n"); + return -1; + } + + if (mprotect(addr, len, PROT_NONE)) + ODP_ERR("failure for protect\n"); + + addr_aligned = (void *)(((uintptr_t)addr + align - 1) & (-align)); + + ODP_DBG("physmem: VA Reserved: %p, aligned: %p, len=%p\n", + addr, addr_aligned, len + align); + + block->va = addr_aligned; + block->va_reserved = addr; + block->va_reserved_size = len + align; + + return 0; +} + +int physmem_block_map(struct physmem_block *block, void *addr) +{ int retval; int mapped_cnt; struct hugepage_info *hp;
- if (block == NULL || anchor_addr == NULL) + if (block == NULL) return -EINVAL;
- /* make sure we can actually map this memory region */ - addr = mmap(anchor_addr, block->size, - PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE | MAP_FIXED, - -1, 0); - - if (addr == MAP_FAILED) - return errno; + if (addr == NULL) { + if (reserve_va_area(block)) + return -ENOMEM; + addr = block->va; + } else { + if (((uintptr_t)addr & (uintptr_t)(block->hp_size - 1)) != 0) + return -EINVAL; + block->va = addr; + block->va_reserved = NULL; + block->va_reserved_size = 0; + }
- block->va = addr; mapped_cnt = 0;
ODP_DBG("Mapping block %d at %p\n", block->id, block->va); @@ -507,11 +543,17 @@ int physmem_block_map(struct physmem_block *block, void *anchor_addr)
exit_failure:
+ /* FIXME: give back reserved memory */ + block->va_reserved = NULL; + block->va_reserved_size = 0; + + while (mapped_cnt--) { hp = &pages[block->first + mapped_cnt]; munmap(hp->va, hp->size); hp->va = NULL; } + block->va = NULL;
return retval; @@ -532,6 +574,12 @@ int physmem_block_unmap(struct physmem_block *block) ret = errno; }
+ if (block->va_reserved != block->va) { + if (munmap(block->va_reserved, + (uintptr_t)block->va - (uintptr_t)block->va_reserved)) + ret = errno; + } + return ret; }
@@ -548,8 +596,10 @@ int physmem_block_init_global(void) { init_blocks();
- if (init_hugepages()) + if (init_hugepages()) { + physmem_block_term_global(); return -1; + }
if (sort_in_blocks(pages, MAX_HUGEPAGES) != 0) return -1; diff --git a/platform/linux-generic/pktio/physmem/physmem.h b/platform/linux-generic/pktio/physmem/physmem.h index 9a7f37c4..77dcb389 100644 --- a/platform/linux-generic/pktio/physmem/physmem.h +++ b/platform/linux-generic/pktio/physmem/physmem.h @@ -22,8 +22,10 @@ typedef enum { struct physmem_block { LIST_ENTRY(physmem_block) next; void *va; /* virtual address where the block is mapped */ + void *va_reserved; /* internal */ uint64_t pa; /* physical address where it starts */ uint64_t size; /* the size of this memory block */ + uint64_t va_reserved_size; /* internal */ uint32_t first; /* index of first hugepage belonging to this block * in pages[] */ uint32_t count; /* number of hugepages in this block */ @@ -35,8 +37,8 @@ struct physmem_block { int physmem_block_init_global(void); int physmem_block_term_global(void);
-struct physmem_block *physmem_block_alloc(uint64_t); -void physmem_block_free(struct physmem_block *); +struct physmem_block *physmem_block_alloc(uint64_t size); +void physmem_block_free(struct physmem_block *block); int physmem_block_map(struct physmem_block *block, void *addr); int physmem_block_unmap(struct physmem_block *block);
-----------------------------------------------------------------------
Summary of changes: doc/application-api-guide/Doxyfile | 1 + include/Makefile.am | 7 ++ .../subsystem/spec/buffer_subsystem.h | 0 .../subsystem/spec/pool_subsystem.h | 0 .../subsystem/spec/queue_subsystem.h | 0 .../subsystem/spec/schedule_subsystem.h | 0 platform/linux-dpdk/Makefile.am | 4 - platform/linux-dpdk/buffer/dpdk.c | 2 +- .../linux-dpdk/include/odp/api/plat/buffer_types.h | 2 +- .../linux-dpdk/include/odp/api/plat/event_types.h | 2 +- .../linux-dpdk/include/odp/api/plat/timer_types.h | 2 +- platform/linux-dpdk/include/odp_config_internal.h | 5 - platform/linux-dpdk/include/odp_pool_internal.h | 2 +- platform/linux-dpdk/odp_crypto.c | 107 ++++++++++++--------- platform/linux-dpdk/pktio/dpdk.c | 5 +- platform/linux-dpdk/pool/dpdk.c | 21 +--- platform/linux-dpdk/test/Makefile.am | 2 - .../test/validation/api/pktio/pktio_run.sh | 2 +- platform/linux-generic/Makefile.am | 4 - platform/linux-generic/buffer/generic.c | 2 +- platform/linux-generic/buffer/subsystem.c | 2 +- .../linux-generic/include/odp_config_internal.h | 7 +- platform/linux-generic/include/odp_internal.h | 3 +- platform/linux-generic/include/odp_pool_internal.h | 33 +++---- platform/linux-generic/odp_init.c | 26 +++-- platform/linux-generic/odp_packet.c | 6 +- platform/linux-generic/pktio/physmem/physmem.c | 74 +++++++++++--- platform/linux-generic/pktio/physmem/physmem.h | 6 +- platform/linux-generic/pool/generic.c | 37 +++---- platform/linux-generic/pool/subsystem.c | 2 +- platform/linux-generic/queue/generic.c | 2 +- platform/linux-generic/queue/scalable.c | 2 +- platform/linux-generic/queue/subsystem.c | 2 +- platform/linux-generic/schedule/generic.c | 2 +- platform/linux-generic/schedule/iquery.c | 2 +- platform/linux-generic/schedule/scalable.c | 2 +- platform/linux-generic/schedule/sp.c | 2 +- platform/linux-generic/schedule/subsystem.c | 2 +- platform/linux-generic/test/wrapper-script.sh | 3 + test/Makefile.inc | 2 + test/performance/Makefile.am | 2 +- 41 files changed, 224 insertions(+), 165 deletions(-) rename platform/linux-generic/include/odp_buffer_subsystem.h => include/subsystem/spec/buffer_subsystem.h (100%) rename platform/linux-generic/include/odp_pool_subsystem.h => include/subsystem/spec/pool_subsystem.h (100%) rename platform/linux-generic/include/odp_queue_subsystem.h => include/subsystem/spec/queue_subsystem.h (100%) rename platform/linux-generic/include/odp_schedule_subsystem.h => include/subsystem/spec/schedule_subsystem.h (100%) create mode 100755 platform/linux-generic/test/wrapper-script.sh
hooks/post-receive