diff options
Diffstat (limited to 'platform/linux-generic/include')
4 files changed, 67 insertions, 8 deletions
diff --git a/platform/linux-generic/include/odp/api/plat/time_inlines.h b/platform/linux-generic/include/odp/api/plat/time_inlines.h index 1ca495065..bb2913532 100644 --- a/platform/linux-generic/include/odp/api/plat/time_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/time_inlines.h @@ -1,5 +1,5 @@ /* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2020, Nokia + * Copyright (c) 2020-2021, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -46,6 +46,18 @@ static inline odp_time_t _odp_time_cur(void) return _odp_timespec_cur(); } +static inline odp_time_t _odp_time_cur_strict(void) +{ + if (_odp_time_glob.use_hw) { + odp_time_t time; + + time.count = _odp_cpu_global_time_strict() - _odp_time_glob.hw_start; + return time; + } + + return _odp_timespec_cur(); +} + static inline uint64_t _odp_time_hw_to_ns(odp_time_t time) { uint64_t nsec; @@ -79,6 +91,12 @@ static inline uint64_t _odp_time_convert_to_ns(odp_time_t time) #define odp_time_to_ns __odp_time_to_ns #define odp_time_local_ns __odp_time_local_ns #define odp_time_global_ns __odp_time_global_ns + + #define odp_time_local_strict __odp_time_local_strict + #define odp_time_global_strict __odp_time_global_strict + #define odp_time_local_strict_ns __odp_time_local_strict_ns + #define odp_time_global_strict_ns __odp_time_global_strict_ns + #define odp_time_cmp __odp_time_cmp #define odp_time_diff __odp_time_diff #define odp_time_sum __odp_time_sum @@ -97,9 +115,14 @@ _ODP_INLINE odp_time_t odp_time_global(void) return _odp_time_cur(); } -_ODP_INLINE uint64_t odp_time_to_ns(odp_time_t time) +_ODP_INLINE odp_time_t odp_time_local_strict(void) { - return _odp_time_convert_to_ns(time); + return _odp_time_cur_strict(); +} + +_ODP_INLINE odp_time_t odp_time_global_strict(void) +{ + return _odp_time_cur_strict(); } _ODP_INLINE uint64_t odp_time_local_ns(void) @@ -112,6 +135,21 @@ _ODP_INLINE uint64_t odp_time_global_ns(void) return _odp_time_convert_to_ns(_odp_time_cur()); } +_ODP_INLINE uint64_t odp_time_local_strict_ns(void) +{ + return _odp_time_convert_to_ns(_odp_time_cur_strict()); +} + +_ODP_INLINE uint64_t odp_time_global_strict_ns(void) +{ + return _odp_time_convert_to_ns(_odp_time_cur_strict()); +} + +_ODP_INLINE uint64_t odp_time_to_ns(odp_time_t time) +{ + return _odp_time_convert_to_ns(time); +} + _ODP_INLINE int odp_time_cmp(odp_time_t t2, odp_time_t t1) { if (odp_likely(t2.u64 > t1.u64)) diff --git a/platform/linux-generic/include/odp_debug_internal.h b/platform/linux-generic/include/odp_debug_internal.h index dfad95b19..5027cfe4a 100644 --- a/platform/linux-generic/include/odp_debug_internal.h +++ b/platform/linux-generic/include/odp_debug_internal.h @@ -33,8 +33,15 @@ extern "C" { * level 0 to N. */ #define CONFIG_DEBUG_LEVEL 0 +ODP_PRINTF_FORMAT(1, 2) +static inline void check_printf_format(const char *fmt, ...) +{ + (void)fmt; +} + #define _ODP_LOG_FN(level, fmt, ...) \ do { \ + check_printf_format(fmt, ##__VA_ARGS__); \ if (_odp_this_thread && _odp_this_thread->log_fn) \ _odp_this_thread->log_fn(level, fmt, ##__VA_ARGS__); \ else \ diff --git a/platform/linux-generic/include/odp_ipsec_internal.h b/platform/linux-generic/include/odp_ipsec_internal.h index 2509d22ab..96153007f 100644 --- a/platform/linux-generic/include/odp_ipsec_internal.h +++ b/platform/linux-generic/include/odp_ipsec_internal.h @@ -1,4 +1,5 @@ /* Copyright (c) 2017-2018, Linaro Limited + * Copyright (c) 2018, 2020-2021, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -169,7 +170,7 @@ struct ipsec_sa_s { struct { odp_ipsec_frag_mode_t frag_mode; - uint32_t mtu; + odp_atomic_u32_t mtu; union { struct { @@ -196,13 +197,15 @@ struct ipsec_sa_s { odp_atomic_u64_t hard_exp_pkts_err; /* - * Track error packets after lifetime check is done. + * Track error packets and bytes after lifetime check is done. * Required since, the stats tracking lifetime is being * used for SA success packets stats. */ odp_atomic_u64_t post_lifetime_err_pkts; + odp_atomic_u64_t post_lifetime_err_bytes; } stats; + uint32_t next_sa; odp_ipsec_sa_param_t param; }; @@ -302,10 +305,16 @@ uint16_t _odp_ipsec_sa_alloc_ipv4_id(ipsec_sa_t *ipsec_sa); int _odp_ipsec_try_inline(odp_packet_t *pkt); /** - * Get number of packets successfully processed by the SA + * Populate number of packets and bytes of data successfully processed by the SA + * in the odp_ipsec_stats_t structure passed. * */ -uint64_t _odp_ipsec_sa_stats_pkts(ipsec_sa_t *sa); +void _odp_ipsec_sa_stats_pkts(ipsec_sa_t *sa, odp_ipsec_stats_t *stats); + +/** + * Return true if IPsec operates in sync mode in the given direction. + */ +odp_bool_t _odp_ipsec_is_sync_mode(odp_ipsec_dir_t dir); /** * @} diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 7bbd78ab0..c5a51d11d 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -36,6 +36,7 @@ extern "C" { #include <net/if.h> #include <linux/if_ether.h> #include <sys/select.h> +#include <inttypes.h> #define PKTIO_MAX_QUEUES 64 #define PKTIO_LSO_PROFILES 16 @@ -237,7 +238,7 @@ static inline pktio_entry_t *get_pktio_entry(odp_pktio_t pktio) return NULL; if (odp_unlikely(_odp_typeval(pktio) > ODP_CONFIG_PKTIO_ENTRIES)) { - ODP_DBG("pktio limit %d/%d exceed\n", + ODP_DBG("pktio limit %" PRIuPTR "/%d exceed\n", _odp_typeval(pktio), ODP_CONFIG_PKTIO_ENTRIES); return NULL; } @@ -302,6 +303,10 @@ int _odp_sock_recv_mq_tmo_try_int_driven(const struct odp_pktin_queue_t queues[] uint64_t usecs, int *trial_successful); +/* Setup PKTOUT with single queue for TM */ +int _odp_pktio_pktout_tm_config(odp_pktio_t pktio_hdl, + odp_pktout_queue_t *queue, bool reconf); + #ifdef __cplusplus } #endif |