diff options
Diffstat (limited to 'platform')
439 files changed, 1693 insertions, 2375 deletions
diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am index 0bfe35092..86dc1d495 100644 --- a/platform/linux-dpdk/Makefile.am +++ b/platform/linux-dpdk/Makefile.am @@ -149,7 +149,6 @@ noinst_HEADERS = \ ${top_srcdir}/platform/linux-generic/include/odp_name_table_internal.h \ include/odp_packet_io_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_parse_internal.h \ - ${top_srcdir}/platform/linux-generic/include/odp_print_internal.h \ include/odp_errno_define.h \ include/odp_event_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_event_validation_internal.h \ @@ -157,7 +156,7 @@ noinst_HEADERS = \ ${top_srcdir}/platform/linux-generic/include/odp_pcapng.h \ ${top_srcdir}/platform/linux-generic/include/odp_pkt_queue_internal.h \ include/odp_pool_internal.h \ - include/odp_posix_extensions.h \ + ${top_srcdir}/platform/linux-generic/include/odp_posix_extensions.h \ include/odp_queue_basic_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_queue_if.h \ ${top_srcdir}/platform/linux-generic/include/odp_queue_lf.h \ @@ -176,6 +175,7 @@ noinst_HEADERS = \ ${top_srcdir}/platform/linux-generic/include/odp_ring_u64_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_schedule_if.h \ ${top_srcdir}/platform/linux-generic/include/odp_sorted_list_internal.h \ + ${top_srcdir}/platform/linux-generic/include/odp_string_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_sysinfo_internal.h \ include/odp_shm_internal.h \ include/odp_thread_internal.h \ @@ -184,13 +184,13 @@ noinst_HEADERS = \ ${top_srcdir}/platform/linux-generic/include/odp_traffic_mngr_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_types_internal.h \ include/odp_event_vector_internal.h \ - include/protocols/eth.h \ - include/protocols/ip.h \ - include/protocols/ipsec.h \ - include/protocols/sctp.h \ - include/protocols/tcp.h \ - include/protocols/thash.h \ - include/protocols/udp.h \ + ${top_srcdir}/platform/linux-generic/include/protocols/eth.h \ + ${top_srcdir}/platform/linux-generic/include/protocols/ip.h \ + ${top_srcdir}/platform/linux-generic/include/protocols/ipsec.h \ + ${top_srcdir}/platform/linux-generic/include/protocols/sctp.h \ + ${top_srcdir}/platform/linux-generic/include/protocols/tcp.h \ + ${top_srcdir}/platform/linux-generic/include/protocols/thash.h \ + ${top_srcdir}/platform/linux-generic/include/protocols/udp.h \ Makefile.inc BUILT_SOURCES = \ @@ -231,7 +231,6 @@ __LIB__libodp_dpdk_la_SOURCES = \ ../linux-generic/pktio/loop.c \ ../linux-generic/pktio/null.c \ ../linux-generic/odp_pkt_queue.c \ - ../linux-generic/odp_print.c \ odp_pool.c \ odp_queue_basic.c \ odp_queue_eventdev.c \ @@ -249,6 +248,7 @@ __LIB__libodp_dpdk_la_SOURCES = \ ../linux-generic/odp_sorted_list.c \ ../linux-generic/odp_stash.c \ ../linux-generic/odp_std.c \ + ../linux-generic/odp_string.c \ odp_system_info.c \ ../linux-generic/odp_pcapng.c \ odp_thread.c \ @@ -425,7 +425,7 @@ __LIB__libodp_dpdk_la_LIBADD += $(PTHREAD_LIBS) __LIB__libodp_dpdk_la_LIBADD += $(TIMER_LIBS) __LIB__libodp_dpdk_la_LIBADD += $(ORT_LIBS) -CHECK_GLOBALS_REGEX = " (odp_|_odp_|_deprecated_odp_|miniz_|mz_|tdefl_|tinfl_|mp_hdlr_init_odp_pool_ops)" +CHECK_GLOBALS_REGEX = " (odp_|_odp_|_deprecated_odp_|miniz_|mz_|tdefl_|tinfl_|mp_hdlr_init_odp_pool_ops|__odr_asan)" TESTS_ENVIRONMENT = \ LIBTOOL="$(LIBTOOL)" \ diff --git a/platform/linux-dpdk/README b/platform/linux-dpdk/README index c0298ab34..8326d6baf 100644 --- a/platform/linux-dpdk/README +++ b/platform/linux-dpdk/README @@ -1,9 +1,6 @@ -Copyright (c) 2018-2019, Linaro Limited -Copyright (c) 2019-2024, Nokia -All rights reserved. - -SPDX-License-Identifier: BSD-3-Clause - +SPDX-License-Identifier: BSD-3-Clause +Copyright (c) 2018-2019 Linaro Limited +Copyright (c) 2019-2024 Nokia 1. Rationale ================================================= diff --git a/platform/linux-dpdk/arch/aarch64/odp/api/abi/cpu.h b/platform/linux-dpdk/arch/aarch64/odp/api/abi/cpu.h index 35d59f108..96ada8d97 100644 --- a/platform/linux-dpdk/arch/aarch64/odp/api/abi/cpu.h +++ b/platform/linux-dpdk/arch/aarch64/odp/api/abi/cpu.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2021, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Linaro Limited + * Copyright (c) 2021 Nokia */ #ifndef ODP_API_ABI_CPU_H_ diff --git a/platform/linux-dpdk/arch/arm/odp/api/abi/cpu.h b/platform/linux-dpdk/arch/arm/odp/api/abi/cpu.h index 6644a1ed3..ace4e2640 100644 --- a/platform/linux-dpdk/arch/arm/odp/api/abi/cpu.h +++ b/platform/linux-dpdk/arch/arm/odp/api/abi/cpu.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #ifndef ODP_API_ABI_CPU_H_ diff --git a/platform/linux-dpdk/arch/default/odp/api/abi/cpu.h b/platform/linux-dpdk/arch/default/odp/api/abi/cpu.h index e4fe6f631..0e6fdfa38 100644 --- a/platform/linux-dpdk/arch/default/odp/api/abi/cpu.h +++ b/platform/linux-dpdk/arch/default/odp/api/abi/cpu.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #ifndef ODP_API_ABI_CPU_H_ diff --git a/platform/linux-dpdk/arch/powerpc/odp/api/abi/cpu.h b/platform/linux-dpdk/arch/powerpc/odp/api/abi/cpu.h index 7b7720a42..bfdd7dce0 100644 --- a/platform/linux-dpdk/arch/powerpc/odp/api/abi/cpu.h +++ b/platform/linux-dpdk/arch/powerpc/odp/api/abi/cpu.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #ifndef ODP_API_ABI_CPU_H_ diff --git a/platform/linux-dpdk/arch/x86/odp/api/abi/cpu.h b/platform/linux-dpdk/arch/x86/odp/api/abi/cpu.h index 6644a1ed3..ace4e2640 100644 --- a/platform/linux-dpdk/arch/x86/odp/api/abi/cpu.h +++ b/platform/linux-dpdk/arch/x86/odp/api/abi/cpu.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #ifndef ODP_API_ABI_CPU_H_ diff --git a/platform/linux-dpdk/doc/platform_specific.dox b/platform/linux-dpdk/doc/platform_specific.dox index ad3126e20..2c964f33d 100644 --- a/platform/linux-dpdk/doc/platform_specific.dox +++ b/platform/linux-dpdk/doc/platform_specific.dox @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ /** diff --git a/platform/linux-dpdk/include-abi/odp/api/abi/packet.h b/platform/linux-dpdk/include-abi/odp/api/abi/packet.h index 913181b7a..bfd2176c9 100644 --- a/platform/linux-dpdk/include-abi/odp/api/abi/packet.h +++ b/platform/linux-dpdk/include-abi/odp/api/abi/packet.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ /** diff --git a/platform/linux-dpdk/include-abi/odp/api/abi/packet_types.h b/platform/linux-dpdk/include-abi/odp/api/abi/packet_types.h index 9ca66db54..e66ad11f2 100644 --- a/platform/linux-dpdk/include-abi/odp/api/abi/packet_types.h +++ b/platform/linux-dpdk/include-abi/odp/api/abi/packet_types.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2021 Nokia */ /** diff --git a/platform/linux-dpdk/include/odp/api/plat/buffer_inlines.h b/platform/linux-dpdk/include/odp/api/plat/buffer_inlines.h index 1740c36b3..aec041500 100644 --- a/platform/linux-dpdk/include/odp/api/plat/buffer_inlines.h +++ b/platform/linux-dpdk/include/odp/api/plat/buffer_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2019-2023 Nokia */ #ifndef ODP_PLAT_BUFFER_INLINES_H_ diff --git a/platform/linux-dpdk/include/odp/api/plat/byteorder_inlines.h b/platform/linux-dpdk/include/odp/api/plat/byteorder_inlines.h index 3fdb5179c..54e4dde70 100644 --- a/platform/linux-dpdk/include/odp/api/plat/byteorder_inlines.h +++ b/platform/linux-dpdk/include/odp/api/plat/byteorder_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ /** diff --git a/platform/linux-dpdk/include/odp/api/plat/event_inline_types.h b/platform/linux-dpdk/include/odp/api/plat/event_inline_types.h index 94a95a889..689743cbc 100644 --- a/platform/linux-dpdk/include/odp/api/plat/event_inline_types.h +++ b/platform/linux-dpdk/include/odp/api/plat/event_inline_types.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_EVENT_INLINE_TYPES_H_ diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_flag_inlines.h b/platform/linux-dpdk/include/odp/api/plat/packet_flag_inlines.h index b6876e6d7..799a8c42c 100644 --- a/platform/linux-dpdk/include/odp/api/plat/packet_flag_inlines.h +++ b/platform/linux-dpdk/include/odp/api/plat/packet_flag_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ /** diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h b/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h index 255db9d78..38e8d9d88 100644 --- a/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h +++ b/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2022-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2022-2023 Nokia */ /** diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h b/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h index b41a272ef..627ed1d44 100644 --- a/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h +++ b/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2019-2024 Nokia */ /** @@ -61,6 +59,7 @@ extern "C" { #define odp_packet_data_seg_len __odp_packet_data_seg_len #define odp_packet_len __odp_packet_len #define odp_packet_buf_len __odp_packet_buf_len + #define odp_packet_reset_max_len __odp_packet_reset_max_len #define odp_packet_headroom __odp_packet_headroom #define odp_packet_tailroom __odp_packet_tailroom #define odp_packet_pool __odp_packet_pool @@ -187,6 +186,11 @@ _ODP_INLINE uint32_t odp_packet_buf_len(odp_packet_t pkt) return (uint32_t)(mb->nb_segs * mb->buf_len); } +_ODP_INLINE uint32_t odp_packet_reset_max_len(odp_packet_t pkt) +{ + return odp_packet_buf_len(pkt) - RTE_PKTMBUF_HEADROOM; +} + _ODP_INLINE void *odp_packet_data_seg_len(odp_packet_t pkt, uint32_t *seg_len) { diff --git a/platform/linux-dpdk/include/odp/api/plat/std_inlines.h b/platform/linux-dpdk/include/odp/api/plat/std_inlines.h index b52b0512a..9c719bed0 100644 --- a/platform/linux-dpdk/include/odp/api/plat/std_inlines.h +++ b/platform/linux-dpdk/include/odp/api/plat/std_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #ifndef ODP_PLAT_STD_INLINE_H_ diff --git a/platform/linux-dpdk/include/odp/api/plat/time_inlines.h b/platform/linux-dpdk/include/odp/api/plat/time_inlines.h index f3d2a6947..3b4d9cc10 100644 --- a/platform/linux-dpdk/include/odp/api/plat/time_inlines.h +++ b/platform/linux-dpdk/include/odp/api/plat/time_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2020-2024, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2020-2024 Nokia */ #ifndef ODP_PLAT_TIME_INLINES_H_ diff --git a/platform/linux-dpdk/include/odp/api/plat/timer_inline_types.h b/platform/linux-dpdk/include/odp/api/plat/timer_inline_types.h index 6c997e80d..ddfc380f3 100644 --- a/platform/linux-dpdk/include/odp/api/plat/timer_inline_types.h +++ b/platform/linux-dpdk/include/odp/api/plat/timer_inline_types.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_TIMER_INLINE_TYPES_H_ diff --git a/platform/linux-dpdk/include/odp/api/plat/timer_inlines.h b/platform/linux-dpdk/include/odp/api/plat/timer_inlines.h index a85c7582d..b59d65a8e 100644 --- a/platform/linux-dpdk/include/odp/api/plat/timer_inlines.h +++ b/platform/linux-dpdk/include/odp/api/plat/timer_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2022-2024, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022-2024 Nokia */ #ifndef ODP_PLAT_TIMER_INLINES_H_ diff --git a/platform/linux-dpdk/include/odp_buffer_internal.h b/platform/linux-dpdk/include/odp_buffer_internal.h index cb7f50073..760c5ca2f 100644 --- a/platform/linux-dpdk/include/odp_buffer_internal.h +++ b/platform/linux-dpdk/include/odp_buffer_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2021-2023 Nokia */ /** diff --git a/platform/linux-dpdk/include/odp_config_internal.h b/platform/linux-dpdk/include/odp_config_internal.h index c423ec14b..70b2e14df 100644 --- a/platform/linux-dpdk/include/odp_config_internal.h +++ b/platform/linux-dpdk/include/odp_config_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2020-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2020-2023 Nokia */ #ifndef ODP_CONFIG_INTERNAL_H_ diff --git a/platform/linux-dpdk/include/odp_errno_define.h b/platform/linux-dpdk/include/odp_errno_define.h index 9f9486267..44f15a11c 100644 --- a/platform/linux-dpdk/include/odp_errno_define.h +++ b/platform/linux-dpdk/include/odp_errno_define.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ /** diff --git a/platform/linux-dpdk/include/odp_event_internal.h b/platform/linux-dpdk/include/odp_event_internal.h index cbe6d960b..5a1b9c02e 100644 --- a/platform/linux-dpdk/include/odp_event_internal.h +++ b/platform/linux-dpdk/include/odp_event_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021-2023 Nokia */ /** diff --git a/platform/linux-dpdk/include/odp_event_vector_internal.h b/platform/linux-dpdk/include/odp_event_vector_internal.h index 0d4cd9048..572e687b1 100644 --- a/platform/linux-dpdk/include/odp_event_vector_internal.h +++ b/platform/linux-dpdk/include/odp_event_vector_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2020-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2020-2023 Nokia */ /** diff --git a/platform/linux-dpdk/include/odp_eventdev_internal.h b/platform/linux-dpdk/include/odp_eventdev_internal.h index a36b85ff5..68a3b6a91 100644 --- a/platform/linux-dpdk/include/odp_eventdev_internal.h +++ b/platform/linux-dpdk/include/odp_eventdev_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2019, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2019 Nokia */ /** diff --git a/platform/linux-dpdk/include/odp_packet_internal.h b/platform/linux-dpdk/include/odp_packet_internal.h index cae77245a..a00212541 100644 --- a/platform/linux-dpdk/include/odp_packet_internal.h +++ b/platform/linux-dpdk/include/odp_packet_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited + * Copyright (c) 2021-2023 Nokia */ /** diff --git a/platform/linux-dpdk/include/odp_packet_io_internal.h b/platform/linux-dpdk/include/odp_packet_io_internal.h index bab750a22..781e07c96 100644 --- a/platform/linux-dpdk/include/odp_packet_io_internal.h +++ b/platform/linux-dpdk/include/odp_packet_io_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2023 Nokia */ /** diff --git a/platform/linux-dpdk/include/odp_pool_internal.h b/platform/linux-dpdk/include/odp_pool_internal.h index b8fd17314..f8be1f026 100644 --- a/platform/linux-dpdk/include/odp_pool_internal.h +++ b/platform/linux-dpdk/include/odp_pool_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2021-2023 Nokia */ /** diff --git a/platform/linux-dpdk/include/odp_posix_extensions.h b/platform/linux-dpdk/include/odp_posix_extensions.h deleted file mode 120000 index 420e11dd9..000000000 --- a/platform/linux-dpdk/include/odp_posix_extensions.h +++ /dev/null @@ -1 +0,0 @@ -../../linux-generic/include/odp_posix_extensions.h
\ No newline at end of file diff --git a/platform/linux-dpdk/include/odp_ptr_ring_mpmc_internal.h b/platform/linux-dpdk/include/odp_ptr_ring_mpmc_internal.h index 3e56c7f0e..4f7ecc2c3 100644 --- a/platform/linux-dpdk/include/odp_ptr_ring_mpmc_internal.h +++ b/platform/linux-dpdk/include/odp_ptr_ring_mpmc_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #ifndef ODP_RING_MPMC_INTERNAL_H_ diff --git a/platform/linux-dpdk/include/odp_ptr_ring_spsc_internal.h b/platform/linux-dpdk/include/odp_ptr_ring_spsc_internal.h index 3680f087a..0c158f83b 100644 --- a/platform/linux-dpdk/include/odp_ptr_ring_spsc_internal.h +++ b/platform/linux-dpdk/include/odp_ptr_ring_spsc_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #ifndef ODP_RING_SPSC_INTERNAL_H_ diff --git a/platform/linux-dpdk/include/odp_ptr_ring_st_internal.h b/platform/linux-dpdk/include/odp_ptr_ring_st_internal.h index cc258aeb4..e11d9f205 100644 --- a/platform/linux-dpdk/include/odp_ptr_ring_st_internal.h +++ b/platform/linux-dpdk/include/odp_ptr_ring_st_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #ifndef ODP_RING_ST_INTERNAL_H_ diff --git a/platform/linux-dpdk/include/odp_queue_basic_internal.h b/platform/linux-dpdk/include/odp_queue_basic_internal.h index 4e693d9b0..e3da311d3 100644 --- a/platform/linux-dpdk/include/odp_queue_basic_internal.h +++ b/platform/linux-dpdk/include/odp_queue_basic_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #ifndef ODP_QUEUE_BASIC_INTERNAL_H_ diff --git a/platform/linux-dpdk/include/odp_shm_internal.h b/platform/linux-dpdk/include/odp_shm_internal.h index b83b63a91..a19fb92f4 100644 --- a/platform/linux-dpdk/include/odp_shm_internal.h +++ b/platform/linux-dpdk/include/odp_shm_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ /** diff --git a/platform/linux-dpdk/include/odp_thread_internal.h b/platform/linux-dpdk/include/odp_thread_internal.h index 6342cc420..089db05f9 100644 --- a/platform/linux-dpdk/include/odp_thread_internal.h +++ b/platform/linux-dpdk/include/odp_thread_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Nokia */ #ifndef ODP_THREAD_INTERNAL_H_ diff --git a/platform/linux-dpdk/include/odp_timer_internal.h b/platform/linux-dpdk/include/odp_timer_internal.h index 35a4911af..2a1aed312 100644 --- a/platform/linux-dpdk/include/odp_timer_internal.h +++ b/platform/linux-dpdk/include/odp_timer_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited + * Copyright (c) 2021-2023 Nokia */ /** diff --git a/platform/linux-dpdk/include/protocols b/platform/linux-dpdk/include/protocols deleted file mode 120000 index 39a0a7ad1..000000000 --- a/platform/linux-dpdk/include/protocols +++ /dev/null @@ -1 +0,0 @@ -../../linux-generic/include/protocols
\ No newline at end of file diff --git a/platform/linux-dpdk/m4/configure.m4 b/platform/linux-dpdk/m4/configure.m4 index 535cfc5fa..3faea267b 100644 --- a/platform/linux-dpdk/m4/configure.m4 +++ b/platform/linux-dpdk/m4/configure.m4 @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2015 Linaro Limited +# + ODP_IMPLEMENTATION_NAME="odp-dpdk" ODP_LIB_NAME="odp-dpdk" @@ -101,7 +105,6 @@ AC_CONFIG_FILES([platform/linux-dpdk/Makefile platform/linux-dpdk/test/Makefile platform/linux-dpdk/test/example/Makefile platform/linux-dpdk/test/example/classifier/Makefile - platform/linux-dpdk/test/example/generator/Makefile platform/linux-dpdk/test/example/ipsec_api/Makefile platform/linux-dpdk/test/example/ipsec_crypto/Makefile platform/linux-dpdk/test/example/l2fwd_simple/Makefile diff --git a/platform/linux-dpdk/m4/odp_libconfig.m4 b/platform/linux-dpdk/m4/odp_libconfig.m4 index 2bf89ac2e..d2e4401de 100644 --- a/platform/linux-dpdk/m4/odp_libconfig.m4 +++ b/platform/linux-dpdk/m4/odp_libconfig.m4 @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Nokia +# + ########################################################################## # Configuration file version ########################################################################## diff --git a/platform/linux-dpdk/odp_buffer.c b/platform/linux-dpdk/odp_buffer.c index 6cabe41e2..e8bf2f100 100644 --- a/platform/linux-dpdk/odp_buffer.c +++ b/platform/linux-dpdk/odp_buffer.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2021-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2021-2022 Nokia */ #include <odp/api/align.h> @@ -13,7 +11,7 @@ #include <odp_buffer_internal.h> #include <odp_debug_internal.h> #include <odp_pool_internal.h> -#include <odp_print_internal.h> +#include <odp_string_internal.h> #include <string.h> #include <stdio.h> diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_crypto.c index 6170dd8df..5ce9699f3 100644 --- a/platform/linux-dpdk/odp_crypto.c +++ b/platform/linux-dpdk/odp_crypto.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * Copyright (c) 2018-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited + * Copyright (c) 2018-2023 Nokia */ #include <odp_posix_extensions.h> @@ -756,7 +754,7 @@ static int cipher_aead_capability(odp_cipher_alg_t cipher, odp_crypto_cipher_capability_t dst[], int num_copy) { - odp_crypto_cipher_capability_t src[num_copy]; + odp_crypto_cipher_capability_t src[_ODP_MAX(num_copy, 1)]; int idx = 0, rc = 0; int size = sizeof(odp_crypto_cipher_capability_t); @@ -794,7 +792,8 @@ static int cipher_aead_capability(odp_cipher_alg_t cipher, if (idx < num_copy) num_copy = idx; - memcpy(dst, src, num_copy * size); + if (dst) + memcpy(dst, src, num_copy * size); return idx; } @@ -803,7 +802,7 @@ static int cipher_capability(odp_cipher_alg_t cipher, odp_crypto_cipher_capability_t dst[], int num_copy) { - odp_crypto_cipher_capability_t src[num_copy]; + odp_crypto_cipher_capability_t src[_ODP_MAX(num_copy, 1)]; int idx = 0, rc = 0; int size = sizeof(odp_crypto_cipher_capability_t); uint8_t cdev_id, cdev_count; @@ -840,7 +839,8 @@ static int cipher_capability(odp_cipher_alg_t cipher, if (idx < num_copy) num_copy = idx; - memcpy(dst, src, num_copy * size); + if (dst) + memcpy(dst, src, num_copy * size); return idx; } @@ -956,7 +956,7 @@ static int auth_aead_capability(odp_auth_alg_t auth, odp_crypto_auth_capability_t dst[], int num_copy) { - odp_crypto_auth_capability_t src[num_copy]; + odp_crypto_auth_capability_t src[_ODP_MAX(num_copy, 1)]; int idx = 0, rc = 0; int size = sizeof(odp_crypto_auth_capability_t); @@ -996,7 +996,8 @@ static int auth_aead_capability(odp_auth_alg_t auth, if (idx < num_copy) num_copy = idx; - memcpy(dst, src, num_copy * size); + if (dst) + memcpy(dst, src, num_copy * size); return idx; } @@ -1005,7 +1006,7 @@ static int auth_capability(odp_auth_alg_t auth, odp_crypto_auth_capability_t dst[], int num_copy) { - odp_crypto_auth_capability_t src[num_copy]; + odp_crypto_auth_capability_t src[_ODP_MAX(num_copy, 1)]; int idx = 0, rc = 0; int size = sizeof(odp_crypto_auth_capability_t); uint8_t cdev_id, cdev_count; @@ -1084,7 +1085,8 @@ static int auth_capability(odp_auth_alg_t auth, if (idx < num_copy) num_copy = idx; - memcpy(dst, src, num_copy * size); + if (dst) + memcpy(dst, src, num_copy * size); return idx; } @@ -1736,9 +1738,11 @@ static void crypto_fill_sym_param(const crypto_session_entry_t *session, _ODP_ASSERT(cipher_iv_len == 0 || param->cipher_iv_ptr != NULL); _ODP_ASSERT(auth_iv_len == 0 || param->auth_iv_ptr != NULL); - iv_ptr = rte_crypto_op_ctod_offset(op, uint8_t *, IV_OFFSET); - memcpy(iv_ptr, param->cipher_iv_ptr, cipher_iv_len); + if (cipher_iv_len > 0) { + iv_ptr = rte_crypto_op_ctod_offset(op, uint8_t *, IV_OFFSET); + memcpy(iv_ptr, param->cipher_iv_ptr, cipher_iv_len); + } if (odp_unlikely(auth_iv_len > 0)) { iv_ptr = rte_crypto_op_ctod_offset(op, uint8_t *, IV_OFFSET + MAX_IV_LENGTH); memcpy(iv_ptr, param->auth_iv_ptr, auth_iv_len); diff --git a/platform/linux-dpdk/odp_dma.c b/platform/linux-dpdk/odp_dma.c index 0a470ea23..40f294304 100644 --- a/platform/linux-dpdk/odp_dma.c +++ b/platform/linux-dpdk/odp_dma.c @@ -28,6 +28,7 @@ #include <odp_pool_internal.h> #include <odp_queue_if.h> #include <odp_schedule_if.h> +#include <odp_string_internal.h> #include <rte_dmadev.h> #include <rte_mbuf_core.h> @@ -541,10 +542,8 @@ odp_dma_t odp_dma_create(const char *name, const odp_dma_param_t *param) session->is_mt = param->mt_mode == ODP_DMA_MT_SAFE; session->name[0] = 0; - if (name) { - strncpy(session->name, name, ODP_DMA_NAME_LEN - 1); - session->name[ODP_DMA_NAME_LEN - 1] = 0; - } + if (name) + _odp_strcpy(session->name, name, ODP_DMA_NAME_LEN); return (odp_dma_t)session; } diff --git a/platform/linux-dpdk/odp_errno.c b/platform/linux-dpdk/odp_errno.c index 2f03ee898..433129efb 100644 --- a/platform/linux-dpdk/odp_errno.c +++ b/platform/linux-dpdk/odp_errno.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ #include <odp/api/errno.h> diff --git a/platform/linux-dpdk/odp_event.c b/platform/linux-dpdk/odp_event.c index 0c2f3d22e..761c78cfd 100644 --- a/platform/linux-dpdk/odp_event.c +++ b/platform/linux-dpdk/odp_event.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2020-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2020-2023 Nokia */ #include <odp/api/event.h> diff --git a/platform/linux-dpdk/odp_init.c b/platform/linux-dpdk/odp_init.c index 79c449f1d..0e855524e 100644 --- a/platform/linux-dpdk/odp_init.c +++ b/platform/linux-dpdk/odp_init.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2023 Nokia */ #include <odp_posix_extensions.h> @@ -28,6 +26,7 @@ #include <rte_config.h> #include <rte_debug.h> #include <rte_eal.h> +#include <rte_errno.h> #include <rte_string_fns.h> enum init_stage { @@ -221,6 +220,8 @@ static int _odp_init_dpdk(const char *cmdline) _ODP_ERR("Error reading PCI config\n"); return -1; } + if (pci_cmd != NULL) + pci_str = pci_cmd; /* Read any additional EAL command string from config */ ealcmdlen = read_eal_cmdstr(&eal_cmd); @@ -230,15 +231,12 @@ static int _odp_init_dpdk(const char *cmdline) free(pci_cmd); return -1; } - cmdlen = snprintf(NULL, 0, "odpdpdk --legacy-mem -m %" PRIu32 " %s ", mem_prealloc, - cmdline) + pcicmdlen + ealcmdlen; - - if (pci_cmd != NULL) - pci_str = pci_cmd; - if (eal_cmd != NULL) eal_str = eal_cmd; + cmdlen = snprintf(NULL, 0, "odpdpdk --legacy-mem -m %" PRIu32 " %s %s %s", + mem_prealloc, cmdline, pci_str, eal_str); + char full_cmdline[cmdlen]; /* First argument is facility log, simply bind it to odpdpdk for now. In @@ -271,7 +269,7 @@ static int _odp_init_dpdk(const char *cmdline) i = rte_eal_init(dpdk_argc, dpdk_argv); if (i < 0) { - _ODP_ERR("Cannot init the Intel DPDK EAL!\n"); + _ODP_ERR("DPDK EAL init failed: %s\n", rte_strerror(rte_errno)); return -1; } else if (i + 1 != dpdk_argc) { _ODP_DBG("Some DPDK args were not processed!\n"); diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_packet.c index bcd2c2fb3..e08654d93 100644 --- a/platform/linux-dpdk/odp_packet.c +++ b/platform/linux-dpdk/odp_packet.c @@ -1,13 +1,12 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2024 Nokia */ #include <odp/api/align.h> #include <odp/api/buffer.h> #include <odp/api/byteorder.h> +#include <odp/api/cpu.h> #include <odp/api/hash.h> #include <odp/api/hints.h> #include <odp/api/packet.h> @@ -30,7 +29,7 @@ #include <odp_packet_io_internal.h> #include <odp_parse_internal.h> #include <odp_pool_internal.h> -#include <odp_print_internal.h> +#include <odp_string_internal.h> #include <rte_version.h> @@ -128,6 +127,14 @@ static inline int num_segments(uint32_t len, uint32_t seg_len) return num; } +static inline void packet_reset_md(odp_packet_hdr_t *pkt_hdr, struct rte_mbuf *mb) +{ + mb->port = 0xff; + mb->vlan_tci = 0; + + packet_init(pkt_hdr, ODP_PKTIO_INVALID); +} + static inline int packet_reset(odp_packet_t pkt, uint32_t len) { odp_packet_hdr_t *const pkt_hdr = packet_hdr(pkt); @@ -135,12 +142,10 @@ static inline int packet_reset(odp_packet_t pkt, uint32_t len) uint8_t nb_segs = 0; int32_t lenleft = len; - packet_init(pkt_hdr, ODP_PKTIO_INVALID); + packet_reset_md(pkt_hdr, mb); - mb->port = 0xff; mb->pkt_len = len; mb->data_off = RTE_PKTMBUF_HEADROOM; - mb->vlan_tci = 0; nb_segs = 1; if (RTE_PKTMBUF_HEADROOM + lenleft <= mb->buf_len) { @@ -318,18 +323,19 @@ int odp_packet_alloc_multi(odp_pool_t pool_hdl, uint32_t len, int odp_packet_reset(odp_packet_t pkt, uint32_t len) { - if (odp_unlikely(len == 0)) + if (odp_unlikely(len == 0 || len > odp_packet_reset_max_len(pkt))) return -1; - if (RTE_PKTMBUF_HEADROOM + len > odp_packet_buf_len(pkt)) { - _ODP_DBG("Not enough head room for that packet %d/%d\n", - RTE_PKTMBUF_HEADROOM + len, odp_packet_buf_len(pkt)); - return -1; - } - return packet_reset(pkt, len); } +void odp_packet_reset_meta(odp_packet_t pkt) +{ + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); + + packet_reset_md(pkt_hdr, &pkt_hdr->mb); +} + int odp_event_filter_packet(const odp_event_t event[], odp_packet_t packet[], odp_event_t remain[], int num) diff --git a/platform/linux-dpdk/odp_packet_dpdk.c b/platform/linux-dpdk/odp_packet_dpdk.c index da76db06d..776cc24ac 100644 --- a/platform/linux-dpdk/odp_packet_dpdk.c +++ b/platform/linux-dpdk/odp_packet_dpdk.c @@ -1,12 +1,11 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2023 Nokia */ #include <odp_posix_extensions.h> +#include <odp/api/cpu.h> #include <odp/api/hints.h> #include <odp/api/packet.h> #include <odp/api/packet_io.h> @@ -26,6 +25,7 @@ #include <odp_packet_internal.h> #include <odp_packet_io_internal.h> #include <odp_pool_internal.h> +#include <odp_string_internal.h> #include <protocols/eth.h> #include <rte_config.h> @@ -104,6 +104,8 @@ #define IXGBE_DRV_NAME "net_ixgbe" #define I40E_DRV_NAME "net_i40e" +#define PCAP_DRV_NAME "net_pcap" + /* Minimum RX burst size */ #define DPDK_MIN_RX_BURST 4 @@ -890,14 +892,20 @@ static int dpdk_start(pktio_entry_t *pktio_entry) pktio_entry->state == PKTIO_STATE_STOP_PENDING) rte_eth_dev_stop(pkt_dpdk->port_id); - /* DPDK doesn't support nb_rx_q/nb_tx_q being 0 */ - if (!pktio_entry->num_in_queue) - pktio_entry->num_in_queue = 1; - if (!pktio_entry->num_out_queue) - pktio_entry->num_out_queue = 1; - rte_eth_dev_info_get(port_id, &dev_info); + /* Pcap driver reconfiguration may fail if number of rx/tx queues is set to zero */ + if (!strncmp(dev_info.driver_name, PCAP_DRV_NAME, strlen(PCAP_DRV_NAME))) { + if (!pktio_entry->num_in_queue) { + pktio_entry->num_in_queue = 1; + pkt_dpdk->num_rx_desc[0] = dev_info.rx_desc_lim.nb_min; + } + if (!pktio_entry->num_out_queue) { + pktio_entry->num_out_queue = 1; + pkt_dpdk->num_tx_desc[0] = dev_info.tx_desc_lim.nb_min; + } + } + /* Setup device */ if (dpdk_setup_eth_dev(pktio_entry, &dev_info)) { _ODP_ERR("Failed to configure device\n"); @@ -1551,8 +1559,7 @@ static int dpdk_extra_stat_info(pktio_entry_t *pktio_entry, num_stats = ret; for (i = 0; i < num && i < num_stats; i++) - strncpy(info[i].name, xstats_names[i].name, - ODP_PKTIO_STATS_EXTRA_NAME_LEN - 1); + _odp_strcpy(info[i].name, xstats_names[i].name, ODP_PKTIO_STATS_EXTRA_NAME_LEN); return num_stats; } diff --git a/platform/linux-dpdk/odp_packet_flags.c b/platform/linux-dpdk/odp_packet_flags.c index 345ac8488..3856aba4f 100644 --- a/platform/linux-dpdk/odp_packet_flags.c +++ b/platform/linux-dpdk/odp_packet_flags.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited */ #include <odp/api/plat/packet_flag_inlines.h> diff --git a/platform/linux-dpdk/odp_pool.c b/platform/linux-dpdk/odp_pool.c index dfd14a978..8b15518c9 100644 --- a/platform/linux-dpdk/odp_pool.c +++ b/platform/linux-dpdk/odp_pool.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2023 Nokia */ #include <odp/api/align.h> @@ -24,6 +22,7 @@ #include <odp_macros_internal.h> #include <odp_packet_internal.h> #include <odp_pool_internal.h> +#include <odp_string_internal.h> #include <odp_timer_internal.h> #include <rte_config.h> @@ -57,8 +56,9 @@ /* Pool name format */ #define POOL_NAME_FORMAT "%" PRIu64 "-%d-%s" -/* Define a practical limit for contiguous memory allocations */ -#define MAX_SIZE (CONFIG_PACKET_SEG_SIZE - CONFIG_BUFFER_ALIGN_MIN) +/* Default alignment for buffers */ +#define BUFFER_ALIGN_DEFAULT ODP_CACHE_LINE_SIZE +ODP_STATIC_ASSERT(_ODP_CHECK_IS_POWER2(BUFFER_ALIGN_DEFAULT), "Buffer align must be power of two"); /* Maximum packet user area size */ #define MAX_UAREA_SIZE 2048 @@ -263,7 +263,8 @@ int odp_pool_capability(odp_pool_capability_t *capa) /* Buffer pools */ capa->buf.max_pools = max_pools; capa->buf.max_align = CONFIG_BUFFER_ALIGN_MAX; - capa->buf.max_size = MAX_SIZE; + capa->buf.max_size = _ODP_ROUNDDOWN_POWER2(CONFIG_PACKET_SEG_SIZE, BUFFER_ALIGN_DEFAULT) - + _ODP_EV_ENDMARK_SIZE; capa->buf.max_num = CONFIG_POOL_MAX_NUM; capa->buf.max_uarea_size = MAX_UAREA_SIZE; capa->buf.uarea_persistence = true; @@ -274,8 +275,8 @@ int odp_pool_capability(odp_pool_capability_t *capa) /* Packet pools */ capa->pkt.max_align = CONFIG_BUFFER_ALIGN_MIN; capa->pkt.max_pools = max_pools; - capa->pkt.max_len = CONFIG_PACKET_MAX_SEG_LEN; - capa->pkt.max_num = _odp_pool_glb->config.pkt_max_num; + capa->pkt.max_len = CONFIG_PACKET_MAX_SEG_LEN - _ODP_EV_ENDMARK_SIZE; + capa->pkt.max_num = _odp_pool_glb->config.pkt_max_num; capa->pkt.min_headroom = RTE_PKTMBUF_HEADROOM; capa->pkt.max_headroom = RTE_PKTMBUF_HEADROOM; capa->pkt.min_tailroom = CONFIG_PACKET_TAILROOM; @@ -657,7 +658,6 @@ static void init_obj_priv_data(struct rte_mempool *mp ODP_UNUSED, void *arg, voi } } - odp_pool_t _odp_pool_create(const char *name, const odp_pool_param_t *params, odp_pool_type_t type_2) { @@ -677,14 +677,14 @@ odp_pool_t _odp_pool_create(const char *name, const odp_pool_param_t *params, priv_data.type = params->type; if (name) - strncpy(pool->name, name, ODP_POOL_NAME_LEN - 1); + _odp_strcpy(pool->name, name, ODP_POOL_NAME_LEN); switch (params->type) { case ODP_POOL_BUFFER: num = params->buf.num; cache_size = params->buf.cache_size; priv_size = get_mbuf_priv_size(sizeof(odp_buffer_hdr_t)); - align = params->buf.align > 0 ? params->buf.align : ODP_CACHE_LINE_SIZE; + align = params->buf.align > 0 ? params->buf.align : BUFFER_ALIGN_DEFAULT; align = _ODP_MAX(align, (uint32_t)CONFIG_BUFFER_ALIGN_MIN); data_size = _ODP_ROUNDUP_ALIGN(params->buf.size + trailer, align); uarea_size = params->buf.uarea_size; @@ -1118,7 +1118,7 @@ int odp_pool_ext_capability(odp_pool_type_t type, capa->stats.all = supported_stats.all; capa->pkt.max_num_buf = _odp_pool_glb->config.pkt_max_num; - capa->pkt.max_buf_size = MAX_SIZE; + capa->pkt.max_buf_size = CONFIG_PACKET_SEG_SIZE - CONFIG_BUFFER_ALIGN_MIN; capa->pkt.odp_header_size = SIZEOF_OBJHDR + sizeof(odp_packet_hdr_t); capa->pkt.odp_trailer_size = _ODP_EV_ENDMARK_SIZE; capa->pkt.min_mem_align = ODP_CACHE_LINE_SIZE; @@ -1216,12 +1216,10 @@ odp_pool_t odp_pool_ext_create(const char *name, if (check_pool_ext_param(params)) return ODP_POOL_INVALID; - if (name == NULL) { + if (name == NULL) pool_name[0] = 0; - } else { - strncpy(pool_name, name, ODP_POOL_NAME_LEN - 1); - pool_name[ODP_POOL_NAME_LEN - 1] = 0; - } + else + _odp_strcpy(pool_name, name, ODP_POOL_NAME_LEN); /* Find an unused buffer pool slot and initialize it as requested */ for (i = 0; i < CONFIG_POOLS; i++) { diff --git a/platform/linux-dpdk/odp_queue_basic.c b/platform/linux-dpdk/odp_queue_basic.c index 4b9dee891..4ee51ee6b 100644 --- a/platform/linux-dpdk/odp_queue_basic.c +++ b/platform/linux-dpdk/odp_queue_basic.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2021-2023 Nokia */ #include <odp/api/align.h> @@ -32,6 +30,7 @@ #include <odp_queue_basic_internal.h> #include <odp_queue_if.h> #include <odp_schedule_if.h> +#include <odp_string_internal.h> #include <odp_timer_internal.h> #include <inttypes.h> @@ -1000,12 +999,11 @@ static int queue_init(queue_entry_t *queue, const char *name, queue_type = param->type; - if (name == NULL) { + if (name == NULL) queue->name[0] = 0; - } else { - strncpy(queue->name, name, ODP_QUEUE_NAME_LEN - 1); - queue->name[ODP_QUEUE_NAME_LEN - 1] = 0; - } + else + _odp_strcpy(queue->name, name, ODP_QUEUE_NAME_LEN); + memcpy(&queue->param, param, sizeof(odp_queue_param_t)); if (queue->param.sched.lock_count > _odp_sched_fn->max_ordered_locks()) return -1; diff --git a/platform/linux-dpdk/odp_queue_eventdev.c b/platform/linux-dpdk/odp_queue_eventdev.c index c0928bfd2..8071c1785 100644 --- a/platform/linux-dpdk/odp_queue_eventdev.c +++ b/platform/linux-dpdk/odp_queue_eventdev.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2019-2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2019-2021 Nokia */ #include <odp_eventdev_internal.h> @@ -20,6 +18,7 @@ #include <odp_libconfig_internal.h> #include <odp_queue_if.h> #include <odp_schedule_if.h> +#include <odp_string_internal.h> #include <odp_timer_internal.h> #include <rte_config.h> @@ -1123,12 +1122,11 @@ static int queue_init(queue_entry_t *queue, const char *name, queue_type = param->type; - if (name == NULL) { + if (name == NULL) queue->name[0] = 0; - } else { - strncpy(queue->name, name, ODP_QUEUE_NAME_LEN - 1); - queue->name[ODP_QUEUE_NAME_LEN - 1] = 0; - } + else + _odp_strcpy(queue->name, name, ODP_QUEUE_NAME_LEN); + memcpy(&queue->param, param, sizeof(odp_queue_param_t)); if (queue->param.sched.lock_count > _odp_sched_fn->max_ordered_locks()) return -1; diff --git a/platform/linux-dpdk/odp_queue_if.c b/platform/linux-dpdk/odp_queue_if.c index efe3eb155..856d2f66e 100644 --- a/platform/linux-dpdk/odp_queue_if.c +++ b/platform/linux-dpdk/odp_queue_if.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2023 Nokia */ #include <odp/autoheader_internal.h> diff --git a/platform/linux-dpdk/odp_queue_spsc.c b/platform/linux-dpdk/odp_queue_spsc.c index 61dde0ed0..a47d2a4be 100644 --- a/platform/linux-dpdk/odp_queue_spsc.c +++ b/platform/linux-dpdk/odp_queue_spsc.c @@ -1,9 +1,8 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2021 Nokia */ + #include <odp/api/hints.h> #include <odp_debug_internal.h> diff --git a/platform/linux-dpdk/odp_schedule_eventdev.c b/platform/linux-dpdk/odp_schedule_eventdev.c index 4ef8a51b7..5e13b5ad2 100644 --- a/platform/linux-dpdk/odp_schedule_eventdev.c +++ b/platform/linux-dpdk/odp_schedule_eventdev.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2019, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2019 Nokia */ #include <odp_posix_extensions.h> @@ -20,6 +18,7 @@ #include <odp_eventdev_internal.h> #include <odp_packet_io_internal.h> #include <odp_schedule_if.h> +#include <odp_string_internal.h> #include <odp_timer_internal.h> #include <rte_config.h> @@ -821,13 +820,10 @@ static odp_schedule_group_t schedule_group_create(const char *name, if (!_odp_eventdev_gbl->grp[i].allocated) { char *grp_name = _odp_eventdev_gbl->grp[i].name; - if (name == NULL) { + if (name == NULL) grp_name[0] = 0; - } else { - strncpy(grp_name, name, - ODP_SCHED_GROUP_NAME_LEN - 1); - grp_name[ODP_SCHED_GROUP_NAME_LEN - 1] = 0; - } + else + _odp_strcpy(grp_name, name, ODP_SCHED_GROUP_NAME_LEN); grp_update_mask(i, mask); group = (odp_schedule_group_t)i; diff --git a/platform/linux-dpdk/odp_schedule_if.c b/platform/linux-dpdk/odp_schedule_if.c index dbb098e8b..b83de135f 100644 --- a/platform/linux-dpdk/odp_schedule_if.c +++ b/platform/linux-dpdk/odp_schedule_if.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2021-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2021-2022 Nokia */ #include <odp/autoheader_internal.h> diff --git a/platform/linux-dpdk/odp_shared_memory.c b/platform/linux-dpdk/odp_shared_memory.c index 398771708..dff52fc55 100644 --- a/platform/linux-dpdk/odp_shared_memory.c +++ b/platform/linux-dpdk/odp_shared_memory.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited + * Copyright (c) 2021-2023 Nokia */ #include <odp_posix_extensions.h> @@ -18,6 +16,7 @@ #include <odp_global_data.h> #include <odp_macros_internal.h> #include <odp_shm_internal.h> +#include <odp_string_internal.h> #include <stdio.h> #include <string.h> @@ -287,8 +286,12 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, } block->mz = mz; - snprintf(block->name, ODP_SHM_NAME_LEN, "%s", name); - block->name[ODP_SHM_NAME_LEN - 1] = 0; + + if (name == NULL) + block->name[0] = 0; + else + _odp_strcpy(block->name, name, ODP_SHM_NAME_LEN); + block->type = SHM_TYPE_LOCAL; block->size = size; @@ -334,8 +337,12 @@ odp_shm_t odp_shm_import(const char *remote_name, odp_instance_t odp_inst, block = &shm_tbl->block[idx]; block->mz = mz; - snprintf(block->name, ODP_SHM_NAME_LEN, "%s", local_name); - block->name[ODP_SHM_NAME_LEN - 1] = 0; + + if (local_name == NULL) + block->name[0] = 0; + else + _odp_strcpy(block->name, local_name, ODP_SHM_NAME_LEN); + block->type = SHM_TYPE_REMOTE; odp_spinlock_unlock(&shm_tbl->lock); @@ -481,7 +488,6 @@ static void walk_memzone(const struct rte_memzone *mz, void *arg) odp_system_memblock_t *memblock; int32_t cur = data->blocks; const char *name; - int name_len; data->info->total_mapped += mz->len; data->blocks++; @@ -499,12 +505,7 @@ static void walk_memzone(const struct rte_memzone *mz, void *arg) return; memblock = &data->memblock[cur]; - name_len = strlen(name); - if (name_len >= ODP_SYSTEM_MEMBLOCK_NAME_LEN) - name_len = ODP_SYSTEM_MEMBLOCK_NAME_LEN - 1; - - memcpy(memblock->name, name, name_len); - memblock->name[name_len] = 0; + _odp_strcpy(memblock->name, name, ODP_SYSTEM_MEMBLOCK_NAME_LEN); memblock->addr = (uintptr_t)mz->addr; memblock->used = mz->len; diff --git a/platform/linux-dpdk/odp_std_api.c b/platform/linux-dpdk/odp_std_api.c index 251e6f874..ea6379061 100644 --- a/platform/linux-dpdk/odp_std_api.c +++ b/platform/linux-dpdk/odp_std_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ #include <odp/api/std.h> diff --git a/platform/linux-dpdk/odp_system_info.c b/platform/linux-dpdk/odp_system_info.c index d9cddcb40..dd257b811 100644 --- a/platform/linux-dpdk/odp_system_info.c +++ b/platform/linux-dpdk/odp_system_info.c @@ -1,15 +1,9 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2020-2024, Nokia - * All rights reserved. +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2020-2024 Nokia * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * BSD LICENSE - * - * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. - * All rights reserved. + * Copyright(c) 2010-2014 Intel Corporation + * - lib/eal/linux/eal_hugepage_info.c */ #include <odp_posix_extensions.h> diff --git a/platform/linux-dpdk/odp_thread.c b/platform/linux-dpdk/odp_thread.c index 10b5de5e0..3afad4e89 100644 --- a/platform/linux-dpdk/odp_thread.c +++ b/platform/linux-dpdk/odp_thread.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #include <odp_posix_extensions.h> @@ -40,9 +38,9 @@ typedef struct { odp_thrmask_t control; }; odp_atomic_u64_t thrmask_all_epoch; - uint32_t num; - uint32_t num_worker; - uint32_t num_control; + odp_atomic_u32_t num; + odp_atomic_u32_t num_worker; + odp_atomic_u32_t num_control; uint32_t num_max; odp_spinlock_t lock; odp_shm_t shm; @@ -86,6 +84,9 @@ int _odp_thread_init_global(void) return -1; memset(thread_globals, 0, sizeof(thread_globals_t)); + odp_atomic_init_u32(&thread_globals->num, 0); + odp_atomic_init_u32(&thread_globals->num_worker, 0); + odp_atomic_init_u32(&thread_globals->num_control, 0); thread_globals->shm = shm; @@ -102,10 +103,7 @@ int _odp_thread_term_global(void) { int ret, num; - odp_spinlock_lock(&thread_globals->lock); - num = thread_globals->num; - odp_spinlock_unlock(&thread_globals->lock); - + num = odp_atomic_load_u32(&thread_globals->num); if (num) _ODP_ERR("%u threads have not called odp_term_local().\n", num); @@ -140,7 +138,7 @@ static int alloc_id(odp_thread_type_t type) int thr; odp_thrmask_t *all = &thread_globals->all; - if (thread_globals->num >= thread_globals->num_max) + if (odp_atomic_load_u32(&thread_globals->num) >= thread_globals->num_max) return -1; for (thr = 0; thr < (int)thread_globals->num_max; thr++) { @@ -150,13 +148,13 @@ static int alloc_id(odp_thread_type_t type) if (type == ODP_THREAD_WORKER) { odp_thrmask_set(&thread_globals->worker, thr); - thread_globals->num_worker++; + odp_atomic_inc_u32(&thread_globals->num_worker); } else { odp_thrmask_set(&thread_globals->control, thr); - thread_globals->num_control++; + odp_atomic_inc_u32(&thread_globals->num_control); } - thread_globals->num++; + odp_atomic_inc_u32(&thread_globals->num); return thr; } } @@ -179,14 +177,13 @@ static int free_id(int thr) if (thread_globals->thr[thr].type == ODP_THREAD_WORKER) { odp_thrmask_clr(&thread_globals->worker, thr); - thread_globals->num_worker--; + odp_atomic_dec_u32(&thread_globals->num_worker); } else { odp_thrmask_clr(&thread_globals->control, thr); - thread_globals->num_control--; + odp_atomic_dec_u32(&thread_globals->num_control); } - thread_globals->num--; - return thread_globals->num; + return odp_atomic_fetch_dec_u32(&thread_globals->num) - 1; } int _odp_thread_init_local(odp_thread_type_t type) @@ -288,17 +285,17 @@ int _odp_thread_term_local(void) int odp_thread_count(void) { - return thread_globals->num; + return odp_atomic_load_u32(&thread_globals->num); } int odp_thread_control_count(void) { - return thread_globals->num_control; + return odp_atomic_load_u32(&thread_globals->num_control); } int odp_thread_worker_count(void) { - return thread_globals->num_worker; + return odp_atomic_load_u32(&thread_globals->num_worker); } int odp_thread_count_max(void) @@ -318,12 +315,23 @@ int odp_thread_worker_count_max(void) int odp_thrmask_worker(odp_thrmask_t *mask) { + uint32_t num_worker; + + odp_spinlock_lock(&thread_globals->lock); odp_thrmask_copy(mask, &thread_globals->worker); - return thread_globals->num_worker; + num_worker = odp_atomic_load_u32(&thread_globals->num_worker); + odp_spinlock_unlock(&thread_globals->lock); + return num_worker; + } int odp_thrmask_control(odp_thrmask_t *mask) { + uint32_t num_control; + + odp_spinlock_lock(&thread_globals->lock); odp_thrmask_copy(mask, &thread_globals->control); - return thread_globals->num_control; + num_control = odp_atomic_load_u32(&thread_globals->num_control); + odp_spinlock_unlock(&thread_globals->lock); + return num_control; } diff --git a/platform/linux-dpdk/odp_time.c b/platform/linux-dpdk/odp_time.c index fbee02df1..35c4cbabb 100644 --- a/platform/linux-dpdk/odp_time.c +++ b/platform/linux-dpdk/odp_time.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2021-2024, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2021-2024 Nokia */ #include <odp/api/plat/time_inlines.h> diff --git a/platform/linux-dpdk/odp_timer.c b/platform/linux-dpdk/odp_timer.c index f4c190aad..08689322a 100644 --- a/platform/linux-dpdk/odp_timer.c +++ b/platform/linux-dpdk/odp_timer.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2019-2024, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2019-2024 Nokia */ #include <odp_posix_extensions.h> @@ -26,9 +24,9 @@ #include <odp_libconfig_internal.h> #include <odp_macros_internal.h> #include <odp_pool_internal.h> -#include <odp_print_internal.h> #include <odp_queue_if.h> #include <odp_ring_u32_internal.h> +#include <odp_string_internal.h> #include <odp_thread_internal.h> #include <odp_timer_internal.h> @@ -129,7 +127,7 @@ typedef struct timer_pool_s { } free_timer; odp_timer_pool_param_t param; - char name[ODP_TIMER_POOL_NAME_LEN + 1]; + char name[ODP_TIMER_POOL_NAME_LEN]; int used; odp_ticketlock_t lock; uint32_t cur_timers; @@ -715,11 +713,8 @@ odp_timer_pool_t odp_timer_pool_create(const char *name, } odp_ticketlock_unlock(&timer_global->lock); - if (name) { - strncpy(timer_pool->name, name, - ODP_TIMER_POOL_NAME_LEN); - timer_pool->name[ODP_TIMER_POOL_NAME_LEN] = 0; - } + if (name) + _odp_strcpy(timer_pool->name, name, ODP_TIMER_POOL_NAME_LEN); timer_pool->param = *param; timer_pool->param.res_ns = res_ns; diff --git a/platform/linux-dpdk/test/example/Makefile.am b/platform/linux-dpdk/test/example/Makefile.am index 947647cd4..a9d0948de 100644 --- a/platform/linux-dpdk/test/example/Makefile.am +++ b/platform/linux-dpdk/test/example/Makefile.am @@ -1,6 +1,5 @@ SUBDIRS = \ classifier \ - generator \ ipsec_api \ ipsec_crypto \ l2fwd_simple \ diff --git a/platform/linux-dpdk/test/example/classifier/pktio_env b/platform/linux-dpdk/test/example/classifier/pktio_env index 8b390092c..e6778cb39 100644 --- a/platform/linux-dpdk/test/example/classifier/pktio_env +++ b/platform/linux-dpdk/test/example/classifier/pktio_env @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (c) 2020, Marvell -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Marvell # # Script to setup interfaces used for running application on linux-generic. # diff --git a/platform/linux-dpdk/test/example/generator/Makefile.am b/platform/linux-dpdk/test/example/generator/Makefile.am deleted file mode 100644 index 2ffced539..000000000 --- a/platform/linux-dpdk/test/example/generator/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = pktio_env diff --git a/platform/linux-dpdk/test/example/generator/pktio_env b/platform/linux-dpdk/test/example/generator/pktio_env deleted file mode 100644 index cea715a5b..000000000 --- a/platform/linux-dpdk/test/example/generator/pktio_env +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2020, Marvell -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# -# Script to setup interfaces used for running application on odp-dpdk. -# -# Generator uses a loop interface to validate udp mode. -# -# Network set-up -# IF0 ---> null:0 - -IF0=null:0 - -if [ "$0" = "$BASH_SOURCE" ]; then - echo "Error: Platform specific env file has to be sourced." -fi - -validate_result() -{ - return 0 -} - -setup_interfaces() -{ - return 0 -} - -cleanup_interfaces() -{ - return 0 -} diff --git a/platform/linux-dpdk/test/example/ipsec_api/pktio_env b/platform/linux-dpdk/test/example/ipsec_api/pktio_env index 3267bd4cd..ec501b319 100644 --- a/platform/linux-dpdk/test/example/ipsec_api/pktio_env +++ b/platform/linux-dpdk/test/example/ipsec_api/pktio_env @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (C) 2021, Marvell -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (C) 2021 Marvell # # Script to setup interfaces used for running application on linux-dpdk. # diff --git a/platform/linux-dpdk/test/example/ipsec_crypto/pktio_env b/platform/linux-dpdk/test/example/ipsec_crypto/pktio_env index 1c6e7d172..006293eaa 100644 --- a/platform/linux-dpdk/test/example/ipsec_crypto/pktio_env +++ b/platform/linux-dpdk/test/example/ipsec_crypto/pktio_env @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (C) 2021, Marvell -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (C) 2021 Marvell # # Script to setup interfaces used for running application on linux-dpdk. # diff --git a/platform/linux-dpdk/test/example/l2fwd_simple/pktio_env b/platform/linux-dpdk/test/example/l2fwd_simple/pktio_env index d1cb6d84a..cea4e1c23 100644 --- a/platform/linux-dpdk/test/example/l2fwd_simple/pktio_env +++ b/platform/linux-dpdk/test/example/l2fwd_simple/pktio_env @@ -1,10 +1,8 @@ #!/bin/sh # -# Copyright (c) 2020, Marvell -# Copyright (c) 2020, Nokia -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Marvell +# Copyright (c) 2020 Nokia # # Script to setup interfaces used for running application on linux-dpdk. # diff --git a/platform/linux-dpdk/test/example/l3fwd/pktio_env b/platform/linux-dpdk/test/example/l3fwd/pktio_env index c9e35f09a..475272ecc 100644 --- a/platform/linux-dpdk/test/example/l3fwd/pktio_env +++ b/platform/linux-dpdk/test/example/l3fwd/pktio_env @@ -1,10 +1,8 @@ #!/bin/sh # -# Copyright (c) 2020, Marvell -# Copyright (c) 2020, Nokia -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Marvell +# Copyright (c) 2020 Nokia # # Script to setup interfaces used for running application on linux-dpdk. # diff --git a/platform/linux-dpdk/test/example/packet/pktio_env b/platform/linux-dpdk/test/example/packet/pktio_env index 0f6a1c233..ef10c3436 100644 --- a/platform/linux-dpdk/test/example/packet/pktio_env +++ b/platform/linux-dpdk/test/example/packet/pktio_env @@ -1,10 +1,8 @@ #!/bin/sh # -# Copyright (c) 2020, Marvell -# Copyright (c) 2020, Nokia -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Marvell +# Copyright (c) 2020 Nokia # # Script to setup interfaces used for running application on linux-dpdk. # diff --git a/platform/linux-dpdk/test/example/ping/pktio_env b/platform/linux-dpdk/test/example/ping/pktio_env index a8dba6e9a..45a58935a 100644 --- a/platform/linux-dpdk/test/example/ping/pktio_env +++ b/platform/linux-dpdk/test/example/ping/pktio_env @@ -1,10 +1,8 @@ #!/bin/sh # -# Copyright (c) 2020, Marvell -# Copyright (c) 2020, Nokia -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Marvell +# Copyright (c) 2020 Nokia # # Script to setup interfaces used for running application on linux-dpdk. # diff --git a/platform/linux-dpdk/test/example/simple_pipeline/pktio_env b/platform/linux-dpdk/test/example/simple_pipeline/pktio_env index c2cccffbc..5ebc4b8d7 100644 --- a/platform/linux-dpdk/test/example/simple_pipeline/pktio_env +++ b/platform/linux-dpdk/test/example/simple_pipeline/pktio_env @@ -1,10 +1,8 @@ #!/bin/sh # -# Copyright (c) 2020, Marvell -# Copyright (c) 2020, Nokia -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Marvell +# Copyright (c) 2020 Nokia # # Script to setup interfaces used for running application on linux-dpdk. # diff --git a/platform/linux-dpdk/test/example/switch/pktio_env b/platform/linux-dpdk/test/example/switch/pktio_env index 8daca3c3e..ee2e97d40 100644 --- a/platform/linux-dpdk/test/example/switch/pktio_env +++ b/platform/linux-dpdk/test/example/switch/pktio_env @@ -1,10 +1,8 @@ #!/bin/sh # -# Copyright (c) 2020, Marvell -# Copyright (c) 2020, Nokia -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Marvell +# Copyright (c) 2020 Nokia # # Script to setup interfaces used for running application on linux-dpdk. # 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 641b39493..7d73036dc 100755 --- a/platform/linux-dpdk/test/validation/api/pktio/pktio_run.sh +++ b/platform/linux-dpdk/test/validation/api/pktio/pktio_run.sh @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (c) 2015-2018, Linaro Limited -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2015-2018 Linaro Limited # # Proceed the pktio tests. This script expects at least one argument: diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 11cdb4c64..d1d482849 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -156,8 +156,8 @@ noinst_HEADERS = \ include/odp_packet_internal.h \ include/odp_packet_io_internal.h \ include/odp_parse_internal.h \ - include/odp_print_internal.h \ include/odp_socket_common.h \ + include/odp_string_internal.h \ include/odp_packet_io_stats_common.h \ include/odp_packet_io_stats.h \ include/odp_sysfs_stats.h \ @@ -240,7 +240,6 @@ __LIB__libodp_linux_la_SOURCES = \ odp_packet_io.c \ odp_parse.c \ odp_pkt_queue.c \ - odp_print.c \ odp_pool.c \ odp_pool_mem_src_ops.c \ odp_queue_basic.c \ @@ -260,6 +259,7 @@ __LIB__libodp_linux_la_SOURCES = \ odp_sorted_list.c \ odp_stash.c \ odp_std.c \ + odp_string.c \ odp_system_info.c \ odp_pcapng.c \ odp_thread.c \ @@ -492,7 +492,7 @@ if ODP_PKTIO_PCAP __LIB__libodp_linux_la_LIBADD += $(PCAP_LIBS) endif -CHECK_GLOBALS_REGEX = " (odp_|_odp_|_deprecated_odp_|miniz_|mz_|tdefl_|tinfl_|mp_hdlr_init_odp_pool_ops)" +CHECK_GLOBALS_REGEX = " (odp_|_odp_|_deprecated_odp_|miniz_|mz_|tdefl_|tinfl_|mp_hdlr_init_odp_pool_ops|__odr_asan)" TESTS_ENVIRONMENT = \ LIBTOOL="$(LIBTOOL)" \ diff --git a/platform/linux-generic/README b/platform/linux-generic/README index 8fa50c127..905b06a4a 100644 --- a/platform/linux-generic/README +++ b/platform/linux-generic/README @@ -1,8 +1,6 @@ -Copyright (c) 2014-2018, Linaro Limited -Copyright (c) 2019-2023, Nokia -All rights reserved. - -SPDX-License-Identifier: BSD-3-Clause +SPDX-License-Identifier: BSD-3-Clause +Copyright (c) 2014-2018 Linaro Limited +Copyright (c) 2019-2023 Nokia 1. Intro OpenDataPlane API generic Linux implementation. Directory linux-generic diff --git a/platform/linux-generic/arch/aarch64/cpu_flags.c b/platform/linux-generic/arch/aarch64/cpu_flags.c index 9923e9306..35ef7c1f0 100644 --- a/platform/linux-generic/arch/aarch64/cpu_flags.c +++ b/platform/linux-generic/arch/aarch64/cpu_flags.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2020-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2020-2023 Nokia */ #include <odp/api/hints.h> diff --git a/platform/linux-generic/arch/aarch64/cpu_flags.h b/platform/linux-generic/arch/aarch64/cpu_flags.h index 177b1c44f..f520306ac 100644 --- a/platform/linux-generic/arch/aarch64/cpu_flags.h +++ b/platform/linux-generic/arch/aarch64/cpu_flags.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, ARM Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 ARM Limited */ #ifndef ODP_PLAT_CPU_FLAGS_H_ diff --git a/platform/linux-generic/arch/aarch64/odp/api/abi/atomic.h b/platform/linux-generic/arch/aarch64/odp/api/abi/atomic.h index 14cca3ca0..32a763ee6 100644 --- a/platform/linux-generic/arch/aarch64/odp/api/abi/atomic.h +++ b/platform/linux-generic/arch/aarch64/odp/api/abi/atomic.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, ARM Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 ARM Limited */ #ifdef __ARM_FEATURE_ATOMICS diff --git a/platform/linux-generic/arch/aarch64/odp/api/abi/atomic_inlines.h b/platform/linux-generic/arch/aarch64/odp/api/abi/atomic_inlines.h index 3b0f94efe..19180ffee 100644 --- a/platform/linux-generic/arch/aarch64/odp/api/abi/atomic_inlines.h +++ b/platform/linux-generic/arch/aarch64/odp/api/abi/atomic_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2021, ARM Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 ARM Limited + * Copyright (c) 2021 Nokia */ #ifndef ODP_API_ABI_ATOMIC_INLINES_H_ diff --git a/platform/linux-generic/arch/aarch64/odp/api/abi/cpu.h b/platform/linux-generic/arch/aarch64/odp/api/abi/cpu.h index 825ff19d4..0e7cbf86b 100644 --- a/platform/linux-generic/arch/aarch64/odp/api/abi/cpu.h +++ b/platform/linux-generic/arch/aarch64/odp/api/abi/cpu.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #ifndef ODP_API_ABI_CPU_H_ diff --git a/platform/linux-generic/arch/aarch64/odp/api/abi/cpu_inlines.h b/platform/linux-generic/arch/aarch64/odp/api/abi/cpu_inlines.h index a26908e66..5890fc7a4 100644 --- a/platform/linux-generic/arch/aarch64/odp/api/abi/cpu_inlines.h +++ b/platform/linux-generic/arch/aarch64/odp/api/abi/cpu_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2021-2023 Nokia */ #ifndef ODP_ARCH_CPU_INLINES_H_ diff --git a/platform/linux-generic/arch/aarch64/odp/api/abi/hash_crc32.h b/platform/linux-generic/arch/aarch64/odp/api/abi/hash_crc32.h index fd7bf91c6..56bdd2812 100644 --- a/platform/linux-generic/arch/aarch64/odp/api/abi/hash_crc32.h +++ b/platform/linux-generic/arch/aarch64/odp/api/abi/hash_crc32.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021 ARM Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 ARM Limited */ #ifndef ODP_API_ABI_HASH_CRC32_H_ diff --git a/platform/linux-generic/arch/aarch64/odp/api/abi/time_cpu.h b/platform/linux-generic/arch/aarch64/odp/api/abi/time_cpu.h index aba2799c7..29e92da2a 100644 --- a/platform/linux-generic/arch/aarch64/odp/api/abi/time_cpu.h +++ b/platform/linux-generic/arch/aarch64/odp/api/abi/time_cpu.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Nokia */ #ifndef ODP_API_ABI_TIME_CPU_H_ diff --git a/platform/linux-generic/arch/aarch64/odp/api/abi/time_inlines.h b/platform/linux-generic/arch/aarch64/odp/api/abi/time_inlines.h index 331d1996f..eed571027 100644 --- a/platform/linux-generic/arch/aarch64/odp/api/abi/time_inlines.h +++ b/platform/linux-generic/arch/aarch64/odp/api/abi/time_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia */ #include <odp/api/abi/time_cpu_inlines.h> diff --git a/platform/linux-generic/arch/aarch64/odp_atomic.c b/platform/linux-generic/arch/aarch64/odp_atomic.c index c6b809768..56604f7f0 100644 --- a/platform/linux-generic/arch/aarch64/odp_atomic.c +++ b/platform/linux-generic/arch/aarch64/odp_atomic.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2021, ARM Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2021 ARM Limited */ #include <odp/api/atomic.h> diff --git a/platform/linux-generic/arch/aarch64/odp_atomic.h b/platform/linux-generic/arch/aarch64/odp_atomic.h index d3b8ea4dc..5bbaa9ca8 100644 --- a/platform/linux-generic/arch/aarch64/odp_atomic.h +++ b/platform/linux-generic/arch/aarch64/odp_atomic.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2017-2021, ARM Limited - * Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2021 ARM Limited + * Copyright (c) 2017-2018 Linaro Limited */ #ifndef PLATFORM_LINUXGENERIC_ARCH_ARM_ODP_ATOMIC_H diff --git a/platform/linux-generic/arch/aarch64/odp_cpu.h b/platform/linux-generic/arch/aarch64/odp_cpu.h index ad8b36d87..cd15cda2d 100644 --- a/platform/linux-generic/arch/aarch64/odp_cpu.h +++ b/platform/linux-generic/arch/aarch64/odp_cpu.h @@ -1,9 +1,6 @@ -/* Copyright (c) 2017, ARM Limited. All rights reserved. - * - * Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2018 Linaro Limited */ #ifndef PLATFORM_LINUXGENERIC_ARCH_ARM_ODP_CPU_H diff --git a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c index 52936dacf..3d1d7bf40 100644 --- a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c +++ b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c @@ -1,9 +1,7 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2021, ARM Limited - * Copyright (c) 2022-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited + * Copyright (c) 2021 ARM Limited + * Copyright (c) 2022-2023 Nokia */ #include <odp_posix_extensions.h> diff --git a/platform/linux-generic/arch/aarch64/odp_random.h b/platform/linux-generic/arch/aarch64/odp_random.h index 023e6c455..1f6187c31 100644 --- a/platform/linux-generic/arch/aarch64/odp_random.h +++ b/platform/linux-generic/arch/aarch64/odp_random.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, ARM Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 ARM Limited */ #ifndef ODP_AARCH64_RANDOM_H_ diff --git a/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c b/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c index f242c845e..b1bbb0305 100644 --- a/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2020-2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2020-2021 Nokia */ #include <stdio.h> diff --git a/platform/linux-generic/arch/arm/odp/api/abi/cpu.h b/platform/linux-generic/arch/arm/odp/api/abi/cpu.h index 9224af9a0..ad93cc816 100644 --- a/platform/linux-generic/arch/arm/odp/api/abi/cpu.h +++ b/platform/linux-generic/arch/arm/odp/api/abi/cpu.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #ifndef ODP_API_ABI_CPU_H_ diff --git a/platform/linux-generic/arch/arm/odp/api/abi/cpu_inlines.h b/platform/linux-generic/arch/arm/odp/api/abi/cpu_inlines.h index bf44806a0..298953d95 100644 --- a/platform/linux-generic/arch/arm/odp/api/abi/cpu_inlines.h +++ b/platform/linux-generic/arch/arm/odp/api/abi/cpu_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #ifndef ODP_ARCH_CPU_INLINES_H_ diff --git a/platform/linux-generic/arch/arm/odp_cpu.h b/platform/linux-generic/arch/arm/odp_cpu.h index 6b2674736..f8af54800 100644 --- a/platform/linux-generic/arch/arm/odp_cpu.h +++ b/platform/linux-generic/arch/arm/odp_cpu.h @@ -1,9 +1,6 @@ -/* Copyright (c) 2017, ARM Limited. All rights reserved. - * - * Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2018 Linaro Limited */ #ifndef PLATFORM_LINUXGENERIC_ARCH_ARM_ODP_CPU_H diff --git a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c b/platform/linux-generic/arch/arm/odp_sysinfo_parse.c index 4cbe46d7c..57c17d8ee 100644 --- a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/arm/odp_sysinfo_parse.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2020, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2020 Nokia */ #include <odp_global_data.h> diff --git a/platform/linux-generic/arch/common/odp/api/abi/time_cpu_inlines.h b/platform/linux-generic/arch/common/odp/api/abi/time_cpu_inlines.h index 553114666..3b0808072 100644 --- a/platform/linux-generic/arch/common/odp/api/abi/time_cpu_inlines.h +++ b/platform/linux-generic/arch/common/odp/api/abi/time_cpu_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2020-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2020-2023 Nokia */ #ifndef ODP_ARCH_TIME_CPU_INLINES_H_ diff --git a/platform/linux-generic/arch/common/odp_time_cpu.c b/platform/linux-generic/arch/common/odp_time_cpu.c index 3c392de0c..6416f5575 100644 --- a/platform/linux-generic/arch/common/odp_time_cpu.c +++ b/platform/linux-generic/arch/common/odp_time_cpu.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2020-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2020-2023 Nokia */ #include <odp/api/time_types.h> diff --git a/platform/linux-generic/arch/default/odp/api/abi/atomic_generic.h b/platform/linux-generic/arch/default/odp/api/abi/atomic_generic.h index c6ed86363..b2029777c 100644 --- a/platform/linux-generic/arch/default/odp/api/abi/atomic_generic.h +++ b/platform/linux-generic/arch/default/odp/api/abi/atomic_generic.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2021, ARM Limited - * Copyright (c) 2021-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 ARM Limited + * Copyright (c) 2021-2022 Nokia */ #ifndef ODP_API_ABI_ATOMIC_GENERIC_H_ diff --git a/platform/linux-generic/arch/default/odp/api/abi/atomic_inlines.h b/platform/linux-generic/arch/default/odp/api/abi/atomic_inlines.h index f1072d11f..8da9b73d1 100644 --- a/platform/linux-generic/arch/default/odp/api/abi/atomic_inlines.h +++ b/platform/linux-generic/arch/default/odp/api/abi/atomic_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Nokia */ #include <odp/api/abi/atomic_generic.h> diff --git a/platform/linux-generic/arch/default/odp/api/abi/cpu.h b/platform/linux-generic/arch/default/odp/api/abi/cpu.h index e09efdfcf..402655dfc 100644 --- a/platform/linux-generic/arch/default/odp/api/abi/cpu.h +++ b/platform/linux-generic/arch/default/odp/api/abi/cpu.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #ifndef ODP_API_ABI_CPU_H_ diff --git a/platform/linux-generic/arch/default/odp/api/abi/cpu_generic.h b/platform/linux-generic/arch/default/odp/api/abi/cpu_generic.h index b75e65717..b2ba3972a 100644 --- a/platform/linux-generic/arch/default/odp/api/abi/cpu_generic.h +++ b/platform/linux-generic/arch/default/odp/api/abi/cpu_generic.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #ifndef ODP_API_ABI_CPU_GENERIC_H_ diff --git a/platform/linux-generic/arch/default/odp/api/abi/cpu_inlines.h b/platform/linux-generic/arch/default/odp/api/abi/cpu_inlines.h index 54aeae946..6a35e93eb 100644 --- a/platform/linux-generic/arch/default/odp/api/abi/cpu_inlines.h +++ b/platform/linux-generic/arch/default/odp/api/abi/cpu_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #ifndef ODP_ARCH_CPU_INLINES_H_ diff --git a/platform/linux-generic/arch/default/odp/api/abi/hash_crc32.h b/platform/linux-generic/arch/default/odp/api/abi/hash_crc32.h index 8759ed948..07da45621 100644 --- a/platform/linux-generic/arch/default/odp/api/abi/hash_crc32.h +++ b/platform/linux-generic/arch/default/odp/api/abi/hash_crc32.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Nokia */ #ifndef ODP_API_ABI_HASH_CRC32_H_ diff --git a/platform/linux-generic/arch/default/odp/api/abi/time_inlines.h b/platform/linux-generic/arch/default/odp/api/abi/time_inlines.h index ed0ffdb3f..6e592d7a8 100644 --- a/platform/linux-generic/arch/default/odp/api/abi/time_inlines.h +++ b/platform/linux-generic/arch/default/odp/api/abi/time_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2020-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2020-2023 Nokia */ #ifndef ODP_ARCH_TIME_INLINES_H_ diff --git a/platform/linux-generic/arch/default/odp_atomic.c b/platform/linux-generic/arch/default/odp_atomic.c index 36fc5e8ea..a2a3bd2f2 100644 --- a/platform/linux-generic/arch/default/odp_atomic.c +++ b/platform/linux-generic/arch/default/odp_atomic.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2021, ARM Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2021 ARM Limited */ #include <odp/api/atomic.h> diff --git a/platform/linux-generic/arch/default/odp_atomic.h b/platform/linux-generic/arch/default/odp_atomic.h index 4cfc6b4bd..eef88c7b3 100644 --- a/platform/linux-generic/arch/default/odp_atomic.h +++ b/platform/linux-generic/arch/default/odp_atomic.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, ARM Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 ARM Limited */ #ifndef ODP_DEFAULT_ATOMIC_H_ diff --git a/platform/linux-generic/arch/default/odp_cpu.h b/platform/linux-generic/arch/default/odp_cpu.h index 6b10966c6..e9d88c791 100644 --- a/platform/linux-generic/arch/default/odp_cpu.h +++ b/platform/linux-generic/arch/default/odp_cpu.h @@ -1,9 +1,6 @@ -/* Copyright (c) 2017, ARM Limited. All rights reserved. - * - * Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2018 Linaro Limited */ #ifndef ODP_DEFAULT_CPU_H_ diff --git a/platform/linux-generic/arch/default/odp_cpu_cycles.c b/platform/linux-generic/arch/default/odp_cpu_cycles.c index 41436a672..97c1da93c 100644 --- a/platform/linux-generic/arch/default/odp_cpu_cycles.c +++ b/platform/linux-generic/arch/default/odp_cpu_cycles.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #include <odp_posix_extensions.h> diff --git a/platform/linux-generic/arch/default/odp_hash_crc32.c b/platform/linux-generic/arch/default/odp_hash_crc32.c index f71c11909..c6956787f 100644 --- a/platform/linux-generic/arch/default/odp_hash_crc32.c +++ b/platform/linux-generic/arch/default/odp_hash_crc32.c @@ -1,40 +1,8 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/*- - * BSD LICENSE - * - * Copyright(c) 2010-2013 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright(c) 2010-2014 Intel Corporation + * - lib/hash/rte_crc_sw.h */ #include <odp/api/align.h> diff --git a/platform/linux-generic/arch/default/odp_random.c b/platform/linux-generic/arch/default/odp_random.c index 18d2a45d2..7c8b33c42 100644 --- a/platform/linux-generic/arch/default/odp_random.c +++ b/platform/linux-generic/arch/default/odp_random.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Nokia */ #include <odp_random.h> diff --git a/platform/linux-generic/arch/default/odp_random.h b/platform/linux-generic/arch/default/odp_random.h index 215eb6d93..7b6c5a2f3 100644 --- a/platform/linux-generic/arch/default/odp_random.h +++ b/platform/linux-generic/arch/default/odp_random.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Nokia */ #ifndef ODP_DEFAULT_RANDOM_H_ diff --git a/platform/linux-generic/arch/default/odp_sysinfo_parse.c b/platform/linux-generic/arch/default/odp_sysinfo_parse.c index 11d33d576..024bc8217 100644 --- a/platform/linux-generic/arch/default/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/default/odp_sysinfo_parse.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #include <odp_global_data.h> diff --git a/platform/linux-generic/arch/default/odp_time.c b/platform/linux-generic/arch/default/odp_time.c index 664a5deae..ec9da0896 100644 --- a/platform/linux-generic/arch/default/odp_time.c +++ b/platform/linux-generic/arch/default/odp_time.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2020-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2020-2023 Nokia */ #include <odp_posix_extensions.h> diff --git a/platform/linux-generic/arch/powerpc/odp/api/abi/cpu.h b/platform/linux-generic/arch/powerpc/odp/api/abi/cpu.h index ecf56e82e..dc128e1a8 100644 --- a/platform/linux-generic/arch/powerpc/odp/api/abi/cpu.h +++ b/platform/linux-generic/arch/powerpc/odp/api/abi/cpu.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #ifndef ODP_API_ABI_CPU_H_ diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c index 2049cc42f..519ca62ed 100644 --- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c @@ -1,11 +1,10 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #include <odp_global_data.h> #include <odp_sysinfo_internal.h> +#include <odp_string_internal.h> #include <string.h> int _odp_cpuinfo_parser(FILE *file, system_info_t *sysinfo) @@ -39,13 +38,9 @@ int _odp_cpuinfo_parser(FILE *file, system_info_t *sysinfo) pos = strstr(str, "cpu"); if (pos) { - int len; - pos = strchr(str, ':'); - strncpy(sysinfo->model_str[id], pos + 2, - MODEL_STR_SIZE - 1); - len = strlen(sysinfo->model_str[id]); - sysinfo->model_str[id][len - 1] = 0; + _odp_strcpy(sysinfo->model_str[id], pos + 2, + MODEL_STR_SIZE); model = 1; count--; } diff --git a/platform/linux-generic/arch/x86/cpu_flags.c b/platform/linux-generic/arch/x86/cpu_flags.c index 9211df002..124f1d184 100644 --- a/platform/linux-generic/arch/x86/cpu_flags.c +++ b/platform/linux-generic/arch/x86/cpu_flags.c @@ -1,12 +1,11 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - /* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited + * Copyright (c) 2023 Nokia + * * Copyright(c) 2010-2015 Intel Corporation + * - lib/eal/x86/include/rte_cpuflags.h + * - lib/eal/x86/rte_cpuflags.c + * - lib/eal/x86/rte_cpuid.h */ #include "cpu_flags.h" diff --git a/platform/linux-generic/arch/x86/cpu_flags.h b/platform/linux-generic/arch/x86/cpu_flags.h index 8d485dbfa..8f6be6813 100644 --- a/platform/linux-generic/arch/x86/cpu_flags.h +++ b/platform/linux-generic/arch/x86/cpu_flags.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #ifndef ODP_PLAT_CPU_FLAGS_H_ diff --git a/platform/linux-generic/arch/x86/odp/api/abi/cpu.h b/platform/linux-generic/arch/x86/odp/api/abi/cpu.h index 9224af9a0..ad93cc816 100644 --- a/platform/linux-generic/arch/x86/odp/api/abi/cpu.h +++ b/platform/linux-generic/arch/x86/odp/api/abi/cpu.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #ifndef ODP_API_ABI_CPU_H_ diff --git a/platform/linux-generic/arch/x86/odp/api/abi/cpu_inlines.h b/platform/linux-generic/arch/x86/odp/api/abi/cpu_inlines.h index 4b542a577..066945e7b 100644 --- a/platform/linux-generic/arch/x86/odp/api/abi/cpu_inlines.h +++ b/platform/linux-generic/arch/x86/odp/api/abi/cpu_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #ifndef ODP_ARCH_CPU_INLINES_H_ diff --git a/platform/linux-generic/arch/x86/odp/api/abi/cpu_rdtsc.h b/platform/linux-generic/arch/x86/odp/api/abi/cpu_rdtsc.h index ccc5f0f36..9e6d9f278 100644 --- a/platform/linux-generic/arch/x86/odp/api/abi/cpu_rdtsc.h +++ b/platform/linux-generic/arch/x86/odp/api/abi/cpu_rdtsc.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #ifndef ODP_ARCH_CPU_RDTSC_H_ diff --git a/platform/linux-generic/arch/x86/odp/api/abi/hash_crc32.h b/platform/linux-generic/arch/x86/odp/api/abi/hash_crc32.h index c2c71bcb7..576b68f20 100644 --- a/platform/linux-generic/arch/x86/odp/api/abi/hash_crc32.h +++ b/platform/linux-generic/arch/x86/odp/api/abi/hash_crc32.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Nokia */ #ifndef ODP_API_ABI_HASH_CRC32_H_ @@ -11,6 +9,7 @@ extern "C" { #endif +#include <odp/api/std_types.h> #include <stdint.h> uint32_t _odp_hash_crc32_generic(const void *data, uint32_t data_len, @@ -34,23 +33,23 @@ static inline uint32_t _odp_hash_crc32c(const void *data, uint32_t data_len, #ifdef __x86_64__ for (i = 0; i < data_len / 8; i++) { - init_val = (uint32_t)__builtin_ia32_crc32di(init_val, *(const uint64_t *)pd); + init_val = (uint32_t)__builtin_ia32_crc32di(init_val, *(const odp_una_u64_t *)pd); pd += 8; } if (data_len & 0x4) { - init_val = __builtin_ia32_crc32si(init_val, *(const uint32_t *)pd); + init_val = __builtin_ia32_crc32si(init_val, *(const odp_una_u32_t *)pd); pd += 4; } #else for (i = 0; i < data_len / 4; i++) { - init_val = __builtin_ia32_crc32si(init_val, *(const uint32_t *)pd); + init_val = __builtin_ia32_crc32si(init_val, *(const odp_una_u32_t *)pd); pd += 4; } #endif if (data_len & 0x2) { - init_val = __builtin_ia32_crc32hi(init_val, *(const uint16_t *)pd); + init_val = __builtin_ia32_crc32hi(init_val, *(const odp_una_u16_t *)pd); pd += 2; } diff --git a/platform/linux-generic/arch/x86/odp/api/abi/time_cpu.h b/platform/linux-generic/arch/x86/odp/api/abi/time_cpu.h index baf79ad3f..74b6eb740 100644 --- a/platform/linux-generic/arch/x86/odp/api/abi/time_cpu.h +++ b/platform/linux-generic/arch/x86/odp/api/abi/time_cpu.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #ifndef ODP_ARCH_TIME_CPU_H_ diff --git a/platform/linux-generic/arch/x86/odp/api/abi/time_inlines.h b/platform/linux-generic/arch/x86/odp/api/abi/time_inlines.h index 331d1996f..eed571027 100644 --- a/platform/linux-generic/arch/x86/odp/api/abi/time_inlines.h +++ b/platform/linux-generic/arch/x86/odp/api/abi/time_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia */ #include <odp/api/abi/time_cpu_inlines.h> diff --git a/platform/linux-generic/arch/x86/odp_cpu.h b/platform/linux-generic/arch/x86/odp_cpu.h index 8f8f22daf..2282285fc 100644 --- a/platform/linux-generic/arch/x86/odp_cpu.h +++ b/platform/linux-generic/arch/x86/odp_cpu.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Nokia */ #ifndef ODP_X86_CPU_H_ diff --git a/platform/linux-generic/arch/x86/odp_cpu_cycles.c b/platform/linux-generic/arch/x86/odp_cpu_cycles.c index 2624af0f6..4950f0bad 100644 --- a/platform/linux-generic/arch/x86/odp_cpu_cycles.c +++ b/platform/linux-generic/arch/x86/odp_cpu_cycles.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ #include <odp/api/cpu.h> diff --git a/platform/linux-generic/arch/x86/odp_random.h b/platform/linux-generic/arch/x86/odp_random.h index 54628038e..14551f47e 100644 --- a/platform/linux-generic/arch/x86/odp_random.h +++ b/platform/linux-generic/arch/x86/odp_random.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Nokia */ /* diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c index 3cbdb2037..0a5aedfcc 100644 --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c @@ -1,11 +1,10 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2023 Nokia */ #include <odp_sysinfo_internal.h> +#include <odp_string_internal.h> #include "cpu_flags.h" #include <string.h> @@ -49,8 +48,8 @@ int _odp_cpuinfo_parser(FILE *file, system_info_t *sysinfo) if (pos_end != NULL) *(pos_end - 1) = '\0'; - strncpy(sysinfo->model_str[id], pos + 2, - MODEL_STR_SIZE - 1); + _odp_strcpy(sysinfo->model_str[id], pos + 2, + MODEL_STR_SIZE); if (sysinfo->cpu_hz_max[id]) { freq_set = true; diff --git a/platform/linux-generic/doc/platform_specific.dox b/platform/linux-generic/doc/platform_specific.dox index be0486666..197e6de10 100644 --- a/platform/linux-generic/doc/platform_specific.dox +++ b/platform/linux-generic/doc/platform_specific.dox @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/dumpconfig/dumpconfig.c b/platform/linux-generic/dumpconfig/dumpconfig.c index a04f5c2dd..47ad48b70 100644 --- a/platform/linux-generic/dumpconfig/dumpconfig.c +++ b/platform/linux-generic/dumpconfig/dumpconfig.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #include <stdio.h> diff --git a/platform/linux-generic/example/ml/mnist.c b/platform/linux-generic/example/ml/mnist.c index 4c1066302..28720a3fd 100644 --- a/platform/linux-generic/example/ml/mnist.c +++ b/platform/linux-generic/example/ml/mnist.c @@ -56,8 +56,8 @@ static int read_digit_csv(const char *file_name, uint8_t *expected_digit, float size = ftell(digit_file); rewind(digit_file); - tmp = malloc(size); - memset(tmp, 0, size); + tmp = malloc(size + 1); + memset(tmp, 0, size + 1); num_elem = fread(tmp, size, 1, digit_file); fclose(digit_file); diff --git a/platform/linux-generic/example/ml/model_explorer.c b/platform/linux-generic/example/ml/model_explorer.c index bd449b032..408b96c03 100644 --- a/platform/linux-generic/example/ml/model_explorer.c +++ b/platform/linux-generic/example/ml/model_explorer.c @@ -73,6 +73,11 @@ int main(int argc, char *argv[]) odp_ml_model_print(ml_model); + if (odp_ml_model_destroy(ml_model)) { + printf("odp_ml_model_destroy failed.\n"); + ret = -1; + } + odp_term: if (odp_term_local()) { printf("Local term failed.\n"); diff --git a/platform/linux-generic/include-abi/odp/api/abi/align.h b/platform/linux-generic/include-abi/odp/api/abi/align.h index 7fa343078..aa8f2eab7 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/align.h +++ b/platform/linux-generic/include-abi/odp/api/abi/align.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/abi-default/align.h> diff --git a/platform/linux-generic/include-abi/odp/api/abi/atomic.h b/platform/linux-generic/include-abi/odp/api/abi/atomic.h index 4f481f913..cb5d6fcc9 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/atomic.h +++ b/platform/linux-generic/include-abi/odp/api/abi/atomic.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/barrier.h b/platform/linux-generic/include-abi/odp/api/abi/barrier.h index cff12c577..6e804ce31 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/barrier.h +++ b/platform/linux-generic/include-abi/odp/api/abi/barrier.h @@ -1,38 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ -/** - * @file - * - * ODP barrier - */ - -#ifndef ODP_ABI_BARRIER_H_ -#define ODP_ABI_BARRIER_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include <odp/api/std_types.h> -#include <odp/api/atomic.h> - -/** - * @internal - * ODP thread synchronization barrier - */ -struct odp_barrier_s { - uint32_t count; /**< Thread count */ - odp_atomic_u32_t bar; /**< Barrier counter */ -}; - -typedef struct odp_barrier_s odp_barrier_t; - -#ifdef __cplusplus -} -#endif - -#endif +#include <odp/api/abi-default/barrier.h> diff --git a/platform/linux-generic/include-abi/odp/api/abi/buffer.h b/platform/linux-generic/include-abi/odp/api/abi/buffer.h index a6309fe39..51759e974 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/buffer.h +++ b/platform/linux-generic/include-abi/odp/api/abi/buffer.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2023 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/buffer_types.h b/platform/linux-generic/include-abi/odp/api/abi/buffer_types.h index 63067268c..da7a6532d 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/buffer_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/buffer_types.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2023 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/byteorder.h b/platform/linux-generic/include-abi/odp/api/abi/byteorder.h index c0b5ebe0c..e9cebff02 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/byteorder.h +++ b/platform/linux-generic/include-abi/odp/api/abi/byteorder.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/classification.h b/platform/linux-generic/include-abi/odp/api/abi/classification.h index d63763dbd..e67f585ac 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/classification.h +++ b/platform/linux-generic/include-abi/odp/api/abi/classification.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/comp.h b/platform/linux-generic/include-abi/odp/api/abi/comp.h index 45681e961..590950aef 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/comp.h +++ b/platform/linux-generic/include-abi/odp/api/abi/comp.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #ifndef ODP_ABI_COMP_H_ diff --git a/platform/linux-generic/include-abi/odp/api/abi/cpumask.h b/platform/linux-generic/include-abi/odp/api/abi/cpumask.h index c64bf2a69..696f8664f 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/cpumask.h +++ b/platform/linux-generic/include-abi/odp/api/abi/cpumask.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/abi-default/cpumask.h> 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 bef725c28..3be9b138c 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/crypto.h +++ b/platform/linux-generic/include-abi/odp/api/abi/crypto.h @@ -1,11 +1,8 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2022 Nokia */ - /** * @file * diff --git a/platform/linux-generic/include-abi/odp/api/abi/crypto_types.h b/platform/linux-generic/include-abi/odp/api/abi/crypto_types.h index b1e4aa5ae..b37a78f86 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/crypto_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/crypto_types.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2022 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/debug.h b/platform/linux-generic/include-abi/odp/api/abi/debug.h index a3a86e64a..b82e2d171 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/debug.h +++ b/platform/linux-generic/include-abi/odp/api/abi/debug.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/dma.h b/platform/linux-generic/include-abi/odp/api/abi/dma.h index 60798143c..fb40d38c3 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/dma.h +++ b/platform/linux-generic/include-abi/odp/api/abi/dma.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/dma_types.h b/platform/linux-generic/include-abi/odp/api/abi/dma_types.h index d5bee0374..4ad113ddd 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/dma_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/dma_types.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Nokia */ #ifndef ODP_API_ABI_DMA_TYPES_H_ diff --git a/platform/linux-generic/include-abi/odp/api/abi/errno.h b/platform/linux-generic/include-abi/odp/api/abi/errno.h index 6215a0676..fdfd03e3a 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/errno.h +++ b/platform/linux-generic/include-abi/odp/api/abi/errno.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2020, Marvell - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2020 Marvell */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/event.h b/platform/linux-generic/include-abi/odp/api/abi/event.h index e059f318c..ca2901c87 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/event.h +++ b/platform/linux-generic/include-abi/odp/api/abi/event.h @@ -1,11 +1,8 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2022 Nokia */ - /** * @file * diff --git a/platform/linux-generic/include-abi/odp/api/abi/event_types.h b/platform/linux-generic/include-abi/odp/api/abi/event_types.h index 01ee66cd3..4beafa6b7 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/event_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/event_types.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2022-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2022-2023 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/hash.h b/platform/linux-generic/include-abi/odp/api/abi/hash.h index b132d7eb4..fe61a2111 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/hash.h +++ b/platform/linux-generic/include-abi/odp/api/abi/hash.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2020, Marvell - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2020 Marvell */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/init.h b/platform/linux-generic/include-abi/odp/api/abi/init.h index 7ad523fde..936644f46 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/init.h +++ b/platform/linux-generic/include-abi/odp/api/abi/init.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/abi-default/init.h> diff --git a/platform/linux-generic/include-abi/odp/api/abi/ipsec.h b/platform/linux-generic/include-abi/odp/api/abi/ipsec.h index 1817e5564..40ae34b17 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/ipsec.h +++ b/platform/linux-generic/include-abi/odp/api/abi/ipsec.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2022 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/ipsec_types.h b/platform/linux-generic/include-abi/odp/api/abi/ipsec_types.h index 1c5501997..50a859d3c 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/ipsec_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/ipsec_types.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2022 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/packet.h b/platform/linux-generic/include-abi/odp/api/abi/packet.h index 5703141d4..e3ada64a0 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/packet.h +++ b/platform/linux-generic/include-abi/odp/api/abi/packet.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2019, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2019 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/packet_flags.h b/platform/linux-generic/include-abi/odp/api/abi/packet_flags.h index 8e7b88ca2..22cae8e1b 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/packet_flags.h +++ b/platform/linux-generic/include-abi/odp/api/abi/packet_flags.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/packet_io.h b/platform/linux-generic/include-abi/odp/api/abi/packet_io.h index c7c7b2faa..d60d29d3c 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/packet_io.h +++ b/platform/linux-generic/include-abi/odp/api/abi/packet_io.h @@ -1,11 +1,8 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2020-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2020-2022 Nokia */ - /** * @file * diff --git a/platform/linux-generic/include-abi/odp/api/abi/packet_io_types.h b/platform/linux-generic/include-abi/odp/api/abi/packet_io_types.h index 76b162020..7d66e9da5 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/packet_io_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/packet_io_types.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2020-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2020-2023 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/packet_types.h b/platform/linux-generic/include-abi/odp/api/abi/packet_types.h index 90b2af107..7ffdec678 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/packet_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/packet_types.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2019-2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2019-2021 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/pool.h b/platform/linux-generic/include-abi/odp/api/abi/pool.h index d8a80197c..fd5cd04ec 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/pool.h +++ b/platform/linux-generic/include-abi/odp/api/abi/pool.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2022 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/pool_types.h b/platform/linux-generic/include-abi/odp/api/abi/pool_types.h index 77b0ff638..143a1c4ee 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/pool_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/pool_types.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/proto_stats.h b/platform/linux-generic/include-abi/odp/api/abi/proto_stats.h index d81035df2..f9399407d 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/proto_stats.h +++ b/platform/linux-generic/include-abi/odp/api/abi/proto_stats.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2021, Marvell - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Marvell + * Copyright (c) 2021 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/proto_stats_types.h b/platform/linux-generic/include-abi/odp/api/abi/proto_stats_types.h index d9db29188..0404ace05 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/proto_stats_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/proto_stats_types.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2021, Marvell - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Marvell + * Copyright (c) 2021 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/queue.h b/platform/linux-generic/include-abi/odp/api/abi/queue.h index 6c34123df..59cbe9bb6 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/queue.h +++ b/platform/linux-generic/include-abi/odp/api/abi/queue.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/queue_types.h b/platform/linux-generic/include-abi/odp/api/abi/queue_types.h index 4eff762bd..18ab36286 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/queue_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/queue_types.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2021 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/random.h b/platform/linux-generic/include-abi/odp/api/abi/random.h index 07714a47e..89745378b 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/random.h +++ b/platform/linux-generic/include-abi/odp/api/abi/random.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/rwlock.h b/platform/linux-generic/include-abi/odp/api/abi/rwlock.h index 78d7c1a4a..8194aa649 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/rwlock.h +++ b/platform/linux-generic/include-abi/odp/api/abi/rwlock.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/abi-default/rwlock.h> diff --git a/platform/linux-generic/include-abi/odp/api/abi/rwlock_recursive.h b/platform/linux-generic/include-abi/odp/api/abi/rwlock_recursive.h index ab7150605..fb9142332 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/rwlock_recursive.h +++ b/platform/linux-generic/include-abi/odp/api/abi/rwlock_recursive.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/abi-default/rwlock_recursive.h> diff --git a/platform/linux-generic/include-abi/odp/api/abi/schedule.h b/platform/linux-generic/include-abi/odp/api/abi/schedule.h index bb28886b0..c65aa6a22 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/schedule.h +++ b/platform/linux-generic/include-abi/odp/api/abi/schedule.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited + * Copyright (c) 2022 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/schedule_types.h b/platform/linux-generic/include-abi/odp/api/abi/schedule_types.h index d5164ff79..1b2990c2b 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/schedule_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/schedule_types.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/abi-default/schedule_types.h> diff --git a/platform/linux-generic/include-abi/odp/api/abi/shared_memory.h b/platform/linux-generic/include-abi/odp/api/abi/shared_memory.h index bfcb9ebe5..a7ef9c5a9 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/shared_memory.h +++ b/platform/linux-generic/include-abi/odp/api/abi/shared_memory.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ diff --git a/platform/linux-generic/include-abi/odp/api/abi/spinlock.h b/platform/linux-generic/include-abi/odp/api/abi/spinlock.h index d1e5fa1e9..22f093ab5 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/spinlock.h +++ b/platform/linux-generic/include-abi/odp/api/abi/spinlock.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/abi-default/spinlock.h> diff --git a/platform/linux-generic/include-abi/odp/api/abi/spinlock_recursive.h b/platform/linux-generic/include-abi/odp/api/abi/spinlock_recursive.h index cdcbae1b4..f7d2e5212 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/spinlock_recursive.h +++ b/platform/linux-generic/include-abi/odp/api/abi/spinlock_recursive.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/abi-default/spinlock_recursive.h> diff --git a/platform/linux-generic/include-abi/odp/api/abi/stash.h b/platform/linux-generic/include-abi/odp/api/abi/stash.h index 69bf989d6..f28f8ee96 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/stash.h +++ b/platform/linux-generic/include-abi/odp/api/abi/stash.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2020, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2020 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/stash_types.h b/platform/linux-generic/include-abi/odp/api/abi/stash_types.h index 2a4115886..140f5a2ef 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/stash_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/stash_types.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/std.h b/platform/linux-generic/include-abi/odp/api/abi/std.h index 201fca18e..639e730b4 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/std.h +++ b/platform/linux-generic/include-abi/odp/api/abi/std.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/std_types.h b/platform/linux-generic/include-abi/odp/api/abi/std_types.h index 594e6f9dd..c0d930e1f 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/std_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/std_types.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/abi-default/std_types.h> diff --git a/platform/linux-generic/include-abi/odp/api/abi/sync.h b/platform/linux-generic/include-abi/odp/api/abi/sync.h index 276514b58..b1053f478 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/sync.h +++ b/platform/linux-generic/include-abi/odp/api/abi/sync.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/thread.h b/platform/linux-generic/include-abi/odp/api/abi/thread.h index 14c074b95..31145dade 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/thread.h +++ b/platform/linux-generic/include-abi/odp/api/abi/thread.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ /* Inlined API functions */ diff --git a/platform/linux-generic/include-abi/odp/api/abi/thrmask.h b/platform/linux-generic/include-abi/odp/api/abi/thrmask.h index ab05cd83f..2bb61d233 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/thrmask.h +++ b/platform/linux-generic/include-abi/odp/api/abi/thrmask.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/abi-default/thrmask.h> diff --git a/platform/linux-generic/include-abi/odp/api/abi/ticketlock.h b/platform/linux-generic/include-abi/odp/api/abi/ticketlock.h index b621bea7e..1a9322264 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/ticketlock.h +++ b/platform/linux-generic/include-abi/odp/api/abi/ticketlock.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include-abi/odp/api/abi/time.h b/platform/linux-generic/include-abi/odp/api/abi/time.h index 62c7e2b67..d641ddda5 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/time.h +++ b/platform/linux-generic/include-abi/odp/api/abi/time.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ /* Inlined API functions */ diff --git a/platform/linux-generic/include-abi/odp/api/abi/time_types.h b/platform/linux-generic/include-abi/odp/api/abi/time_types.h index cba80f508..a415200a0 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/time_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/time_types.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia */ #include <odp/api/abi-default/time_types.h> diff --git a/platform/linux-generic/include-abi/odp/api/abi/timer.h b/platform/linux-generic/include-abi/odp/api/abi/timer.h index 0a3b3a9cc..f9209591f 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/timer.h +++ b/platform/linux-generic/include-abi/odp/api/abi/timer.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ /* Inlined functions for non-ABI compat mode */ diff --git a/platform/linux-generic/include-abi/odp/api/abi/timer_types.h b/platform/linux-generic/include-abi/odp/api/abi/timer_types.h index 6cfa37a36..efcf25fcc 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/timer_types.h +++ b/platform/linux-generic/include-abi/odp/api/abi/timer_types.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited */ diff --git a/platform/linux-generic/include-abi/odp/api/abi/traffic_mngr.h b/platform/linux-generic/include-abi/odp/api/abi/traffic_mngr.h index 0e6bc7982..9a457c370 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/traffic_mngr.h +++ b/platform/linux-generic/include-abi/odp/api/abi/traffic_mngr.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/abi-default/traffic_mngr.h> diff --git a/platform/linux-generic/include-abi/odp/api/abi/version.h b/platform/linux-generic/include-abi/odp/api/abi/version.h index 429d4f3fa..cf4b9a128 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/version.h +++ b/platform/linux-generic/include-abi/odp/api/abi/version.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/abi-default/version.h> diff --git a/platform/linux-generic/include/ishmphy_internal.h b/platform/linux-generic/include/ishmphy_internal.h index 3ed29f40a..f979825c5 100644 --- a/platform/linux-generic/include/ishmphy_internal.h +++ b/platform/linux-generic/include/ishmphy_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #ifndef _ISHMPHY_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp/api/plat/atomic_inlines.h b/platform/linux-generic/include/odp/api/plat/atomic_inlines.h index e47559102..fabf2eb04 100644 --- a/platform/linux-generic/include/odp/api/plat/atomic_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/atomic_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2021 Nokia */ /** diff --git a/platform/linux-generic/include/odp/api/plat/buffer_inline_types.h b/platform/linux-generic/include/odp/api/plat/buffer_inline_types.h index f64a176f5..3b0307cea 100644 --- a/platform/linux-generic/include/odp/api/plat/buffer_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/buffer_inline_types.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_BUFFER_INLINE_TYPES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/buffer_inlines.h b/platform/linux-generic/include/odp/api/plat/buffer_inlines.h index 75ef36cf3..4ef9687e7 100644 --- a/platform/linux-generic/include/odp/api/plat/buffer_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/buffer_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2019-2023 Nokia */ #ifndef ODP_PLAT_BUFFER_INLINES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h b/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h index 31d2f1db9..692c66c74 100644 --- a/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include/odp/api/plat/cpu_inlines.h b/platform/linux-generic/include/odp/api/plat/cpu_inlines.h index bb1b89154..556597441 100644 --- a/platform/linux-generic/include/odp/api/plat/cpu_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/cpu_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2021-2023 Nokia */ #ifndef ODP_PLAT_CPU_INLINES_H_ @@ -19,11 +17,21 @@ #ifndef _ODP_NO_INLINE /* Inline functions by default */ #define _ODP_INLINE static inline - #define odp_cpu_pause __odp_cpu_pause - #define odp_cpu_cycles __odp_cpu_cycles - #define odp_cpu_cycles_max __odp_cpu_cycles_max - #define odp_cpu_cycles_resolution __odp_cpu_cycles_resolution - #define odp_cpu_cycles_diff __odp_cpu_cycles_diff + #define odp_cpu_pause __odp_cpu_pause + #define odp_cpu_cycles __odp_cpu_cycles + #define odp_cpu_cycles_max __odp_cpu_cycles_max + #define odp_cpu_cycles_resolution __odp_cpu_cycles_resolution + #define odp_cpu_cycles_diff __odp_cpu_cycles_diff + #define odp_prefetch __odp_prefetch + #define odp_prefetch_l1 __odp_prefetch_l1 + #define odp_prefetch_l2 __odp_prefetch_l2 + #define odp_prefetch_l3 __odp_prefetch_l3 + #define odp_prefetch_store __odp_prefetch_store + #define odp_prefetch_store_l1 __odp_prefetch_store_l1 + #define odp_prefetch_store_l2 __odp_prefetch_store_l2 + #define odp_prefetch_store_l3 __odp_prefetch_store_l3 + #define odp_prefetch_strm_l1 __odp_prefetch_strm_l1 + #define odp_prefetch_store_strm_l1 __odp_prefetch_store_strm_l1 #else #define _ODP_INLINE #endif @@ -56,6 +64,62 @@ _ODP_INLINE uint64_t odp_cpu_cycles_diff(uint64_t c2, uint64_t c1) return c2 + (odp_cpu_cycles_max() - c1) + _odp_cpu_cycles_resolution(); } +_ODP_INLINE void odp_prefetch(const void *ptr) +{ + /* + * __builtin_prefetch (const void *addr, rw, locality) + * + * rw 0..1 (0: read, 1: write) + * locality 0..3 (0: don't leave to cache, 3: leave on all cache levels) + */ + __builtin_prefetch(ptr, 0, 3); +} + +_ODP_INLINE void odp_prefetch_l1(const void *ptr) +{ + __builtin_prefetch(ptr, 0, 3); +} + +_ODP_INLINE void odp_prefetch_l2(const void *ptr) +{ + __builtin_prefetch(ptr, 0, 2); +} + +_ODP_INLINE void odp_prefetch_l3(const void *ptr) +{ + __builtin_prefetch(ptr, 0, 1); +} + +_ODP_INLINE void odp_prefetch_store(const void *ptr) +{ + __builtin_prefetch(ptr, 1, 3); +} + +_ODP_INLINE void odp_prefetch_store_l1(const void *ptr) +{ + __builtin_prefetch(ptr, 1, 3); +} + +_ODP_INLINE void odp_prefetch_store_l2(const void *ptr) +{ + __builtin_prefetch(ptr, 1, 2); +} + +_ODP_INLINE void odp_prefetch_store_l3(const void *ptr) +{ + __builtin_prefetch(ptr, 1, 1); +} + +_ODP_INLINE void odp_prefetch_strm_l1(const void *ptr) +{ + __builtin_prefetch(ptr, 0, 0); +} + +_ODP_INLINE void odp_prefetch_store_strm_l1(const void *ptr) +{ + __builtin_prefetch(ptr, 1, 0); +} + /** @endcond */ #endif diff --git a/platform/linux-generic/include/odp/api/plat/crypto_inlines.h b/platform/linux-generic/include/odp/api/plat/crypto_inlines.h index f350edfea..c8b6ae5ba 100644 --- a/platform/linux-generic/include/odp/api/plat/crypto_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/crypto_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_CRYPTO_INLINES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/debug_inlines.h b/platform/linux-generic/include/odp/api/plat/debug_inlines.h index 0755b1fda..8502cb05e 100644 --- a/platform/linux-generic/include/odp/api/plat/debug_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/debug_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2020-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited + * Copyright (c) 2020-2023 Nokia */ /** diff --git a/platform/linux-generic/include/odp/api/plat/dma_inlines.h b/platform/linux-generic/include/odp/api/plat/dma_inlines.h index 84b5fef5b..da3b25c0d 100644 --- a/platform/linux-generic/include/odp/api/plat/dma_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/dma_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia */ #ifndef ODP_PLAT_DMA_INLINES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/event_inline_types.h b/platform/linux-generic/include/odp/api/plat/event_inline_types.h index cbf01588f..641b2a290 100644 --- a/platform/linux-generic/include/odp/api/plat/event_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/event_inline_types.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_EVENT_INLINE_TYPES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/event_inlines.h b/platform/linux-generic/include/odp/api/plat/event_inlines.h index 990575166..0bff84aef 100644 --- a/platform/linux-generic/include/odp/api/plat/event_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/event_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2022-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2022-2024 Nokia */ #ifndef ODP_PLAT_EVENT_INLINES_H_ @@ -31,6 +29,7 @@ #define odp_event_pool __odp_event_pool #define odp_event_user_area __odp_event_user_area #define odp_event_user_area_and_flag __odp_event_user_area_and_flag + #define odp_event_user_flag_set __odp_event_user_flag_set #define odp_event_subtype __odp_event_subtype #define odp_event_types __odp_event_types #define odp_event_types_multi __odp_event_types_multi @@ -154,6 +153,34 @@ _ODP_INLINE void *odp_event_user_area_and_flag(odp_event_t event, int *flag) } } +_ODP_INLINE void odp_event_user_flag_set(odp_event_t event, int val) +{ + const odp_event_type_t type = __odp_event_type_get(event); + + switch (type) { + case ODP_EVENT_PACKET: + { + odp_packet_t pkt = (odp_packet_t)event; + _odp_packet_flags_t *flags = _odp_pkt_get_ptr(pkt, _odp_packet_flags_t, flags); + + flags->user_flag = !!val; + return; + } + case ODP_EVENT_PACKET_VECTOR: + { + odp_packet_vector_t pktv = (odp_packet_vector_t)event; + _odp_event_vector_flags_t *flags = + _odp_event_vect_get_ptr(pktv, _odp_event_vector_flags_t, flags); + + flags->user_flag = !!val; + return; + } + default: + /* Nothing to do */ + return; + } +} + _ODP_INLINE odp_event_subtype_t odp_event_subtype(odp_event_t event) { return __odp_event_subtype_get(event); diff --git a/platform/linux-generic/include/odp/api/plat/event_validation_external.h b/platform/linux-generic/include/odp/api/plat/event_validation_external.h index 7f5c0364f..05d98bcf2 100644 --- a/platform/linux-generic/include/odp/api/plat/event_validation_external.h +++ b/platform/linux-generic/include/odp/api/plat/event_validation_external.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia */ /** diff --git a/platform/linux-generic/include/odp/api/plat/event_vector_inline_types.h b/platform/linux-generic/include/odp/api/plat/event_vector_inline_types.h index 773f5171c..7b956be5d 100644 --- a/platform/linux-generic/include/odp/api/plat/event_vector_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/event_vector_inline_types.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2020, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2020 Nokia */ #ifndef ODP_PLAT_EVENT_VECTOR_INLINE_TYPES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/hash_inlines.h b/platform/linux-generic/include/odp/api/plat/hash_inlines.h index b38a34d53..db781597f 100644 --- a/platform/linux-generic/include/odp/api/plat/hash_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/hash_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Nokia */ #ifndef ODP_PLAT_HASH_INLINES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/ipsec_inlines.h b/platform/linux-generic/include/odp/api/plat/ipsec_inlines.h index 1d1f6ec61..924708371 100644 --- a/platform/linux-generic/include/odp/api/plat/ipsec_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/ipsec_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_IPSEC_INLINES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/packet_flag_inlines.h b/platform/linux-generic/include/odp/api/plat/packet_flag_inlines.h index 9330d89f8..00ca1e694 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_flag_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/packet_flag_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited + * Copyright (c) 2022 Nokia */ /** diff --git a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h index 691965624..e819c48a3 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2019-2022 Nokia */ diff --git a/platform/linux-generic/include/odp/api/plat/packet_inlines.h b/platform/linux-generic/include/odp/api/plat/packet_inlines.h index 2dd74fa29..ff79013e6 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited + * Copyright (c) 2019-2022 Nokia */ /** @@ -14,6 +12,7 @@ #ifndef _ODP_PLAT_PACKET_INLINES_H_ #define _ODP_PLAT_PACKET_INLINES_H_ +#include <odp/api/cpu.h> #include <odp/api/event.h> #include <odp/api/hints.h> #include <odp/api/packet_types.h> diff --git a/platform/linux-generic/include/odp/api/plat/packet_io_inlines.h b/platform/linux-generic/include/odp/api/plat/packet_io_inlines.h index a3d1d0d61..5c7a815b5 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_io_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/packet_io_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018-2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_PACKET_IO_INLINES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/packet_vector_inlines.h b/platform/linux-generic/include/odp/api/plat/packet_vector_inlines.h index 2f8e0a709..9aa15ae60 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_vector_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/packet_vector_inlines.h @@ -1,8 +1,5 @@ -/* Copyright (c) 2020-2022, Nokia - * - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2020-2022 Nokia */ /** diff --git a/platform/linux-generic/include/odp/api/plat/pool_inline_types.h b/platform/linux-generic/include/odp/api/plat/pool_inline_types.h index fbff7eda7..b1c078c6a 100644 --- a/platform/linux-generic/include/odp/api/plat/pool_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/pool_inline_types.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include/odp/api/plat/pool_inlines.h b/platform/linux-generic/include/odp/api/plat/pool_inlines.h index 58d66fad2..9b206b9f7 100644 --- a/platform/linux-generic/include/odp/api/plat/pool_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/pool_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_POOL_INLINES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/queue_inline_types.h b/platform/linux-generic/include/odp/api/plat/queue_inline_types.h index 593942072..c224ae092 100644 --- a/platform/linux-generic/include/odp/api/plat/queue_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/queue_inline_types.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2023 Nokia */ #ifndef ODP_PLAT_QUEUE_INLINE_TYPES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/queue_inlines.h b/platform/linux-generic/include/odp/api/plat/queue_inlines.h index 609c0c9e4..1c8d369c3 100644 --- a/platform/linux-generic/include/odp/api/plat/queue_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/queue_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2023 Nokia */ #ifndef ODP_PLAT_QUEUE_INLINES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/rwlock_inlines.h b/platform/linux-generic/include/odp/api/plat/rwlock_inlines.h index 0bb9d8c6e..7df3727dd 100644 --- a/platform/linux-generic/include/odp/api/plat/rwlock_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/rwlock_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_RWLOCK_INLINES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/rwlock_recursive_inlines.h b/platform/linux-generic/include/odp/api/plat/rwlock_recursive_inlines.h index 21ad4be4a..ab9a03e21 100644 --- a/platform/linux-generic/include/odp/api/plat/rwlock_recursive_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/rwlock_recursive_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_RWLOCK_RECURSIVE_INLINES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/schedule_inline_types.h b/platform/linux-generic/include/odp/api/plat/schedule_inline_types.h index 92089c9a0..17bad6488 100644 --- a/platform/linux-generic/include/odp/api/plat/schedule_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/schedule_inline_types.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_SCHEDULE_INLINE_TYPES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/schedule_inlines.h b/platform/linux-generic/include/odp/api/plat/schedule_inlines.h index 733b068d9..2162bd8e6 100644 --- a/platform/linux-generic/include/odp/api/plat/schedule_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/schedule_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_SCHEDULE_INLINES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/spinlock_inlines.h b/platform/linux-generic/include/odp/api/plat/spinlock_inlines.h index a04c43f88..6a07350de 100644 --- a/platform/linux-generic/include/odp/api/plat/spinlock_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/spinlock_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_SPINLOCK_INLINES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/spinlock_recursive_inlines.h b/platform/linux-generic/include/odp/api/plat/spinlock_recursive_inlines.h index e795353f4..04d3ee11d 100644 --- a/platform/linux-generic/include/odp/api/plat/spinlock_recursive_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/spinlock_recursive_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_SPINLOCK_RECURSIVE_INLINES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/std_inlines.h b/platform/linux-generic/include/odp/api/plat/std_inlines.h index 3f6a7e9d4..0e875258b 100644 --- a/platform/linux-generic/include/odp/api/plat/std_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/std_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #ifndef ODP_PLAT_STD_INLINE_H_ diff --git a/platform/linux-generic/include/odp/api/plat/strong_types.h b/platform/linux-generic/include/odp/api/plat/strong_types.h index 6b61c7c27..3866c8080 100644 --- a/platform/linux-generic/include/odp/api/plat/strong_types.h +++ b/platform/linux-generic/include/odp/api/plat/strong_types.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ diff --git a/platform/linux-generic/include/odp/api/plat/thread_inline_types.h b/platform/linux-generic/include/odp/api/plat/thread_inline_types.h index d24263fa7..e594a37ff 100644 --- a/platform/linux-generic/include/odp/api/plat/thread_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/thread_inline_types.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018-2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_THREAD_INLINE_TYPES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/thread_inlines.h b/platform/linux-generic/include/odp/api/plat/thread_inlines.h index 2b6957064..be8ee9725 100644 --- a/platform/linux-generic/include/odp/api/plat/thread_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/thread_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #ifndef ODP_PLAT_THREAD_INLINES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h index b596d1609..24eddf195 100644 --- a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #ifndef _ODP_PLAT_TICKETLOCK_INLINES_H_ 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 8ead06f7b..d7295c9d0 100644 --- a/platform/linux-generic/include/odp/api/plat/time_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/time_inlines.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2020-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2020-2023 Nokia */ #ifndef ODP_PLAT_TIME_INLINES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/timer_inline_types.h b/platform/linux-generic/include/odp/api/plat/timer_inline_types.h index 330cbe4ce..a89660bc2 100644 --- a/platform/linux-generic/include/odp/api/plat/timer_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/timer_inline_types.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #ifndef ODP_PLAT_TIMER_INLINE_TYPES_H_ diff --git a/platform/linux-generic/include/odp/api/plat/timer_inlines.h b/platform/linux-generic/include/odp/api/plat/timer_inlines.h index d2982079f..c5ba380e5 100644 --- a/platform/linux-generic/include/odp/api/plat/timer_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/timer_inlines.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2022-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022-2023 Nokia */ #ifndef ODP_PLAT_TIMER_INLINES_H_ diff --git a/platform/linux-generic/include/odp_atomic_internal.h b/platform/linux-generic/include/odp_atomic_internal.h index 6de8cd485..3e6c45a27 100644 --- a/platform/linux-generic/include/odp_atomic_internal.h +++ b/platform/linux-generic/include/odp_atomic_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include/odp_bitset.h b/platform/linux-generic/include/odp_bitset.h index e55b9ef1a..92212330b 100644 --- a/platform/linux-generic/include/odp_bitset.h +++ b/platform/linux-generic/include/odp_bitset.h @@ -1,9 +1,6 @@ -/* Copyright (c) 2017, ARM Limited. All rights reserved. - * - * Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2018 Linaro Limited */ #ifndef _ODP_BITSET_H_ diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index 676b9f116..66b2a454c 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2021 Nokia */ /** diff --git a/platform/linux-generic/include/odp_chksum_internal.h b/platform/linux-generic/include/odp_chksum_internal.h index e589ecb94..04f79771c 100644 --- a/platform/linux-generic/include/odp_chksum_internal.h +++ b/platform/linux-generic/include/odp_chksum_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2020, 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2020-2023 Nokia */ #ifndef ODP_CHKSUM_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_classification_datamodel.h b/platform/linux-generic/include/odp_classification_datamodel.h index c042a5308..1da4ed1f7 100644 --- a/platform/linux-generic/include/odp_classification_datamodel.h +++ b/platform/linux-generic/include/odp_classification_datamodel.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include/odp_classification_internal.h b/platform/linux-generic/include/odp_classification_internal.h index 7841e64fb..4223af1b4 100644 --- a/platform/linux-generic/include/odp_classification_internal.h +++ b/platform/linux-generic/include/odp_classification_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited + * Copyright (c) 2021-2023 Nokia */ /** diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h index 89d89936c..c7147acaf 100644 --- a/platform/linux-generic/include/odp_config_internal.h +++ b/platform/linux-generic/include/odp_config_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2019-2023 Nokia */ #ifndef ODP_CONFIG_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_debug_internal.h b/platform/linux-generic/include/odp_debug_internal.h index d1fc0d0ba..456612aab 100644 --- a/platform/linux-generic/include/odp_debug_internal.h +++ b/platform/linux-generic/include/odp_debug_internal.h @@ -1,9 +1,8 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2020-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited + * Copyright (c) 2020-2022 Nokia */ + /** * @file * diff --git a/platform/linux-generic/include/odp_errno_define.h b/platform/linux-generic/include/odp_errno_define.h index 3f97618b0..7303c70c7 100644 --- a/platform/linux-generic/include/odp_errno_define.h +++ b/platform/linux-generic/include/odp_errno_define.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include/odp_ethtool_rss.h b/platform/linux-generic/include/odp_ethtool_rss.h index 66221aa51..2dfb30a3b 100644 --- a/platform/linux-generic/include/odp_ethtool_rss.h +++ b/platform/linux-generic/include/odp_ethtool_rss.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #ifndef ODP_ETHTOOL_RSS_H_ diff --git a/platform/linux-generic/include/odp_ethtool_stats.h b/platform/linux-generic/include/odp_ethtool_stats.h index 2888d1c81..d3de8ce88 100644 --- a/platform/linux-generic/include/odp_ethtool_stats.h +++ b/platform/linux-generic/include/odp_ethtool_stats.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #ifndef ODP_ETHTOOL_H_ diff --git a/platform/linux-generic/include/odp_event_internal.h b/platform/linux-generic/include/odp_event_internal.h index 1b85d64fc..33e6fa927 100644 --- a/platform/linux-generic/include/odp_event_internal.h +++ b/platform/linux-generic/include/odp_event_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021-2022 Nokia */ /** diff --git a/platform/linux-generic/include/odp_event_validation_internal.h b/platform/linux-generic/include/odp_event_validation_internal.h index f4ac16f31..06be79e7a 100644 --- a/platform/linux-generic/include/odp_event_validation_internal.h +++ b/platform/linux-generic/include/odp_event_validation_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia */ #ifndef ODP_EVENT_VALIDATION_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_event_vector_internal.h b/platform/linux-generic/include/odp_event_vector_internal.h index 39f9daf04..eab64dc9d 100644 --- a/platform/linux-generic/include/odp_event_vector_internal.h +++ b/platform/linux-generic/include/odp_event_vector_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2020-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2020-2023 Nokia */ /** diff --git a/platform/linux-generic/include/odp_fdserver_internal.h b/platform/linux-generic/include/odp_fdserver_internal.h index 0b0a9bb0e..8637b53be 100644 --- a/platform/linux-generic/include/odp_fdserver_internal.h +++ b/platform/linux-generic/include/odp_fdserver_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #ifndef _FD_SERVER_INTERNAL_H diff --git a/platform/linux-generic/include/odp_forward_typedefs_internal.h b/platform/linux-generic/include/odp_forward_typedefs_internal.h index 350ad6a36..9212281fe 100644 --- a/platform/linux-generic/include/odp_forward_typedefs_internal.h +++ b/platform/linux-generic/include/odp_forward_typedefs_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include/odp_global_data.h b/platform/linux-generic/include/odp_global_data.h index 2a87192df..e532cf0e7 100644 --- a/platform/linux-generic/include/odp_global_data.h +++ b/platform/linux-generic/include/odp_global_data.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2023 Nokia */ #ifndef ODP_GLOBAL_DATA_H_ diff --git a/platform/linux-generic/include/odp_init_internal.h b/platform/linux-generic/include/odp_init_internal.h index ca5d68c87..4ee80114a 100644 --- a/platform/linux-generic/include/odp_init_internal.h +++ b/platform/linux-generic/include/odp_init_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited */ #ifndef ODP_INIT_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_ipsec_internal.h b/platform/linux-generic/include/odp_ipsec_internal.h index b97aa7031..030cb6bf3 100644 --- a/platform/linux-generic/include/odp_ipsec_internal.h +++ b/platform/linux-generic/include/odp_ipsec_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * Copyright (c) 2018, 2020-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited + * Copyright (c) 2018-2022 Nokia */ /** diff --git a/platform/linux-generic/include/odp_ishmphy_internal.h b/platform/linux-generic/include/odp_ishmphy_internal.h index 2bc9911ce..89178bd4e 100644 --- a/platform/linux-generic/include/odp_ishmphy_internal.h +++ b/platform/linux-generic/include/odp_ishmphy_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #ifndef _ISHMPHY_INTERNAL_H diff --git a/platform/linux-generic/include/odp_ishmpool_internal.h b/platform/linux-generic/include/odp_ishmpool_internal.h index d5a0ccd47..4c1e071f5 100644 --- a/platform/linux-generic/include/odp_ishmpool_internal.h +++ b/platform/linux-generic/include/odp_ishmpool_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #ifndef ODP_ISHMBUDDY_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_libconfig_internal.h b/platform/linux-generic/include/odp_libconfig_internal.h index 3f051547b..98320d823 100644 --- a/platform/linux-generic/include/odp_libconfig_internal.h +++ b/platform/linux-generic/include/odp_libconfig_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include/odp_llqueue.h b/platform/linux-generic/include/odp_llqueue.h index 29810ebf3..40e2b2dda 100644 --- a/platform/linux-generic/include/odp_llqueue.h +++ b/platform/linux-generic/include/odp_llqueue.h @@ -1,9 +1,6 @@ -/* Copyright (c) 2017, ARM Limited. All rights reserved. - * - * Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2018 Linaro Limited */ #ifndef ODP_LLQUEUE_H_ diff --git a/platform/linux-generic/include/odp_macros_internal.h b/platform/linux-generic/include/odp_macros_internal.h index 047e550f9..88251d627 100644 --- a/platform/linux-generic/include/odp_macros_internal.h +++ b/platform/linux-generic/include/odp_macros_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2022-2024, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited + * Copyright (c) 2022-2024 Nokia */ /** diff --git a/platform/linux-generic/include/odp_name_table_internal.h b/platform/linux-generic/include/odp_name_table_internal.h index 9101acfa8..4d329c907 100644 --- a/platform/linux-generic/include/odp_name_table_internal.h +++ b/platform/linux-generic/include/odp_name_table_internal.h @@ -1,9 +1,6 @@ -/* Copyright 2015 EZchip Semiconductor Ltd. All Rights Reserved. - * - * Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015 EZchip Semiconductor Ltd. + * Copyright (c) 2015-2018 Linaro Limited */ #ifndef ODP_INT_NAME_TABLE_H_ @@ -13,6 +10,7 @@ extern "C" { #endif +#include <odp/api/traffic_mngr.h> #include <stdint.h> typedef enum { @@ -34,7 +32,7 @@ typedef enum { typedef uint32_t _odp_int_name_t; #define ODP_INVALID_NAME 0 -#define _ODP_INT_NAME_LEN 32 +#define _ODP_INT_NAME_LEN (ODP_TM_NAME_LEN - 1) _odp_int_name_t _odp_int_name_tbl_add(const char *name, uint8_t name_kind, diff --git a/platform/linux-generic/include/odp_packet_dpdk.h b/platform/linux-generic/include/odp_packet_dpdk.h index 23b1677a5..d40cf7d95 100644 --- a/platform/linux-generic/include/odp_packet_dpdk.h +++ b/platform/linux-generic/include/odp_packet_dpdk.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2019-2022 Nokia */ #ifndef ODP_PACKET_DPDK_H diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 0b03aa211..60b49a89b 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2022 Nokia */ /** @@ -219,6 +217,25 @@ static inline void packet_subtype_set(odp_packet_t pkt, int subtype) } /** + * Reset packet metadata + */ +static inline void _odp_packet_reset_md(odp_packet_hdr_t *pkt_hdr) +{ + /* Clear all flags. Resets also return value of cls_mark, user_ptr, etc. */ + pkt_hdr->p.input_flags.all = 0; + pkt_hdr->p.flags.all_flags = 0; + + pkt_hdr->p.l2_offset = 0; + pkt_hdr->p.l3_offset = ODP_PACKET_OFFSET_INVALID; + pkt_hdr->p.l4_offset = ODP_PACKET_OFFSET_INVALID; + + if (odp_unlikely(pkt_hdr->event_hdr.subtype != ODP_EVENT_PACKET_BASIC)) + pkt_hdr->event_hdr.subtype = ODP_EVENT_PACKET_BASIC; + + pkt_hdr->input = ODP_PKTIO_INVALID; +} + +/** * Initialize packet */ static inline void packet_init(odp_packet_hdr_t *pkt_hdr, uint32_t len) @@ -240,14 +257,6 @@ static inline void packet_init(odp_packet_hdr_t *pkt_hdr, uint32_t len) last->seg_len = seg_len; } - /* Clear all flags. Resets also return value of cls_mark, user_ptr, etc. */ - pkt_hdr->p.input_flags.all = 0; - pkt_hdr->p.flags.all_flags = 0; - - pkt_hdr->p.l2_offset = 0; - pkt_hdr->p.l3_offset = ODP_PACKET_OFFSET_INVALID; - pkt_hdr->p.l4_offset = ODP_PACKET_OFFSET_INVALID; - /* * Packet headroom is set from the pool's headroom * Packet tailroom is rounded up to fill the last @@ -257,10 +266,7 @@ static inline void packet_init(odp_packet_hdr_t *pkt_hdr, uint32_t len) pkt_hdr->headroom = pool->headroom; pkt_hdr->tailroom = pool->seg_len - seg_len + pool->tailroom; - if (odp_unlikely(pkt_hdr->event_hdr.subtype != ODP_EVENT_PACKET_BASIC)) - pkt_hdr->event_hdr.subtype = ODP_EVENT_PACKET_BASIC; - - pkt_hdr->input = ODP_PKTIO_INVALID; + _odp_packet_reset_md(pkt_hdr); } /** diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 6c8a2305b..d8fb77c74 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2023 Nokia */ /** diff --git a/platform/linux-generic/include/odp_packet_io_stats.h b/platform/linux-generic/include/odp_packet_io_stats.h index c1b37fb29..b86e7b845 100644 --- a/platform/linux-generic/include/odp_packet_io_stats.h +++ b/platform/linux-generic/include/odp_packet_io_stats.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #ifndef ODP_PACKET_IO_STATS_H_ diff --git a/platform/linux-generic/include/odp_packet_io_stats_common.h b/platform/linux-generic/include/odp_packet_io_stats_common.h index 19bd7c448..7e7ef9723 100644 --- a/platform/linux-generic/include/odp_packet_io_stats_common.h +++ b/platform/linux-generic/include/odp_packet_io_stats_common.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #ifndef ODP_PACKET_IO_STATS_COMMON_H_ diff --git a/platform/linux-generic/include/odp_parse_internal.h b/platform/linux-generic/include/odp_parse_internal.h index 8b3fb480b..28a401c25 100644 --- a/platform/linux-generic/include/odp_parse_internal.h +++ b/platform/linux-generic/include/odp_parse_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2022 Nokia */ #ifndef ODP_PARSE_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_pcapng.h b/platform/linux-generic/include/odp_pcapng.h index 6f2a3dda5..1afe96867 100644 --- a/platform/linux-generic/include/odp_pcapng.h +++ b/platform/linux-generic/include/odp_pcapng.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2019, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2019 Nokia */ #ifndef ODP_PCAPNG_H_ diff --git a/platform/linux-generic/include/odp_pkt_queue_internal.h b/platform/linux-generic/include/odp_pkt_queue_internal.h index 03e5b575e..3c6ac7230 100644 --- a/platform/linux-generic/include/odp_pkt_queue_internal.h +++ b/platform/linux-generic/include/odp_pkt_queue_internal.h @@ -1,9 +1,6 @@ -/* Copyright 2015 EZchip Semiconductor Ltd. All Rights Reserved. - * - * Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015 EZchip Semiconductor Ltd. + * Copyright (c) 2015-2018 Linaro Limited */ #ifndef _ODP_INT_PKT_QUEUE_H_ diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h index 2c33bb4a2..b98e7e334 100644 --- a/platform/linux-generic/include/odp_pool_internal.h +++ b/platform/linux-generic/include/odp_pool_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2022 Nokia */ /** diff --git a/platform/linux-generic/include/odp_posix_extensions.h b/platform/linux-generic/include/odp_posix_extensions.h index 93c8fdb6c..cda257d1d 100644 --- a/platform/linux-generic/include/odp_posix_extensions.h +++ b/platform/linux-generic/include/odp_posix_extensions.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #ifndef ODP_POSIX_EXTENSIONS_H diff --git a/platform/linux-generic/include/odp_print_internal.h b/platform/linux-generic/include/odp_print_internal.h deleted file mode 100644 index 949a1cc70..000000000 --- a/platform/linux-generic/include/odp_print_internal.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ODP_PRINT_INTERNAL_H_ -#define ODP_PRINT_INTERNAL_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include <stddef.h> - -int _odp_snprint(char *str, size_t size, const char *format, ...); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/odp_queue_basic_internal.h b/platform/linux-generic/include/odp_queue_basic_internal.h index 3cdcf8600..e6edec1cd 100644 --- a/platform/linux-generic/include/odp_queue_basic_internal.h +++ b/platform/linux-generic/include/odp_queue_basic_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2023 Nokia */ #ifndef ODP_QUEUE_BASIC_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_queue_if.h b/platform/linux-generic/include/odp_queue_if.h index ed4ec4e61..48be24b0a 100644 --- a/platform/linux-generic/include/odp_queue_if.h +++ b/platform/linux-generic/include/odp_queue_if.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2017, ARM Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017 ARM Limited + * Copyright (c) 2021 Nokia */ #ifndef ODP_QUEUE_IF_H_ diff --git a/platform/linux-generic/include/odp_queue_lf.h b/platform/linux-generic/include/odp_queue_lf.h index 9419812cf..f58327520 100644 --- a/platform/linux-generic/include/odp_queue_lf.h +++ b/platform/linux-generic/include/odp_queue_lf.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #ifndef ODP_QUEUE_LF_H_ diff --git a/platform/linux-generic/include/odp_queue_scalable_internal.h b/platform/linux-generic/include/odp_queue_scalable_internal.h index dccc2aef9..7ba668f5f 100644 --- a/platform/linux-generic/include/odp_queue_scalable_internal.h +++ b/platform/linux-generic/include/odp_queue_scalable_internal.h @@ -1,9 +1,6 @@ -/* Copyright (c) 2017, ARM Limited. All rights reserved. - * - * Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2018 Linaro Limited */ #ifndef ODP_QUEUE_SCALABLE_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_random_openssl_internal.h b/platform/linux-generic/include/odp_random_openssl_internal.h index 5cb9006d1..fb4b78e81 100644 --- a/platform/linux-generic/include/odp_random_openssl_internal.h +++ b/platform/linux-generic/include/odp_random_openssl_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2020, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2020 Nokia */ #ifndef ODP_RANDOM_OPENSSL_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_random_std_internal.h b/platform/linux-generic/include/odp_random_std_internal.h index fb350fd22..22583089c 100644 --- a/platform/linux-generic/include/odp_random_std_internal.h +++ b/platform/linux-generic/include/odp_random_std_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2020, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2020 Nokia */ #ifndef ODP_RANDOM_STD_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_ring_common.h b/platform/linux-generic/include/odp_ring_common.h index a2d9e4be5..7c28abde8 100644 --- a/platform/linux-generic/include/odp_ring_common.h +++ b/platform/linux-generic/include/odp_ring_common.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2019-2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2019-2021 Nokia */ #ifndef ODP_RING_COMMON_H_ diff --git a/platform/linux-generic/include/odp_ring_internal.h b/platform/linux-generic/include/odp_ring_internal.h index 296a87116..53c5e944c 100644 --- a/platform/linux-generic/include/odp_ring_internal.h +++ b/platform/linux-generic/include/odp_ring_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2019-2022 Nokia */ /* This header should NOT be included directly. There are no include guards for diff --git a/platform/linux-generic/include/odp_ring_mpmc_internal.h b/platform/linux-generic/include/odp_ring_mpmc_internal.h index 3526b3866..63e86baca 100644 --- a/platform/linux-generic/include/odp_ring_mpmc_internal.h +++ b/platform/linux-generic/include/odp_ring_mpmc_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2023 Nokia */ #ifndef ODP_RING_MPMC_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_ring_mpmc_u32_internal.h b/platform/linux-generic/include/odp_ring_mpmc_u32_internal.h index 4699b5b47..b5896f9d4 100644 --- a/platform/linux-generic/include/odp_ring_mpmc_u32_internal.h +++ b/platform/linux-generic/include/odp_ring_mpmc_u32_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia */ #ifndef ODP_RING_MPMC_U32_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_ring_mpmc_u64_internal.h b/platform/linux-generic/include/odp_ring_mpmc_u64_internal.h index e7bf31a94..a77b38c3f 100644 --- a/platform/linux-generic/include/odp_ring_mpmc_u64_internal.h +++ b/platform/linux-generic/include/odp_ring_mpmc_u64_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia */ #ifndef ODP_RING_MPMC_U64_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_ring_ptr_internal.h b/platform/linux-generic/include/odp_ring_ptr_internal.h index 13b2b2fbf..ee3c29ff0 100644 --- a/platform/linux-generic/include/odp_ring_ptr_internal.h +++ b/platform/linux-generic/include/odp_ring_ptr_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2019, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2019 Nokia */ #ifndef ODP_RING_PTR_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_ring_spsc_internal.h b/platform/linux-generic/include/odp_ring_spsc_internal.h index 23e7d8868..0b774f197 100644 --- a/platform/linux-generic/include/odp_ring_spsc_internal.h +++ b/platform/linux-generic/include/odp_ring_spsc_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #ifndef ODP_RING_SPSC_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_ring_st_internal.h b/platform/linux-generic/include/odp_ring_st_internal.h index 406d043b5..543ca9cb2 100644 --- a/platform/linux-generic/include/odp_ring_st_internal.h +++ b/platform/linux-generic/include/odp_ring_st_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #ifndef ODP_RING_ST_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_ring_u32_internal.h b/platform/linux-generic/include/odp_ring_u32_internal.h index baa02e4ca..2e91e1d88 100644 --- a/platform/linux-generic/include/odp_ring_u32_internal.h +++ b/platform/linux-generic/include/odp_ring_u32_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2019, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2019 Nokia */ #ifndef ODP_RING_U32_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_ring_u64_internal.h b/platform/linux-generic/include/odp_ring_u64_internal.h index 4b4c7b1b5..1de098d45 100644 --- a/platform/linux-generic/include/odp_ring_u64_internal.h +++ b/platform/linux-generic/include/odp_ring_u64_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Nokia */ #ifndef ODP_RING_U64_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_schedule_if.h b/platform/linux-generic/include/odp_schedule_if.h index 07f935bc9..7a61b1dc0 100644 --- a/platform/linux-generic/include/odp_schedule_if.h +++ b/platform/linux-generic/include/odp_schedule_if.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #ifndef ODP_SCHEDULE_IF_H_ diff --git a/platform/linux-generic/include/odp_schedule_scalable.h b/platform/linux-generic/include/odp_schedule_scalable.h index 28c0a9894..a2db327df 100644 --- a/platform/linux-generic/include/odp_schedule_scalable.h +++ b/platform/linux-generic/include/odp_schedule_scalable.h @@ -1,9 +1,6 @@ -/* Copyright (c) 2017, ARM Limited. All rights reserved. - * - * Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2018 Linaro Limited */ #ifndef ODP_SCHEDULE_SCALABLE_H diff --git a/platform/linux-generic/include/odp_schedule_scalable_config.h b/platform/linux-generic/include/odp_schedule_scalable_config.h index 3462d047b..1133d49aa 100644 --- a/platform/linux-generic/include/odp_schedule_scalable_config.h +++ b/platform/linux-generic/include/odp_schedule_scalable_config.h @@ -1,9 +1,6 @@ -/* Copyright (c) 2017, ARM Limited. All rights reserved. - * - * Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2018 Linaro Limited */ #ifndef ODP_SCHEDULE_SCALABLE_CONFIG_H_ diff --git a/platform/linux-generic/include/odp_schedule_scalable_ordered.h b/platform/linux-generic/include/odp_schedule_scalable_ordered.h index be4894f73..ad2dfc8ee 100644 --- a/platform/linux-generic/include/odp_schedule_scalable_ordered.h +++ b/platform/linux-generic/include/odp_schedule_scalable_ordered.h @@ -1,9 +1,6 @@ -/* Copyright (c) 2017, ARM Limited. All rights reserved. - * - * Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2018 Linaro Limited */ #ifndef ODP_SCHEDULE_SCALABLE_ORDERED_H diff --git a/platform/linux-generic/include/odp_shm_internal.h b/platform/linux-generic/include/odp_shm_internal.h index 9e51ffad1..bd9566e74 100644 --- a/platform/linux-generic/include/odp_shm_internal.h +++ b/platform/linux-generic/include/odp_shm_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2019, Nokia - * Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2019 Nokia */ #ifndef ODP_SHM_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_socket_common.h b/platform/linux-generic/include/odp_socket_common.h index f48dabc3b..bb89133a7 100644 --- a/platform/linux-generic/include/odp_socket_common.h +++ b/platform/linux-generic/include/odp_socket_common.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2019, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2019 Nokia */ #ifndef ODP_SOCKET_COMMON_H_ diff --git a/platform/linux-generic/include/odp_sorted_list_internal.h b/platform/linux-generic/include/odp_sorted_list_internal.h index 9e5a457dc..feb1fc7d6 100644 --- a/platform/linux-generic/include/odp_sorted_list_internal.h +++ b/platform/linux-generic/include/odp_sorted_list_internal.h @@ -1,9 +1,6 @@ -/* Copyright 2015 EZchip Semiconductor Ltd. All Rights Reserved. - * - * Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015 EZchip Semiconductor Ltd. + * Copyright (c) 2015-2018 Linaro Limited */ #ifndef _ODP_INT_SORTED_LIST_H_ diff --git a/platform/linux-generic/include/odp_string_internal.h b/platform/linux-generic/include/odp_string_internal.h new file mode 100644 index 000000000..37e9361af --- /dev/null +++ b/platform/linux-generic/include/odp_string_internal.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia + */ + +#ifndef ODP_STRING_INTERNAL_H_ +#define ODP_STRING_INTERNAL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <stddef.h> + +/* Helps with snprintf() return value checking + * + * Otherwise like snprintf(), but returns always the number of characters + * printed (without the end mark) or zero on error. Terminates the string + * always with the end mark. */ +int _odp_snprint(char *str, size_t size, const char *format, ...); + +/* + * Copy a string + * + * Like strncpy(), but additionally ensures that the destination string is null + * terminated, unless sz is zero in which case returns dst without doing + * anything else. + */ +char *_odp_strcpy(char *restrict dst, const char *restrict src, size_t sz); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp_sysfs_stats.h b/platform/linux-generic/include/odp_sysfs_stats.h index 0adb67c84..8d7ac2327 100644 --- a/platform/linux-generic/include/odp_sysfs_stats.h +++ b/platform/linux-generic/include/odp_sysfs_stats.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #ifndef ODP_SYSFS_STATS_H_ diff --git a/platform/linux-generic/include/odp_sysinfo_internal.h b/platform/linux-generic/include/odp_sysinfo_internal.h index c14cf78d9..793d7986e 100644 --- a/platform/linux-generic/include/odp_sysinfo_internal.h +++ b/platform/linux-generic/include/odp_sysinfo_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited */ #ifndef ODP_SYSINFO_INTERNAL_H_ diff --git a/platform/linux-generic/include/odp_timer_internal.h b/platform/linux-generic/include/odp_timer_internal.h index 38192d917..2351def95 100644 --- a/platform/linux-generic/include/odp_timer_internal.h +++ b/platform/linux-generic/include/odp_timer_internal.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2021-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited + * Copyright (c) 2021-2022 Nokia */ /** diff --git a/platform/linux-generic/include/odp_timer_wheel_internal.h b/platform/linux-generic/include/odp_timer_wheel_internal.h index c0c411b91..f54c058d7 100644 --- a/platform/linux-generic/include/odp_timer_wheel_internal.h +++ b/platform/linux-generic/include/odp_timer_wheel_internal.h @@ -1,9 +1,6 @@ -/* Copyright 2015 EZchip Semiconductor Ltd. All Rights Reserved. - * - * Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015 EZchip Semiconductor Ltd. + * Copyright (c) 2015-2018 Linaro Limited */ #ifndef _ODP_INT_TIMER_WHEEL_H_ diff --git a/platform/linux-generic/include/odp_traffic_mngr_internal.h b/platform/linux-generic/include/odp_traffic_mngr_internal.h index 28744d8b1..960756340 100644 --- a/platform/linux-generic/include/odp_traffic_mngr_internal.h +++ b/platform/linux-generic/include/odp_traffic_mngr_internal.h @@ -1,9 +1,6 @@ -/* Copyright 2015 EZchip Semiconductor Ltd. All Rights Reserved. - * - * Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015 EZchip Semiconductor Ltd. + * Copyright (c) 2015-2018 Linaro Limited */ /** @@ -407,7 +404,7 @@ struct tm_system_s { uint64_t current_time; uint8_t tm_idx; uint8_t first_enq; - odp_bool_t is_idle; + odp_atomic_u32_t is_idle; tm_status_t status; uint64_t shaper_green_cnt; diff --git a/platform/linux-generic/include/odp_types_internal.h b/platform/linux-generic/include/odp_types_internal.h index a97ac9cd4..d69db19f6 100644 --- a/platform/linux-generic/include/odp_types_internal.h +++ b/platform/linux-generic/include/odp_types_internal.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #ifndef ODP_TYPES_INTERNAL_H_ diff --git a/platform/linux-generic/include/protocols/eth.h b/platform/linux-generic/include/protocols/eth.h index e66dd52c7..d9ea4f704 100644 --- a/platform/linux-generic/include/protocols/eth.h +++ b/platform/linux-generic/include/protocols/eth.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include/protocols/ip.h b/platform/linux-generic/include/protocols/ip.h index e145cbe25..97652d02c 100644 --- a/platform/linux-generic/include/protocols/ip.h +++ b/platform/linux-generic/include/protocols/ip.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include/protocols/ipsec.h b/platform/linux-generic/include/protocols/ipsec.h index 0eb320330..5bb0d2169 100644 --- a/platform/linux-generic/include/protocols/ipsec.h +++ b/platform/linux-generic/include/protocols/ipsec.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ diff --git a/platform/linux-generic/include/protocols/sctp.h b/platform/linux-generic/include/protocols/sctp.h index 0e7abb475..e8c4b0c03 100644 --- a/platform/linux-generic/include/protocols/sctp.h +++ b/platform/linux-generic/include/protocols/sctp.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include/protocols/tcp.h b/platform/linux-generic/include/protocols/tcp.h index 5b302be53..04620d571 100644 --- a/platform/linux-generic/include/protocols/tcp.h +++ b/platform/linux-generic/include/protocols/tcp.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ diff --git a/platform/linux-generic/include/protocols/thash.h b/platform/linux-generic/include/protocols/thash.h index 7e1bec549..f8539f524 100644 --- a/platform/linux-generic/include/protocols/thash.h +++ b/platform/linux-generic/include/protocols/thash.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/include/protocols/udp.h b/platform/linux-generic/include/protocols/udp.h index 2614d31ab..0eccbd44d 100644 --- a/platform/linux-generic/include/protocols/udp.h +++ b/platform/linux-generic/include/protocols/udp.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ /** diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4 index 3306849d2..d662ecfcd 100644 --- a/platform/linux-generic/m4/configure.m4 +++ b/platform/linux-generic/m4/configure.m4 @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2014 Linaro Limited +# + ODP_IMPLEMENTATION_NAME="odp-linux" ODP_LIB_NAME="odp-linux" @@ -66,7 +70,6 @@ AC_CONFIG_FILES([platform/linux-generic/Makefile platform/linux-generic/test/Makefile platform/linux-generic/test/example/Makefile platform/linux-generic/test/example/classifier/Makefile - platform/linux-generic/test/example/generator/Makefile platform/linux-generic/test/example/ipsec_api/Makefile platform/linux-generic/test/example/ipsec_crypto/Makefile platform/linux-generic/test/example/l2fwd_simple/Makefile diff --git a/platform/linux-generic/m4/odp_cpu.m4 b/platform/linux-generic/m4/odp_cpu.m4 index 35a83faf6..f363813f1 100644 --- a/platform/linux-generic/m4/odp_cpu.m4 +++ b/platform/linux-generic/m4/odp_cpu.m4 @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2021 Nokia +# + ########################################################################## # Set ODP_CACHE_LINE_SIZE define ########################################################################## diff --git a/platform/linux-generic/m4/odp_crypto.m4 b/platform/linux-generic/m4/odp_crypto.m4 index 1cec6edb4..e7cfa8865 100644 --- a/platform/linux-generic/m4/odp_crypto.m4 +++ b/platform/linux-generic/m4/odp_crypto.m4 @@ -1,3 +1,8 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2022 ARM Limited +# Copyright (c) 2022 Nokia +# + # ODP_CRYPTO # ---------- # Select default crypto implementation diff --git a/platform/linux-generic/m4/odp_dpdk.m4 b/platform/linux-generic/m4/odp_dpdk.m4 index dc3c9610e..2e101df30 100644 --- a/platform/linux-generic/m4/odp_dpdk.m4 +++ b/platform/linux-generic/m4/odp_dpdk.m4 @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2016 Linaro Limited +# + ########################################################################## # Enable DPDK support ########################################################################## diff --git a/platform/linux-generic/m4/odp_event_validation.m4 b/platform/linux-generic/m4/odp_event_validation.m4 index 08bb8902e..df466d4ee 100644 --- a/platform/linux-generic/m4/odp_event_validation.m4 +++ b/platform/linux-generic/m4/odp_event_validation.m4 @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2022 Nokia +# + # ODP_EVENT_VALIDATION # -------------------- # Select event validation level diff --git a/platform/linux-generic/m4/odp_ipsec_mb.m4 b/platform/linux-generic/m4/odp_ipsec_mb.m4 index 3268d94c0..d85d179a3 100644 --- a/platform/linux-generic/m4/odp_ipsec_mb.m4 +++ b/platform/linux-generic/m4/odp_ipsec_mb.m4 @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2022 ARM Limited +# + ######################################################################### # Check for libIPSec_MB availability ######################################################################### diff --git a/platform/linux-generic/m4/odp_libconfig.m4 b/platform/linux-generic/m4/odp_libconfig.m4 index 77095e0fe..25ffd87a4 100644 --- a/platform/linux-generic/m4/odp_libconfig.m4 +++ b/platform/linux-generic/m4/odp_libconfig.m4 @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Nokia +# + ########################################################################## # Configuration file version ########################################################################## diff --git a/platform/linux-generic/m4/odp_ml.m4 b/platform/linux-generic/m4/odp_ml.m4 index a7b9a4fd6..ab424ab39 100644 --- a/platform/linux-generic/m4/odp_ml.m4 +++ b/platform/linux-generic/m4/odp_ml.m4 @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2023 Nokia +# + ########################################################################## # Onnxruntime library path and name ########################################################################## diff --git a/platform/linux-generic/m4/odp_openssl.m4 b/platform/linux-generic/m4/odp_openssl.m4 index 3d3f13a81..4f51b6b01 100644 --- a/platform/linux-generic/m4/odp_openssl.m4 +++ b/platform/linux-generic/m4/odp_openssl.m4 @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2015 Linaro Limited +# + ########################################################################## # Enable/disable usage of OpenSSL library ########################################################################## diff --git a/platform/linux-generic/m4/odp_pcap.m4 b/platform/linux-generic/m4/odp_pcap.m4 index dd1c16e69..cc74d0ca3 100644 --- a/platform/linux-generic/m4/odp_pcap.m4 +++ b/platform/linux-generic/m4/odp_pcap.m4 @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2015 Linaro Limited +# + # ODP_PCAP([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # -------------------------------------------------- AC_DEFUN([ODP_PCAP], diff --git a/platform/linux-generic/m4/odp_pcapng.m4 b/platform/linux-generic/m4/odp_pcapng.m4 index 6ad92db88..58e537478 100644 --- a/platform/linux-generic/m4/odp_pcapng.m4 +++ b/platform/linux-generic/m4/odp_pcapng.m4 @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2018 Linaro Limited +# + ########################################################################## # Enable PCAPNG support ########################################################################## diff --git a/platform/linux-generic/m4/odp_scheduler.m4 b/platform/linux-generic/m4/odp_scheduler.m4 index c199ceed5..d6f1c6e5c 100644 --- a/platform/linux-generic/m4/odp_scheduler.m4 +++ b/platform/linux-generic/m4/odp_scheduler.m4 @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2016 Linaro Limited +# + # ODP_SCHEDULER # ------------- # Select default scheduler diff --git a/platform/linux-generic/m4/odp_wfe.m4 b/platform/linux-generic/m4/odp_wfe.m4 index f0f0542f7..678e6229b 100644 --- a/platform/linux-generic/m4/odp_wfe.m4 +++ b/platform/linux-generic/m4/odp_wfe.m4 @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2023 Nokia +# + ########################################################################## # Enable/disable WFE based lock implementations ########################################################################## diff --git a/platform/linux-generic/m4/odp_xdp.m4 b/platform/linux-generic/m4/odp_xdp.m4 index dcfd39ed7..6820088af 100644 --- a/platform/linux-generic/m4/odp_xdp.m4 +++ b/platform/linux-generic/m4/odp_xdp.m4 @@ -1,3 +1,7 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2022 Nokia +# + ########################################################################## # Check for libxdp availability ########################################################################## diff --git a/platform/linux-generic/odp_atomic_api.c b/platform/linux-generic/odp_atomic_api.c index c56f2c53f..f887f5c1c 100644 --- a/platform/linux-generic/odp_atomic_api.c +++ b/platform/linux-generic/odp_atomic_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ #include <odp/api/atomic.h> diff --git a/platform/linux-generic/odp_barrier.c b/platform/linux-generic/odp_barrier.c index 3747713f6..634f1fe4e 100644 --- a/platform/linux-generic/odp_barrier.c +++ b/platform/linux-generic/odp_barrier.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited */ #include <odp/api/barrier.h> diff --git a/platform/linux-generic/odp_buffer.c b/platform/linux-generic/odp_buffer.c index 82bf61add..af9b85edc 100644 --- a/platform/linux-generic/odp_buffer.c +++ b/platform/linux-generic/odp_buffer.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2022 Nokia */ #include <odp/api/align.h> @@ -13,7 +11,7 @@ #include <odp_pool_internal.h> #include <odp_buffer_internal.h> #include <odp_debug_internal.h> -#include <odp_print_internal.h> +#include <odp_string_internal.h> #include <string.h> #include <stdio.h> diff --git a/platform/linux-generic/odp_buffer_api.c b/platform/linux-generic/odp_buffer_api.c index 01f99b158..71f0e6d4e 100644 --- a/platform/linux-generic/odp_buffer_api.c +++ b/platform/linux-generic/odp_buffer_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2019, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2019 Nokia */ #include <odp/api/buffer.h> diff --git a/platform/linux-generic/odp_byteorder_api.c b/platform/linux-generic/odp_byteorder_api.c index 4b9f0da7a..ebd945ef5 100644 --- a/platform/linux-generic/odp_byteorder_api.c +++ b/platform/linux-generic/odp_byteorder_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #include <odp/api/byteorder.h> diff --git a/platform/linux-generic/odp_chksum.c b/platform/linux-generic/odp_chksum.c index a0336893e..33997fcb7 100644 --- a/platform/linux-generic/odp_chksum.c +++ b/platform/linux-generic/odp_chksum.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/chksum.h> diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 016a8f0c5..83a676ce5 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited + * Copyright (c) 2019-2023 Nokia */ #include <odp/api/classification.h> @@ -21,6 +19,7 @@ #include <odp_packet_io_internal.h> #include <odp_classification_datamodel.h> #include <odp_classification_internal.h> +#include <odp_string_internal.h> #include <protocols/eth.h> #include <protocols/ip.h> #include <protocols/ipsec.h> @@ -278,12 +277,11 @@ odp_cos_t odp_cls_cos_create(const char *name, const odp_cls_cos_param_t *param_ if (0 == cos->valid) { char *cos_name = cos->name; - if (name == NULL) { + if (name == NULL) cos_name[0] = 0; - } else { - strncpy(cos_name, name, ODP_COS_NAME_LEN - 1); - cos_name[ODP_COS_NAME_LEN - 1] = 0; - } + else + _odp_strcpy(cos_name, name, ODP_COS_NAME_LEN); + for (j = 0; j < CLS_PMR_PER_COS_MAX; j++) { cos->pmr[j] = NULL; cos->linked_cos[j] = NULL; diff --git a/platform/linux-generic/odp_comp.c b/platform/linux-generic/odp_comp.c index 13999457f..21403bda3 100644 --- a/platform/linux-generic/odp_comp.c +++ b/platform/linux-generic/odp_comp.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #include <string.h> diff --git a/platform/linux-generic/odp_cpu_api.c b/platform/linux-generic/odp_cpu_api.c index 503fbd4c7..16107e701 100644 --- a/platform/linux-generic/odp_cpu_api.c +++ b/platform/linux-generic/odp_cpu_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #include <odp/api/cpu.h> diff --git a/platform/linux-generic/odp_cpumask.c b/platform/linux-generic/odp_cpumask.c index 7d7575f51..778a851a3 100644 --- a/platform/linux-generic/odp_cpumask.c +++ b/platform/linux-generic/odp_cpumask.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited */ #include <odp_posix_extensions.h> diff --git a/platform/linux-generic/odp_cpumask_task.c b/platform/linux-generic/odp_cpumask_task.c index a579b2e7e..b0819bbf0 100644 --- a/platform/linux-generic/odp_cpumask_task.c +++ b/platform/linux-generic/odp_cpumask_task.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2021-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2021-2022 Nokia */ #include <odp_posix_extensions.h> diff --git a/platform/linux-generic/odp_crypto_api.c b/platform/linux-generic/odp_crypto_api.c index 646472e2e..aaa167044 100644 --- a/platform/linux-generic/odp_crypto_api.c +++ b/platform/linux-generic/odp_crypto_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #include <odp/api/crypto.h> diff --git a/platform/linux-generic/odp_crypto_ipsecmb.c b/platform/linux-generic/odp_crypto_ipsecmb.c index e58844098..917b5ff14 100644 --- a/platform/linux-generic/odp_crypto_ipsecmb.c +++ b/platform/linux-generic/odp_crypto_ipsecmb.c @@ -1,9 +1,7 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2021, ARM Limited - * Copyright (c) 2022-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited + * Copyright (c) 2021 ARM Limited + * Copyright (c) 2022-2023 Nokia */ #include <odp_posix_extensions.h> diff --git a/platform/linux-generic/odp_crypto_null.c b/platform/linux-generic/odp_crypto_null.c index 6eda0f455..91e65a5a8 100644 --- a/platform/linux-generic/odp_crypto_null.c +++ b/platform/linux-generic/odp_crypto_null.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited + * Copyright (c) 2021-2023 Nokia */ #include <odp_posix_extensions.h> diff --git a/platform/linux-generic/odp_crypto_openssl.c b/platform/linux-generic/odp_crypto_openssl.c index 879ce0b97..b67038280 100644 --- a/platform/linux-generic/odp_crypto_openssl.c +++ b/platform/linux-generic/odp_crypto_openssl.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited + * Copyright (c) 2021-2023 Nokia */ #include <odp_posix_extensions.h> @@ -1910,7 +1908,8 @@ int odp_crypto_cipher_capability(odp_cipher_alg_t cipher, if (num < num_copy) num_copy = num; - memcpy(dst, src, num_copy * size); + if (dst) + memcpy(dst, src, num_copy * size); return num; } @@ -2012,7 +2011,8 @@ int odp_crypto_auth_capability(odp_auth_alg_t auth, if (num < num_copy) num_copy = num; - memcpy(dst, src, num_copy * size); + if (dst) + memcpy(dst, src, num_copy * size); return num; } diff --git a/platform/linux-generic/odp_dma.c b/platform/linux-generic/odp_dma.c index b3439498c..879a2a59b 100644 --- a/platform/linux-generic/odp_dma.c +++ b/platform/linux-generic/odp_dma.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021-2023 Nokia */ #include <odp/api/dma.h> @@ -23,6 +21,7 @@ #include <odp_init_internal.h> #include <odp_event_internal.h> #include <odp_pool_internal.h> +#include <odp_string_internal.h> #include <string.h> #include <inttypes.h> @@ -263,10 +262,8 @@ odp_dma_t odp_dma_create(const char *name, const odp_dma_param_t *param) session->name[0] = 0; - if (name) { - strncpy(session->name, name, ODP_DMA_NAME_LEN - 1); - session->name[ODP_DMA_NAME_LEN - 1] = 0; - } + if (name) + _odp_strcpy(session->name, name, ODP_DMA_NAME_LEN); session->dma_param = *param; diff --git a/platform/linux-generic/odp_dma_api.c b/platform/linux-generic/odp_dma_api.c index 1e1d5d91f..96b3f7ec3 100644 --- a/platform/linux-generic/odp_dma_api.c +++ b/platform/linux-generic/odp_dma_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia */ #include <odp/api/dma.h> diff --git a/platform/linux-generic/odp_errno.c b/platform/linux-generic/odp_errno.c index bce398834..6e9119a5f 100644 --- a/platform/linux-generic/odp_errno.c +++ b/platform/linux-generic/odp_errno.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ #include <odp/api/errno.h> diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c index f3644f02b..ce2745497 100644 --- a/platform/linux-generic/odp_event.c +++ b/platform/linux-generic/odp_event.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2020-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2020-2023 Nokia */ #include <odp/api/event.h> diff --git a/platform/linux-generic/odp_event_api.c b/platform/linux-generic/odp_event_api.c index 4fbc98ddf..bd4b1a2d5 100644 --- a/platform/linux-generic/odp_event_api.c +++ b/platform/linux-generic/odp_event_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #include <odp/api/event.h> diff --git a/platform/linux-generic/odp_event_validation.c b/platform/linux-generic/odp_event_validation.c index c2d430f1a..f3cb98f7f 100644 --- a/platform/linux-generic/odp_event_validation.c +++ b/platform/linux-generic/odp_event_validation.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia */ #include <odp/api/atomic.h> @@ -20,7 +18,7 @@ #include <odp_init_internal.h> #include <odp_libconfig_internal.h> #include <odp_macros_internal.h> -#include <odp_print_internal.h> +#include <odp_string_internal.h> #include <inttypes.h> #include <string.h> diff --git a/platform/linux-generic/odp_fdserver.c b/platform/linux-generic/odp_fdserver.c index e72df0669..9d866f6a1 100644 --- a/platform/linux-generic/odp_fdserver.c +++ b/platform/linux-generic/odp_fdserver.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ /* diff --git a/platform/linux-generic/odp_hash_api.c b/platform/linux-generic/odp_hash_api.c index 893c9dc11..620ea0dfc 100644 --- a/platform/linux-generic/odp_hash_api.c +++ b/platform/linux-generic/odp_hash_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Nokia */ #include <odp/api/hash.h> diff --git a/platform/linux-generic/odp_hash_crc_gen.c b/platform/linux-generic/odp_hash_crc_gen.c index f831c63b8..4090d3863 100644 --- a/platform/linux-generic/odp_hash_crc_gen.c +++ b/platform/linux-generic/odp_hash_crc_gen.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #include <stdio.h> @@ -82,37 +80,37 @@ static inline uint8_t reflect_u8(uint8_t byte) /* Reflect 32 bits */ static inline uint32_t reflect_u32(uint32_t u32) { - uint8_t u8[4]; + uint32_t r[4]; - u8[0] = reflect_u8((u32 & 0xff000000u) >> 24); - u8[1] = reflect_u8((u32 & 0x00ff0000u) >> 16); - u8[2] = reflect_u8((u32 & 0x0000ff00u) >> 8); - u8[3] = reflect_u8(u32 & 0xffu); + r[0] = reflect_u8((u32 & 0xff000000u) >> 24); + r[1] = reflect_u8((u32 & 0x00ff0000u) >> 16); + r[2] = reflect_u8((u32 & 0x0000ff00u) >> 8); + r[3] = reflect_u8(u32 & 0xffu); - return (u8[3] << 24) | (u8[2] << 16) | (u8[1] << 8) | u8[0]; + return (r[3] << 24) | (r[2] << 16) | (r[1] << 8) | r[0]; } /* Reflect 24 bits */ static inline uint32_t reflect_u24(uint32_t u32) { - uint8_t u8[4]; + uint32_t r[4]; - u8[0] = reflect_u8((u32 & 0xff0000u) >> 16); - u8[1] = reflect_u8((u32 & 0x00ff00u) >> 8); - u8[2] = reflect_u8(u32 & 0xffu); + r[0] = reflect_u8((u32 & 0xff0000u) >> 16); + r[1] = reflect_u8((u32 & 0x00ff00u) >> 8); + r[2] = reflect_u8(u32 & 0xffu); - return (u8[2] << 16) | (u8[1] << 8) | u8[0]; + return (r[2] << 16) | (r[1] << 8) | r[0]; } /* Reflect 16 bits */ static inline uint32_t reflect_u16(uint32_t u32) { - uint8_t u8[4]; + uint32_t r[4]; - u8[0] = reflect_u8((u32 & 0xff00u) >> 8); - u8[1] = reflect_u8(u32 & 0xffu); + r[0] = reflect_u8((u32 & 0xff00u) >> 8); + r[1] = reflect_u8(u32 & 0xffu); - return (u8[1] << 8) | u8[0]; + return (r[1] << 8) | r[0]; } /* Generate table for a 32/24/16 bit CRCs. diff --git a/platform/linux-generic/odp_impl.c b/platform/linux-generic/odp_impl.c index f8af2c51f..0b192a82f 100644 --- a/platform/linux-generic/odp_impl.c +++ b/platform/linux-generic/odp_impl.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited */ #include <odp/autoheader_internal.h> diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 795252df1..6c9c12860 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2021-2023 Nokia */ #include <odp_posix_extensions.h> diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index ee402b935..033d7706d 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * Copyright (c) 2018-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited + * Copyright (c) 2018-2022 Nokia */ #include <odp/api/byteorder.h> diff --git a/platform/linux-generic/odp_ipsec_api.c b/platform/linux-generic/odp_ipsec_api.c index 1d1abe84a..b92cc9225 100644 --- a/platform/linux-generic/odp_ipsec_api.c +++ b/platform/linux-generic/odp_ipsec_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #include <odp/api/ipsec.h> diff --git a/platform/linux-generic/odp_ipsec_events.c b/platform/linux-generic/odp_ipsec_events.c index 769cab78b..c88089d98 100644 --- a/platform/linux-generic/odp_ipsec_events.c +++ b/platform/linux-generic/odp_ipsec_events.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/ipsec.h> diff --git a/platform/linux-generic/odp_ipsec_sad.c b/platform/linux-generic/odp_ipsec_sad.c index 89cc8aef7..34320522b 100644 --- a/platform/linux-generic/odp_ipsec_sad.c +++ b/platform/linux-generic/odp_ipsec_sad.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * Copyright (c) 2018-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited + * Copyright (c) 2018-2023 Nokia */ #include <odp/api/atomic.h> diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index 3ef1894bc..84663078c 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2019, Nokia - * Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2019 Nokia */ /* This file handles the internal shared memory: internal shared memory @@ -49,6 +47,7 @@ #include <odp_ishmphy_internal.h> #include <odp_ishmpool_internal.h> #include <odp_libconfig_internal.h> +#include <odp_string_internal.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> @@ -652,6 +651,7 @@ static int create_file(int block_index, huge_flag_t huge, uint64_t len, int oflag = O_RDWR | O_CREAT | O_TRUNC; /* flags for open */ char dir[ISHM_FILENAME_MAXLEN]; int ret; + const odp_bool_t use_huge = huge == HUGE; /* No ishm_block_t for the master single VA memory file */ if (single_va) { @@ -665,11 +665,10 @@ static int create_file(int block_index, huge_flag_t huge, uint64_t len, } /* huge dir must be known to create files there!: */ - if ((huge == HUGE) && - (!odp_global_ro.hugepage_info.default_huge_page_dir)) + if (use_huge && !odp_global_ro.hugepage_info.default_huge_page_dir) return -1; - if (huge == HUGE) + if (use_huge) snprintf(dir, ISHM_FILENAME_MAXLEN, "%s/%s", odp_global_ro.hugepage_info.default_huge_page_dir, odp_global_ro.uid); @@ -685,7 +684,7 @@ static int create_file(int block_index, huge_flag_t huge, uint64_t len, fd = open(filename, oflag, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (fd < 0) { - if (huge != HUGE) + if (!use_huge) _ODP_ERR("Normal page open failed: file=%s, " "err=\"%s\"\n", filename, strerror(errno)); return -1; @@ -699,9 +698,10 @@ static int create_file(int block_index, huge_flag_t huge, uint64_t len, } if (ret == -1) { - _ODP_ERR("%s memory allocation failed: fd=%d, file=%s, " - "err=\"%s\"\n", (huge == HUGE) ? "Huge page" : - "Normal page", fd, filename, strerror(errno)); + _ODP_LOG(use_huge ? ODP_LOG_WARN : ODP_LOG_ERR, + use_huge ? "WARN" : "ERR", + "%s page memory allocation failed: fd=%d, file=%s, err=\"%s\"\n", + use_huge ? "Huge" : "Normal", fd, filename, strerror(errno)); close(fd); unlink(filename); return -1; @@ -1090,7 +1090,7 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd, /* save block name (if any given): */ if (name) - strncpy(new_block->name, name, ISHM_NAME_MAXLEN - 1); + _odp_strcpy(new_block->name, name, ISHM_NAME_MAXLEN); else new_block->name[0] = 0; diff --git a/platform/linux-generic/odp_ishmphy.c b/platform/linux-generic/odp_ishmphy.c index 796482b98..046b254c3 100644 --- a/platform/linux-generic/odp_ishmphy.c +++ b/platform/linux-generic/odp_ishmphy.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ /* diff --git a/platform/linux-generic/odp_ishmpool.c b/platform/linux-generic/odp_ishmpool.c index 89ec10695..fb2cf43c4 100644 --- a/platform/linux-generic/odp_ishmpool.c +++ b/platform/linux-generic/odp_ishmpool.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited */ /* This file gathers the buddy and slab allocation functionality provided diff --git a/platform/linux-generic/odp_libconfig.c b/platform/linux-generic/odp_libconfig.c index d5e159e21..7c362a755 100644 --- a/platform/linux-generic/odp_libconfig.c +++ b/platform/linux-generic/odp_libconfig.c @@ -1,9 +1,7 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2020, Nokia - * Copyright (c) 2021, Marvell - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2020 Nokia + * Copyright (c) 2021 Marvell */ #include <stdlib.h> diff --git a/platform/linux-generic/odp_ml.c b/platform/linux-generic/odp_ml.c index 6ab9e7177..a5d055f4f 100644 --- a/platform/linux-generic/odp_ml.c +++ b/platform/linux-generic/odp_ml.c @@ -26,6 +26,7 @@ #include <odp_libconfig_internal.h> #include <odp_macros_internal.h> #include <odp_pool_internal.h> +#include <odp_string_internal.h> #include <onnxruntime_c_api.h> @@ -505,8 +506,7 @@ static int get_model_io_info(OrtSession *session, ml_model_t *mdl, return -1; } - strncpy(input_info[i].name, name, ODP_ML_MODEL_IO_NAME_LEN - 1); - input_info[i].name[ODP_ML_MODEL_IO_NAME_LEN - 1] = 0; + _odp_strcpy(input_info[i].name, name, ODP_ML_MODEL_IO_NAME_LEN); /* Free memory allocated by SessionGetInputName */ status = ort_api->AllocatorFree(allocator, name); @@ -556,8 +556,7 @@ static int get_model_io_info(OrtSession *session, ml_model_t *mdl, return -1; } - strncpy(output_info[i].name, name, ODP_ML_MODEL_IO_NAME_LEN - 1); - output_info[i].name[ODP_ML_MODEL_IO_NAME_LEN - 1] = 0; + _odp_strcpy(output_info[i].name, name, ODP_ML_MODEL_IO_NAME_LEN); /* Free memory allocated by SessionGetOutputName */ status = ort_api->AllocatorFree(allocator, name); @@ -784,23 +783,31 @@ static int check_io_shape(ml_model_t *mdl) odp_ml_shape_info_t *shape; for (uint32_t i = 0; i < mdl->info.num_inputs; i++) { + int num_dyn = 0; + shape = &mdl->input_info[i].shape; - if (shape->type == ODP_ML_SHAPE_NONE) { - _ODP_ERR("Undefined shape type for model input[%u]\n", i); - return -1; - } + switch (shape->type) { + case ODP_ML_SHAPE_STATIC: + break; - if (shape->type == ODP_ML_SHAPE_STATIC) - continue; + case ODP_ML_SHAPE_BATCH: + for (uint32_t j = 0; j < shape->num_dim; j++) + if (shape->dim[j] == ODP_ML_DIM_DYNAMIC) + num_dyn++; - /* shape->type == ODP_ML_SHAPE_BATCH */ - for (uint32_t j = 0; j < shape->num_dim; j++) { - if (shape->dim[j] == ODP_ML_DIM_DYNAMIC && !shape->dim_max[j]) { - _ODP_ERR("Missing dim_max[%u] for dynamic sized input[%u], please" - " provide via the extra_info of model param\n", j, i); + if (num_dyn != 1) { + _ODP_ERR("Incorrect number (%d) of dynamic dimensions " + "for model input[%u]\n", + num_dyn, i); return -1; } + + break; + + default: + _ODP_ERR("Undefined shape type for model input[%u]\n", i); + return -1; } } @@ -917,10 +924,8 @@ odp_ml_model_t odp_ml_model_create(const char *name, const odp_ml_model_param_t mdl->session_opts = session_opts; info->index = i; - if (name) { - strncpy(info->name, name, ODP_ML_MODEL_NAME_LEN - 1); - info->name[ODP_ML_MODEL_NAME_LEN - 1] = 0; - } + if (name) + _odp_strcpy(info->name, name, ODP_ML_MODEL_NAME_LEN); mdl->max_compl_id = param->max_compl_id; for (uint32_t j = 0; j < ML_MAX_COMPL_ID; j++) @@ -2523,7 +2528,7 @@ static int read_config_file(ort_run_opts_t *opts) _ODP_PRINT(" %s: %i\n", conf_str, opts->enable_profiling); conf_str = "ml.execution_mode"; - if (_odp_libconfig_lookup_str(conf_str, mode_str, ML_MAX_CONFIG_STR_LEN) < 0) { + if (_odp_libconfig_lookup_str(conf_str, mode_str, ML_MAX_CONFIG_STR_LEN - 1) < 0) { _ODP_ERR("Config option '%s' not found.\n", conf_str); return -1; } @@ -2550,7 +2555,7 @@ static int read_config_file(ort_run_opts_t *opts) conf_str = "ml.graph_optimization_level"; if (_odp_libconfig_lookup_str(conf_str, opt_level_str, - ML_MAX_CONFIG_STR_LEN) < 0) { + ML_MAX_CONFIG_STR_LEN - 1) < 0) { _ODP_ERR("Config option '%s' not found.\n", conf_str); return -1; } @@ -2563,7 +2568,7 @@ static int read_config_file(ort_run_opts_t *opts) conf_str = "ml.optimized_model_filepath"; if (_odp_libconfig_lookup_str(conf_str, opts->opt_model_filepath, - ML_MAX_CONFIG_STR_LEN) < 0) { + ML_MAX_CONFIG_STR_LEN - 1) < 0) { _ODP_ERR("Config option '%s' not found.\n", conf_str); return -1; } diff --git a/platform/linux-generic/odp_name_table.c b/platform/linux-generic/odp_name_table.c index 7c93d594b..46a038ac7 100644 --- a/platform/linux-generic/odp_name_table.c +++ b/platform/linux-generic/odp_name_table.c @@ -1,9 +1,6 @@ - /* Copyright 2015 EZchip Semiconductor Ltd. All Rights Reserved. - - * Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause + /* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015 EZchip Semiconductor Ltd. + * Copyright (c) 2015-2018 Linaro Limited */ #include <odp/api/hash.h> diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 17a4a9298..6559ba606 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2023 Nokia */ #include <odp/autoheader_external.h> @@ -25,7 +23,7 @@ #include <odp_packet_internal.h> #include <odp_packet_io_internal.h> #include <odp_pool_internal.h> -#include <odp_print_internal.h> +#include <odp_string_internal.h> /* Inlined API functions */ #include <odp/api/plat/byteorder_inlines.h> @@ -701,6 +699,9 @@ void odp_packet_free(odp_packet_t pkt) static inline void packet_free_multi_ev(const odp_packet_t pkt[], int num, _odp_ev_id_t id) { + if (odp_unlikely(!num)) + return; + odp_packet_hdr_t *pkt_hdrs[num]; int i; int num_freed = 0; @@ -736,6 +737,14 @@ void odp_packet_free_sp(const odp_packet_t pkt[], int num) packet_free_multi_ev(pkt, num, _ODP_EV_PACKET_FREE_SP); } +uint32_t odp_packet_reset_max_len(odp_packet_t pkt) +{ + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); + pool_t *pool = _odp_pool_entry(pkt_hdr->event_hdr.pool); + + return pool->seg_len * pkt_hdr->seg_count; +} + int odp_packet_reset(odp_packet_t pkt, uint32_t len) { odp_packet_hdr_t *const pkt_hdr = packet_hdr(pkt); @@ -757,6 +766,13 @@ int odp_packet_reset(odp_packet_t pkt, uint32_t len) return 0; } +void odp_packet_reset_meta(odp_packet_t pkt) +{ + _ODP_ASSERT(pkt != ODP_PACKET_INVALID); + + _odp_packet_reset_md(packet_hdr(pkt)); +} + int odp_event_filter_packet(const odp_event_t event[], odp_packet_t packet[], odp_event_t remain[], int num) diff --git a/platform/linux-generic/odp_packet_api.c b/platform/linux-generic/odp_packet_api.c index 61d03d0c8..0309c4e5a 100644 --- a/platform/linux-generic/odp_packet_api.c +++ b/platform/linux-generic/odp_packet_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited */ #include <odp/api/packet.h> diff --git a/platform/linux-generic/odp_packet_flags.c b/platform/linux-generic/odp_packet_flags.c index 777da12ae..e119d136f 100644 --- a/platform/linux-generic/odp_packet_flags.c +++ b/platform/linux-generic/odp_packet_flags.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited */ #include <odp/api/plat/packet_flag_inlines.h> diff --git a/platform/linux-generic/odp_packet_flags_api.c b/platform/linux-generic/odp_packet_flags_api.c index e77f22c3e..91457504c 100644 --- a/platform/linux-generic/odp_packet_flags_api.c +++ b/platform/linux-generic/odp_packet_flags_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited */ #include <odp/api/packet_flags.h> diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 8283c41e6..f523d6de5 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2023 Nokia */ #include <odp_posix_extensions.h> @@ -31,6 +29,7 @@ #include <odp_libconfig_internal.h> #include <odp_packet_internal.h> #include <odp_packet_io_internal.h> +#include <odp_string_internal.h> #include <odp_pcapng.h> #include <odp_queue_if.h> #include <odp_schedule_if.h> @@ -229,8 +228,7 @@ static const char *strip_pktio_type(const char *name, char *type_out) int type_len = if_name - name; char pktio_type[type_len + 1]; - strncpy(pktio_type, name, type_len); - pktio_type[type_len] = '\0'; + _odp_strcpy(pktio_type, name, type_len + 1); /* Remove colon */ if_name++; @@ -301,7 +299,7 @@ static odp_pktio_t setup_pktio_entry(const char *name, odp_pool_t pool, uint16_t pktin_frame_offset = pktio_global->config.pktin_frame_offset; int ret = -1; - if (strlen(name) >= PKTIO_NAME_LEN - 1) { + if (strlen(name) >= PKTIO_NAME_LEN) { /* ioctl names limitation */ _ODP_ERR("pktio name %s is too long (max: %d chars)\n", name, PKTIO_NAME_LEN - 1); return ODP_PKTIO_INVALID; diff --git a/platform/linux-generic/odp_packet_io_api.c b/platform/linux-generic/odp_packet_io_api.c index d0b66a67f..196d8ce01 100644 --- a/platform/linux-generic/odp_packet_io_api.c +++ b/platform/linux-generic/odp_packet_io_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2018-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #include <odp/api/packet_io.h> diff --git a/platform/linux-generic/odp_packet_vector.c b/platform/linux-generic/odp_packet_vector.c index 698445181..80533da25 100644 --- a/platform/linux-generic/odp_packet_vector.c +++ b/platform/linux-generic/odp_packet_vector.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2020-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2020-2022 Nokia */ #include <odp/api/align.h> @@ -14,7 +12,7 @@ #include <odp_debug_internal.h> #include <odp_event_vector_internal.h> #include <odp_pool_internal.h> -#include <odp_print_internal.h> +#include <odp_string_internal.h> #include <inttypes.h> #include <stdint.h> diff --git a/platform/linux-generic/odp_parse.c b/platform/linux-generic/odp_parse.c index d7fdb1439..60e8e5922 100644 --- a/platform/linux-generic/odp_parse.c +++ b/platform/linux-generic/odp_parse.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2022 Nokia */ #include <odp_parse_internal.h> @@ -42,17 +40,13 @@ uint16_t _odp_parse_eth(packet_parser_t *prs, const uint8_t **parseptr, input_flags.jumbo = 1; /* Handle Ethernet broadcast/multicast addresses */ - macaddr0 = odp_be_to_cpu_16(*((const uint16_t *)(const void *)eth)); + macaddr0 = odp_be_to_cpu_16(*((const odp_una_u16_t *)eth)); if (odp_unlikely((macaddr0 & 0x0100) == 0x0100)) input_flags.eth_mcast = 1; if (odp_unlikely(macaddr0 == 0xffff)) { - macaddr2 = - odp_be_to_cpu_16(*((const uint16_t *) - (const void *)eth + 1)); - macaddr4 = - odp_be_to_cpu_16(*((const uint16_t *) - (const void *)eth + 2)); + macaddr2 = odp_be_to_cpu_16(*((const odp_una_u16_t *)eth + 1)); + macaddr4 = odp_be_to_cpu_16(*((const odp_una_u16_t *)eth + 2)); if ((macaddr2 == 0xffff) && (macaddr4 == 0xffff)) input_flags.eth_bcast = 1; @@ -71,8 +65,7 @@ uint16_t _odp_parse_eth(packet_parser_t *prs, const uint8_t **parseptr, ethtype = 0; goto error; } - ethtype = odp_be_to_cpu_16(*((const uint16_t *)(uintptr_t) - (*parseptr + 6))); + ethtype = odp_be_to_cpu_16(*((const odp_una_u16_t *)(*parseptr + 6))); *offset += 8; *parseptr += 8; } diff --git a/platform/linux-generic/odp_pcapng.c b/platform/linux-generic/odp_pcapng.c index 7f11f4340..db9bf1af7 100644 --- a/platform/linux-generic/odp_pcapng.c +++ b/platform/linux-generic/odp_pcapng.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2019-2022 Nokia */ #include <odp_posix_extensions.h> diff --git a/platform/linux-generic/odp_pkt_queue.c b/platform/linux-generic/odp_pkt_queue.c index d3dd6639f..1a5c9bd3c 100644 --- a/platform/linux-generic/odp_pkt_queue.c +++ b/platform/linux-generic/odp_pkt_queue.c @@ -1,9 +1,6 @@ -/* Copyright 2015 EZchip Semiconductor Ltd. All Rights Reserved. - - * Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015 EZchip Semiconductor Ltd. + * Copyright (c) 2015-2018 Linaro Limited */ #include <odp/api/packet.h> @@ -18,6 +15,7 @@ #include <malloc.h> #include <stdio.h> #include <inttypes.h> +#include <stdalign.h> #define NUM_PKTS 7 @@ -109,7 +107,7 @@ static int pkt_queue_free_list_add(queue_pool_t *pool, queue_blks = region_desc->queue_blks; if (!queue_blks) { malloc_len = num_blks * sizeof(queue_blk_t); - queue_blks = malloc(malloc_len); + queue_blks = aligned_alloc(alignof(queue_blk_t), malloc_len); if (!queue_blks) { free_alloced_queue_blks(alloc_cnt, alloced_queue_blks); diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index d3fde70f6..92f3fb7da 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2023 Nokia */ #include <odp/api/align.h> @@ -32,6 +30,7 @@ #include <odp_timer_internal.h> #include <odp_event_vector_internal.h> #include <odp_buffer_internal.h> +#include <odp_string_internal.h> #include <string.h> #include <stdio.h> @@ -136,6 +135,9 @@ static void cache_flush(pool_cache_t *cache, pool_t *pool) ring_ptr_t *ring; uint32_t mask; + if (!pool->ring) + return; + ring = &pool->ring->hdr; mask = pool->ring_mask; @@ -429,7 +431,7 @@ static pool_t *reserve_pool(uint32_t shmflags, uint8_t pool_ext, uint32_t num) odp_shm_t shm; uint32_t mem_size; pool_t *pool; - char ring_name[ODP_POOL_NAME_LEN]; + char ring_name[ODP_SHM_NAME_LEN]; for (i = 0; i < CONFIG_POOLS; i++) { pool = _odp_pool_entry_from_idx(i); @@ -647,12 +649,10 @@ static bool shm_is_from_huge_pages(odp_shm_t shm) static void set_pool_name(pool_t *pool, const char *name) { - if (name == NULL) { + if (name == NULL) pool->name[0] = 0; - } else { - strncpy(pool->name, name, ODP_POOL_NAME_LEN - 1); - pool->name[ODP_POOL_NAME_LEN - 1] = 0; - } + else + _odp_strcpy(pool->name, name, ODP_POOL_NAME_LEN); } static void set_pool_cache_size(pool_t *pool, uint32_t cache_size) @@ -890,7 +890,7 @@ odp_pool_t _odp_pool_create(const char *name, const odp_pool_param_t *params, if (!adj_size) { _ODP_ERR("Calculating adjusted block size failed\n"); - return ODP_POOL_INVALID; + goto error; } } @@ -995,6 +995,11 @@ error: if (pool->uarea_shm != ODP_SHM_INVALID) odp_shm_free(pool->uarea_shm); + if (pool->ring_shm != ODP_SHM_INVALID) + odp_shm_free(pool->ring_shm); + + pool->ring = NULL; + LOCK(&pool->lock); pool->reserved = 0; UNLOCK(&pool->lock); @@ -2047,6 +2052,8 @@ error: if (pool->ring_shm != ODP_SHM_INVALID) odp_shm_free(pool->ring_shm); + pool->ring = NULL; + LOCK(&pool->lock); pool->reserved = 0; UNLOCK(&pool->lock); diff --git a/platform/linux-generic/odp_pool_api.c b/platform/linux-generic/odp_pool_api.c index d9e0aabad..f81e864aa 100644 --- a/platform/linux-generic/odp_pool_api.c +++ b/platform/linux-generic/odp_pool_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #include <odp/api/pool.h> diff --git a/platform/linux-generic/odp_pool_mem_src_ops.c b/platform/linux-generic/odp_pool_mem_src_ops.c index 2f8dc2078..c07abc78e 100644 --- a/platform/linux-generic/odp_pool_mem_src_ops.c +++ b/platform/linux-generic/odp_pool_mem_src_ops.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #include <odp/autoheader_internal.h> diff --git a/platform/linux-generic/odp_queue_api.c b/platform/linux-generic/odp_queue_api.c index 495cf8746..e1beeeb58 100644 --- a/platform/linux-generic/odp_queue_api.c +++ b/platform/linux-generic/odp_queue_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #include <odp/api/queue.h> diff --git a/platform/linux-generic/odp_queue_basic.c b/platform/linux-generic/odp_queue_basic.c index f9700742c..ec51b65f2 100644 --- a/platform/linux-generic/odp_queue_basic.c +++ b/platform/linux-generic/odp_queue_basic.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2021-2023 Nokia */ #include <odp/api/align.h> @@ -33,6 +31,7 @@ #include <odp_queue_if.h> #include <odp_schedule_if.h> #include <odp_timer_internal.h> +#include <odp_string_internal.h> #include <inttypes.h> #include <string.h> @@ -1049,12 +1048,10 @@ static int queue_init(queue_entry_t *queue, const char *name, queue_type = param->type; - if (name == NULL) { + if (name == NULL) queue->name[0] = 0; - } else { - strncpy(queue->name, name, ODP_QUEUE_NAME_LEN - 1); - queue->name[ODP_QUEUE_NAME_LEN - 1] = 0; - } + else + _odp_strcpy(queue->name, name, ODP_QUEUE_NAME_LEN); memcpy(&queue->param, param, sizeof(odp_queue_param_t)); if (queue->param.sched.lock_count > _odp_sched_fn->max_ordered_locks()) return -1; diff --git a/platform/linux-generic/odp_queue_if.c b/platform/linux-generic/odp_queue_if.c index cc6594afd..248e7743a 100644 --- a/platform/linux-generic/odp_queue_if.c +++ b/platform/linux-generic/odp_queue_if.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2017, ARM Limited - * Copyright (c) 2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017 ARM Limited + * Copyright (c) 2023 Nokia */ #include <odp/autoheader_internal.h> diff --git a/platform/linux-generic/odp_queue_lf.c b/platform/linux-generic/odp_queue_lf.c index 7c9ba4013..e7f8fa435 100644 --- a/platform/linux-generic/odp_queue_lf.c +++ b/platform/linux-generic/odp_queue_lf.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2018-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #include <odp/api/queue.h> diff --git a/platform/linux-generic/odp_queue_scalable.c b/platform/linux-generic/odp_queue_scalable.c index bddaa532d..f2eb82d23 100644 --- a/platform/linux-generic/odp_queue_scalable.c +++ b/platform/linux-generic/odp_queue_scalable.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2017, ARM Limited - * Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/hints.h> @@ -29,6 +27,7 @@ #include <odp/api/plat/queue_inline_types.h> #include <odp_global_data.h> #include <odp_macros_internal.h> +#include <odp_string_internal.h> #include <string.h> #include <inttypes.h> @@ -104,8 +103,7 @@ static int queue_init(queue_entry_t *queue, const char *name, sched_elem = &queue->sched_elem; ring_size = param->size > 0 ? _ODP_ROUNDUP_POWER2_U32(param->size) : CONFIG_SCAL_QUEUE_SIZE; - strncpy(queue->name, name ? name : "", ODP_QUEUE_NAME_LEN - 1); - queue->name[ODP_QUEUE_NAME_LEN - 1] = 0; + _odp_strcpy(queue->name, name ? name : "", ODP_QUEUE_NAME_LEN); memcpy(&queue->param, param, sizeof(odp_queue_param_t)); size = ring_size * sizeof(_odp_event_hdr_t *); diff --git a/platform/linux-generic/odp_queue_spsc.c b/platform/linux-generic/odp_queue_spsc.c index 74cc740e0..bb2a7ce9f 100644 --- a/platform/linux-generic/odp_queue_spsc.c +++ b/platform/linux-generic/odp_queue_spsc.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #include <odp_debug_internal.h> diff --git a/platform/linux-generic/odp_random.c b/platform/linux-generic/odp_random.c index 3060e8ed9..d96f03f39 100644 --- a/platform/linux-generic/odp_random.c +++ b/platform/linux-generic/odp_random.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2020, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2020 Nokia */ #include <stdint.h> diff --git a/platform/linux-generic/odp_random_openssl.c b/platform/linux-generic/odp_random_openssl.c index fdc40871b..c45cb470b 100644 --- a/platform/linux-generic/odp_random_openssl.c +++ b/platform/linux-generic/odp_random_openssl.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2020, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited + * Copyright (c) 2020 Nokia */ #include <odp_posix_extensions.h> diff --git a/platform/linux-generic/odp_random_std.c b/platform/linux-generic/odp_random_std.c index 50cd773f2..5ae47d596 100644 --- a/platform/linux-generic/odp_random_std.c +++ b/platform/linux-generic/odp_random_std.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited */ #include <odp/api/byteorder.h> @@ -42,11 +40,11 @@ static int32_t _random_data(uint8_t *buf, uint32_t len, uint64_t *seed) { const uint32_t ret = len; - if (!_ODP_UNALIGNED && ((uintptr_t)buf & 3) && len) { + if (!_ODP_UNALIGNED) { uint32_t r = xorshift64s32(seed); - if ((uintptr_t)buf & 1) { - *(uint8_t *)(uintptr_t)buf = r & 0xff; + if (((uintptr_t)buf & 1) && len) { + *(uint8_t *)buf = r & 0xff; r >>= 8; buf += 1; len -= 1; @@ -57,24 +55,29 @@ static int32_t _random_data(uint8_t *buf, uint32_t len, uint64_t *seed) buf += 2; len -= 2; } - } - for (uint32_t i = 0; i < len / 4; i++) { - *(uint32_t *)(uintptr_t)buf = xorshift64s32(seed); - buf += 4; + for (uint32_t i = 0; i < len / 4; i++) { + *(uint32_t *)(uintptr_t)buf = xorshift64s32(seed); + buf += 4; + } + } else { + for (uint32_t i = 0; i < len / 4; i++) { + *(odp_una_u32_t *)buf = xorshift64s32(seed); + buf += 4; + } } if (len & 3) { uint32_t r = xorshift64s32(seed); if (len & 2) { - *(uint16_t *)(uintptr_t)buf = r & 0xffff; + *(odp_una_u16_t *)buf = r & 0xffff; r >>= 16; buf += 2; } if (len & 1) - *(uint8_t *)(uintptr_t)buf = r & 0xff; + *(uint8_t *)buf = r & 0xff; } return ret; diff --git a/platform/linux-generic/odp_rwlock_api.c b/platform/linux-generic/odp_rwlock_api.c index 217479598..9969473d1 100644 --- a/platform/linux-generic/odp_rwlock_api.c +++ b/platform/linux-generic/odp_rwlock_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #include <odp/api/rwlock.h> diff --git a/platform/linux-generic/odp_rwlock_recursive_api.c b/platform/linux-generic/odp_rwlock_recursive_api.c index b2580ae42..b13dd5522 100644 --- a/platform/linux-generic/odp_rwlock_recursive_api.c +++ b/platform/linux-generic/odp_rwlock_recursive_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #include <odp/api/rwlock_recursive.h> diff --git a/platform/linux-generic/odp_schedule_api.c b/platform/linux-generic/odp_schedule_api.c index 4be1ba6f7..1a758405a 100644 --- a/platform/linux-generic/odp_schedule_api.c +++ b/platform/linux-generic/odp_schedule_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #include <odp/api/schedule.h> diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c index 379f1f828..69fbf7d6f 100644 --- a/platform/linux-generic/odp_schedule_basic.c +++ b/platform/linux-generic/odp_schedule_basic.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2022 Nokia */ /* @@ -40,7 +38,7 @@ #include <odp_global_data.h> #include <odp_event_internal.h> #include <odp_macros_internal.h> -#include <odp_print_internal.h> +#include <odp_string_internal.h> #include <string.h> #include <time.h> @@ -674,13 +672,12 @@ static int schedule_init_global(void) sched->sched_grp[ODP_SCHED_GROUP_ALL].allocated = 1; sched->sched_grp[ODP_SCHED_GROUP_WORKER].allocated = 1; sched->sched_grp[ODP_SCHED_GROUP_CONTROL].allocated = 1; - strncpy(sched->sched_grp[ODP_SCHED_GROUP_ALL].name, "__SCHED_GROUP_ALL", - ODP_SCHED_GROUP_NAME_LEN - 1); - strncpy(sched->sched_grp[ODP_SCHED_GROUP_WORKER].name, "__SCHED_GROUP_WORKER", - ODP_SCHED_GROUP_NAME_LEN - 1); - strncpy(sched->sched_grp[ODP_SCHED_GROUP_CONTROL].name, "__SCHED_GROUP_CONTROL", - ODP_SCHED_GROUP_NAME_LEN - 1); - + _odp_strcpy(sched->sched_grp[ODP_SCHED_GROUP_ALL].name, "__SCHED_GROUP_ALL", + ODP_SCHED_GROUP_NAME_LEN); + _odp_strcpy(sched->sched_grp[ODP_SCHED_GROUP_WORKER].name, "__SCHED_GROUP_WORKER", + ODP_SCHED_GROUP_NAME_LEN); + _odp_strcpy(sched->sched_grp[ODP_SCHED_GROUP_CONTROL].name, "__SCHED_GROUP_CONTROL", + ODP_SCHED_GROUP_NAME_LEN); odp_thrmask_setall(&sched->mask_all); @@ -1922,7 +1919,7 @@ static odp_schedule_group_t schedule_group_create(const char *name, return ODP_SCHED_GROUP_INVALID; } - int thr_tbl[count]; + int thr_tbl[ODP_THREAD_COUNT_MAX]; if (count && threads_from_mask(thr_tbl, count, mask)) return ODP_SCHED_GROUP_INVALID; @@ -1933,13 +1930,11 @@ static odp_schedule_group_t schedule_group_create(const char *name, if (!sched->sched_grp[i].allocated) { char *grp_name = sched->sched_grp[i].name; - if (name == NULL) { + if (name == NULL) grp_name[0] = 0; - } else { - strncpy(grp_name, name, - ODP_SCHED_GROUP_NAME_LEN - 1); - grp_name[ODP_SCHED_GROUP_NAME_LEN - 1] = 0; - } + else + _odp_strcpy(grp_name, name, + ODP_SCHED_GROUP_NAME_LEN); grp_update_mask(i, mask); group = (odp_schedule_group_t)i; diff --git a/platform/linux-generic/odp_schedule_if.c b/platform/linux-generic/odp_schedule_if.c index f4d50f84e..c0f015623 100644 --- a/platform/linux-generic/odp_schedule_if.c +++ b/platform/linux-generic/odp_schedule_if.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2021-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2021-2022 Nokia */ #include <odp/autoheader_internal.h> diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c index 5166fb6d0..4947353d6 100644 --- a/platform/linux-generic/odp_schedule_scalable.c +++ b/platform/linux-generic/odp_schedule_scalable.c @@ -1,9 +1,6 @@ -/* Copyright (c) 2017, ARM Limited. All rights reserved. - * - * Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/align.h> @@ -35,6 +32,7 @@ #include <odp_macros_internal.h> #include <odp_packet_io_internal.h> #include <odp_timer_internal.h> +#include <odp_string_internal.h> #include <limits.h> #include <stdbool.h> @@ -1468,7 +1466,7 @@ static odp_schedule_group_t schedule_group_create(const char *name, if (sg == NULL) goto shm_pool_alloc_failed; - strncpy(sg->name, name ? name : "", ODP_SCHED_GROUP_NAME_LEN - 1); + _odp_strcpy(sg->name, name ? name : "", ODP_SCHED_GROUP_NAME_LEN); global->sg_vec[sgi] = sg; memset(sg->thr_actual, 0, sizeof(sg->thr_actual)); sg->thr_wanted = bitset_null(); diff --git a/platform/linux-generic/odp_schedule_scalable_ordered.c b/platform/linux-generic/odp_schedule_scalable_ordered.c index f8568ce53..d8e0bcaaa 100644 --- a/platform/linux-generic/odp_schedule_scalable_ordered.c +++ b/platform/linux-generic/odp_schedule_scalable_ordered.c @@ -1,9 +1,6 @@ -/* Copyright (c) 2017, ARM Limited. All rights reserved. - * - * Copyright (c) 2017-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017-2018 Linaro Limited */ #include <odp/api/shared_memory.h> diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c index 030e95171..1ada5581b 100644 --- a/platform/linux-generic/odp_schedule_sp.c +++ b/platform/linux-generic/odp_schedule_sp.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2019-2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2019-2021 Nokia */ /* @@ -32,6 +30,7 @@ #include <odp_ring_u32_internal.h> #include <odp_timer_internal.h> #include <odp_queue_basic_internal.h> +#include <odp_string_internal.h> #include <odp_global_data.h> #include <string.h> @@ -107,7 +106,7 @@ typedef struct ODP_ALIGNED_CACHE sched_group_t { /* All groups */ struct { - char name[ODP_SCHED_GROUP_NAME_LEN + 1]; + char name[ODP_SCHED_GROUP_NAME_LEN]; odp_thrmask_t mask; int allocated; } group[NUM_GROUP]; @@ -213,18 +212,18 @@ static int init_global(void) for (i = 0; i < NUM_THREAD; i++) odp_atomic_init_u32(&sched_group->s.thr[i].gen_cnt, 0); - strncpy(sched_group->s.group[GROUP_ALL].name, "__group_all", - ODP_SCHED_GROUP_NAME_LEN); + _odp_strcpy(sched_group->s.group[GROUP_ALL].name, "__group_all", + ODP_SCHED_GROUP_NAME_LEN); odp_thrmask_zero(&sched_group->s.group[GROUP_ALL].mask); sched_group->s.group[GROUP_ALL].allocated = 1; - strncpy(sched_group->s.group[GROUP_WORKER].name, "__group_worker", - ODP_SCHED_GROUP_NAME_LEN); + _odp_strcpy(sched_group->s.group[GROUP_WORKER].name, "__group_worker", + ODP_SCHED_GROUP_NAME_LEN); odp_thrmask_zero(&sched_group->s.group[GROUP_WORKER].mask); sched_group->s.group[GROUP_WORKER].allocated = 1; - strncpy(sched_group->s.group[GROUP_CONTROL].name, "__group_control", - ODP_SCHED_GROUP_NAME_LEN); + _odp_strcpy(sched_group->s.group[GROUP_CONTROL].name, "__group_control", + ODP_SCHED_GROUP_NAME_LEN); odp_thrmask_zero(&sched_group->s.group[GROUP_CONTROL].mask); sched_group->s.group[GROUP_CONTROL].allocated = 1; @@ -804,13 +803,11 @@ static odp_schedule_group_t schedule_group_create(const char *name, #if __GNUC__ >= 13 #pragma GCC diagnostic ignored "-Wstringop-overflow" #endif - if (name == NULL) { + if (name == NULL) grp_name[0] = 0; - } else { - strncpy(grp_name, name, - ODP_SCHED_GROUP_NAME_LEN - 1); - grp_name[ODP_SCHED_GROUP_NAME_LEN - 1] = 0; - } + else + _odp_strcpy(grp_name, name, + ODP_SCHED_GROUP_NAME_LEN); #pragma GCC diagnostic pop odp_thrmask_copy(&sched_group->s.group[i].mask, thrmask); diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index ef4df3a33..a6ea427f3 100644 --- a/platform/linux-generic/odp_shared_memory.c +++ b/platform/linux-generic/odp_shared_memory.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2021 Nokia */ #include <odp_config_internal.h> diff --git a/platform/linux-generic/odp_sorted_list.c b/platform/linux-generic/odp_sorted_list.c index c93b11886..3cca8be0c 100644 --- a/platform/linux-generic/odp_sorted_list.c +++ b/platform/linux-generic/odp_sorted_list.c @@ -1,9 +1,6 @@ -/* Copyright 2015 EZchip Semiconductor Ltd. All Rights Reserved. - * - * Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015 EZchip Semiconductor Ltd. + * Copyright (c) 2015-2018 Linaro Limited */ #include <stdint.h> diff --git a/platform/linux-generic/odp_spinlock_api.c b/platform/linux-generic/odp_spinlock_api.c index 06925e9a5..27155d867 100644 --- a/platform/linux-generic/odp_spinlock_api.c +++ b/platform/linux-generic/odp_spinlock_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #include <odp/api/spinlock.h> diff --git a/platform/linux-generic/odp_spinlock_recursive_api.c b/platform/linux-generic/odp_spinlock_recursive_api.c index 2b1e8b200..ae87cb2f3 100644 --- a/platform/linux-generic/odp_spinlock_recursive_api.c +++ b/platform/linux-generic/odp_spinlock_recursive_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #include <odp/api/spinlock_recursive.h> diff --git a/platform/linux-generic/odp_stash.c b/platform/linux-generic/odp_stash.c index cb87a5fa5..154815dd4 100644 --- a/platform/linux-generic/odp_stash.c +++ b/platform/linux-generic/odp_stash.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2020-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2020-2023 Nokia */ #include <odp/api/align.h> diff --git a/platform/linux-generic/odp_std.c b/platform/linux-generic/odp_std.c index 9db5a35b3..dd2cd486c 100644 --- a/platform/linux-generic/odp_std.c +++ b/platform/linux-generic/odp_std.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Nokia */ #include <odp/api/std.h> diff --git a/platform/linux-generic/odp_std_api.c b/platform/linux-generic/odp_std_api.c index 0bcd68de2..1843fb1ce 100644 --- a/platform/linux-generic/odp_std_api.c +++ b/platform/linux-generic/odp_std_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #include <odp/api/std.h> diff --git a/platform/linux-generic/odp_print.c b/platform/linux-generic/odp_string.c index 30a06c2f4..9ba56dee8 100644 --- a/platform/linux-generic/odp_print.c +++ b/platform/linux-generic/odp_string.c @@ -1,19 +1,13 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #include <odp/api/hints.h> -#include <odp_print_internal.h> +#include <odp_string_internal.h> #include <stdarg.h> #include <stdio.h> +#include <string.h> -/* Helps with snprintf() return value checking - * - * Otherwise like snprintf(), but returns always the number of characters - * printed (without the end mark) or zero on error. Terminates the string - * always with the end mark. */ ODP_PRINTF_FORMAT(3, 4) int _odp_snprint(char *str, size_t size, const char *format, ...) { @@ -45,3 +39,13 @@ int _odp_snprint(char *str, size_t size, const char *format, ...) return len; } + +char *_odp_strcpy(char *restrict dst, const char *restrict src, size_t sz) +{ + if (!sz) + return dst; + + strncpy(dst, src, sz - 1); + dst[sz - 1] = 0; + return dst; +} diff --git a/platform/linux-generic/odp_sync_api.c b/platform/linux-generic/odp_sync_api.c index 56c86db14..cbcf16802 100644 --- a/platform/linux-generic/odp_sync_api.c +++ b/platform/linux-generic/odp_sync_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #include <odp/api/sync.h> diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index a2593b531..c31068492 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -1,15 +1,10 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2020-2022, Nokia - * All rights reserved. +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2020-2022 Nokia * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * BSD LICENSE - * - * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. - * All rights reserved. + * Copyright(c) 2010-2014 Intel Corporation + * - lib/eal/common/eal_common_string_fns.c + * - lib/eal/linux/eal_hugepage_info.c */ #include <odp_posix_extensions.h> diff --git a/platform/linux-generic/odp_thread.c b/platform/linux-generic/odp_thread.c index 88aec8f06..34dbb2990 100644 --- a/platform/linux-generic/odp_thread.c +++ b/platform/linux-generic/odp_thread.c @@ -1,13 +1,12 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #include <odp_posix_extensions.h> #include <sched.h> +#include <odp/api/atomic.h> #include <odp/api/thread.h> #include <odp/api/thrmask.h> #include <odp/api/spinlock.h> @@ -34,9 +33,9 @@ typedef struct { odp_thrmask_t control; }; - uint32_t num; - uint32_t num_worker; - uint32_t num_control; + odp_atomic_u32_t num; + odp_atomic_u32_t num_worker; + odp_atomic_u32_t num_control; uint32_t num_max; odp_spinlock_t lock; } thread_globals_t; @@ -78,6 +77,9 @@ int _odp_thread_init_global(void) return -1; memset(thread_globals, 0, sizeof(thread_globals_t)); + odp_atomic_init_u32(&thread_globals->num, 0); + odp_atomic_init_u32(&thread_globals->num_worker, 0); + odp_atomic_init_u32(&thread_globals->num_control, 0); odp_spinlock_init(&thread_globals->lock); thread_globals->num_max = num_max; _ODP_PRINT("System config:\n"); @@ -90,10 +92,7 @@ int _odp_thread_term_global(void) { int ret, num; - odp_spinlock_lock(&thread_globals->lock); - num = thread_globals->num; - odp_spinlock_unlock(&thread_globals->lock); - + num = odp_atomic_load_u32(&thread_globals->num); if (num) _ODP_ERR("%u threads have not called odp_term_local().\n", num); @@ -109,7 +108,7 @@ static int alloc_id(odp_thread_type_t type) int thr; odp_thrmask_t *all = &thread_globals->all; - if (thread_globals->num >= thread_globals->num_max) + if (odp_atomic_load_u32(&thread_globals->num) >= thread_globals->num_max) return -1; for (thr = 0; thr < (int)thread_globals->num_max; thr++) { @@ -118,13 +117,13 @@ static int alloc_id(odp_thread_type_t type) if (type == ODP_THREAD_WORKER) { odp_thrmask_set(&thread_globals->worker, thr); - thread_globals->num_worker++; + odp_atomic_inc_u32(&thread_globals->num_worker); } else { odp_thrmask_set(&thread_globals->control, thr); - thread_globals->num_control++; + odp_atomic_inc_u32(&thread_globals->num_control); } - thread_globals->num++; + odp_atomic_inc_u32(&thread_globals->num); return thr; } } @@ -146,14 +145,13 @@ static int free_id(int thr) if (thread_globals->thr[thr].type == ODP_THREAD_WORKER) { odp_thrmask_clr(&thread_globals->worker, thr); - thread_globals->num_worker--; + odp_atomic_dec_u32(&thread_globals->num_worker); } else { odp_thrmask_clr(&thread_globals->control, thr); - thread_globals->num_control--; + odp_atomic_dec_u32(&thread_globals->num_control); } - thread_globals->num--; - return thread_globals->num; + return odp_atomic_fetch_dec_u32(&thread_globals->num) - 1; } int _odp_thread_init_local(odp_thread_type_t type) @@ -254,17 +252,17 @@ int _odp_thread_term_local(void) int odp_thread_count(void) { - return thread_globals->num; + return odp_atomic_load_u32(&thread_globals->num); } int odp_thread_control_count(void) { - return thread_globals->num_control; + return odp_atomic_load_u32(&thread_globals->num_control); } int odp_thread_worker_count(void) { - return thread_globals->num_worker; + return odp_atomic_load_u32(&thread_globals->num_worker); } int odp_thread_count_max(void) @@ -284,12 +282,22 @@ int odp_thread_worker_count_max(void) int odp_thrmask_worker(odp_thrmask_t *mask) { + uint32_t num_worker; + + odp_spinlock_lock(&thread_globals->lock); odp_thrmask_copy(mask, &thread_globals->worker); - return thread_globals->num_worker; + num_worker = odp_atomic_load_u32(&thread_globals->num_worker); + odp_spinlock_unlock(&thread_globals->lock); + return num_worker; } int odp_thrmask_control(odp_thrmask_t *mask) { + uint32_t num_control; + + odp_spinlock_lock(&thread_globals->lock); odp_thrmask_copy(mask, &thread_globals->control); - return thread_globals->num_control; + num_control = odp_atomic_load_u32(&thread_globals->num_control); + odp_spinlock_unlock(&thread_globals->lock); + return num_control; } diff --git a/platform/linux-generic/odp_thread_api.c b/platform/linux-generic/odp_thread_api.c index 470a82de7..65f7820f6 100644 --- a/platform/linux-generic/odp_thread_api.c +++ b/platform/linux-generic/odp_thread_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2018-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #include <odp/api/thread.h> diff --git a/platform/linux-generic/odp_thrmask.c b/platform/linux-generic/odp_thrmask.c index f8704a0dd..1dfde9e1b 100644 --- a/platform/linux-generic/odp_thrmask.c +++ b/platform/linux-generic/odp_thrmask.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ #include <odp/api/thrmask.h> diff --git a/platform/linux-generic/odp_ticketlock_api.c b/platform/linux-generic/odp_ticketlock_api.c index 8995dd555..aac5945a6 100644 --- a/platform/linux-generic/odp_ticketlock_api.c +++ b/platform/linux-generic/odp_ticketlock_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited */ #include <odp/api/ticketlock.h> diff --git a/platform/linux-generic/odp_time_api.c b/platform/linux-generic/odp_time_api.c index d906e14b8..1aca5eb8c 100644 --- a/platform/linux-generic/odp_time_api.c +++ b/platform/linux-generic/odp_time_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited */ #include <odp/api/time.h> diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index c8ea31078..7741cfd4c 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2019-2023 Nokia */ /** @@ -46,7 +44,7 @@ #include <odp_libconfig_internal.h> #include <odp_macros_internal.h> #include <odp_pool_internal.h> -#include <odp_print_internal.h> +#include <odp_string_internal.h> #include <odp_queue_if.h> #include <odp_timer_internal.h> #include <odp_types_internal.h> @@ -190,10 +188,10 @@ typedef struct timer_pool_s { odp_atomic_u32_t notify_overrun; int owner; pthread_t thr_pthread; /* pthread_t of timer thread */ - pid_t thr_pid; /* gettid() for timer thread */ + odp_atomic_u64_t thr_pid; /* gettid() for timer thread */ int thr_warm_up; /* number of warm up rounds */ odp_atomic_u32_t thr_ready; /* thread ready from warm up */ - int thr_exit; /* request to exit for timer thread */ + odp_atomic_u32_t thr_exit; /* request to exit for timer thread */ double base_freq; uint64_t max_multiplier; uint8_t periodic; @@ -342,7 +340,7 @@ static void posix_timer_stop(timer_pool_t *tp) /* Stop the thread */ _ODP_DBG("stop\n"); - tp->thr_exit = 1; + odp_atomic_store_u32(&tp->thr_exit, 1); ret = pthread_join(tp->thr_pthread, NULL); if (ret != 0) _ODP_ABORT("Unable to join thread, err %d\n", ret); @@ -934,6 +932,7 @@ static void *timer_thread(void *arg) siginfo_t si; int warm_up = tp->thr_warm_up; int num = 0; + pid_t thr_pid; tmo.tv_sec = 0; tmo.tv_nsec = ODP_TIME_MSEC_IN_NS * 100; @@ -944,15 +943,18 @@ static void *timer_thread(void *arg) sigaddset(&sigset, SIGALRM); /* Signal that this thread has started */ - odp_mb_full(); - tp->thr_pid = (pid_t)syscall(SYS_gettid); - odp_mb_full(); + thr_pid = (pid_t)syscall(SYS_gettid); + if (thr_pid <= 0) { + _ODP_ERR("Invalid tid: %d\n", thr_pid); + return NULL; + } + odp_atomic_store_u64(&tp->thr_pid, thr_pid); while (1) { ret = sigtimedwait(&sigset, &si, &tmo); - if (tp->thr_exit) { - tp->thr_pid = 0; + if (odp_atomic_load_u32(&tp->thr_exit)) { + odp_atomic_store_u64(&tp->thr_pid, 0); return NULL; } @@ -1061,7 +1063,7 @@ static void posix_timer_start(timer_pool_t *tp) sec = res / ODP_TIME_SEC_IN_NS; nsec = res - sec * ODP_TIME_SEC_IN_NS; - tp->thr_pid = 0; + odp_atomic_init_u64(&tp->thr_pid, 0); tp->thr_warm_up = 1; /* 20ms warm up */ @@ -1074,13 +1076,13 @@ static void posix_timer_start(timer_pool_t *tp) _ODP_ABORT("Unable to create timer thread: %d\n", ret); /* wait thread set tp->thr_pid */ - while (tp->thr_pid == 0) - sched_yield(); + while (!odp_atomic_load_u64(&tp->thr_pid)) + odp_cpu_pause(); memset(&sigev, 0, sizeof(sigev)); sigev.sigev_notify = SIGEV_THREAD_ID; sigev.sigev_value.sival_ptr = tp; - sigev._sigev_un._tid = tp->thr_pid; + sigev._sigev_un._tid = odp_atomic_load_u64(&tp->thr_pid); sigev.sigev_signo = SIGALRM; if (timer_create(CLOCK_MONOTONIC, &sigev, &tp->timerid)) @@ -1098,7 +1100,7 @@ static void posix_timer_start(timer_pool_t *tp) /* Wait response from timer thread that warm up signals have been * processed. Warm up helps avoiding overrun on the first timeout. */ while (odp_atomic_load_acq_u32(&tp->thr_ready) == 0) - sched_yield(); + odp_cpu_pause(); if (ODP_DEBUG_PRINT) { uint32_t old_val = 0; @@ -1232,12 +1234,10 @@ static odp_timer_pool_t timer_pool_new(const char *name, const odp_timer_pool_pa odp_atomic_init_u64(&tp->cur_tick, 0); - if (name == NULL) { + if (name == NULL) tp->name[0] = 0; - } else { - strncpy(tp->name, name, ODP_TIMER_POOL_NAME_LEN - 1); - tp->name[ODP_TIMER_POOL_NAME_LEN - 1] = 0; - } + else + _odp_strcpy(tp->name, name, ODP_TIMER_POOL_NAME_LEN); tp->param = *param; tp->param.res_ns = res_ns; @@ -1251,6 +1251,7 @@ static odp_timer_pool_t timer_pool_new(const char *name, const odp_timer_pool_pa tp->num_alloc = 0; odp_atomic_init_u32(&tp->high_wm, 0); odp_atomic_init_u32(&tp->notify_overrun, 0); + odp_atomic_init_u32(&tp->thr_exit, 0); tp->first_free = 0; tp->owner = -1; diff --git a/platform/linux-generic/odp_timer_api.c b/platform/linux-generic/odp_timer_api.c index cd657956b..7a3f6efce 100644 --- a/platform/linux-generic/odp_timer_api.c +++ b/platform/linux-generic/odp_timer_api.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Nokia */ #include <odp/api/timer.h> diff --git a/platform/linux-generic/odp_timer_wheel.c b/platform/linux-generic/odp_timer_wheel.c index 876e06730..aee65e82d 100644 --- a/platform/linux-generic/odp_timer_wheel.c +++ b/platform/linux-generic/odp_timer_wheel.c @@ -1,9 +1,6 @@ -/* Copyright 2015 EZchip Semiconductor Ltd. All Rights Reserved. - * - * Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015 EZchip Semiconductor Ltd. + * Copyright (c) 2015-2018 Linaro Limited */ #include <stdint.h> diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c index f0327fad0..6311c941d 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -1,15 +1,13 @@ -/* Copyright 2015 EZchip Semiconductor Ltd. All Rights Reserved. - * - * Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2022, Marvell - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015 EZchip Semiconductor Ltd. + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2022 Marvell + * Copyright (c) 2022 Nokia */ #include <odp_posix_extensions.h> +#include <odp/api/cpu.h> #include <odp/api/packet.h> #include <odp/api/packet_flags.h> #include <odp/api/std_types.h> @@ -160,7 +158,6 @@ typedef struct { int cpu_num; /* Service threads */ - uint64_t busy_wait_counter; odp_bool_t main_loop_running; odp_atomic_u64_t atomic_request_cnt; odp_atomic_u64_t currently_serving_cnt; @@ -492,6 +489,7 @@ static tm_system_t *tm_system_alloc(void) memset(tm_system, 0, sizeof(tm_system_t)); tm_system->tm_idx = tm_idx; tm_system->status = TM_STATUS_RESERVED; + odp_atomic_init_u32(&tm_system->is_idle, 0); return tm_system; } } @@ -2415,14 +2413,6 @@ static int tm_process_expired_timers(tm_system_t *tm_system, return work_done; } -static void busy_wait(uint32_t iterations) -{ - uint32_t cnt; - - for (cnt = 1; cnt <= iterations; cnt++) - tm_glb->busy_wait_counter++; -} - static void signal_request(void) { uint64_t request_num, serving; @@ -2431,7 +2421,7 @@ static void signal_request(void) serving = odp_atomic_load_u64(&tm_glb->currently_serving_cnt); while (serving != request_num) { - busy_wait(100); + odp_cpu_pause(); serving = odp_atomic_load_u64(&tm_glb->currently_serving_cnt); } } @@ -2448,11 +2438,11 @@ static void check_for_request(void) /* Signal the other requesting thread to proceed and then * wait for their done indication */ odp_atomic_inc_u64(&tm_glb->currently_serving_cnt); - busy_wait(100); + odp_cpu_pause(); done_cnt = odp_atomic_load_u64(&tm_glb->atomic_done_cnt); while (done_cnt != request_num) { - busy_wait(100); + odp_cpu_pause(); done_cnt = odp_atomic_load_u64(&tm_glb->atomic_done_cnt); } } @@ -2506,7 +2496,7 @@ static void *tm_system_thread(void *arg) odp_barrier_wait(&tm_group->tm_group_barrier); tm_glb->main_loop_running = true; - destroying = odp_atomic_load_u64(&tm_system->destroying); + destroying = odp_atomic_load_acq_u64(&tm_system->destroying); current_ns = odp_time_to_ns(odp_time_local()); _odp_timer_wheel_start(_odp_int_timer_wheel, current_ns); @@ -2547,9 +2537,9 @@ static void *tm_system_thread(void *arg) current_ns = odp_time_to_ns(odp_time_local()); tm_system->current_time = current_ns; - tm_system->is_idle = (timer_cnt == 0) && - (work_queue_cnt == 0); - destroying = odp_atomic_load_u64(&tm_system->destroying); + odp_atomic_store_rel_u32(&tm_system->is_idle, + (timer_cnt == 0) && (work_queue_cnt == 0)); + destroying = odp_atomic_load_acq_u64(&tm_system->destroying); /* Advance to the next tm_system in the tm_system_group. */ tm_system = tm_system->next; @@ -2569,7 +2559,7 @@ odp_bool_t odp_tm_is_idle(odp_tm_t odp_tm) tm_system_t *tm_system; tm_system = GET_TM_SYSTEM(odp_tm); - return tm_system->is_idle; + return odp_atomic_load_acq_u32(&tm_system->is_idle); } void odp_tm_requirements_init(odp_tm_requirements_t *requirements) @@ -3214,7 +3204,7 @@ int odp_tm_destroy(odp_tm_t odp_tm) * all new pkts are prevented from coming in. */ odp_barrier_init(&tm_system->tm_system_destroy_barrier, 2); - odp_atomic_inc_u64(&tm_system->destroying); + odp_atomic_store_rel_u64(&tm_system->destroying, 1); odp_barrier_wait(&tm_system->tm_system_destroy_barrier); /* Remove ourselves from the group. If we are the last tm_system in @@ -4525,7 +4515,7 @@ int odp_tm_enq(odp_tm_queue_t tm_queue, odp_packet_t pkt) if (!tm_system) return -1; - if (odp_atomic_load_u64(&tm_system->destroying)) + if (odp_atomic_load_acq_u64(&tm_system->destroying)) return -1; rc = tm_enqueue(tm_system, tm_queue_obj, pkt); @@ -4549,7 +4539,7 @@ int odp_tm_enq_with_cnt(odp_tm_queue_t tm_queue, odp_packet_t pkt) if (!tm_system) return -1; - if (odp_atomic_load_u64(&tm_system->destroying)) + if (odp_atomic_load_acq_u64(&tm_system->destroying)) return -1; rc = tm_enqueue(tm_system, tm_queue_obj, pkt); @@ -4575,7 +4565,7 @@ int odp_tm_enq_multi(odp_tm_queue_t tm_queue, const odp_packet_t packets[], if (!tm_system) return -1; - if (odp_atomic_load_u64(&tm_system->destroying)) + if (odp_atomic_load_acq_u64(&tm_system->destroying)) return -1; for (i = 0; i < num; i++) { diff --git a/platform/linux-generic/odp_version.c b/platform/linux-generic/odp_version.c index baa336839..8c8b9be09 100644 --- a/platform/linux-generic/odp_version.c +++ b/platform/linux-generic/odp_version.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ #include <odp/api/version.h> diff --git a/platform/linux-generic/odp_weak.c b/platform/linux-generic/odp_weak.c index 747886d4e..aab23b1ec 100644 --- a/platform/linux-generic/odp_weak.c +++ b/platform/linux-generic/odp_weak.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited */ #include <odp/api/debug.h> diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 3fa796007..b28e63890 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2019-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited + * Copyright (c) 2019-2023 Nokia */ #include <odp/autoheader_internal.h> @@ -34,6 +32,7 @@ #include <protocols/udp.h> #include <odp_pool_internal.h> #include <odp_socket_common.h> +#include <odp_string_internal.h> #include <rte_config.h> #include <rte_common.h> @@ -119,6 +118,8 @@ ODP_STATIC_ASSERT(CONFIG_PACKET_HEADROOM == RTE_PKTMBUF_HEADROOM, #define IXGBE_DRV_NAME "net_ixgbe" #define I40E_DRV_NAME "net_i40e" +#define PCAP_DRV_NAME "net_pcap" + #define DPDK_MEMORY_MB 512 #define DPDK_NB_MBUF 16384 #define DPDK_MBUF_BUF_SIZE RTE_MBUF_DEFAULT_BUF_SIZE @@ -1434,7 +1435,7 @@ static int dpdk_pktio_init(void) if (numa_nodes <= 0) numa_nodes = 1; - char mem_str[mem_str_len * numa_nodes]; + char mem_str[mem_str_len * numa_nodes + 1]; for (i = 0; i < numa_nodes; i++) sprintf(&mem_str[i * mem_str_len], "%d,", DPDK_MEMORY_MB); @@ -2084,14 +2085,20 @@ static int dpdk_start(pktio_entry_t *pktio_entry) uint16_t port_id = pkt_dpdk->port_id; int ret; - /* DPDK doesn't support nb_rx_q/nb_tx_q being 0 */ - if (!pktio_entry->num_in_queue) - pktio_entry->num_in_queue = 1; - if (!pktio_entry->num_out_queue) - pktio_entry->num_out_queue = 1; - rte_eth_dev_info_get(port_id, &dev_info); + /* Pcap driver reconfiguration may fail if number of rx/tx queues is set to zero */ + if (!strncmp(dev_info.driver_name, PCAP_DRV_NAME, strlen(PCAP_DRV_NAME))) { + if (!pktio_entry->num_in_queue) { + pktio_entry->num_in_queue = 1; + pkt_dpdk->num_rx_desc[0] = dev_info.rx_desc_lim.nb_min; + } + if (!pktio_entry->num_out_queue) { + pktio_entry->num_out_queue = 1; + pkt_dpdk->num_tx_desc[0] = dev_info.tx_desc_lim.nb_min; + } + } + /* Setup device */ if (dpdk_setup_eth_dev(pktio_entry)) { _ODP_ERR("Failed to configure device\n"); @@ -2468,8 +2475,8 @@ static int dpdk_extra_stat_info(pktio_entry_t *pktio_entry, num_stats = ret; for (i = 0; i < num && i < num_stats; i++) - strncpy(info[i].name, xstats_names[i].name, - ODP_PKTIO_STATS_EXTRA_NAME_LEN - 1); + _odp_strcpy(info[i].name, xstats_names[i].name, + ODP_PKTIO_STATS_EXTRA_NAME_LEN); return num_stats; } diff --git a/platform/linux-generic/pktio/ethtool_rss.c b/platform/linux-generic/pktio/ethtool_rss.c index df97e2417..7cfce7812 100644 --- a/platform/linux-generic/pktio/ethtool_rss.c +++ b/platform/linux-generic/pktio/ethtool_rss.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited */ #include <odp_posix_extensions.h> diff --git a/platform/linux-generic/pktio/io_ops.c b/platform/linux-generic/pktio/io_ops.c index 141b881e3..ff97a25be 100644 --- a/platform/linux-generic/pktio/io_ops.c +++ b/platform/linux-generic/pktio/io_ops.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited */ #include <odp/autoheader_internal.h> diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c index dd286328a..2e6110dc2 100644 --- a/platform/linux-generic/pktio/ipc.c +++ b/platform/linux-generic/pktio/ipc.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2019-2022 Nokia */ #include <odp/api/hints.h> @@ -313,7 +311,7 @@ static int _ipc_init_master(pktio_entry_t *pktio_entry, /* Set up pool name for remote info */ pinfo = pktio_ipc->pinfo; pool_name = _ipc_odp_buffer_pool_shm_name(pool_hdl); - if (strlen(pool_name) > ODP_POOL_NAME_LEN) { + if (strlen(pool_name) >= ODP_POOL_NAME_LEN) { _ODP_ERR("pid %d ipc pool name %s is too big %zu\n", getpid(), pool_name, strlen(pool_name)); goto free_s_prod; diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index ff48525a3..05a1a3dce 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2013-2023, Nokia Solutions and Networks - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2013-2023 Nokia Solutions and Networks */ #include <odp/api/debug.h> diff --git a/platform/linux-generic/pktio/null.c b/platform/linux-generic/pktio/null.c index 00c45f84a..862969415 100644 --- a/platform/linux-generic/pktio/null.c +++ b/platform/linux-generic/pktio/null.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2018-2018, Linaro Limited - * Copyright (c) 2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2022 Nokia */ #include <odp/api/debug.h> diff --git a/platform/linux-generic/pktio/pcap.c b/platform/linux-generic/pktio/pcap.c index 78b9876d7..02b4d467a 100644 --- a/platform/linux-generic/pktio/pcap.c +++ b/platform/linux-generic/pktio/pcap.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2021-2023 Nokia */ /** @@ -195,10 +193,12 @@ static int pcapif_promisc_mode_set(pktio_entry_t *pktio_entry, } if (pcap_setfilter(pcap->rx, &bpf) != 0) { + pcap_freecode(&bpf); _ODP_ERR("failed to set promisc mode filter: %s\n", pcap_geterr(pcap->rx)); return -1; } + pcap_freecode(&bpf); pcap->promisc = enable; return 0; diff --git a/platform/linux-generic/pktio/pktio_common.c b/platform/linux-generic/pktio/pktio_common.c index 097b8cf29..7dbd77c49 100644 --- a/platform/linux-generic/pktio/pktio_common.c +++ b/platform/linux-generic/pktio/pktio_common.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2013, Nokia Solutions and Networks - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2013 Nokia Solutions and Networks */ #include <odp_packet_io_internal.h> diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index 2a037e51f..bd4ffc94f 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2013-2023, Nokia Solutions and Networks - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2013-2023 Nokia Solutions and Networks */ #include <odp_posix_extensions.h> diff --git a/platform/linux-generic/pktio/socket_common.c b/platform/linux-generic/pktio/socket_common.c index dabe86aa2..503df1685 100644 --- a/platform/linux-generic/pktio/socket_common.c +++ b/platform/linux-generic/pktio/socket_common.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2019-2020, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2019-2020 Nokia */ #include <odp_posix_extensions.h> diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c index 92bf8a4bf..e8457cac2 100644 --- a/platform/linux-generic/pktio/socket_mmap.c +++ b/platform/linux-generic/pktio/socket_mmap.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * Copyright (c) 2013-2023, Nokia Solutions and Networks - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2013-2023 Nokia Solutions and Networks */ #include <odp_posix_extensions.h> diff --git a/platform/linux-generic/pktio/socket_xdp.c b/platform/linux-generic/pktio/socket_xdp.c index 599942657..2cd7b080b 100644 --- a/platform/linux-generic/pktio/socket_xdp.c +++ b/platform/linux-generic/pktio/socket_xdp.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2022-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022-2023 Nokia */ #include <odp/autoheader_internal.h> diff --git a/platform/linux-generic/pktio/stats/ethtool_stats.c b/platform/linux-generic/pktio/stats/ethtool_stats.c index bbf0729f1..1cee0c4d5 100644 --- a/platform/linux-generic/pktio/stats/ethtool_stats.c +++ b/platform/linux-generic/pktio/stats/ethtool_stats.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2021-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2021-2022 Nokia */ #include <odp_posix_extensions.h> @@ -10,6 +8,7 @@ #include <odp/api/packet_io_stats.h> #include <odp_debug_internal.h> +#include <odp_string_internal.h> #include <odp_ethtool_stats.h> #include <sys/ioctl.h> @@ -234,7 +233,7 @@ int _odp_ethtool_extra_stat_info(int fd, const char *name, for (i = 0; i < n_stats && i < (unsigned int)num; i++) { char *cnt = (char *)&strings->data[i * ETH_GSTRING_LEN]; - strncpy(info[i].name, cnt, ODP_PKTIO_STATS_EXTRA_NAME_LEN - 1); + _odp_strcpy(info[i].name, cnt, ODP_PKTIO_STATS_EXTRA_NAME_LEN); } free(strings); diff --git a/platform/linux-generic/pktio/stats/packet_io_stats.c b/platform/linux-generic/pktio/stats/packet_io_stats.c index 280aca250..b839faaa6 100644 --- a/platform/linux-generic/pktio/stats/packet_io_stats.c +++ b/platform/linux-generic/pktio/stats/packet_io_stats.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2021, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2014-2018 Linaro Limited + * Copyright (c) 2021 Nokia */ #include <odp_packet_io_stats.h> diff --git a/platform/linux-generic/pktio/stats/sysfs_stats.c b/platform/linux-generic/pktio/stats/sysfs_stats.c index 2b47d4b83..9d2b3ec75 100644 --- a/platform/linux-generic/pktio/stats/sysfs_stats.c +++ b/platform/linux-generic/pktio/stats/sysfs_stats.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2021-2022, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2021-2022 Nokia */ #include <odp/api/packet_io_stats.h> diff --git a/platform/linux-generic/pktio/tap.c b/platform/linux-generic/pktio/tap.c index baac09646..7806f825a 100644 --- a/platform/linux-generic/pktio/tap.c +++ b/platform/linux-generic/pktio/tap.c @@ -1,8 +1,6 @@ -/* Copyright (c) 2015, Ilya Maximets <i.maximets@samsung.com> - * Copyright (c) 2021-2023, Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015 Ilya Maximets <i.maximets@samsung.com> + * Copyright (c) 2021-2023 Nokia */ /** diff --git a/platform/linux-generic/test/example/Makefile.am b/platform/linux-generic/test/example/Makefile.am index 947647cd4..a9d0948de 100644 --- a/platform/linux-generic/test/example/Makefile.am +++ b/platform/linux-generic/test/example/Makefile.am @@ -1,6 +1,5 @@ SUBDIRS = \ classifier \ - generator \ ipsec_api \ ipsec_crypto \ l2fwd_simple \ diff --git a/platform/linux-generic/test/example/classifier/pktio_env b/platform/linux-generic/test/example/classifier/pktio_env index eb8f2a80a..1a3cc51a2 100644 --- a/platform/linux-generic/test/example/classifier/pktio_env +++ b/platform/linux-generic/test/example/classifier/pktio_env @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (c) 2020, Marvell -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Marvell # # Script to setup interfaces used for running application on linux-generic. # diff --git a/platform/linux-generic/test/example/generator/Makefile.am b/platform/linux-generic/test/example/generator/Makefile.am deleted file mode 100644 index 2ffced539..000000000 --- a/platform/linux-generic/test/example/generator/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = pktio_env diff --git a/platform/linux-generic/test/example/generator/pktio_env b/platform/linux-generic/test/example/generator/pktio_env deleted file mode 100644 index 06af667e8..000000000 --- a/platform/linux-generic/test/example/generator/pktio_env +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2020, Marvell -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# -# Script to setup interfaces used for running application on linux-generic. -# -# Generator uses null interfaces to validate udp mode. -# -# Network set-up -# IF0 ---> null:0 - -IF0=null:0 - -if [ "$0" = "$BASH_SOURCE" ]; then - echo "Error: Platform specific env file has to be sourced." -fi - -validate_result() -{ - return 0 -} - -setup_interfaces() -{ - return 0 -} - -cleanup_interfaces() -{ - return 0 -} diff --git a/platform/linux-generic/test/example/ipsec_api/pktio_env b/platform/linux-generic/test/example/ipsec_api/pktio_env index b3a073631..67a59919a 100644 --- a/platform/linux-generic/test/example/ipsec_api/pktio_env +++ b/platform/linux-generic/test/example/ipsec_api/pktio_env @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (C) 2021, Marvell -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2021 Marvell # # Script to setup interfaces used for running application on linux-generic. # diff --git a/platform/linux-generic/test/example/ipsec_crypto/pktio_env b/platform/linux-generic/test/example/ipsec_crypto/pktio_env index fd770ac41..82d68f860 100644 --- a/platform/linux-generic/test/example/ipsec_crypto/pktio_env +++ b/platform/linux-generic/test/example/ipsec_crypto/pktio_env @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (C) 2021, Marvell -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2021 Marvell # # Script to setup interfaces used for running application on linux-generic. # diff --git a/platform/linux-generic/test/example/l2fwd_simple/pktio_env b/platform/linux-generic/test/example/l2fwd_simple/pktio_env index e1fbe87cc..016ebf660 100644 --- a/platform/linux-generic/test/example/l2fwd_simple/pktio_env +++ b/platform/linux-generic/test/example/l2fwd_simple/pktio_env @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (C) 2020, Marvell -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Marvell # # Script to setup interfaces used for running application on linux-generic. # diff --git a/platform/linux-generic/test/example/l3fwd/pktio_env b/platform/linux-generic/test/example/l3fwd/pktio_env index a692d79bc..b176d5a3b 100644 --- a/platform/linux-generic/test/example/l3fwd/pktio_env +++ b/platform/linux-generic/test/example/l3fwd/pktio_env @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (C) 2020, Marvell -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Marvell # # Script to setup interfaces used for running application on linux-generic. # diff --git a/platform/linux-generic/test/example/packet/pktio_env b/platform/linux-generic/test/example/packet/pktio_env index 4e1914e2e..47d643ef0 100644 --- a/platform/linux-generic/test/example/packet/pktio_env +++ b/platform/linux-generic/test/example/packet/pktio_env @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (C) 2020, Marvell -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Marvell # # Script to setup interfaces used for running application on linux-generic. # diff --git a/platform/linux-generic/test/example/ping/pktio_env b/platform/linux-generic/test/example/ping/pktio_env index 90106da9d..8b3464ee4 100644 --- a/platform/linux-generic/test/example/ping/pktio_env +++ b/platform/linux-generic/test/example/ping/pktio_env @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (C) 2020, Marvell -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Marvell # # Script to setup interfaces used for running application on linux-generic. # diff --git a/platform/linux-generic/test/example/simple_pipeline/pktio_env b/platform/linux-generic/test/example/simple_pipeline/pktio_env index e1fbe87cc..016ebf660 100644 --- a/platform/linux-generic/test/example/simple_pipeline/pktio_env +++ b/platform/linux-generic/test/example/simple_pipeline/pktio_env @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (C) 2020, Marvell -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Marvell # # Script to setup interfaces used for running application on linux-generic. # diff --git a/platform/linux-generic/test/example/switch/pktio_env b/platform/linux-generic/test/example/switch/pktio_env index 78201cec7..8df735b3b 100644 --- a/platform/linux-generic/test/example/switch/pktio_env +++ b/platform/linux-generic/test/example/switch/pktio_env @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (C) 2020, Marvell -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2020 Marvell # # Script to setup interfaces used for running application on linux-generic. # diff --git a/platform/linux-generic/test/validation/api/ml/ml_linux.c b/platform/linux-generic/test/validation/api/ml/ml_linux.c index 28e18fbb5..30d4ec6ba 100644 --- a/platform/linux-generic/test/validation/api/ml/ml_linux.c +++ b/platform/linux-generic/test/validation/api/ml/ml_linux.c @@ -414,6 +414,21 @@ static void test_ml_model_lookup(void) CU_ASSERT(odp_ml_model_destroy(model2) == 0); } +static void test_ml_model_long_name(void) +{ + odp_ml_model_t model; + char name[ODP_ML_MODEL_NAME_LEN]; + + memset(name, 'a', sizeof(name)); + name[sizeof(name) - 1] = 0; + + model = odp_ml_model_create(name, &global.model_param); + CU_ASSERT_FATAL(model != ODP_ML_MODEL_INVALID); + + CU_ASSERT(odp_ml_model_to_u64(model) == odp_ml_model_to_u64(odp_ml_model_lookup(name))); + CU_ASSERT(odp_ml_model_destroy(model) == 0); +} + static void test_ml_model_info(void) { int ret; @@ -1130,6 +1145,7 @@ odp_testinfo_t ml_suite[] = { ODP_TEST_INFO_CONDITIONAL(test_ml_debug, check_ml_support), ODP_TEST_INFO_CONDITIONAL(test_ml_model_create, check_ml_support), ODP_TEST_INFO_CONDITIONAL(test_ml_model_lookup, check_ml_support), + ODP_TEST_INFO_CONDITIONAL(test_ml_model_long_name, check_ml_support), ODP_TEST_INFO_CONDITIONAL(test_ml_model_info, check_ml_support), ODP_TEST_INFO_CONDITIONAL(test_ml_model_load, check_load_sync), ODP_TEST_INFO_CONDITIONAL(test_ml_model_load_async_poll, check_load_poll), diff --git a/platform/linux-generic/test/validation/api/pktio/pktio_env b/platform/linux-generic/test/validation/api/pktio/pktio_env index ba9998e6a..754e73b75 100644 --- a/platform/linux-generic/test/validation/api/pktio/pktio_env +++ b/platform/linux-generic/test/validation/api/pktio/pktio_env @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (c) 2015-2018, Linaro Limited -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2015-2018 Linaro Limited # # Test script wrapper for running ODP pktio apps on linux-generic. # diff --git a/platform/linux-generic/test/validation/api/pktio/pktio_run.sh b/platform/linux-generic/test/validation/api/pktio/pktio_run.sh index cac297768..89671df54 100755 --- a/platform/linux-generic/test/validation/api/pktio/pktio_run.sh +++ b/platform/linux-generic/test/validation/api/pktio/pktio_run.sh @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (c) 2015-2018, Linaro Limited -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2015-2018 Linaro Limited # # Proceed the pktio tests. This script expects at least one argument: diff --git a/platform/linux-generic/test/validation/api/pktio/pktio_run_dpdk.sh b/platform/linux-generic/test/validation/api/pktio/pktio_run_dpdk.sh index 39b540228..68510c2a3 100755 --- a/platform/linux-generic/test/validation/api/pktio/pktio_run_dpdk.sh +++ b/platform/linux-generic/test/validation/api/pktio/pktio_run_dpdk.sh @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (c) 2016-2018, Linaro Limited -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2016-2018 Linaro Limited # # Proceed the pktio tests. This script expects at least one argument: diff --git a/platform/linux-generic/test/validation/api/pktio/pktio_run_pcap.sh b/platform/linux-generic/test/validation/api/pktio/pktio_run_pcap.sh index 290bc81d5..700abbf35 100755 --- a/platform/linux-generic/test/validation/api/pktio/pktio_run_pcap.sh +++ b/platform/linux-generic/test/validation/api/pktio/pktio_run_pcap.sh @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (c) 2015-2018, Linaro Limited -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2015-2018 Linaro Limited # # any parameter passed as arguments to this script is passed unchanged to diff --git a/platform/linux-generic/test/validation/api/pktio/pktio_run_tap.sh b/platform/linux-generic/test/validation/api/pktio/pktio_run_tap.sh index ecfe5a126..0fd08134e 100755 --- a/platform/linux-generic/test/validation/api/pktio/pktio_run_tap.sh +++ b/platform/linux-generic/test/validation/api/pktio/pktio_run_tap.sh @@ -1,9 +1,7 @@ #!/bin/sh # -# Copyright (c) 2015, Ilya Maximets <i.maximets@samsung.com> -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2015 Ilya Maximets <i.maximets@samsung.com> # diff --git a/platform/linux-generic/test/validation/api/shmem/shmem_common.h b/platform/linux-generic/test/validation/api/shmem/shmem_common.h index 33df4476c..145aea350 100644 --- a/platform/linux-generic/test/validation/api/shmem/shmem_common.h +++ b/platform/linux-generic/test/validation/api/shmem/shmem_common.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #ifndef _COMMON_TEST_SHMEM_H_ diff --git a/platform/linux-generic/test/validation/api/shmem/shmem_linux.c b/platform/linux-generic/test/validation/api/shmem/shmem_linux.c index 03a9255f7..061d86d6e 100644 --- a/platform/linux-generic/test/validation/api/shmem/shmem_linux.c +++ b/platform/linux-generic/test/validation/api/shmem/shmem_linux.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ /* this test makes sure that odp shared memory created with the ODP_SHM_PROC @@ -222,13 +220,17 @@ int main(int argc __attribute__((unused)), char *argv[]) uid_t uid = getuid(); char *shm_dir = getenv("ODP_SHM_DIR"); const char *exeext = getenv("EXEEXT"); + char *dir_name; if (exeext == NULL) exeext = ""; - /* odp_app1 is in the same directory as this file: */ strncpy(prg_name, argv[0], PATH_MAX - 1); - sprintf(odp_name1, "%s/%s%s", dirname(prg_name), ODP_APP1_NAME, exeext); + prg_name[PATH_MAX - 1] = 0; + dir_name = dirname(prg_name); + + /* odp_app1 is in the same directory as this file: */ + snprintf(odp_name1, sizeof(odp_name1), "%s/%s%s", dir_name, ODP_APP1_NAME, exeext); /* start the ODP application: */ odp_app1 = fork(); @@ -300,8 +302,7 @@ int main(int argc __attribute__((unused)), char *argv[]) } /* odp_app2 is in the same directory as this file: */ - strncpy(prg_name, argv[0], PATH_MAX - 1); - sprintf(odp_name2, "%s/%s%s", dirname(prg_name), ODP_APP2_NAME, exeext); + snprintf(odp_name2, sizeof(odp_name2), "%s/%s%s", dir_name, ODP_APP2_NAME, exeext); /* start the second ODP application with pid of ODP_APP1 as parameter:*/ sprintf(pid1, "%d", odp_app1); diff --git a/platform/linux-generic/test/validation/api/shmem/shmem_linux.h b/platform/linux-generic/test/validation/api/shmem/shmem_linux.h index 24646ae7c..d3f83636b 100644 --- a/platform/linux-generic/test/validation/api/shmem/shmem_linux.h +++ b/platform/linux-generic/test/validation/api/shmem/shmem_linux.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ void test_success(char *fifo_name, int fd, pid_t odp_app); diff --git a/platform/linux-generic/test/validation/api/shmem/shmem_odp1.c b/platform/linux-generic/test/validation/api/shmem/shmem_odp1.c index 98148d6c7..09dd04cd1 100644 --- a/platform/linux-generic/test/validation/api/shmem/shmem_odp1.c +++ b/platform/linux-generic/test/validation/api/shmem/shmem_odp1.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #include <odp_api.h> diff --git a/platform/linux-generic/test/validation/api/shmem/shmem_odp1.h b/platform/linux-generic/test/validation/api/shmem/shmem_odp1.h index 241637e58..64bffd684 100644 --- a/platform/linux-generic/test/validation/api/shmem/shmem_odp1.h +++ b/platform/linux-generic/test/validation/api/shmem/shmem_odp1.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ void shmem_test_odp_shm_proc(void); diff --git a/platform/linux-generic/test/validation/api/shmem/shmem_odp2.c b/platform/linux-generic/test/validation/api/shmem/shmem_odp2.c index 14ad2d82e..1f4c04fa0 100644 --- a/platform/linux-generic/test/validation/api/shmem/shmem_odp2.c +++ b/platform/linux-generic/test/validation/api/shmem/shmem_odp2.c @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ #include <odp_api.h> diff --git a/platform/linux-generic/test/validation/api/shmem/shmem_odp2.h b/platform/linux-generic/test/validation/api/shmem/shmem_odp2.h index 0493d6caa..cf841e6fd 100644 --- a/platform/linux-generic/test/validation/api/shmem/shmem_odp2.h +++ b/platform/linux-generic/test/validation/api/shmem/shmem_odp2.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2016-2018 Linaro Limited */ int main(int argc, char *argv[]); |