diff options
Diffstat (limited to 'platform/linux-generic')
-rw-r--r-- | platform/linux-generic/Makefile.am | 2 | ||||
-rw-r--r-- | platform/linux-generic/arch/aarch64/odp_crypto_armv8.c | 14 | ||||
-rw-r--r-- | platform/linux-generic/include-abi/odp/api/abi/crypto.h | 3 | ||||
-rw-r--r-- | platform/linux-generic/include/odp/api/plat/crypto_inlines.h | 49 | ||||
-rw-r--r-- | platform/linux-generic/odp_crypto_api.c | 11 | ||||
-rw-r--r-- | platform/linux-generic/odp_crypto_ipsecmb.c | 14 | ||||
-rw-r--r-- | platform/linux-generic/odp_crypto_null.c | 14 | ||||
-rw-r--r-- | platform/linux-generic/odp_crypto_openssl.c | 14 |
8 files changed, 64 insertions, 57 deletions
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 7bc48edd6..7d312d0b7 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -34,6 +34,7 @@ odpapiplatinclude_HEADERS = \ include/odp/api/plat/buffer_inline_types.h \ include/odp/api/plat/byteorder_inlines.h \ include/odp/api/plat/cpu_inlines.h \ + include/odp/api/plat/crypto_inlines.h \ include/odp/api/plat/debug_inlines.h \ include/odp/api/plat/event_inlines.h \ include/odp/api/plat/event_inline_types.h \ @@ -294,6 +295,7 @@ __LIB__libodp_linux_la_SOURCES += \ odp_buffer_api.c \ odp_byteorder_api.c \ odp_cpu_api.c \ + odp_crypto_api.c \ odp_event_api.c \ odp_hash_api.c \ odp_ipsec_api.c \ diff --git a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c index 0a73d4868..58e566c22 100644 --- a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c +++ b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c @@ -889,20 +889,6 @@ uint64_t odp_crypto_session_to_u64(odp_crypto_session_t hdl) return (uint64_t)hdl; } -odp_packet_t odp_crypto_packet_from_event(odp_event_t ev) -{ - /* This check not mandated by the API specification */ - _ODP_ASSERT(odp_event_type(ev) == ODP_EVENT_PACKET); - _ODP_ASSERT(odp_event_subtype(ev) == ODP_EVENT_PACKET_CRYPTO); - - return odp_packet_from_event(ev); -} - -odp_event_t odp_crypto_packet_to_event(odp_packet_t pkt) -{ - return odp_packet_to_event(pkt); -} - int odp_crypto_result(odp_crypto_packet_result_t *result, odp_packet_t packet) { diff --git a/platform/linux-generic/include-abi/odp/api/abi/crypto.h b/platform/linux-generic/include-abi/odp/api/abi/crypto.h index 24019db12..bef725c28 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/crypto.h +++ b/platform/linux-generic/include-abi/odp/api/abi/crypto.h @@ -19,7 +19,8 @@ extern "C" { #endif -/* Placeholder for inlined API functions */ +/* Inlined API functions */ +#include <odp/api/plat/crypto_inlines.h> #ifdef __cplusplus } diff --git a/platform/linux-generic/include/odp/api/plat/crypto_inlines.h b/platform/linux-generic/include/odp/api/plat/crypto_inlines.h new file mode 100644 index 000000000..cfea67283 --- /dev/null +++ b/platform/linux-generic/include/odp/api/plat/crypto_inlines.h @@ -0,0 +1,49 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_PLAT_CRYPTO_INLINES_H_ +#define ODP_PLAT_CRYPTO_INLINES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/api/event.h> +#include <odp/api/packet.h> + +#include <odp/api/plat/debug_inlines.h> + +/** @cond _ODP_HIDE_FROM_DOXYGEN_ */ + +#ifndef _ODP_NO_INLINE + /* Inline functions by default */ + #define _ODP_INLINE static inline + #define odp_crypto_packet_from_event __odp_crypto_packet_from_event + #define odp_crypto_packet_to_event __odp_crypto_packet_to_event +#else + #define _ODP_INLINE +#endif + +_ODP_INLINE odp_packet_t odp_crypto_packet_from_event(odp_event_t ev) +{ + _ODP_ASSERT(odp_event_type(ev) == ODP_EVENT_PACKET); + _ODP_ASSERT(odp_event_subtype(ev) == ODP_EVENT_PACKET_CRYPTO); + + return odp_packet_from_event(ev); +} + +_ODP_INLINE odp_event_t odp_crypto_packet_to_event(odp_packet_t pkt) +{ + return odp_packet_to_event(pkt); +} + +/** @endcond */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/odp_crypto_api.c b/platform/linux-generic/odp_crypto_api.c new file mode 100644 index 000000000..646472e2e --- /dev/null +++ b/platform/linux-generic/odp_crypto_api.c @@ -0,0 +1,11 @@ +/* Copyright (c) 2022, Nokia + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/api/crypto.h> + +/* Non-inlined versions of API functions */ +#define _ODP_NO_INLINE +#include <odp/api/plat/crypto_inlines.h> diff --git a/platform/linux-generic/odp_crypto_ipsecmb.c b/platform/linux-generic/odp_crypto_ipsecmb.c index d291a7067..34b62fdee 100644 --- a/platform/linux-generic/odp_crypto_ipsecmb.c +++ b/platform/linux-generic/odp_crypto_ipsecmb.c @@ -790,20 +790,6 @@ uint64_t odp_crypto_session_to_u64(odp_crypto_session_t hdl) return (uint64_t)hdl; } -odp_packet_t odp_crypto_packet_from_event(odp_event_t ev) -{ - /* This check not mandated by the API specification */ - _ODP_ASSERT(odp_event_type(ev) == ODP_EVENT_PACKET); - _ODP_ASSERT(odp_event_subtype(ev) == ODP_EVENT_PACKET_CRYPTO); - - return odp_packet_from_event(ev); -} - -odp_event_t odp_crypto_packet_to_event(odp_packet_t pkt) -{ - return odp_packet_to_event(pkt); -} - int odp_crypto_result(odp_crypto_packet_result_t *result, odp_packet_t packet) { diff --git a/platform/linux-generic/odp_crypto_null.c b/platform/linux-generic/odp_crypto_null.c index b9d319861..aeb27ab5b 100644 --- a/platform/linux-generic/odp_crypto_null.c +++ b/platform/linux-generic/odp_crypto_null.c @@ -449,20 +449,6 @@ uint64_t odp_crypto_session_to_u64(odp_crypto_session_t hdl) return (uint64_t)hdl; } -odp_packet_t odp_crypto_packet_from_event(odp_event_t ev) -{ - /* This check not mandated by the API specification */ - _ODP_ASSERT(odp_event_type(ev) == ODP_EVENT_PACKET); - _ODP_ASSERT(odp_event_subtype(ev) == ODP_EVENT_PACKET_CRYPTO); - - return odp_packet_from_event(ev); -} - -odp_event_t odp_crypto_packet_to_event(odp_packet_t pkt) -{ - return odp_packet_to_event(pkt); -} - static odp_crypto_packet_result_t *get_op_result_from_packet(odp_packet_t pkt) { diff --git a/platform/linux-generic/odp_crypto_openssl.c b/platform/linux-generic/odp_crypto_openssl.c index 0f637850f..210cad38d 100644 --- a/platform/linux-generic/odp_crypto_openssl.c +++ b/platform/linux-generic/odp_crypto_openssl.c @@ -2778,20 +2778,6 @@ uint64_t odp_crypto_session_to_u64(odp_crypto_session_t hdl) return (uint64_t)hdl; } -odp_packet_t odp_crypto_packet_from_event(odp_event_t ev) -{ - /* This check not mandated by the API specification */ - _ODP_ASSERT(odp_event_type(ev) == ODP_EVENT_PACKET); - _ODP_ASSERT(odp_event_subtype(ev) == ODP_EVENT_PACKET_CRYPTO); - - return odp_packet_from_event(ev); -} - -odp_event_t odp_crypto_packet_to_event(odp_packet_t pkt) -{ - return odp_packet_to_event(pkt); -} - static odp_crypto_packet_result_t *get_op_result_from_packet(odp_packet_t pkt) { |