From 0e8647378bfbe730101e5f089e134356dea00cda Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Wed, 22 Nov 2017 15:21:28 +0800 Subject: linux-gen: pool: rearrange pool_t to separate control and data plane Separate the pool's control plane and data plane data structures. This avoids sharing control plane related data and dataplane related data on the same cache line. Signed-off-by: Kevin Wang Reviewed-by: Honnappa Nagarahalli Reviewed-by: Ola Liljedahl Reviewed-by: Brian Brooks Reviewed-by: Yi He Reviewed-by: Bill Fischofer --- platform/linux-generic/include/odp_pool_internal.h | 29 +++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h index 5004e283c..0ec12148e 100644 --- a/platform/linux-generic/include/odp_pool_internal.h +++ b/platform/linux-generic/include/odp_pool_internal.h @@ -54,34 +54,33 @@ typedef struct pool_t { char name[ODP_POOL_NAME_LEN]; odp_pool_param_t params; odp_pool_t pool_hdl; - uint32_t pool_idx; - uint32_t ring_mask; odp_shm_t shm; odp_shm_t uarea_shm; - int reserved; uint32_t num; uint32_t align; + uint32_t shm_size; + uint32_t uarea_shm_size; + odp_shm_t ring_shm; + /* Used by DPDK zero-copy pktio */ + pool_destroy_cb_fn ext_destroy; + void *ext_desc; + + /* Below is for data plane */ + uint8_t *base_addr ODP_ALIGNED_CACHE; + uint8_t *uarea_base_addr; + pool_ring_t *ring; uint32_t headroom; uint32_t tailroom; uint32_t seg_len; uint32_t max_len; uint32_t uarea_size; uint32_t block_size; - uint32_t shm_size; - uint32_t uarea_shm_size; - uint8_t *base_addr; - uint8_t *uarea_base_addr; - - /* Used by DPDK zero-copy pktio */ + uint32_t pool_idx; + uint32_t ring_mask; + uint8_t reserved; uint8_t mem_from_huge_pages; - pool_destroy_cb_fn ext_destroy; - void *ext_desc; pool_cache_t local_cache[ODP_THREAD_COUNT_MAX]; - - odp_shm_t ring_shm; - pool_ring_t *ring; - } pool_t; typedef struct pool_table_t { -- cgit v1.2.3 From 8c1cb083f8bacd0c1fe56a759591ff7e0633be37 Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Wed, 22 Nov 2017 15:28:20 +0800 Subject: linux-gen: packet: get pool_hdl from odp_buffer_hdr_t In odp_packet_rem_data() and odp_packet_add_data(), pool_hdl is able to be gotten from odp_packet_hdr_t, don't need to get from pool_t indirectly. Signed-off-by: Kevin Wang Reviewed-by: Honnappa Nagarahalli Reviewed-by: Ola Liljedahl Reviewed-by: Brian Brooks Reviewed-by: Yi He Reviewed-by: Bill Fischofer --- platform/linux-generic/odp_packet.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index c65d7011e..853d3baa9 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -1345,13 +1345,12 @@ int odp_packet_add_data(odp_packet_t *pkt_ptr, uint32_t offset, uint32_t len) odp_packet_t pkt = *pkt_ptr; odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); uint32_t pktlen = pkt_hdr->frame_len; - pool_t *pool = pkt_hdr->buf_hdr.pool_ptr; odp_packet_t newpkt; if (offset > pktlen) return -1; - newpkt = odp_packet_alloc(pool->pool_hdl, pktlen + len); + newpkt = odp_packet_alloc(pkt_hdr->buf_hdr.pool_hdl, pktlen + len); if (newpkt == ODP_PACKET_INVALID) return -1; @@ -1375,13 +1374,12 @@ int odp_packet_rem_data(odp_packet_t *pkt_ptr, uint32_t offset, uint32_t len) odp_packet_t pkt = *pkt_ptr; odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); uint32_t pktlen = pkt_hdr->frame_len; - pool_t *pool = pkt_hdr->buf_hdr.pool_ptr; odp_packet_t newpkt; if (offset > pktlen || offset + len > pktlen) return -1; - newpkt = odp_packet_alloc(pool->pool_hdl, pktlen - len); + newpkt = odp_packet_alloc(pkt_hdr->buf_hdr.pool_hdl, pktlen - len); if (newpkt == ODP_PACKET_INVALID) return -1; -- cgit v1.2.3 From 9126cea4346f5b715e335a54b9d72ec89533187a Mon Sep 17 00:00:00 2001 From: Bogdan Pricope Date: Thu, 23 Nov 2017 15:16:45 +0200 Subject: linux-gen: modular-framework: move buffer subsystem header to a public folder Move buffer subsystem header to a public folder. Signed-off-by: Bogdan Pricope Reviewed-by: Honnappa Nagarahalli Signed-off-by: Yi He --- include/Makefile.am | 4 ++ include/subsystem/spec/buffer_subsystem.h | 64 ++++++++++++++++++++++ platform/linux-dpdk/Makefile.am | 1 - platform/linux-dpdk/buffer/dpdk.c | 2 +- platform/linux-generic/Makefile.am | 1 - platform/linux-generic/buffer/generic.c | 2 +- platform/linux-generic/buffer/subsystem.c | 2 +- .../linux-generic/include/odp_buffer_subsystem.h | 64 ---------------------- 8 files changed, 71 insertions(+), 69 deletions(-) create mode 100644 include/subsystem/spec/buffer_subsystem.h delete mode 100644 platform/linux-generic/include/odp_buffer_subsystem.h diff --git a/include/Makefile.am b/include/Makefile.am index 376916723..0edaf31a9 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -68,6 +68,10 @@ odpdrvspecinclude_HEADERS = \ odp/drv/spec/std_types.h \ odp/drv/spec/sync.h +subsystemspecincludedir= $(includedir)/subsystem/spec +subsystemspecinclude_HEADERS = \ + subsystem/spec/buffer_subsystem.h + odpapiabidefaultincludedir= $(includedir)/odp/arch/default/api/abi odpapiabidefaultinclude_HEADERS = \ odp/arch/default/api/abi/buffer.h \ diff --git a/include/subsystem/spec/buffer_subsystem.h b/include/subsystem/spec/buffer_subsystem.h new file mode 100644 index 000000000..3c791d207 --- /dev/null +++ b/include/subsystem/spec/buffer_subsystem.h @@ -0,0 +1,64 @@ +/* Copyright (c) 2017, ARM Limited. All rights reserved. + * + * Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_BUFFER_SUBSYSTEM_H_ +#define ODP_BUFFER_SUBSYSTEM_H_ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +#define BUFFER_SUBSYSTEM_VERSION 0x00010000UL + +/* ODP buffer public APIs subsystem */ +ODP_SUBSYSTEM_DECLARE(buffer); + +/* Subsystem APIs declarations */ +ODP_SUBSYSTEM_API(buffer, odp_buffer_t, buffer_from_event, odp_event_t ev); +ODP_SUBSYSTEM_API(buffer, odp_event_t, buffer_to_event, odp_buffer_t buf); +ODP_SUBSYSTEM_API(buffer, void *, buffer_addr, odp_buffer_t buf); +ODP_SUBSYSTEM_API(buffer, uint32_t, buffer_size, odp_buffer_t buf); +ODP_SUBSYSTEM_API(buffer, int, buffer_is_valid, odp_buffer_t buf); +ODP_SUBSYSTEM_API(buffer, odp_pool_t, buffer_pool, odp_buffer_t buf); +ODP_SUBSYSTEM_API(buffer, odp_buffer_t, buffer_alloc, odp_pool_t pool_hdl); +ODP_SUBSYSTEM_API(buffer, int, buffer_alloc_multi, odp_pool_t pool_hdl, + odp_buffer_t buf[], int num); +ODP_SUBSYSTEM_API(buffer, void, buffer_free, odp_buffer_t buf); +ODP_SUBSYSTEM_API(buffer, void, buffer_free_multi, + const odp_buffer_t buf[], int num); +ODP_SUBSYSTEM_API(buffer, void, buffer_print, odp_buffer_t buf); +ODP_SUBSYSTEM_API(buffer, uint64_t, buffer_to_u64, odp_buffer_t hdl); + +typedef ODP_MODULE_CLASS(buffer) { + odp_module_base_t base; + + odp_api_proto(buffer, buffer_from_event) buffer_from_event; + odp_api_proto(buffer, buffer_to_event) buffer_to_event; + odp_api_proto(buffer, buffer_addr) buffer_addr; + odp_api_proto(buffer, buffer_alloc_multi) buffer_alloc_multi; + odp_api_proto(buffer, buffer_free_multi) buffer_free_multi; + odp_api_proto(buffer, buffer_alloc) buffer_alloc; + odp_api_proto(buffer, buffer_free) buffer_free; + odp_api_proto(buffer, buffer_size) buffer_size; + odp_api_proto(buffer, buffer_is_valid) buffer_is_valid; + odp_api_proto(buffer, buffer_pool) buffer_pool; + odp_api_proto(buffer, buffer_print) buffer_print; + odp_api_proto(buffer, buffer_to_u64) buffer_to_u64; +} odp_buffer_module_t; + +#ifdef __cplusplus +} +#endif + +#include +#endif + diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am index ee6c36e21..67a46cb8a 100644 --- a/platform/linux-dpdk/Makefile.am +++ b/platform/linux-dpdk/Makefile.am @@ -175,7 +175,6 @@ odpdrvplatinclude_HEADERS = \ noinst_HEADERS = \ - ${top_srcdir}/platform/linux-generic/include/odp_buffer_subsystem.h \ ${top_srcdir}/platform/linux-generic/include/_fdserver_internal.h \ ${top_srcdir}/platform/linux-generic/include/_ishm_internal.h \ ${top_srcdir}/platform/linux-generic/include/_ishmphy_internal.h \ diff --git a/platform/linux-dpdk/buffer/dpdk.c b/platform/linux-dpdk/buffer/dpdk.c index 704468eea..22e1123b0 100644 --- a/platform/linux-dpdk/buffer/dpdk.c +++ b/platform/linux-dpdk/buffer/dpdk.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index a4aaa7693..ffc6daa90 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -160,7 +160,6 @@ noinst_HEADERS = \ include/odp_bitmap_internal.h \ include/odp_bitset.h \ include/odp_buffer_internal.h \ - include/odp_buffer_subsystem.h \ include/odp_classification_datamodel.h \ include/odp_classification_inlines.h \ include/odp_classification_internal.h \ diff --git a/platform/linux-generic/buffer/generic.c b/platform/linux-generic/buffer/generic.c index 3281119be..cf99407cc 100644 --- a/platform/linux-generic/buffer/generic.c +++ b/platform/linux-generic/buffer/generic.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include diff --git a/platform/linux-generic/buffer/subsystem.c b/platform/linux-generic/buffer/subsystem.c index d47525cf9..69ec91800 100644 --- a/platform/linux-generic/buffer/subsystem.c +++ b/platform/linux-generic/buffer/subsystem.c @@ -6,7 +6,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include -#include +#include #include #include diff --git a/platform/linux-generic/include/odp_buffer_subsystem.h b/platform/linux-generic/include/odp_buffer_subsystem.h deleted file mode 100644 index 3c791d207..000000000 --- a/platform/linux-generic/include/odp_buffer_subsystem.h +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (c) 2017, ARM Limited. All rights reserved. - * - * Copyright (c) 2017, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ODP_BUFFER_SUBSYSTEM_H_ -#define ODP_BUFFER_SUBSYSTEM_H_ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#define BUFFER_SUBSYSTEM_VERSION 0x00010000UL - -/* ODP buffer public APIs subsystem */ -ODP_SUBSYSTEM_DECLARE(buffer); - -/* Subsystem APIs declarations */ -ODP_SUBSYSTEM_API(buffer, odp_buffer_t, buffer_from_event, odp_event_t ev); -ODP_SUBSYSTEM_API(buffer, odp_event_t, buffer_to_event, odp_buffer_t buf); -ODP_SUBSYSTEM_API(buffer, void *, buffer_addr, odp_buffer_t buf); -ODP_SUBSYSTEM_API(buffer, uint32_t, buffer_size, odp_buffer_t buf); -ODP_SUBSYSTEM_API(buffer, int, buffer_is_valid, odp_buffer_t buf); -ODP_SUBSYSTEM_API(buffer, odp_pool_t, buffer_pool, odp_buffer_t buf); -ODP_SUBSYSTEM_API(buffer, odp_buffer_t, buffer_alloc, odp_pool_t pool_hdl); -ODP_SUBSYSTEM_API(buffer, int, buffer_alloc_multi, odp_pool_t pool_hdl, - odp_buffer_t buf[], int num); -ODP_SUBSYSTEM_API(buffer, void, buffer_free, odp_buffer_t buf); -ODP_SUBSYSTEM_API(buffer, void, buffer_free_multi, - const odp_buffer_t buf[], int num); -ODP_SUBSYSTEM_API(buffer, void, buffer_print, odp_buffer_t buf); -ODP_SUBSYSTEM_API(buffer, uint64_t, buffer_to_u64, odp_buffer_t hdl); - -typedef ODP_MODULE_CLASS(buffer) { - odp_module_base_t base; - - odp_api_proto(buffer, buffer_from_event) buffer_from_event; - odp_api_proto(buffer, buffer_to_event) buffer_to_event; - odp_api_proto(buffer, buffer_addr) buffer_addr; - odp_api_proto(buffer, buffer_alloc_multi) buffer_alloc_multi; - odp_api_proto(buffer, buffer_free_multi) buffer_free_multi; - odp_api_proto(buffer, buffer_alloc) buffer_alloc; - odp_api_proto(buffer, buffer_free) buffer_free; - odp_api_proto(buffer, buffer_size) buffer_size; - odp_api_proto(buffer, buffer_is_valid) buffer_is_valid; - odp_api_proto(buffer, buffer_pool) buffer_pool; - odp_api_proto(buffer, buffer_print) buffer_print; - odp_api_proto(buffer, buffer_to_u64) buffer_to_u64; -} odp_buffer_module_t; - -#ifdef __cplusplus -} -#endif - -#include -#endif - -- cgit v1.2.3 From f47262a495ce304a924a3c5eb00eb349faeb3666 Mon Sep 17 00:00:00 2001 From: Bogdan Pricope Date: Thu, 23 Nov 2017 15:37:33 +0200 Subject: linux-gen: modular-framework: move pool subsystem header to a public folder Move pool subsystem header to a public folder. Signed-off-by: Bogdan Pricope Reviewed-by: Honnappa Nagarahalli Signed-off-by: Yi He --- include/Makefile.am | 3 +- include/subsystem/spec/pool_subsystem.h | 52 ++++++++++++++++++++++ platform/linux-dpdk/Makefile.am | 1 - platform/linux-dpdk/include/odp_pool_internal.h | 2 +- platform/linux-generic/Makefile.am | 1 - platform/linux-generic/include/odp_pool_internal.h | 2 +- .../linux-generic/include/odp_pool_subsystem.h | 52 ---------------------- platform/linux-generic/pool/subsystem.c | 2 +- 8 files changed, 57 insertions(+), 58 deletions(-) create mode 100644 include/subsystem/spec/pool_subsystem.h delete mode 100644 platform/linux-generic/include/odp_pool_subsystem.h diff --git a/include/Makefile.am b/include/Makefile.am index 0edaf31a9..6bb497dc4 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -70,7 +70,8 @@ odpdrvspecinclude_HEADERS = \ subsystemspecincludedir= $(includedir)/subsystem/spec subsystemspecinclude_HEADERS = \ - subsystem/spec/buffer_subsystem.h + subsystem/spec/buffer_subsystem.h \ + subsystem/spec/pool_subsystem.h odpapiabidefaultincludedir= $(includedir)/odp/arch/default/api/abi odpapiabidefaultinclude_HEADERS = \ diff --git a/include/subsystem/spec/pool_subsystem.h b/include/subsystem/spec/pool_subsystem.h new file mode 100644 index 000000000..0f34ad143 --- /dev/null +++ b/include/subsystem/spec/pool_subsystem.h @@ -0,0 +1,52 @@ +/* Copyright (c) 2017, ARM Limited. All rights reserved. + * + * Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_POOL_SUBSYSTEM_H_ +#define ODP_POOL_SUBSYSTEM_H_ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/* ODP pool public APIs subsystem */ +ODP_SUBSYSTEM_DECLARE(pool); + +/* Subsystem APIs declarations */ +ODP_SUBSYSTEM_API(pool, int, capability, odp_pool_capability_t *capa); +ODP_SUBSYSTEM_API(pool, odp_pool_t, create, const char *name, + odp_pool_param_t *params); +ODP_SUBSYSTEM_API(pool, int, destroy, odp_pool_t pool); +ODP_SUBSYSTEM_API(pool, odp_pool_t, lookup, const char *name); +ODP_SUBSYSTEM_API(pool, int, info, odp_pool_t pool, odp_pool_info_t *info); +ODP_SUBSYSTEM_API(pool, void, print, odp_pool_t pool); +ODP_SUBSYSTEM_API(pool, uint64_t, to_u64, odp_pool_t pool); +ODP_SUBSYSTEM_API(pool, void, param_init, odp_pool_param_t *params); + +typedef ODP_MODULE_CLASS(pool) { + odp_module_base_t base; + + odp_api_proto(pool, capability) capability; + odp_api_proto(pool, create) create; + odp_api_proto(pool, destroy) destroy; + odp_api_proto(pool, lookup) lookup; + odp_api_proto(pool, info) info; + odp_api_proto(pool, print) print; + odp_api_proto(pool, to_u64) to_u64; + odp_api_proto(pool, param_init) param_init; +} pool_module_t; + +#ifdef __cplusplus +} +#endif + +#include +#endif diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am index 67a46cb8a..f188c3770 100644 --- a/platform/linux-dpdk/Makefile.am +++ b/platform/linux-dpdk/Makefile.am @@ -209,7 +209,6 @@ noinst_HEADERS = \ ${top_srcdir}/platform/linux-generic/include/odp_packet_io_pool_access.h \ ${top_srcdir}/platform/linux-generic/include/odp_pkt_queue_internal.h \ ${srcdir}/include/odp_pool_internal.h \ - ${top_srcdir}/platform/linux-generic/include/odp_pool_subsystem.h \ ${srcdir}/include/odp_posix_extensions.h \ ${top_srcdir}/platform/linux-generic/include/odp_queue_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_queue_if.h \ diff --git a/platform/linux-dpdk/include/odp_pool_internal.h b/platform/linux-dpdk/include/odp_pool_internal.h index 2b3fc18c0..7d8fba14e 100644 --- a/platform/linux-dpdk/include/odp_pool_internal.h +++ b/platform/linux-dpdk/include/odp_pool_internal.h @@ -20,7 +20,7 @@ extern "C" { #include #include -#include +#include #include #include #include diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index ffc6daa90..745b86bab 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -191,7 +191,6 @@ noinst_HEADERS = \ include/odp_pkt_queue_internal.h \ include/odp_queue_subsystem.h \ include/odp_pool_internal.h \ - include/odp_pool_subsystem.h \ include/odp_posix_extensions.h \ include/odp_queue_internal.h \ include/odp_queue_scalable_internal.h \ diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h index 0ec12148e..60687b3d4 100644 --- a/platform/linux-generic/include/odp_pool_internal.h +++ b/platform/linux-generic/include/odp_pool_internal.h @@ -21,7 +21,7 @@ extern "C" { #include #include -#include +#include #include #include #include diff --git a/platform/linux-generic/include/odp_pool_subsystem.h b/platform/linux-generic/include/odp_pool_subsystem.h deleted file mode 100644 index 0f34ad143..000000000 --- a/platform/linux-generic/include/odp_pool_subsystem.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (c) 2017, ARM Limited. All rights reserved. - * - * Copyright (c) 2017, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ODP_POOL_SUBSYSTEM_H_ -#define ODP_POOL_SUBSYSTEM_H_ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -/* ODP pool public APIs subsystem */ -ODP_SUBSYSTEM_DECLARE(pool); - -/* Subsystem APIs declarations */ -ODP_SUBSYSTEM_API(pool, int, capability, odp_pool_capability_t *capa); -ODP_SUBSYSTEM_API(pool, odp_pool_t, create, const char *name, - odp_pool_param_t *params); -ODP_SUBSYSTEM_API(pool, int, destroy, odp_pool_t pool); -ODP_SUBSYSTEM_API(pool, odp_pool_t, lookup, const char *name); -ODP_SUBSYSTEM_API(pool, int, info, odp_pool_t pool, odp_pool_info_t *info); -ODP_SUBSYSTEM_API(pool, void, print, odp_pool_t pool); -ODP_SUBSYSTEM_API(pool, uint64_t, to_u64, odp_pool_t pool); -ODP_SUBSYSTEM_API(pool, void, param_init, odp_pool_param_t *params); - -typedef ODP_MODULE_CLASS(pool) { - odp_module_base_t base; - - odp_api_proto(pool, capability) capability; - odp_api_proto(pool, create) create; - odp_api_proto(pool, destroy) destroy; - odp_api_proto(pool, lookup) lookup; - odp_api_proto(pool, info) info; - odp_api_proto(pool, print) print; - odp_api_proto(pool, to_u64) to_u64; - odp_api_proto(pool, param_init) param_init; -} pool_module_t; - -#ifdef __cplusplus -} -#endif - -#include -#endif diff --git a/platform/linux-generic/pool/subsystem.c b/platform/linux-generic/pool/subsystem.c index c5f644912..c845ce16b 100644 --- a/platform/linux-generic/pool/subsystem.c +++ b/platform/linux-generic/pool/subsystem.c @@ -7,7 +7,7 @@ */ #include #include -#include +#include #include #include -- cgit v1.2.3 From cb4d057c0f35fbd9855c4b4a08481aab69be3e07 Mon Sep 17 00:00:00 2001 From: Bogdan Pricope Date: Thu, 23 Nov 2017 15:54:40 +0200 Subject: linux-gen: modular-framework: move queue subsystem header to a public folder Move queue subsystem header to a public folder. Signed-off-by: Bogdan Pricope Reviewed-by: Honnappa Nagarahalli Signed-off-by: Yi He --- include/Makefile.am | 3 +- include/subsystem/spec/queue_subsystem.h | 79 ++++++++++++++++++++++ platform/linux-dpdk/Makefile.am | 1 - platform/linux-generic/Makefile.am | 1 - .../linux-generic/include/odp_queue_subsystem.h | 79 ---------------------- platform/linux-generic/queue/generic.c | 2 +- platform/linux-generic/queue/scalable.c | 2 +- platform/linux-generic/queue/subsystem.c | 2 +- 8 files changed, 84 insertions(+), 85 deletions(-) create mode 100644 include/subsystem/spec/queue_subsystem.h delete mode 100644 platform/linux-generic/include/odp_queue_subsystem.h diff --git a/include/Makefile.am b/include/Makefile.am index 6bb497dc4..4436c61b2 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -71,7 +71,8 @@ odpdrvspecinclude_HEADERS = \ subsystemspecincludedir= $(includedir)/subsystem/spec subsystemspecinclude_HEADERS = \ subsystem/spec/buffer_subsystem.h \ - subsystem/spec/pool_subsystem.h + subsystem/spec/pool_subsystem.h \ + subsystem/spec/queue_subsystem.h odpapiabidefaultincludedir= $(includedir)/odp/arch/default/api/abi odpapiabidefaultinclude_HEADERS = \ diff --git a/include/subsystem/spec/queue_subsystem.h b/include/subsystem/spec/queue_subsystem.h new file mode 100644 index 000000000..57fa68fdb --- /dev/null +++ b/include/subsystem/spec/queue_subsystem.h @@ -0,0 +1,79 @@ +/* Copyright (c) 2017, ARM Limited. All rights reserved. + * + * Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_QUEUE_SUBSYSTEM_H +#define ODP_QUEUE_SUBSYSTEM_H +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +#define QUEUE_SUBSYSTEM_VERSION 0x00010000UL + +/* ODP queue public APIs subsystem */ +ODP_SUBSYSTEM_DECLARE(queue); + +/* Subsystem APIs declarations */ +ODP_SUBSYSTEM_API(queue, odp_queue_t, create, const char *name, + const odp_queue_param_t *param); +ODP_SUBSYSTEM_API(queue, int, destroy, odp_queue_t queue); +ODP_SUBSYSTEM_API(queue, odp_queue_t, lookup, const char *name); +ODP_SUBSYSTEM_API(queue, int, capability, odp_queue_capability_t *capa); +ODP_SUBSYSTEM_API(queue, int, context_set, odp_queue_t queue, + void *context, uint32_t len); +ODP_SUBSYSTEM_API(queue, void *, context, odp_queue_t queue); +ODP_SUBSYSTEM_API(queue, int, enq, odp_queue_t queue, odp_event_t ev); +ODP_SUBSYSTEM_API(queue, int, enq_multi, odp_queue_t queue, + const odp_event_t events[], int num); +ODP_SUBSYSTEM_API(queue, odp_event_t, deq, odp_queue_t queue); +ODP_SUBSYSTEM_API(queue, int, deq_multi, odp_queue_t queue, + odp_event_t events[], int num); +ODP_SUBSYSTEM_API(queue, odp_queue_type_t, type, odp_queue_t queue); +ODP_SUBSYSTEM_API(queue, odp_schedule_sync_t, sched_type, odp_queue_t queue); +ODP_SUBSYSTEM_API(queue, odp_schedule_prio_t, sched_prio, odp_queue_t queue); +ODP_SUBSYSTEM_API(queue, odp_schedule_group_t, sched_group, + odp_queue_t queue); +ODP_SUBSYSTEM_API(queue, uint32_t, lock_count, odp_queue_t queue); +ODP_SUBSYSTEM_API(queue, uint64_t, to_u64, odp_queue_t hdl); +ODP_SUBSYSTEM_API(queue, void, param_init, odp_queue_param_t *param); +ODP_SUBSYSTEM_API(queue, int, info, odp_queue_t queue, + odp_queue_info_t *info); + +typedef ODP_MODULE_CLASS(queue) { + odp_module_base_t base; + + odp_api_proto(queue, enq_multi) enq_multi; + odp_api_proto(queue, deq_multi) deq_multi; + odp_api_proto(queue, enq) enq; + odp_api_proto(queue, deq) deq; + odp_api_proto(queue, context) context; + odp_api_proto(queue, sched_type) sched_type; + odp_api_proto(queue, sched_prio) sched_prio; + odp_api_proto(queue, sched_group) sched_group; + odp_api_proto(queue, create) create; + odp_api_proto(queue, destroy) destroy; + odp_api_proto(queue, lookup) lookup; + odp_api_proto(queue, capability) capability; + odp_api_proto(queue, context_set) context_set; + odp_api_proto(queue, type) type; + odp_api_proto(queue, lock_count) lock_count; + odp_api_proto(queue, to_u64) to_u64; + odp_api_proto(queue, param_init) param_init; + odp_api_proto(queue, info) info; +} odp_queue_module_t; + +#ifdef __cplusplus +} +#endif + +#include +#endif diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am index f188c3770..7742aea3e 100644 --- a/platform/linux-dpdk/Makefile.am +++ b/platform/linux-dpdk/Makefile.am @@ -212,7 +212,6 @@ noinst_HEADERS = \ ${srcdir}/include/odp_posix_extensions.h \ ${top_srcdir}/platform/linux-generic/include/odp_queue_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_queue_if.h \ - ${top_srcdir}/platform/linux-generic/include/odp_queue_subsystem.h \ ${top_srcdir}/platform/linux-generic/include/odp_ring_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_schedule_if.h \ ${top_srcdir}/platform/linux-generic/include/odp_schedule_subsystem.h \ diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 745b86bab..47de83f92 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -189,7 +189,6 @@ noinst_HEADERS = \ include/odp_pktio_ops_tap.h \ include/odp_pktio_ops_subsystem.h \ include/odp_pkt_queue_internal.h \ - include/odp_queue_subsystem.h \ include/odp_pool_internal.h \ include/odp_posix_extensions.h \ include/odp_queue_internal.h \ diff --git a/platform/linux-generic/include/odp_queue_subsystem.h b/platform/linux-generic/include/odp_queue_subsystem.h deleted file mode 100644 index 57fa68fdb..000000000 --- a/platform/linux-generic/include/odp_queue_subsystem.h +++ /dev/null @@ -1,79 +0,0 @@ -/* Copyright (c) 2017, ARM Limited. All rights reserved. - * - * Copyright (c) 2017, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ODP_QUEUE_SUBSYSTEM_H -#define ODP_QUEUE_SUBSYSTEM_H -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#define QUEUE_SUBSYSTEM_VERSION 0x00010000UL - -/* ODP queue public APIs subsystem */ -ODP_SUBSYSTEM_DECLARE(queue); - -/* Subsystem APIs declarations */ -ODP_SUBSYSTEM_API(queue, odp_queue_t, create, const char *name, - const odp_queue_param_t *param); -ODP_SUBSYSTEM_API(queue, int, destroy, odp_queue_t queue); -ODP_SUBSYSTEM_API(queue, odp_queue_t, lookup, const char *name); -ODP_SUBSYSTEM_API(queue, int, capability, odp_queue_capability_t *capa); -ODP_SUBSYSTEM_API(queue, int, context_set, odp_queue_t queue, - void *context, uint32_t len); -ODP_SUBSYSTEM_API(queue, void *, context, odp_queue_t queue); -ODP_SUBSYSTEM_API(queue, int, enq, odp_queue_t queue, odp_event_t ev); -ODP_SUBSYSTEM_API(queue, int, enq_multi, odp_queue_t queue, - const odp_event_t events[], int num); -ODP_SUBSYSTEM_API(queue, odp_event_t, deq, odp_queue_t queue); -ODP_SUBSYSTEM_API(queue, int, deq_multi, odp_queue_t queue, - odp_event_t events[], int num); -ODP_SUBSYSTEM_API(queue, odp_queue_type_t, type, odp_queue_t queue); -ODP_SUBSYSTEM_API(queue, odp_schedule_sync_t, sched_type, odp_queue_t queue); -ODP_SUBSYSTEM_API(queue, odp_schedule_prio_t, sched_prio, odp_queue_t queue); -ODP_SUBSYSTEM_API(queue, odp_schedule_group_t, sched_group, - odp_queue_t queue); -ODP_SUBSYSTEM_API(queue, uint32_t, lock_count, odp_queue_t queue); -ODP_SUBSYSTEM_API(queue, uint64_t, to_u64, odp_queue_t hdl); -ODP_SUBSYSTEM_API(queue, void, param_init, odp_queue_param_t *param); -ODP_SUBSYSTEM_API(queue, int, info, odp_queue_t queue, - odp_queue_info_t *info); - -typedef ODP_MODULE_CLASS(queue) { - odp_module_base_t base; - - odp_api_proto(queue, enq_multi) enq_multi; - odp_api_proto(queue, deq_multi) deq_multi; - odp_api_proto(queue, enq) enq; - odp_api_proto(queue, deq) deq; - odp_api_proto(queue, context) context; - odp_api_proto(queue, sched_type) sched_type; - odp_api_proto(queue, sched_prio) sched_prio; - odp_api_proto(queue, sched_group) sched_group; - odp_api_proto(queue, create) create; - odp_api_proto(queue, destroy) destroy; - odp_api_proto(queue, lookup) lookup; - odp_api_proto(queue, capability) capability; - odp_api_proto(queue, context_set) context_set; - odp_api_proto(queue, type) type; - odp_api_proto(queue, lock_count) lock_count; - odp_api_proto(queue, to_u64) to_u64; - odp_api_proto(queue, param_init) param_init; - odp_api_proto(queue, info) info; -} odp_queue_module_t; - -#ifdef __cplusplus -} -#endif - -#include -#endif diff --git a/platform/linux-generic/queue/generic.c b/platform/linux-generic/queue/generic.c index ab2b97048..37c02380f 100644 --- a/platform/linux-generic/queue/generic.c +++ b/platform/linux-generic/queue/generic.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/platform/linux-generic/queue/scalable.c b/platform/linux-generic/queue/scalable.c index 00cd8da65..f4f5efb85 100644 --- a/platform/linux-generic/queue/scalable.c +++ b/platform/linux-generic/queue/scalable.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include <_ishm_internal.h> #include <_ishmpool_internal.h> diff --git a/platform/linux-generic/queue/subsystem.c b/platform/linux-generic/queue/subsystem.c index 5a88b2df9..b53c440f4 100644 --- a/platform/linux-generic/queue/subsystem.c +++ b/platform/linux-generic/queue/subsystem.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include ODP_SUBSYSTEM_DEFINE(queue, "queue public APIs", QUEUE_SUBSYSTEM_VERSION); -- cgit v1.2.3 From ff5ecde9f73158f00df5df7da6f6ceb9ad4fe0f2 Mon Sep 17 00:00:00 2001 From: Bogdan Pricope Date: Thu, 23 Nov 2017 16:51:21 +0200 Subject: linux-gen: modular-framework: move schedule subsystem header to a public folder Move schedule subsystem header to a public folder. Signed-off-by: Bogdan Pricope Reviewed-by: Honnappa Nagarahalli Signed-off-by: Yi He --- include/Makefile.am | 3 +- include/subsystem/spec/schedule_subsystem.h | 90 ++++++++++++++++++++++ platform/linux-dpdk/Makefile.am | 1 - platform/linux-generic/Makefile.am | 1 - .../linux-generic/include/odp_schedule_subsystem.h | 90 ---------------------- 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 +- 10 files changed, 97 insertions(+), 98 deletions(-) create mode 100644 include/subsystem/spec/schedule_subsystem.h delete mode 100644 platform/linux-generic/include/odp_schedule_subsystem.h diff --git a/include/Makefile.am b/include/Makefile.am index 4436c61b2..b7c31c1f7 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -72,7 +72,8 @@ subsystemspecincludedir= $(includedir)/subsystem/spec subsystemspecinclude_HEADERS = \ subsystem/spec/buffer_subsystem.h \ subsystem/spec/pool_subsystem.h \ - subsystem/spec/queue_subsystem.h + subsystem/spec/queue_subsystem.h \ + subsystem/spec/schedule_subsystem.h odpapiabidefaultincludedir= $(includedir)/odp/arch/default/api/abi odpapiabidefaultinclude_HEADERS = \ diff --git a/include/subsystem/spec/schedule_subsystem.h b/include/subsystem/spec/schedule_subsystem.h new file mode 100644 index 000000000..7d9247788 --- /dev/null +++ b/include/subsystem/spec/schedule_subsystem.h @@ -0,0 +1,90 @@ +/* Copyright (c) 2017, ARM Limited. All rights reserved. + * + * Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_SCHEDULE_SUBSYSTEM_H_ +#define ODP_SCHEDULE_SUBSYSTEM_H_ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* API header files */ +#include +#include + +/* Internal header files */ +#include + +#define SCHEDULE_SUBSYSTEM_VERSION 0x00010000UL + +ODP_SUBSYSTEM_DECLARE(schedule); + +ODP_SUBSYSTEM_API(schedule, uint64_t, wait_time, uint64_t ns); +ODP_SUBSYSTEM_API(schedule, odp_event_t, schedule, odp_queue_t *from, + uint64_t wait); +ODP_SUBSYSTEM_API(schedule, int, schedule_multi, odp_queue_t *from, + uint64_t wait, odp_event_t events[], int num); +ODP_SUBSYSTEM_API(schedule, void, schedule_pause, void); +ODP_SUBSYSTEM_API(schedule, void, schedule_resume, void); +ODP_SUBSYSTEM_API(schedule, void, schedule_release_atomic, void); +ODP_SUBSYSTEM_API(schedule, void, schedule_release_ordered, void); +ODP_SUBSYSTEM_API(schedule, void, schedule_prefetch, int num); +ODP_SUBSYSTEM_API(schedule, int, schedule_num_prio, void); +ODP_SUBSYSTEM_API(schedule, odp_schedule_group_t, schedule_group_create, + const char *name, const odp_thrmask_t *mask); +ODP_SUBSYSTEM_API(schedule, int, schedule_group_destroy, + odp_schedule_group_t group); +ODP_SUBSYSTEM_API(schedule, odp_schedule_group_t, schedule_group_lookup, + const char *name); +ODP_SUBSYSTEM_API(schedule, int, schedule_group_join, + odp_schedule_group_t group, const odp_thrmask_t *mask); +ODP_SUBSYSTEM_API(schedule, int, schedule_group_leave, + odp_schedule_group_t group, const odp_thrmask_t *mask); +ODP_SUBSYSTEM_API(schedule, int, schedule_group_thrmask, + odp_schedule_group_t group, odp_thrmask_t *thrmask); +ODP_SUBSYSTEM_API(schedule, int, schedule_group_info, + odp_schedule_group_t group, odp_schedule_group_info_t *info); +ODP_SUBSYSTEM_API(schedule, void, schedule_order_lock, unsigned lock_index); +ODP_SUBSYSTEM_API(schedule, void, schedule_order_unlock, unsigned lock_index); +ODP_SUBSYSTEM_API(schedule, void, schedule_order_unlock_lock, + uint32_t unlock_index, uint32_t lock_index); + +typedef ODP_MODULE_CLASS(schedule) { + odp_module_base_t base; + /* Called from CP threads */ + odp_api_proto(schedule, schedule_group_create) schedule_group_create; + odp_api_proto(schedule, schedule_group_destroy) schedule_group_destroy; + odp_api_proto(schedule, schedule_group_lookup) schedule_group_lookup; + odp_api_proto(schedule, schedule_group_join) schedule_group_join; + odp_api_proto(schedule, schedule_group_leave) schedule_group_leave; + odp_api_proto(schedule, schedule_group_thrmask) schedule_group_thrmask; + odp_api_proto(schedule, schedule_group_info) schedule_group_info; + odp_api_proto(schedule, schedule_num_prio) schedule_num_prio; + /* Called from DP threads */ + odp_api_proto(schedule, schedule) schedule ODP_ALIGNED_CACHE; + odp_api_proto(schedule, schedule_multi) schedule_multi; + odp_api_proto(schedule, schedule_prefetch) schedule_prefetch; + odp_api_proto(schedule, schedule_order_lock) schedule_order_lock; + odp_api_proto(schedule, schedule_order_unlock) schedule_order_unlock; + odp_api_proto(schedule, schedule_order_unlock_lock) schedule_order_unlock_lock; + odp_api_proto(schedule, schedule_release_atomic) + schedule_release_atomic; + odp_api_proto(schedule, schedule_release_ordered) + schedule_release_ordered; + odp_api_proto(schedule, wait_time) wait_time; + odp_api_proto(schedule, schedule_pause) schedule_pause; + odp_api_proto(schedule, schedule_resume) schedule_resume; +} odp_schedule_module_t; + +#ifdef __cplusplus +} +#endif + +#include +#endif /* ODP_SCHEDULE_SUBSYSTEM_H_ */ diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am index 7742aea3e..6dde37b9c 100644 --- a/platform/linux-dpdk/Makefile.am +++ b/platform/linux-dpdk/Makefile.am @@ -214,7 +214,6 @@ noinst_HEADERS = \ ${top_srcdir}/platform/linux-generic/include/odp_queue_if.h \ ${top_srcdir}/platform/linux-generic/include/odp_ring_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_schedule_if.h \ - ${top_srcdir}/platform/linux-generic/include/odp_schedule_subsystem.h \ ${top_srcdir}/platform/linux-generic/include/odp_sorted_list_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_shm_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_time_internal.h \ diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 47de83f92..8813aea92 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -199,7 +199,6 @@ noinst_HEADERS = \ include/odp_schedule_scalable.h \ include/odp_schedule_scalable_config.h \ include/odp_schedule_scalable_ordered.h \ - include/odp_schedule_subsystem.h \ include/odp_sorted_list_internal.h \ include/odp_shm_internal.h \ include/odp_time_internal.h \ diff --git a/platform/linux-generic/include/odp_schedule_subsystem.h b/platform/linux-generic/include/odp_schedule_subsystem.h deleted file mode 100644 index 7d9247788..000000000 --- a/platform/linux-generic/include/odp_schedule_subsystem.h +++ /dev/null @@ -1,90 +0,0 @@ -/* Copyright (c) 2017, ARM Limited. All rights reserved. - * - * Copyright (c) 2017, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ODP_SCHEDULE_SUBSYSTEM_H_ -#define ODP_SCHEDULE_SUBSYSTEM_H_ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* API header files */ -#include -#include - -/* Internal header files */ -#include - -#define SCHEDULE_SUBSYSTEM_VERSION 0x00010000UL - -ODP_SUBSYSTEM_DECLARE(schedule); - -ODP_SUBSYSTEM_API(schedule, uint64_t, wait_time, uint64_t ns); -ODP_SUBSYSTEM_API(schedule, odp_event_t, schedule, odp_queue_t *from, - uint64_t wait); -ODP_SUBSYSTEM_API(schedule, int, schedule_multi, odp_queue_t *from, - uint64_t wait, odp_event_t events[], int num); -ODP_SUBSYSTEM_API(schedule, void, schedule_pause, void); -ODP_SUBSYSTEM_API(schedule, void, schedule_resume, void); -ODP_SUBSYSTEM_API(schedule, void, schedule_release_atomic, void); -ODP_SUBSYSTEM_API(schedule, void, schedule_release_ordered, void); -ODP_SUBSYSTEM_API(schedule, void, schedule_prefetch, int num); -ODP_SUBSYSTEM_API(schedule, int, schedule_num_prio, void); -ODP_SUBSYSTEM_API(schedule, odp_schedule_group_t, schedule_group_create, - const char *name, const odp_thrmask_t *mask); -ODP_SUBSYSTEM_API(schedule, int, schedule_group_destroy, - odp_schedule_group_t group); -ODP_SUBSYSTEM_API(schedule, odp_schedule_group_t, schedule_group_lookup, - const char *name); -ODP_SUBSYSTEM_API(schedule, int, schedule_group_join, - odp_schedule_group_t group, const odp_thrmask_t *mask); -ODP_SUBSYSTEM_API(schedule, int, schedule_group_leave, - odp_schedule_group_t group, const odp_thrmask_t *mask); -ODP_SUBSYSTEM_API(schedule, int, schedule_group_thrmask, - odp_schedule_group_t group, odp_thrmask_t *thrmask); -ODP_SUBSYSTEM_API(schedule, int, schedule_group_info, - odp_schedule_group_t group, odp_schedule_group_info_t *info); -ODP_SUBSYSTEM_API(schedule, void, schedule_order_lock, unsigned lock_index); -ODP_SUBSYSTEM_API(schedule, void, schedule_order_unlock, unsigned lock_index); -ODP_SUBSYSTEM_API(schedule, void, schedule_order_unlock_lock, - uint32_t unlock_index, uint32_t lock_index); - -typedef ODP_MODULE_CLASS(schedule) { - odp_module_base_t base; - /* Called from CP threads */ - odp_api_proto(schedule, schedule_group_create) schedule_group_create; - odp_api_proto(schedule, schedule_group_destroy) schedule_group_destroy; - odp_api_proto(schedule, schedule_group_lookup) schedule_group_lookup; - odp_api_proto(schedule, schedule_group_join) schedule_group_join; - odp_api_proto(schedule, schedule_group_leave) schedule_group_leave; - odp_api_proto(schedule, schedule_group_thrmask) schedule_group_thrmask; - odp_api_proto(schedule, schedule_group_info) schedule_group_info; - odp_api_proto(schedule, schedule_num_prio) schedule_num_prio; - /* Called from DP threads */ - odp_api_proto(schedule, schedule) schedule ODP_ALIGNED_CACHE; - odp_api_proto(schedule, schedule_multi) schedule_multi; - odp_api_proto(schedule, schedule_prefetch) schedule_prefetch; - odp_api_proto(schedule, schedule_order_lock) schedule_order_lock; - odp_api_proto(schedule, schedule_order_unlock) schedule_order_unlock; - odp_api_proto(schedule, schedule_order_unlock_lock) schedule_order_unlock_lock; - odp_api_proto(schedule, schedule_release_atomic) - schedule_release_atomic; - odp_api_proto(schedule, schedule_release_ordered) - schedule_release_ordered; - odp_api_proto(schedule, wait_time) wait_time; - odp_api_proto(schedule, schedule_pause) schedule_pause; - odp_api_proto(schedule, schedule_resume) schedule_resume; -} odp_schedule_module_t; - -#ifdef __cplusplus -} -#endif - -#include -#endif /* ODP_SCHEDULE_SUBSYSTEM_H_ */ diff --git a/platform/linux-generic/schedule/generic.c b/platform/linux-generic/schedule/generic.c index 73fef40cb..e22762856 100644 --- a/platform/linux-generic/schedule/generic.c +++ b/platform/linux-generic/schedule/generic.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include /* Should remove this dependency */ diff --git a/platform/linux-generic/schedule/iquery.c b/platform/linux-generic/schedule/iquery.c index 5de229832..76d96ff59 100644 --- a/platform/linux-generic/schedule/iquery.c +++ b/platform/linux-generic/schedule/iquery.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include /* Should remove this dependency */ diff --git a/platform/linux-generic/schedule/scalable.c b/platform/linux-generic/schedule/scalable.c index d8f538202..de9c65285 100644 --- a/platform/linux-generic/schedule/scalable.c +++ b/platform/linux-generic/schedule/scalable.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include diff --git a/platform/linux-generic/schedule/sp.c b/platform/linux-generic/schedule/sp.c index ea7b83422..06e2a1441 100644 --- a/platform/linux-generic/schedule/sp.c +++ b/platform/linux-generic/schedule/sp.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/platform/linux-generic/schedule/subsystem.c b/platform/linux-generic/schedule/subsystem.c index ba9a095f4..516cdf3b1 100644 --- a/platform/linux-generic/schedule/subsystem.c +++ b/platform/linux-generic/schedule/subsystem.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include ODP_SUBSYSTEM_DEFINE(schedule, "schedule public APIs", SCHEDULE_SUBSYSTEM_VERSION); -- cgit v1.2.3 From 00c7441fae53949dd87855d48102f932f8f64537 Mon Sep 17 00:00:00 2001 From: Bogdan Pricope Date: Fri, 24 Nov 2017 10:25:19 +0200 Subject: doc: application-api-guide: exclude subsystem files Exclude subsystem files form application API guide document. Documentation will be added when API will be stable. Signed-off-by: Bogdan Pricope Reviewed-by: Honnappa Nagarahalli Signed-off-by: Yi He --- doc/application-api-guide/Doxyfile | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/application-api-guide/Doxyfile b/doc/application-api-guide/Doxyfile index 2709f6fd0..054158498 100644 --- a/doc/application-api-guide/Doxyfile +++ b/doc/application-api-guide/Doxyfile @@ -5,6 +5,7 @@ PROJECT_NUMBER = $(VERSION) PROJECT_LOGO = $(SRCDIR)/doc/images/ODP-Logo-HQ.svg INPUT = $(SRCDIR)/doc/application-api-guide \ $(SRCDIR)/include +EXCLUDE = $(SRCDIR)/include/subsystem EXCLUDE_PATTERNS = drv* odp_drv.h EXAMPLE_PATH = $(SRCDIR)/example $(SRCDIR) WARNINGS = NO -- cgit v1.2.3 From 80b0d616f750e824a4bf0b0f3406ea3a3173ae0e Mon Sep 17 00:00:00 2001 From: Honnappa Nagarahalli Date: Tue, 21 Nov 2017 14:21:18 -0600 Subject: linux-generic: pool: allocate ring memory based on pool size Adjust the size of ring based on configured number of buffers in the pool. Signed-off-by: Honnappa Nagarahalli Reviewed-by: Ola Liljedahl Reviewed-by: Bill Fischofer Signed-off-by: Yi He --- .../linux-generic/include/odp_config_internal.h | 5 --- platform/linux-generic/include/odp_pool_internal.h | 2 +- platform/linux-generic/pool/generic.c | 37 ++++++++++------------ 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h index 9b334df49..9720581a3 100644 --- a/platform/linux-generic/include/odp_config_internal.h +++ b/platform/linux-generic/include/odp_config_internal.h @@ -147,11 +147,6 @@ */ #define CONFIG_BURST_SIZE 16 -/* - * Maximum number of events in a pool - */ -#define CONFIG_POOL_MAX_NUM (1 * 1024 * 1024) - /* * Maximum number of events in a thread local pool cache */ diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h index 60687b3d4..a124697e9 100644 --- a/platform/linux-generic/include/odp_pool_internal.h +++ b/platform/linux-generic/include/odp_pool_internal.h @@ -41,7 +41,7 @@ typedef struct { ring_t hdr; /* Ring data: buffer handles */ - uint32_t buf[CONFIG_POOL_MAX_NUM]; + uint32_t buf[]; } pool_ring_t ODP_ALIGNED_CACHE; diff --git a/platform/linux-generic/pool/generic.c b/platform/linux-generic/pool/generic.c index c55f67575..7a068472c 100644 --- a/platform/linux-generic/pool/generic.c +++ b/platform/linux-generic/pool/generic.c @@ -156,11 +156,12 @@ static int generic_pool_term_local(void) return 0; } -static pool_t *reserve_pool(void) +static pool_t *reserve_pool(uint32_t ring_size) { int i; pool_t *pool; char ring_name[ODP_POOL_NAME_LEN]; + uint32_t ring_shm_size; for (i = 0; i < ODP_CONFIG_POOLS; i++) { pool = pool_entry(i); @@ -169,10 +170,13 @@ static pool_t *reserve_pool(void) if (pool->reserved == 0) { pool->reserved = 1; UNLOCK(&pool->lock); - sprintf(ring_name, "pool_ring_%d", i); + snprintf(ring_name, ODP_POOL_NAME_LEN, + "pool_ring_%d", i); + ring_shm_size = sizeof(pool_ring_t) + + sizeof(pool->ring->buf[0]) * ring_size; pool->ring_shm = odp_shm_reserve(ring_name, - sizeof(pool_ring_t), + ring_shm_size, ODP_CACHE_LINE_SIZE, 0); if (odp_unlikely(pool->ring_shm == ODP_SHM_INVALID)) { ODP_ERR("Unable to alloc pool ring %d\n", i); @@ -395,7 +399,12 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params, if (uarea_size) uarea_size = ROUNDUP_CACHE_LINE(uarea_size); - pool = reserve_pool(); + if (num <= RING_SIZE_MIN) + ring_size = RING_SIZE_MIN; + else + ring_size = ROUNDUP_POWER2_U32(num); + + pool = reserve_pool(ring_size); if (pool == NULL) { ODP_ERR("No more free pools"); @@ -431,11 +440,6 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params, FIRST_HP_SIZE - 1) / FIRST_HP_SIZE); } - if (num <= RING_SIZE_MIN) - ring_size = RING_SIZE_MIN; - else - ring_size = ROUNDUP_POWER2_U32(num); - pool->ring_mask = ring_size - 1; pool->num = num; pool->align = align; @@ -506,11 +510,6 @@ static int check_params(odp_pool_param_t *params) switch (params->type) { case ODP_POOL_BUFFER: - if (params->buf.num > capa.buf.max_num) { - printf("buf.num too large %u\n", params->buf.num); - return -1; - } - if (params->buf.size > capa.buf.max_size) { printf("buf.size too large %u\n", params->buf.size); return -1; @@ -550,10 +549,6 @@ static int check_params(odp_pool_param_t *params) break; case ODP_POOL_TIMEOUT: - if (params->tmo.num > capa.tmo.max_num) { - printf("tmo.num too large %u\n", params->tmo.num); - return -1; - } break; default: @@ -663,12 +658,12 @@ static int generic_pool_capability(odp_pool_capability_t *capa) capa->buf.max_pools = ODP_CONFIG_POOLS; capa->buf.max_align = ODP_CONFIG_BUFFER_ALIGN_MAX; capa->buf.max_size = MAX_SIZE; - capa->buf.max_num = CONFIG_POOL_MAX_NUM; + capa->buf.max_num = 0; /* Packet pools */ capa->pkt.max_pools = ODP_CONFIG_POOLS; capa->pkt.max_len = CONFIG_PACKET_MAX_LEN; - capa->pkt.max_num = CONFIG_POOL_MAX_NUM; + capa->pkt.max_num = 0; capa->pkt.min_headroom = CONFIG_PACKET_HEADROOM; capa->pkt.max_headroom = CONFIG_PACKET_HEADROOM; capa->pkt.min_tailroom = CONFIG_PACKET_TAILROOM; @@ -679,7 +674,7 @@ static int generic_pool_capability(odp_pool_capability_t *capa) /* Timeout pools */ capa->tmo.max_pools = ODP_CONFIG_POOLS; - capa->tmo.max_num = CONFIG_POOL_MAX_NUM; + capa->tmo.max_num = 0; return 0; } -- cgit v1.2.3 From 19fe9172ee1fd069a2db86c554db41cbfc69c42d Mon Sep 17 00:00:00 2001 From: Honnappa Nagarahalli Date: Tue, 21 Nov 2017 14:26:00 -0600 Subject: linux-dpdk: pool: Remove unused CONFIG_POOL_MAX_NUM CONFIG_POOL_MAX_NUM is not used in linux-dpdk. Signed-off-by: Honnappa Nagarahalli Reviewed-by: Ola Liljedahl Reviewed-by: Bill Fischofer Signed-off-by: Yi He --- platform/linux-dpdk/include/odp_config_internal.h | 5 ----- platform/linux-dpdk/pool/dpdk.c | 21 +++------------------ 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/platform/linux-dpdk/include/odp_config_internal.h b/platform/linux-dpdk/include/odp_config_internal.h index 6aadc93f3..f36fcb929 100644 --- a/platform/linux-dpdk/include/odp_config_internal.h +++ b/platform/linux-dpdk/include/odp_config_internal.h @@ -119,11 +119,6 @@ extern "C" { */ #define CONFIG_BURST_SIZE 16 -/* - * Maximum number of events in a pool - */ -#define CONFIG_POOL_MAX_NUM (1 * 1024 * 1024) - /* * Maximum number of events in a thread local pool cache */ diff --git a/platform/linux-dpdk/pool/dpdk.c b/platform/linux-dpdk/pool/dpdk.c index 90d2d7c61..94143dfe8 100644 --- a/platform/linux-dpdk/pool/dpdk.c +++ b/platform/linux-dpdk/pool/dpdk.c @@ -137,12 +137,12 @@ static int dpdk_pool_capability(odp_pool_capability_t *capa) capa->buf.max_pools = ODP_CONFIG_POOLS; capa->buf.max_align = ODP_CONFIG_BUFFER_ALIGN_MAX; capa->buf.max_size = MAX_SIZE; - capa->buf.max_num = CONFIG_POOL_MAX_NUM; + capa->buf.max_num = 0; /* Packet pools */ capa->pkt.max_pools = ODP_CONFIG_POOLS; capa->pkt.max_len = 0; - capa->pkt.max_num = CONFIG_POOL_MAX_NUM; + capa->pkt.max_num = 0; capa->pkt.min_headroom = CONFIG_PACKET_HEADROOM; capa->pkt.min_tailroom = CONFIG_PACKET_TAILROOM; capa->pkt.max_segs_per_pkt = CONFIG_PACKET_MAX_SEGS; @@ -152,7 +152,7 @@ static int dpdk_pool_capability(odp_pool_capability_t *capa) /* Timeout pools */ capa->tmo.max_pools = ODP_CONFIG_POOLS; - capa->tmo.max_num = CONFIG_POOL_MAX_NUM; + capa->tmo.max_num = 0; return 0; } @@ -258,11 +258,6 @@ static int check_params(odp_pool_param_t *params) switch (params->type) { case ODP_POOL_BUFFER: - if (params->buf.num > capa.buf.max_num) { - printf("buf.num too large %u\n", params->buf.num); - return -1; - } - if (params->buf.size > capa.buf.max_size) { printf("buf.size too large %u\n", params->buf.size); return -1; @@ -276,12 +271,6 @@ static int check_params(odp_pool_param_t *params) break; case ODP_POOL_PACKET: - if (params->pkt.num > capa.pkt.max_num) { - printf("pkt.num too large %u\n", params->pkt.num); - - return -1; - } - if (params->pkt.seg_len > capa.pkt.max_seg_len) { printf("pkt.seg_len too large %u\n", params->pkt.seg_len); @@ -297,10 +286,6 @@ static int check_params(odp_pool_param_t *params) break; case ODP_POOL_TIMEOUT: - if (params->tmo.num > capa.tmo.max_num) { - printf("tmo.num too large %u\n", params->tmo.num); - return -1; - } break; default: -- cgit v1.2.3 From 59877869efeb29038ba82a4b4771f5864438f8a8 Mon Sep 17 00:00:00 2001 From: Honnappa Nagarahalli Date: Tue, 21 Nov 2017 15:23:50 -0600 Subject: linux-dpdk: pktio: Do not reset parse fields when parsing not enabled When parsing of the packet is not enabled, application will not look at parse meta data fields. Signed-off-by: Honnappa Nagarahalli Reviewed-by: Ola Liljedahl Reviewed-by: Bill Fischofer Signed-off-by: Yi He --- platform/linux-dpdk/pktio/dpdk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/linux-dpdk/pktio/dpdk.c b/platform/linux-dpdk/pktio/dpdk.c index 832ac7acf..2d95e902e 100644 --- a/platform/linux-dpdk/pktio/dpdk.c +++ b/platform/linux-dpdk/pktio/dpdk.c @@ -403,13 +403,14 @@ static int recv_pkt_dpdk(pktio_entry_t *pktio_entry, int index, for (i = 0; i < nb_rx; ++i) { odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt_table[i]); - packet_parse_reset(pkt_hdr); pkt_hdr->input = pktio_entry->s.handle; if (!pktio_cls_enabled(pktio_entry) && - pktio_entry->s.config.parser.layer) + pktio_entry->s.config.parser.layer) { + packet_parse_reset(pkt_hdr); packet_parse_layer(pkt_hdr, pktio_entry->s.config.parser.layer); + } packet_set_ts(pkt_hdr, ts); } -- cgit v1.2.3 From b920c02af3e0c179435db03c71694ace2a62c4f1 Mon Sep 17 00:00:00 2001 From: Balakrishna Garapati Date: Tue, 14 Nov 2017 17:32:03 +0100 Subject: test: enable dpdk initialization before running validation on linux-dpdk Signed-off-by: Balakrishna Garapati Reviewed-by: Yi He Reviewed-by: Bill Fischofer --- platform/linux-generic/test/wrapper-script.sh | 3 +++ test/Makefile.inc | 2 ++ test/performance/Makefile.am | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 platform/linux-generic/test/wrapper-script.sh diff --git a/platform/linux-generic/test/wrapper-script.sh b/platform/linux-generic/test/wrapper-script.sh new file mode 100755 index 000000000..977a032ae --- /dev/null +++ b/platform/linux-generic/test/wrapper-script.sh @@ -0,0 +1,3 @@ +#wrapper script for pre setting environment for validation suit. +#currently this is empty but needs to be created to make it align with +#linux-dpdk. diff --git a/test/Makefile.inc b/test/Makefile.inc index eaf791e08..3e7dfe57f 100644 --- a/test/Makefile.inc +++ b/test/Makefile.inc @@ -20,6 +20,8 @@ AM_CFLAGS = $(CUNIT_CFLAGS) AM_LDFLAGS = -L$(LIB) -static +LOG_COMPILER = $(top_srcdir)/platform/@with_platform@/test/wrapper-script.sh + @VALGRIND_CHECK_RULES@ TESTS_ENVIRONMENT = ODP_PLATFORM=${with_platform} \ diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am index 1dccd82e1..4417c4843 100644 --- a/test/performance/Makefile.am +++ b/test/performance/Makefile.am @@ -31,6 +31,6 @@ odp_sched_latency_SOURCES = odp_sched_latency.c odp_scheduling_SOURCES = odp_scheduling.c odp_pktio_perf_SOURCES = odp_pktio_perf.c -dist_check_SCRIPTS = $(TESTSCRIPTS) +dist_check_SCRIPTS = $(TESTSCRIPTS) $(LOG_COMPILER) dist_check_DATA = udp64.pcap -- cgit v1.2.3 From 2d187fd4a4039778ca8ed78dc23ea1da436d427b Mon Sep 17 00:00:00 2001 From: Balakrishna Garapati Date: Thu, 30 Nov 2017 14:57:27 +0100 Subject: linux-dpdk: changes which are needed for odp_crypto to work All the changes are within the linux-dpdk/odp_crypto.c file: 1) Added missing brackets which made it impossible to create a crypto session 2) Increased the number of queues created, from nb_queue_pairs - 1 to nb_queue_pairs, what seems to work better 3) Removed a memory leak - the memory allocated for iv and aad were not freed Signed-off-by: Szymon Sliwa Signed-off-by: Balakrishna Garapati Reviewed-by: Yi He Reviewed-by: Bill Fischofer --- platform/linux-dpdk/odp_crypto.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_crypto.c index 8e0f8a9df..9844f2dd7 100644 --- a/platform/linux-dpdk/odp_crypto.c +++ b/platform/linux-dpdk/odp_crypto.c @@ -271,7 +271,7 @@ int odp_crypto_init_global(void) qp_conf.nb_descriptors = NB_MBUF; - for (queue_pair = 0; queue_pair < nb_queue_pairs - 1; + for (queue_pair = 0; queue_pair < nb_queue_pairs; queue_pair++) { rc = rte_cryptodev_queue_pair_setup(cdev_id, queue_pair, @@ -898,11 +898,12 @@ int odp_crypto_session_create(odp_crypto_session_param_t *param, /* Setup session */ session = rte_cryptodev_sym_session_create(cdev_id, first_xform); - if (session == NULL) + if (session == NULL) { /* remove the crypto_session_entry_t */ memset(entry, 0, sizeof(*entry)); free_session(entry); return -1; + } entry->rte_session = (intptr_t)session; entry->cipher_xform = cipher_xform; @@ -1216,6 +1217,9 @@ int odp_crypto_int(odp_packet_t pkt_in, goto err; } + op->sym->auth.aad.data = NULL; + op->sym->cipher.iv.data = NULL; + odp_spinlock_unlock(&global->lock); /* Set crypto operation data parameters */ @@ -1242,9 +1246,8 @@ int odp_crypto_int(odp_packet_t pkt_in, if (aad_len > 0) { op->sym->auth.aad.data = rte_malloc("aad", aad_len, 0); if (op->sym->auth.aad.data == NULL) { - rte_crypto_op_free(op); ODP_ERR("Failed to allocate memory for AAD"); - goto err; + goto err_op_free; } memcpy(op->sym->auth.aad.data, aad_head, aad_len); @@ -1254,16 +1257,14 @@ int odp_crypto_int(odp_packet_t pkt_in, } if (entry->iv.length == 0) { - rte_crypto_op_free(op); ODP_ERR("Wrong IV length"); - goto err; + goto err_op_free; } op->sym->cipher.iv.data = rte_malloc("iv", entry->iv.length, 0); if (op->sym->cipher.iv.data == NULL) { - rte_crypto_op_free(op); ODP_ERR("Failed to allocate memory for IV"); - goto err; + goto err_op_free; } if (param->override_iv_ptr) { @@ -1300,18 +1301,16 @@ int odp_crypto_int(odp_packet_t pkt_in, rc = rte_cryptodev_enqueue_burst(rte_session->dev_id, queue_pair, &op, 1); if (rc == 0) { - rte_crypto_op_free(op); ODP_ERR("Failed to enqueue packet"); - goto err; + goto err_op_free; } rc = rte_cryptodev_dequeue_burst(rte_session->dev_id, queue_pair, &op, 1); if (rc == 0) { - rte_crypto_op_free(op); ODP_ERR("Failed to dequeue packet"); - goto err; + goto err_op_free; } out_pkt = (odp_packet_t)op->sym->m_src; @@ -1331,6 +1330,8 @@ int odp_crypto_int(odp_packet_t pkt_in, op_result = get_op_result_from_packet(out_pkt); *op_result = local_result; + rte_free(op->sym->cipher.iv.data); + rte_free(op->sym->auth.aad.data); rte_crypto_op_free(op); /* Synchronous, simply return results */ @@ -1338,6 +1339,11 @@ int odp_crypto_int(odp_packet_t pkt_in, return 0; +err_op_free: + rte_free(op->sym->cipher.iv.data); + rte_free(op->sym->auth.aad.data); + rte_crypto_op_free(op); + err: if (allocated) { odp_packet_free(out_pkt); -- cgit v1.2.3 From 29e1c5d318822f1ab14e9d82b75f66159f42efcc Mon Sep 17 00:00:00 2001 From: Balakrishna Garapati Date: Thu, 30 Nov 2017 22:50:48 +0100 Subject: linux-dpdk: crypto bug fixes Signed-off-by: Balakrishna Garapati Reviewed-by: Yi He Reviewed-by: Bill Fischofer --- platform/linux-dpdk/odp_crypto.c | 77 ++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 31 deletions(-) diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_crypto.c index 9844f2dd7..ea014c8e8 100644 --- a/platform/linux-dpdk/odp_crypto.c +++ b/platform/linux-dpdk/odp_crypto.c @@ -808,40 +808,53 @@ int odp_crypto_session_create(odp_crypto_session_param_t *param, /* Default to successful result */ *status = ODP_CRYPTO_SES_CREATE_ERR_NONE; - /* Cipher Data */ - cipher_xform.cipher.key.data = rte_malloc("crypto key", - param->cipher_key.length, 0); - if (cipher_xform.cipher.key.data == NULL) { - ODP_ERR("Failed to allocate memory for cipher key\n"); - /* remove the crypto_session_entry_t */ - memset(entry, 0, sizeof(*entry)); - free_session(entry); - return -1; - } - cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; cipher_xform.next = NULL; - cipher_xform.cipher.key.length = param->cipher_key.length; - memcpy(cipher_xform.cipher.key.data, - param->cipher_key.data, - param->cipher_key.length); - - /* Authentication Data */ - auth_xform.auth.key.data = rte_malloc("auth key", - param->auth_key.length, 0); - if (auth_xform.auth.key.data == NULL) { - ODP_ERR("Failed to allocate memory for auth key\n"); - /* remove the crypto_session_entry_t */ - memset(entry, 0, sizeof(*entry)); - free_session(entry); - return -1; + + if (param->cipher_key.length) { + /* Cipher Data */ + cipher_xform.cipher.key.data = rte_malloc("crypto key", + param->cipher_key.length, 0); + if (cipher_xform.cipher.key.data == NULL) { + ODP_ERR("Failed to allocate memory for cipher key\n"); + /* remove the crypto_session_entry_t */ + memset(entry, 0, sizeof(*entry)); + free_session(entry); + return -1; + } + + cipher_xform.cipher.key.length = param->cipher_key.length; + memcpy(cipher_xform.cipher.key.data, + param->cipher_key.data, + param->cipher_key.length); + } else { + cipher_xform.cipher.key.data = 0; + cipher_xform.cipher.key.length = 0; } + auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; auth_xform.next = NULL; - auth_xform.auth.key.length = param->auth_key.length; - memcpy(auth_xform.auth.key.data, - param->auth_key.data, - param->auth_key.length); + + if (param->auth_key.length) { + /* Authentication Data */ + auth_xform.auth.key.data = rte_malloc("auth key", + param->auth_key.length, 0); + if (auth_xform.auth.key.data == NULL) { + ODP_ERR("Failed to allocate memory for auth key\n"); + /* remove the crypto_session_entry_t */ + memset(entry, 0, sizeof(*entry)); + free_session(entry); + return -1; + } + auth_xform.auth.key.length = param->auth_key.length; + memcpy(auth_xform.auth.key.data, + param->auth_key.data, + param->auth_key.length); + } else { + auth_xform.auth.key.data = 0; + auth_xform.auth.key.length = 0; + } + /* Derive order */ if (ODP_CRYPTO_OP_ENCODE == param->op) @@ -1271,11 +1284,13 @@ int odp_crypto_int(odp_packet_t pkt_in, memcpy(op->sym->cipher.iv.data, param->override_iv_ptr, entry->iv.length); + op->sym->cipher.iv.phys_addr = + rte_malloc_virt2phy(op->sym->cipher.iv.data); + op->sym->cipher.iv.length = entry->iv.length; } else if (entry->iv.data) { memcpy(op->sym->cipher.iv.data, entry->iv.data, entry->iv.length); - op->sym->cipher.iv.phys_addr = rte_malloc_virt2phy(op->sym->cipher.iv.data); op->sym->cipher.iv.length = entry->iv.length; @@ -1326,7 +1341,7 @@ int odp_crypto_int(odp_packet_t pkt_in, (rc_auth == ODP_CRYPTO_ALG_ERR_NONE); _odp_buffer_event_subtype_set(packet_to_buffer(out_pkt), - ODP_EVENT_PACKET_BASIC); + ODP_EVENT_PACKET_CRYPTO); op_result = get_op_result_from_packet(out_pkt); *op_result = local_result; -- cgit v1.2.3 From 61d636209fe064bca7e645af3938739290020875 Mon Sep 17 00:00:00 2001 From: Yi He Date: Fri, 1 Dec 2017 16:31:40 +0800 Subject: linux-dpdk: fix platform tests Fixed search path in pktio_run.sh for pktio_main executable, and Makefile.am to run platform tests with wrapper script. Signed-off-by: Yi He Reviewed-by: Honnappa Nagarahalli Reviewed-by: Bill Fischofer --- platform/linux-dpdk/test/Makefile.am | 2 -- platform/linux-dpdk/test/validation/api/pktio/pktio_run.sh | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/platform/linux-dpdk/test/Makefile.am b/platform/linux-dpdk/test/Makefile.am index a872400e4..8cb27b14f 100644 --- a/platform/linux-dpdk/test/Makefile.am +++ b/platform/linux-dpdk/test/Makefile.am @@ -14,8 +14,6 @@ SUBDIRS += validation/api/pktio endif endif -TEST_EXTENSIONS = .sh - TESTNAME = linux-dpdk TESTENV = tests-$(TESTNAME).env diff --git a/platform/linux-dpdk/test/validation/api/pktio/pktio_run.sh b/platform/linux-dpdk/test/validation/api/pktio/pktio_run.sh index 538c87d00..a08256a6b 100755 --- a/platform/linux-dpdk/test/validation/api/pktio/pktio_run.sh +++ b/platform/linux-dpdk/test/validation/api/pktio/pktio_run.sh @@ -23,7 +23,7 @@ # running stand alone out of tree requires setting PATH PATH=${TEST_DIR}/api/pktio:$PATH PATH=$(dirname $0):$PATH -PATH=$(dirname $0)/../../../../common_plat/validation/api/pktio:$PATH +PATH=$(dirname $0)/../../../../../../test/validation/api/pktio:$PATH PATH=.:$PATH pktio_main_path=$(which pktio_main${EXEEXT}) -- cgit v1.2.3 From 75f3d60e6b31544bb9b273364b2cce502262c1f8 Mon Sep 17 00:00:00 2001 From: Yi He Date: Mon, 4 Dec 2017 15:36:08 +0800 Subject: linux-dpdk: fix inconsistent *_INVALID defines Fixed inconsistent defines of ODP_BUFFER_INVALID, ODP_EVENT_INVALID and ODP_TIMEOUT_INVALID as NULL instead of 0xffffffff for linux-dpdk platform, to align with linux-generic as well as abi compatible headers. Signed-off-by: Yi He Reviewed-by: Honnappa Nagarahalli Reviewed-by: Bill Fischofer --- platform/linux-dpdk/include/odp/api/plat/buffer_types.h | 2 +- platform/linux-dpdk/include/odp/api/plat/event_types.h | 2 +- platform/linux-dpdk/include/odp/api/plat/timer_types.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/linux-dpdk/include/odp/api/plat/buffer_types.h b/platform/linux-dpdk/include/odp/api/plat/buffer_types.h index 809768f3d..0f5f7baa1 100644 --- a/platform/linux-dpdk/include/odp/api/plat/buffer_types.h +++ b/platform/linux-dpdk/include/odp/api/plat/buffer_types.h @@ -31,7 +31,7 @@ extern "C" { typedef ODP_HANDLE_T(odp_buffer_t); -#define ODP_BUFFER_INVALID _odp_cast_scalar(odp_buffer_t, 0xffffffff) +#define ODP_BUFFER_INVALID _odp_cast_scalar(odp_buffer_t, NULL) typedef ODP_HANDLE_T(odp_buffer_seg_t); diff --git a/platform/linux-dpdk/include/odp/api/plat/event_types.h b/platform/linux-dpdk/include/odp/api/plat/event_types.h index e0f68e34e..ecda702c8 100644 --- a/platform/linux-dpdk/include/odp/api/plat/event_types.h +++ b/platform/linux-dpdk/include/odp/api/plat/event_types.h @@ -32,7 +32,7 @@ extern "C" { typedef ODP_HANDLE_T(odp_event_t); -#define ODP_EVENT_INVALID _odp_cast_scalar(odp_event_t, 0xffffffff) +#define ODP_EVENT_INVALID _odp_cast_scalar(odp_event_t, NULL) /** * Event types diff --git a/platform/linux-dpdk/include/odp/api/plat/timer_types.h b/platform/linux-dpdk/include/odp/api/plat/timer_types.h index 2ae8bfec8..3d97993ba 100644 --- a/platform/linux-dpdk/include/odp/api/plat/timer_types.h +++ b/platform/linux-dpdk/include/odp/api/plat/timer_types.h @@ -37,7 +37,7 @@ typedef ODP_HANDLE_T(odp_timer_t); typedef ODP_HANDLE_T(odp_timeout_t); -#define ODP_TIMEOUT_INVALID _odp_cast_scalar(odp_timeout_t, 0xffffffff) +#define ODP_TIMEOUT_INVALID _odp_cast_scalar(odp_timeout_t, NULL) /** * @} -- cgit v1.2.3 From 63fd88635cc10caaa02fdccd3f52c9494487bdd2 Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Wed, 6 Dec 2017 15:25:04 +0800 Subject: linux-gen: pool: modify CONFIG_POOL_CACHE_SIZE from 256 to 255 CONFIG_POOL_CACHE_SIZE is used in pool_cache_t. In pool_cache_t, there is another variable "num" which type is uint32_t. So if set CONFIG_POOL_CACHE_SIZE to 256 here, the capacity of pool_cache_t is 1028B which will waste 60B in one cache line. So reduce it to 255. Signed-off-by: Kevin Wang Reviewed-by: Honnappa Nagarahalli Reviewed-by: Ola Liljedahl Reviewed-by: Bill Fischofer Signed-off-by: Yi He --- platform/linux-generic/include/odp_config_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h index 9720581a3..3519cfc74 100644 --- a/platform/linux-generic/include/odp_config_internal.h +++ b/platform/linux-generic/include/odp_config_internal.h @@ -150,6 +150,6 @@ /* * Maximum number of events in a thread local pool cache */ -#define CONFIG_POOL_CACHE_SIZE 256 +#define CONFIG_POOL_CACHE_SIZE 255 #endif -- cgit v1.2.3