From 34a8575d8a00338054b1f0e46d2cec5d734acefd Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Wed, 5 Jul 2023 17:05:25 +0300 Subject: [PATCH 001/192] linux-gen: aarch64: remove duplicate flag filtering Rename flag names so that each flag has a unique name. Duplicate names relate to a single ARM feature which involves two register flags when CPU implements both Advanced SIMD and SVE. It's more informative to print both flags instead of combining those into a single flag. Remove HWCAP_ prefix from flags to shorten the names. FEAT_ prefix is maintained as it refers to feature names in ARM specifications. Signed-off-by: Petri Savolainen Reviewed-by: Tuomas Taipale --- .../linux-generic/arch/aarch64/cpu_flags.c | 54 +++++-------------- 1 file changed, 13 insertions(+), 41 deletions(-) diff --git a/platform/linux-generic/arch/aarch64/cpu_flags.c b/platform/linux-generic/arch/aarch64/cpu_flags.c index 9c2e9fa458..a8bd4b3506 100644 --- a/platform/linux-generic/arch/aarch64/cpu_flags.c +++ b/platform/linux-generic/arch/aarch64/cpu_flags.c @@ -1,5 +1,5 @@ /* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2020-2022, Nokia + * Copyright (c) 2020-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -25,7 +25,7 @@ typedef struct { static hwcap_feat_flag_t hwcap_flags[] = { { - /* Floating-point Extensions */ + /* Floating-point support for single-precision and double-precision types */ .feat_flag = "FEAT_FP", #ifdef HWCAP_FP .hwcap_field = HWCAP_FP, @@ -34,8 +34,10 @@ static hwcap_feat_flag_t hwcap_flags[] = { }, { - /* Floating-point Extensions */ - .feat_flag = "FEAT_FP", + /* Advanced SIMD support for: + * - integer byte, halfword, word and doubleword element operations + * - single-precision and double-precision floating-point arithmetic */ + .feat_flag = "ASIMD", #ifdef HWCAP_ASIMD .hwcap_field = HWCAP_ASIMD, .valid = 1, @@ -44,7 +46,7 @@ static hwcap_feat_flag_t hwcap_flags[] = { { /* Generic Timer is configured to generate events at approx. 10KHz */ - .feat_flag = "HWCAP_EVTSTRM", + .feat_flag = "EVTSTRM", #ifdef HWCAP_EVTSTRM .hwcap_field = HWCAP_EVTSTRM, .valid = 1, @@ -115,8 +117,8 @@ static hwcap_feat_flag_t hwcap_flags[] = { }, { - /* Half-precision Floating-point Data Processing Instructions */ - .feat_flag = "FEAT_FP16", + /* Advanced SIMD support with half-precision floating-point arithmetic */ + .feat_flag = "ASIMDHP", #ifdef HWCAP_ASIMDHP .hwcap_field = HWCAP_ASIMDHP, .valid = 1, @@ -125,7 +127,7 @@ static hwcap_feat_flag_t hwcap_flags[] = { { /* Availability of EL0 Access to certain ID Registers */ - .feat_flag = "HWCAP_CPUID", + .feat_flag = "CPUID", #ifdef HWCAP_CPUID .hwcap_field = HWCAP_CPUID, .valid = 1, @@ -305,7 +307,7 @@ static hwcap_feat_flag_t hwcap_flags[] = { { /* Generic Authentication Extensions */ - .feat_flag = "HWCAP_PACG", + .feat_flag = "PACG", #ifdef HWCAP_PACG .hwcap_field = HWCAP_PACG, .valid = 1, @@ -397,7 +399,7 @@ static hwcap_feat_flag_t hwcap2_flags[] = { { /* SVE Int8 Matrix Multiplication Instructions */ - .feat_flag = "FEAT_I8MM", + .feat_flag = "SVEI8MM", #ifdef HWCAP2_SVEI8MM .hwcap_field = HWCAP2_SVEI8MM, .valid = 1, @@ -424,7 +426,7 @@ static hwcap_feat_flag_t hwcap2_flags[] = { { /* SVE BFloat16 Instructions */ - .feat_flag = "FEAT_BF16", + .feat_flag = "SVEBF16", #ifdef HWCAP2_SVEBF16 .hwcap_field = HWCAP2_SVEBF16, .valid = 1, @@ -868,26 +870,6 @@ static void _odp_sys_info_print_acle_flags(void) _ODP_PRINT("\n"); } -static int check_hwcap_duplicates(unsigned int hwcap_field) -{ - int ret = 0; - - /* FP and AdvSIMD fields of the AArch64 Processor - * Feature Register 0 must have the same value and are - * defined by the same feature flag. Print the flag - * only once. */ -#ifdef HWCAP_ASIMD - if (hwcap_field == HWCAP_ASIMD) - ret = 1; -#endif -#ifdef HWCAP_ASIMDHP - if (hwcap_field == HWCAP_ASIMDHP) - ret = 1; -#endif - - return ret; -} - static void _odp_sys_info_print_hwcap_flags(void) { unsigned long hwcaps, hwcaps2; @@ -901,11 +883,6 @@ static void _odp_sys_info_print_hwcap_flags(void) size = _ODP_ARRAY_SIZE(hwcap_flags); for (unsigned int i = 0; i < size; i++) { if (hwcap_flags[i].valid) { - if (check_hwcap_duplicates(hwcap_flags[i].hwcap_field)) { - hwcaps = hwcaps >> 1; - continue; - } - if (hwcaps & 0x01) _ODP_PRINT("%s ", hwcap_flags[i].feat_flag); hwcaps = hwcaps >> 1; @@ -935,11 +912,6 @@ static void _odp_sys_info_print_hwcap_flags(void) hwcaps = getauxval(AT_HWCAP); for (unsigned long i = 0; i < size; i++) { if (hwcap_flags[i].valid) { - if (check_hwcap_duplicates(hwcap_flags[i].hwcap_field)) { - hwcaps = hwcaps >> 1; - continue; - } - if (!(hwcaps & 0x01)) _ODP_PRINT("%s ", hwcap_flags[i].feat_flag); hwcaps = hwcaps >> 1; From ee2bb5d2f61c43b4bac24d151e7fdfcfcbbde67e Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Fri, 7 Jul 2023 13:42:55 +0300 Subject: [PATCH 002/192] linux-gen: aarch64: simplify HWCAP flag handling Match flags with bitwise AND operation instead of shifting the variable. This is also more robust than assuming that all flags are define in-order. Signed-off-by: Petri Savolainen Reviewed-by: Tuomas Taipale --- .../linux-generic/arch/aarch64/cpu_flags.c | 92 +++++++------------ 1 file changed, 35 insertions(+), 57 deletions(-) diff --git a/platform/linux-generic/arch/aarch64/cpu_flags.c b/platform/linux-generic/arch/aarch64/cpu_flags.c index a8bd4b3506..913eaec605 100644 --- a/platform/linux-generic/arch/aarch64/cpu_flags.c +++ b/platform/linux-generic/arch/aarch64/cpu_flags.c @@ -23,6 +23,10 @@ typedef struct { bool valid; } hwcap_feat_flag_t; +/* Linux HWCAP and HWCAP2 flags + * + * See https://docs.kernel.org/arch/arm64/elf_hwcaps.html for meaning of each flag. + */ static hwcap_feat_flag_t hwcap_flags[] = { { /* Floating-point support for single-precision and double-precision types */ @@ -872,74 +876,48 @@ static void _odp_sys_info_print_acle_flags(void) static void _odp_sys_info_print_hwcap_flags(void) { - unsigned long hwcaps, hwcaps2; - unsigned int size, size2; - - _ODP_PRINT("ARM FEATURES SUPPORTED BY HARDWARE:\n"); - - /* Print supported hardware flags via AT_HWCAP entry of the hwcaps - * auxiliary vector. */ - hwcaps = getauxval(AT_HWCAP); - size = _ODP_ARRAY_SIZE(hwcap_flags); - for (unsigned int i = 0; i < size; i++) { - if (hwcap_flags[i].valid) { - if (hwcaps & 0x01) - _ODP_PRINT("%s ", hwcap_flags[i].feat_flag); - hwcaps = hwcaps >> 1; - } - } + uint64_t hwcap, hwcap2; + uint32_t size, size2, i; - /* Print supported hardware flags via AT_HWCAP2 entry of the hwcaps - * auxiliary vector. */ - hwcaps2 = getauxval(AT_HWCAP2); - size2 = _ODP_ARRAY_SIZE(hwcap2_flags); - for (unsigned long i = 0; i < size2; i++) { - if (hwcap2_flags[i].valid) { - if (hwcaps2 & 0x01) - _ODP_PRINT("%s ", hwcap2_flags[i].feat_flag); - hwcaps2 = hwcaps2 >> 1; - } - } + hwcap = getauxval(AT_HWCAP); + hwcap2 = getauxval(AT_HWCAP2); + size = _ODP_ARRAY_SIZE(hwcap_flags); + size2 = _ODP_ARRAY_SIZE(hwcap2_flags); - _ODP_PRINT("\n"); - - /* Re-initialize hwcaps and hwcaps2 */ - hwcaps = 0; - hwcaps2 = 0; + _ODP_PRINT("ARM FEATURES SUPPORTED BY HARDWARE:\n"); - _ODP_PRINT("\nARM FEATURES NOT SUPPORTED BY HARDWARE:\n"); + /* Supported HWCAP flags */ + for (i = 0; i < size; i++) + if (hwcap & hwcap_flags[i].hwcap_field) + _ODP_PRINT("%s ", hwcap_flags[i].feat_flag); - hwcaps = getauxval(AT_HWCAP); - for (unsigned long i = 0; i < size; i++) { - if (hwcap_flags[i].valid) { - if (!(hwcaps & 0x01)) - _ODP_PRINT("%s ", hwcap_flags[i].feat_flag); - hwcaps = hwcaps >> 1; - } - } + /* Supported HWCAP2 flags */ + for (i = 0; i < size2; i++) + if (hwcap2 & hwcap2_flags[i].hwcap_field) + _ODP_PRINT("%s ", hwcap2_flags[i].feat_flag); - hwcaps2 = getauxval(AT_HWCAP2); - for (unsigned long i = 0; i < size2; i++) { - if (hwcap2_flags[i].valid) { - if (!(hwcaps2 & 0x01)) - _ODP_PRINT("%s ", hwcap2_flags[i].feat_flag); - hwcaps2 = hwcaps2 >> 1; - } - } + _ODP_PRINT("\n\nARM FEATURES NOT SUPPORTED BY HARDWARE:\n"); - _ODP_PRINT("\n"); + /* Unsupported HWCAP flags */ + for (i = 0; i < size; i++) + if (hwcap_flags[i].hwcap_field && (hwcap & hwcap_flags[i].hwcap_field) == 0) + _ODP_PRINT("%s ", hwcap_flags[i].feat_flag); - _ODP_PRINT("\nARM FEATURES NOT SUPPORTED BY KERNEL:\n"); + /* Unsupported HWCAP2 flags */ + for (i = 0; i < size2; i++) + if (hwcap2_flags[i].hwcap_field && (hwcap2 & hwcap2_flags[i].hwcap_field) == 0) + _ODP_PRINT("%s ", hwcap2_flags[i].feat_flag); - for (unsigned long i = 0; i < size; i++) { - if (!hwcap_flags[i].valid) + _ODP_PRINT("\n\nARM FEATURES UNKNOWN TO LINUX VERSION:\n"); + /* Unknown HWCAP flags */ + for (i = 0; i < size; i++) + if (hwcap_flags[i].hwcap_field == 0) _ODP_PRINT("%s ", hwcap_flags[i].feat_flag); - } - for (unsigned long i = 0; i < size2; i++) { - if (!hwcap2_flags[i].valid) + /* Unknown HWCAP2 flags */ + for (i = 0; i < size2; i++) + if (hwcap2_flags[i].hwcap_field == 0) _ODP_PRINT("%s ", hwcap2_flags[i].feat_flag); - } _ODP_PRINT("\n\n"); } From 2407129b6417e25fc14b20a3670b47a7ec2d18e0 Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Fri, 7 Jul 2023 13:55:56 +0300 Subject: [PATCH 003/192] linux-gen: aarch64: remove unused valid field Separate field is not needed to check if Linux knows as HWCAP flag. The flag field itself is initialized to zero. Signed-off-by: Petri Savolainen Reviewed-by: Tuomas Taipale --- .../linux-generic/arch/aarch64/cpu_flags.c | 52 ------------------- 1 file changed, 52 deletions(-) diff --git a/platform/linux-generic/arch/aarch64/cpu_flags.c b/platform/linux-generic/arch/aarch64/cpu_flags.c index 913eaec605..00877386dc 100644 --- a/platform/linux-generic/arch/aarch64/cpu_flags.c +++ b/platform/linux-generic/arch/aarch64/cpu_flags.c @@ -20,7 +20,6 @@ typedef struct { const char *feat_flag; const unsigned int hwcap_field; - bool valid; } hwcap_feat_flag_t; /* Linux HWCAP and HWCAP2 flags @@ -33,7 +32,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_FP", #ifdef HWCAP_FP .hwcap_field = HWCAP_FP, - .valid = 1, #endif }, @@ -44,7 +42,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "ASIMD", #ifdef HWCAP_ASIMD .hwcap_field = HWCAP_ASIMD, - .valid = 1, #endif }, @@ -53,7 +50,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "EVTSTRM", #ifdef HWCAP_EVTSTRM .hwcap_field = HWCAP_EVTSTRM, - .valid = 1, #endif }, @@ -62,7 +58,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_AES", #ifdef HWCAP_AES .hwcap_field = HWCAP_AES, - .valid = 1, #endif }, @@ -71,7 +66,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_PMULL", #ifdef HWCAP_PMULL .hwcap_field = HWCAP_PMULL, - .valid = 1, #endif }, @@ -80,7 +74,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_SHA1", #ifdef HWCAP_SHA1 .hwcap_field = HWCAP_SHA1, - .valid = 1, #endif }, @@ -89,7 +82,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_SHA256", #ifdef HWCAP_SHA2 .hwcap_field = HWCAP_SHA2, - .valid = 1, #endif }, @@ -98,7 +90,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_CRC32", #ifdef HWCAP_CRC32 .hwcap_field = HWCAP_CRC32, - .valid = 1, #endif }, @@ -107,7 +98,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_LSE", #ifdef HWCAP_ATOMICS .hwcap_field = HWCAP_ATOMICS, - .valid = 1, #endif }, @@ -116,7 +106,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_FP16", #ifdef HWCAP_FPHP .hwcap_field = HWCAP_FPHP, - .valid = 1, #endif }, @@ -125,7 +114,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "ASIMDHP", #ifdef HWCAP_ASIMDHP .hwcap_field = HWCAP_ASIMDHP, - .valid = 1, #endif }, @@ -134,7 +122,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "CPUID", #ifdef HWCAP_CPUID .hwcap_field = HWCAP_CPUID, - .valid = 1, #endif }, @@ -143,7 +130,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_RDM", #ifdef HWCAP_ASIMDRDM .hwcap_field = HWCAP_ASIMDRDM, - .valid = 1, #endif }, @@ -152,7 +138,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_JSCVT", #ifdef HWCAP_JSCVT .hwcap_field = HWCAP_JSCVT, - .valid = 1, #endif }, @@ -161,7 +146,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_FCMA", #ifdef HWCAP_FCMA .hwcap_field = HWCAP_FCMA, - .valid = 1, #endif }, @@ -170,7 +154,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_LRCPC", #ifdef HWCAP_LRCPC .hwcap_field = HWCAP_LRCPC, - .valid = 1, #endif }, @@ -179,7 +162,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_DPB", #ifdef HWCAP_DCPOP .hwcap_field = HWCAP_DCPOP, - .valid = 1, #endif }, @@ -188,7 +170,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_SHA3", #ifdef HWCAP_SHA3 .hwcap_field = HWCAP_SHA3, - .valid = 1, #endif }, @@ -197,7 +178,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_SM3", #ifdef HWCAP_SM3 .hwcap_field = HWCAP_SM3, - .valid = 1, #endif }, @@ -206,7 +186,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_SM4", #ifdef HWCAP_SM4 .hwcap_field = HWCAP_SM4, - .valid = 1, #endif }, @@ -215,7 +194,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_DotProd", #ifdef HWCAP_ASIMDDP .hwcap_field = HWCAP_ASIMDDP, - .valid = 1, #endif }, @@ -224,7 +202,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_SHA512", #ifdef HWCAP_SHA512 .hwcap_field = HWCAP_SHA512, - .valid = 1, #endif }, @@ -233,7 +210,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_SVE", #ifdef HWCAP_SVE .hwcap_field = HWCAP_SVE, - .valid = 1, #endif }, @@ -242,7 +218,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_FHM", #ifdef HWCAP_ASIMDFHM .hwcap_field = HWCAP_ASIMDFHM, - .valid = 1, #endif }, @@ -251,7 +226,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_DIT", #ifdef HWCAP_DIT .hwcap_field = HWCAP_DIT, - .valid = 1, #endif }, @@ -260,7 +234,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_LSE2", #ifdef HWCAP_USCAT .hwcap_field = HWCAP_USCAT, - .valid = 1, #endif }, @@ -269,7 +242,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_LRCPC2", #ifdef HWCAP_ILRCPC .hwcap_field = HWCAP_ILRCPC, - .valid = 1, #endif }, @@ -278,7 +250,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_FlagM", #ifdef HWCAP_FLAGM .hwcap_field = HWCAP_FLAGM, - .valid = 1, #endif }, @@ -287,7 +258,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_SSBS2", #ifdef HWCAP_SSBS .hwcap_field = HWCAP_SSBS, - .valid = 1, #endif }, @@ -296,7 +266,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_SB", #ifdef HWCAP_SB .hwcap_field = HWCAP_SB, - .valid = 1, #endif }, @@ -305,7 +274,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "FEAT_PAuth", #ifdef HWCAP_PACA .hwcap_field = HWCAP_PACA, - .valid = 1, #endif }, @@ -314,7 +282,6 @@ static hwcap_feat_flag_t hwcap_flags[] = { .feat_flag = "PACG", #ifdef HWCAP_PACG .hwcap_field = HWCAP_PACG, - .valid = 1, #endif } }; @@ -325,7 +292,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_DPB2", #ifdef HWCAP2_DCPODP .hwcap_field = HWCAP2_DCPODP, - .valid = 1, #endif }, @@ -334,7 +300,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_SVE2", #ifdef HWCAP2_SVE2 .hwcap_field = HWCAP2_SVE2, - .valid = 1, #endif }, @@ -343,7 +308,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_SVE_AES", #ifdef HWCAP2_SVEAES .hwcap_field = HWCAP2_SVEAES, - .valid = 1, #endif }, @@ -352,7 +316,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_SVE_PMULL128", #ifdef HWCAP2_SVEPMULL .hwcap_field = HWCAP2_SVEPMULL, - .valid = 1, #endif }, @@ -361,7 +324,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_SVE_BitPerm", #ifdef HWCAP2_SVEBITPERM .hwcap_field = HWCAP2_SVEBITPERM, - .valid = 1, #endif }, @@ -370,7 +332,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_SVE_SHA3", #ifdef HWCAP2_SVESHA3 .hwcap_field = HWCAP2_SVESHA3, - .valid = 1, #endif }, @@ -379,7 +340,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_SVE_SM4", #ifdef HWCAP2_SVESM4 .hwcap_field = HWCAP2_SVESM4, - .valid = 1, #endif }, @@ -388,7 +348,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_FlagM2", #ifdef HWCAP2_FLAGM2 .hwcap_field = HWCAP2_FLAGM2, - .valid = 1, #endif }, @@ -397,7 +356,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_FRINTTS", #ifdef HWCAP2_FRINT .hwcap_field = HWCAP2_FRINT, - .valid = 1, #endif }, @@ -406,7 +364,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "SVEI8MM", #ifdef HWCAP2_SVEI8MM .hwcap_field = HWCAP2_SVEI8MM, - .valid = 1, #endif }, @@ -415,7 +372,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_F32MM", #ifdef HWCAP2_SVEF32MM .hwcap_field = HWCAP2_SVEF32MM, - .valid = 1, #endif }, @@ -424,7 +380,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_F64MM", #ifdef HWCAP2_SVEF64MM .hwcap_field = HWCAP2_SVEF64MM, - .valid = 1, #endif }, @@ -433,7 +388,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "SVEBF16", #ifdef HWCAP2_SVEBF16 .hwcap_field = HWCAP2_SVEBF16, - .valid = 1, #endif }, @@ -442,7 +396,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_I8MM", #ifdef HWCAP2_I8MM .hwcap_field = HWCAP2_I8MM, - .valid = 1, #endif }, @@ -451,7 +404,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_BF16", #ifdef HWCAP2_BF16 .hwcap_field = HWCAP2_BF16, - .valid = 1, #endif }, @@ -460,7 +412,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_DGH", #ifdef HWCAP2_DGH .hwcap_field = HWCAP2_DGH, - .valid = 1, #endif }, @@ -469,7 +420,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_RNG", #ifdef HWCAP2_RNG .hwcap_field = HWCAP2_RNG, - .valid = 1, #endif }, @@ -478,7 +428,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_BTI", #ifdef HWCAP2_BTI .hwcap_field = HWCAP2_BTI, - .valid = 1, #endif }, @@ -487,7 +436,6 @@ static hwcap_feat_flag_t hwcap2_flags[] = { .feat_flag = "FEAT_MTE2", #ifdef HWCAP2_MTE .hwcap_field = HWCAP2_MTE, - .valid = 1, #endif } }; From 2f8e7ad8a2154206f6ec845909048b9a2642fdae Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Fri, 7 Jul 2023 14:08:34 +0300 Subject: [PATCH 004/192] linux-gen: aarch64: rename hwcap struct fields Use more descriptive field names for flag bit mask and name. Also, change bit mask fields to 64 bits so that it fits all HWCAP2 bits (to be added later). Signed-off-by: Petri Savolainen Reviewed-by: Tuomas Taipale --- .../linux-generic/arch/aarch64/cpu_flags.c | 232 +++++++++--------- 1 file changed, 116 insertions(+), 116 deletions(-) diff --git a/platform/linux-generic/arch/aarch64/cpu_flags.c b/platform/linux-generic/arch/aarch64/cpu_flags.c index 00877386dc..f10bf774d1 100644 --- a/platform/linux-generic/arch/aarch64/cpu_flags.c +++ b/platform/linux-generic/arch/aarch64/cpu_flags.c @@ -18,8 +18,8 @@ #include typedef struct { - const char *feat_flag; - const unsigned int hwcap_field; + const char *name; + const uint64_t bit_mask; } hwcap_feat_flag_t; /* Linux HWCAP and HWCAP2 flags @@ -29,9 +29,9 @@ typedef struct { static hwcap_feat_flag_t hwcap_flags[] = { { /* Floating-point support for single-precision and double-precision types */ - .feat_flag = "FEAT_FP", + .name = "FEAT_FP", #ifdef HWCAP_FP - .hwcap_field = HWCAP_FP, + .bit_mask = HWCAP_FP, #endif }, @@ -39,249 +39,249 @@ static hwcap_feat_flag_t hwcap_flags[] = { /* Advanced SIMD support for: * - integer byte, halfword, word and doubleword element operations * - single-precision and double-precision floating-point arithmetic */ - .feat_flag = "ASIMD", + .name = "ASIMD", #ifdef HWCAP_ASIMD - .hwcap_field = HWCAP_ASIMD, + .bit_mask = HWCAP_ASIMD, #endif }, { /* Generic Timer is configured to generate events at approx. 10KHz */ - .feat_flag = "EVTSTRM", + .name = "EVTSTRM", #ifdef HWCAP_EVTSTRM - .hwcap_field = HWCAP_EVTSTRM, + .bit_mask = HWCAP_EVTSTRM, #endif }, { /* Advanced SIMD AES Instructions */ - .feat_flag = "FEAT_AES", + .name = "FEAT_AES", #ifdef HWCAP_AES - .hwcap_field = HWCAP_AES, + .bit_mask = HWCAP_AES, #endif }, { /* Advanced SIMD PMULL Instructions */ - .feat_flag = "FEAT_PMULL", + .name = "FEAT_PMULL", #ifdef HWCAP_PMULL - .hwcap_field = HWCAP_PMULL, + .bit_mask = HWCAP_PMULL, #endif }, { /* Advanced SIMD SHA1 Instructions */ - .feat_flag = "FEAT_SHA1", + .name = "FEAT_SHA1", #ifdef HWCAP_SHA1 - .hwcap_field = HWCAP_SHA1, + .bit_mask = HWCAP_SHA1, #endif }, { /* Advanced SIMD SHA256 Instructions */ - .feat_flag = "FEAT_SHA256", + .name = "FEAT_SHA256", #ifdef HWCAP_SHA2 - .hwcap_field = HWCAP_SHA2, + .bit_mask = HWCAP_SHA2, #endif }, { /* CRC32 Instructions */ - .feat_flag = "FEAT_CRC32", + .name = "FEAT_CRC32", #ifdef HWCAP_CRC32 - .hwcap_field = HWCAP_CRC32, + .bit_mask = HWCAP_CRC32, #endif }, { /* Large System Extensions */ - .feat_flag = "FEAT_LSE", + .name = "FEAT_LSE", #ifdef HWCAP_ATOMICS - .hwcap_field = HWCAP_ATOMICS, + .bit_mask = HWCAP_ATOMICS, #endif }, { /* Half-precision Floating-point Data Processing Instructions */ - .feat_flag = "FEAT_FP16", + .name = "FEAT_FP16", #ifdef HWCAP_FPHP - .hwcap_field = HWCAP_FPHP, + .bit_mask = HWCAP_FPHP, #endif }, { /* Advanced SIMD support with half-precision floating-point arithmetic */ - .feat_flag = "ASIMDHP", + .name = "ASIMDHP", #ifdef HWCAP_ASIMDHP - .hwcap_field = HWCAP_ASIMDHP, + .bit_mask = HWCAP_ASIMDHP, #endif }, { /* Availability of EL0 Access to certain ID Registers */ - .feat_flag = "CPUID", + .name = "CPUID", #ifdef HWCAP_CPUID - .hwcap_field = HWCAP_CPUID, + .bit_mask = HWCAP_CPUID, #endif }, { /* Rounding Double Multiply Accumulate Extensions */ - .feat_flag = "FEAT_RDM", + .name = "FEAT_RDM", #ifdef HWCAP_ASIMDRDM - .hwcap_field = HWCAP_ASIMDRDM, + .bit_mask = HWCAP_ASIMDRDM, #endif }, { /* JavaScript FJCVTS Conversion Instructions */ - .feat_flag = "FEAT_JSCVT", + .name = "FEAT_JSCVT", #ifdef HWCAP_JSCVT - .hwcap_field = HWCAP_JSCVT, + .bit_mask = HWCAP_JSCVT, #endif }, { /* Floating-point FCMLA and FCADD Instructions */ - .feat_flag = "FEAT_FCMA", + .name = "FEAT_FCMA", #ifdef HWCAP_FCMA - .hwcap_field = HWCAP_FCMA, + .bit_mask = HWCAP_FCMA, #endif }, { /* Load-acquire RCpc Instructions */ - .feat_flag = "FEAT_LRCPC", + .name = "FEAT_LRCPC", #ifdef HWCAP_LRCPC - .hwcap_field = HWCAP_LRCPC, + .bit_mask = HWCAP_LRCPC, #endif }, { /* DC CVAP Instructions */ - .feat_flag = "FEAT_DPB", + .name = "FEAT_DPB", #ifdef HWCAP_DCPOP - .hwcap_field = HWCAP_DCPOP, + .bit_mask = HWCAP_DCPOP, #endif }, { /* Advanced SIMD EOR3, RAX1, XAR, and BCAX Instructions */ - .feat_flag = "FEAT_SHA3", + .name = "FEAT_SHA3", #ifdef HWCAP_SHA3 - .hwcap_field = HWCAP_SHA3, + .bit_mask = HWCAP_SHA3, #endif }, { /* Advanced SIMD SM3 Instructions */ - .feat_flag = "FEAT_SM3", + .name = "FEAT_SM3", #ifdef HWCAP_SM3 - .hwcap_field = HWCAP_SM3, + .bit_mask = HWCAP_SM3, #endif }, { /* Advanced SIMD SM4 Instructions */ - .feat_flag = "FEAT_SM4", + .name = "FEAT_SM4", #ifdef HWCAP_SM4 - .hwcap_field = HWCAP_SM4, + .bit_mask = HWCAP_SM4, #endif }, { /* Advanced SIMD Int8 Dot Product Instructions */ - .feat_flag = "FEAT_DotProd", + .name = "FEAT_DotProd", #ifdef HWCAP_ASIMDDP - .hwcap_field = HWCAP_ASIMDDP, + .bit_mask = HWCAP_ASIMDDP, #endif }, { /* Advanced SIMD SHA512 Instructions */ - .feat_flag = "FEAT_SHA512", + .name = "FEAT_SHA512", #ifdef HWCAP_SHA512 - .hwcap_field = HWCAP_SHA512, + .bit_mask = HWCAP_SHA512, #endif }, { /* Scalable Vector Extensions */ - .feat_flag = "FEAT_SVE", + .name = "FEAT_SVE", #ifdef HWCAP_SVE - .hwcap_field = HWCAP_SVE, + .bit_mask = HWCAP_SVE, #endif }, { /* Half-precision Floating-point FMLAL Instructions */ - .feat_flag = "FEAT_FHM", + .name = "FEAT_FHM", #ifdef HWCAP_ASIMDFHM - .hwcap_field = HWCAP_ASIMDFHM, + .bit_mask = HWCAP_ASIMDFHM, #endif }, { /* Data Independent Timing Instructions */ - .feat_flag = "FEAT_DIT", + .name = "FEAT_DIT", #ifdef HWCAP_DIT - .hwcap_field = HWCAP_DIT, + .bit_mask = HWCAP_DIT, #endif }, { /* Large System Extensions Version 2 */ - .feat_flag = "FEAT_LSE2", + .name = "FEAT_LSE2", #ifdef HWCAP_USCAT - .hwcap_field = HWCAP_USCAT, + .bit_mask = HWCAP_USCAT, #endif }, { /* Load-acquire RCpc Instructions Version 2 */ - .feat_flag = "FEAT_LRCPC2", + .name = "FEAT_LRCPC2", #ifdef HWCAP_ILRCPC - .hwcap_field = HWCAP_ILRCPC, + .bit_mask = HWCAP_ILRCPC, #endif }, { /* Condition Flag Manipulation Extensions */ - .feat_flag = "FEAT_FlagM", + .name = "FEAT_FlagM", #ifdef HWCAP_FLAGM - .hwcap_field = HWCAP_FLAGM, + .bit_mask = HWCAP_FLAGM, #endif }, { /* Speculative Store Bypass Safe Instructions */ - .feat_flag = "FEAT_SSBS2", + .name = "FEAT_SSBS2", #ifdef HWCAP_SSBS - .hwcap_field = HWCAP_SSBS, + .bit_mask = HWCAP_SSBS, #endif }, { /* Speculation Barrier Instructions */ - .feat_flag = "FEAT_SB", + .name = "FEAT_SB", #ifdef HWCAP_SB - .hwcap_field = HWCAP_SB, + .bit_mask = HWCAP_SB, #endif }, { /* Pointer Authentication Extensions */ - .feat_flag = "FEAT_PAuth", + .name = "FEAT_PAuth", #ifdef HWCAP_PACA - .hwcap_field = HWCAP_PACA, + .bit_mask = HWCAP_PACA, #endif }, { /* Generic Authentication Extensions */ - .feat_flag = "PACG", + .name = "PACG", #ifdef HWCAP_PACG - .hwcap_field = HWCAP_PACG, + .bit_mask = HWCAP_PACG, #endif } }; @@ -289,153 +289,153 @@ static hwcap_feat_flag_t hwcap_flags[] = { static hwcap_feat_flag_t hwcap2_flags[] = { { /* DC CVADP instructions */ - .feat_flag = "FEAT_DPB2", + .name = "FEAT_DPB2", #ifdef HWCAP2_DCPODP - .hwcap_field = HWCAP2_DCPODP, + .bit_mask = HWCAP2_DCPODP, #endif }, { /* Scalable Vector Extensions Version 2 */ - .feat_flag = "FEAT_SVE2", + .name = "FEAT_SVE2", #ifdef HWCAP2_SVE2 - .hwcap_field = HWCAP2_SVE2, + .bit_mask = HWCAP2_SVE2, #endif }, { /* SVE AES Instructions */ - .feat_flag = "FEAT_SVE_AES", + .name = "FEAT_SVE_AES", #ifdef HWCAP2_SVEAES - .hwcap_field = HWCAP2_SVEAES, + .bit_mask = HWCAP2_SVEAES, #endif }, { /* SVE PMULL Instructions */ - .feat_flag = "FEAT_SVE_PMULL128", + .name = "FEAT_SVE_PMULL128", #ifdef HWCAP2_SVEPMULL - .hwcap_field = HWCAP2_SVEPMULL, + .bit_mask = HWCAP2_SVEPMULL, #endif }, { /* SVE Bit Permute Instructions */ - .feat_flag = "FEAT_SVE_BitPerm", + .name = "FEAT_SVE_BitPerm", #ifdef HWCAP2_SVEBITPERM - .hwcap_field = HWCAP2_SVEBITPERM, + .bit_mask = HWCAP2_SVEBITPERM, #endif }, { /* SVE SHA-3 Instructions */ - .feat_flag = "FEAT_SVE_SHA3", + .name = "FEAT_SVE_SHA3", #ifdef HWCAP2_SVESHA3 - .hwcap_field = HWCAP2_SVESHA3, + .bit_mask = HWCAP2_SVESHA3, #endif }, { /* SVE SM4 Instructions */ - .feat_flag = "FEAT_SVE_SM4", + .name = "FEAT_SVE_SM4", #ifdef HWCAP2_SVESM4 - .hwcap_field = HWCAP2_SVESM4, + .bit_mask = HWCAP2_SVESM4, #endif }, { /* Condition Flag Manipulation Extensions Version 2 */ - .feat_flag = "FEAT_FlagM2", + .name = "FEAT_FlagM2", #ifdef HWCAP2_FLAGM2 - .hwcap_field = HWCAP2_FLAGM2, + .bit_mask = HWCAP2_FLAGM2, #endif }, { /* FRINT32Z, FRINT32X, FRINT64Z, and FRINT64X instructions */ - .feat_flag = "FEAT_FRINTTS", + .name = "FEAT_FRINTTS", #ifdef HWCAP2_FRINT - .hwcap_field = HWCAP2_FRINT, + .bit_mask = HWCAP2_FRINT, #endif }, { /* SVE Int8 Matrix Multiplication Instructions */ - .feat_flag = "SVEI8MM", + .name = "SVEI8MM", #ifdef HWCAP2_SVEI8MM - .hwcap_field = HWCAP2_SVEI8MM, + .bit_mask = HWCAP2_SVEI8MM, #endif }, { /* SVE Single-precision Floating-point Matrix Multiply Instructions */ - .feat_flag = "FEAT_F32MM", + .name = "FEAT_F32MM", #ifdef HWCAP2_SVEF32MM - .hwcap_field = HWCAP2_SVEF32MM, + .bit_mask = HWCAP2_SVEF32MM, #endif }, { /* SVE Double-precision Floating-point Matrix Multiply Instructions */ - .feat_flag = "FEAT_F64MM", + .name = "FEAT_F64MM", #ifdef HWCAP2_SVEF64MM - .hwcap_field = HWCAP2_SVEF64MM, + .bit_mask = HWCAP2_SVEF64MM, #endif }, { /* SVE BFloat16 Instructions */ - .feat_flag = "SVEBF16", + .name = "SVEBF16", #ifdef HWCAP2_SVEBF16 - .hwcap_field = HWCAP2_SVEBF16, + .bit_mask = HWCAP2_SVEBF16, #endif }, { /* Advanced SIMD and Floating-point Int8 Matrix Multiplication Instructions */ - .feat_flag = "FEAT_I8MM", + .name = "FEAT_I8MM", #ifdef HWCAP2_I8MM - .hwcap_field = HWCAP2_I8MM, + .bit_mask = HWCAP2_I8MM, #endif }, { /* Advanced SIMD and Floating-point BFloat16 Instructions */ - .feat_flag = "FEAT_BF16", + .name = "FEAT_BF16", #ifdef HWCAP2_BF16 - .hwcap_field = HWCAP2_BF16, + .bit_mask = HWCAP2_BF16, #endif }, { /* Data Gathering Hint Extensions */ - .feat_flag = "FEAT_DGH", + .name = "FEAT_DGH", #ifdef HWCAP2_DGH - .hwcap_field = HWCAP2_DGH, + .bit_mask = HWCAP2_DGH, #endif }, { /* Random Number Generation Extensions */ - .feat_flag = "FEAT_RNG", + .name = "FEAT_RNG", #ifdef HWCAP2_RNG - .hwcap_field = HWCAP2_RNG, + .bit_mask = HWCAP2_RNG, #endif }, { /* Branch Target Identification Extensions */ - .feat_flag = "FEAT_BTI", + .name = "FEAT_BTI", #ifdef HWCAP2_BTI - .hwcap_field = HWCAP2_BTI, + .bit_mask = HWCAP2_BTI, #endif }, { /* Full Memory Tagging Extensions */ - .feat_flag = "FEAT_MTE2", + .name = "FEAT_MTE2", #ifdef HWCAP2_MTE - .hwcap_field = HWCAP2_MTE, + .bit_mask = HWCAP2_MTE, #endif } }; @@ -836,36 +836,36 @@ static void _odp_sys_info_print_hwcap_flags(void) /* Supported HWCAP flags */ for (i = 0; i < size; i++) - if (hwcap & hwcap_flags[i].hwcap_field) - _ODP_PRINT("%s ", hwcap_flags[i].feat_flag); + if (hwcap & hwcap_flags[i].bit_mask) + _ODP_PRINT("%s ", hwcap_flags[i].name); /* Supported HWCAP2 flags */ for (i = 0; i < size2; i++) - if (hwcap2 & hwcap2_flags[i].hwcap_field) - _ODP_PRINT("%s ", hwcap2_flags[i].feat_flag); + if (hwcap2 & hwcap2_flags[i].bit_mask) + _ODP_PRINT("%s ", hwcap2_flags[i].name); _ODP_PRINT("\n\nARM FEATURES NOT SUPPORTED BY HARDWARE:\n"); /* Unsupported HWCAP flags */ for (i = 0; i < size; i++) - if (hwcap_flags[i].hwcap_field && (hwcap & hwcap_flags[i].hwcap_field) == 0) - _ODP_PRINT("%s ", hwcap_flags[i].feat_flag); + if (hwcap_flags[i].bit_mask && (hwcap & hwcap_flags[i].bit_mask) == 0) + _ODP_PRINT("%s ", hwcap_flags[i].name); /* Unsupported HWCAP2 flags */ for (i = 0; i < size2; i++) - if (hwcap2_flags[i].hwcap_field && (hwcap2 & hwcap2_flags[i].hwcap_field) == 0) - _ODP_PRINT("%s ", hwcap2_flags[i].feat_flag); + if (hwcap2_flags[i].bit_mask && (hwcap2 & hwcap2_flags[i].bit_mask) == 0) + _ODP_PRINT("%s ", hwcap2_flags[i].name); _ODP_PRINT("\n\nARM FEATURES UNKNOWN TO LINUX VERSION:\n"); /* Unknown HWCAP flags */ for (i = 0; i < size; i++) - if (hwcap_flags[i].hwcap_field == 0) - _ODP_PRINT("%s ", hwcap_flags[i].feat_flag); + if (hwcap_flags[i].bit_mask == 0) + _ODP_PRINT("%s ", hwcap_flags[i].name); /* Unknown HWCAP2 flags */ for (i = 0; i < size2; i++) - if (hwcap2_flags[i].hwcap_field == 0) - _ODP_PRINT("%s ", hwcap2_flags[i].feat_flag); + if (hwcap2_flags[i].bit_mask == 0) + _ODP_PRINT("%s ", hwcap2_flags[i].name); _ODP_PRINT("\n\n"); } From ecaba58e279ec67eb64629f455b393b4278ab680 Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Fri, 7 Jul 2023 15:18:42 +0300 Subject: [PATCH 005/192] linux-gen: aarch64: add missing HWCAP2 bits Add rest of HWCAP2 bits from the latest version of Linux hwcap.h file. Mapping to ARM feature names is left as following work. Signed-off-by: Petri Savolainen Reviewed-by: Tuomas Taipale --- .../linux-generic/arch/aarch64/cpu_flags.c | 177 +++++++++++++++++- 1 file changed, 176 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/arch/aarch64/cpu_flags.c b/platform/linux-generic/arch/aarch64/cpu_flags.c index f10bf774d1..9923e9306b 100644 --- a/platform/linux-generic/arch/aarch64/cpu_flags.c +++ b/platform/linux-generic/arch/aarch64/cpu_flags.c @@ -437,7 +437,182 @@ static hwcap_feat_flag_t hwcap2_flags[] = { #ifdef HWCAP2_MTE .bit_mask = HWCAP2_MTE, #endif - } + }, + + { + .name = "ECV", +#ifdef HWCAP2_ECV + .bit_mask = HWCAP2_ECV, +#endif + }, + + { + .name = "AFP", +#ifdef HWCAP2_AFP + .bit_mask = HWCAP2_AFP, +#endif + }, + + { + .name = "RPRES", +#ifdef HWCAP2_RPRES + .bit_mask = HWCAP2_RPRES, +#endif + }, + + { + .name = "MTE3", +#ifdef HWCAP2_MTE3 + .bit_mask = HWCAP2_MTE3, +#endif + }, + + { + .name = "SME", +#ifdef HWCAP2_SME + .bit_mask = HWCAP2_SME, +#endif + }, + + { + .name = "SME_I16I64", +#ifdef HWCAP2_SME_I16I64 + .bit_mask = HWCAP2_SME_I16I64, +#endif + }, + + { + .name = "SME_F64F64", +#ifdef HWCAP2_SME_F64F64 + .bit_mask = HWCAP2_SME_F64F64, +#endif + }, + + { + .name = "SME_I8I32", +#ifdef HWCAP2_SME_I8I32 + .bit_mask = HWCAP2_SME_I8I32, +#endif + }, + + { + .name = "SME_F16F32", +#ifdef HWCAP2_SME_F16F32 + .bit_mask = HWCAP2_SME_F16F32, +#endif + }, + + { + .name = "SME_B16F32", +#ifdef HWCAP2_SME_B16F32 + .bit_mask = HWCAP2_SME_B16F32, +#endif + }, + + { + .name = "SME_F32F32", +#ifdef HWCAP2_SME_F32F32 + .bit_mask = HWCAP2_SME_F32F32, +#endif + }, + + { + .name = "SME_FA64", +#ifdef HWCAP2_SME_FA64 + .bit_mask = HWCAP2_SME_FA64, +#endif + }, + + { + .name = "WFXT", +#ifdef HWCAP2_WFXT + .bit_mask = HWCAP2_WFXT, +#endif + }, + + { + .name = "EBF16", +#ifdef HWCAP2_EBF16 + .bit_mask = HWCAP2_EBF16, +#endif + }, + + { + .name = "SVE_EBF16", +#ifdef HWCAP2_SVE_EBF16 + .bit_mask = HWCAP2_SVE_EBF16, +#endif + }, + + { + .name = "CSSC", +#ifdef HWCAP2_CSSC + .bit_mask = HWCAP2_CSSC, +#endif + }, + + { + .name = "RPRFM", +#ifdef HWCAP2_RPRFM + .bit_mask = HWCAP2_RPRFM, +#endif + }, + + { + .name = "SVE2P1", +#ifdef HWCAP2_SVE2P1 + .bit_mask = HWCAP2_SVE2P1, +#endif + }, + + { + .name = "SME2", +#ifdef HWCAP2_SME2 + .bit_mask = HWCAP2_SME2, +#endif + }, + + { + .name = "SME2P1", +#ifdef HWCAP2_SME2P1 + .bit_mask = HWCAP2_SME2P1, +#endif + }, + + { + .name = "SME_I16I32", +#ifdef HWCAP2_SME_I16I32 + .bit_mask = HWCAP2_SME_I16I32, +#endif + }, + + { + .name = "SME_BI32I32", +#ifdef HWCAP2_SME_BI32I32 + .bit_mask = HWCAP2_SME_BI32I32, +#endif + }, + + { + .name = "SME_B16B16", +#ifdef HWCAP2_SME_B16B16 + .bit_mask = HWCAP2_SME_B16B16, +#endif + }, + + { + .name = "SME_F16F16", +#ifdef HWCAP2_SME_F16F16 + .bit_mask = HWCAP2_SME_F16F16, +#endif + }, + + { + .name = "MOPS", +#ifdef HWCAP2_MOPS + .bit_mask = HWCAP2_MOPS, +#endif + }, }; static void _odp_sys_info_print_acle_flags(void) From 286841b13ba93160eab3135a7912693ea523f493 Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Thu, 13 Jul 2023 09:37:32 +0300 Subject: [PATCH 006/192] linux-gen: crypto: null: fix session allocation when out of sessions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not dereference a null pointer in null crypto session allocation when running out of sessions. Signed-off-by: Janne Peltonen Reviewed-by: Jere Leppänen --- platform/linux-generic/odp_crypto_null.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/linux-generic/odp_crypto_null.c b/platform/linux-generic/odp_crypto_null.c index c93691e92a..b426b3a6ab 100644 --- a/platform/linux-generic/odp_crypto_null.c +++ b/platform/linux-generic/odp_crypto_null.c @@ -96,6 +96,9 @@ odp_crypto_generic_session_t *alloc_session(void) } odp_spinlock_unlock(&global->lock); + if (!session) + return NULL; + session->idx = session - global->sessions; for (i = 0; i < ODP_THREAD_COUNT_MAX; i++) From 5222126bbd185b85d0396010090262a5dbc373aa Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Thu, 13 Jul 2023 09:37:34 +0300 Subject: [PATCH 007/192] linux-gen: crypto: fail bit mode session creation when not supported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The armv8crypto, ipsecmb and null crypto implementations do not support bit mode. Fix session creation to return failure when a bit mode session is requested. Signed-off-by: Janne Peltonen Reviewed-by: Jere Leppänen --- platform/linux-generic/arch/aarch64/odp_crypto_armv8.c | 10 ++++++++++ platform/linux-generic/odp_crypto_ipsecmb.c | 10 ++++++++++ platform/linux-generic/odp_crypto_null.c | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c index 2eefc63026..0a17355b4a 100644 --- a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c +++ b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c @@ -524,6 +524,16 @@ odp_crypto_session_create(const odp_crypto_session_param_t *param, return -1; } + if (param->cipher_range_in_bits) { + *status = ODP_CRYPTO_SES_ERR_CIPHER; + *session_out = ODP_CRYPTO_SESSION_INVALID; + return -1; + } + if (param->auth_range_in_bits) { + *status = ODP_CRYPTO_SES_ERR_AUTH; + *session_out = ODP_CRYPTO_SESSION_INVALID; + return -1; + } if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP) { *status = ODP_CRYPTO_SES_ERR_PARAMS; *session_out = ODP_CRYPTO_SESSION_INVALID; diff --git a/platform/linux-generic/odp_crypto_ipsecmb.c b/platform/linux-generic/odp_crypto_ipsecmb.c index 0b83adecca..b41938cafa 100644 --- a/platform/linux-generic/odp_crypto_ipsecmb.c +++ b/platform/linux-generic/odp_crypto_ipsecmb.c @@ -544,6 +544,16 @@ odp_crypto_session_create(const odp_crypto_session_param_t *param, return -1; } + if (param->cipher_range_in_bits) { + *status = ODP_CRYPTO_SES_ERR_CIPHER; + *session_out = ODP_CRYPTO_SESSION_INVALID; + return -1; + } + if (param->auth_range_in_bits) { + *status = ODP_CRYPTO_SES_ERR_AUTH; + *session_out = ODP_CRYPTO_SESSION_INVALID; + return -1; + } if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP) { *status = ODP_CRYPTO_SES_ERR_PARAMS; *session_out = ODP_CRYPTO_SESSION_INVALID; diff --git a/platform/linux-generic/odp_crypto_null.c b/platform/linux-generic/odp_crypto_null.c index b426b3a6ab..5e3a4e8373 100644 --- a/platform/linux-generic/odp_crypto_null.c +++ b/platform/linux-generic/odp_crypto_null.c @@ -209,6 +209,16 @@ odp_crypto_session_create(const odp_crypto_session_param_t *param, return -1; } + if (param->cipher_range_in_bits) { + *status = ODP_CRYPTO_SES_ERR_CIPHER; + *session_out = ODP_CRYPTO_SESSION_INVALID; + return -1; + } + if (param->auth_range_in_bits) { + *status = ODP_CRYPTO_SES_ERR_AUTH; + *session_out = ODP_CRYPTO_SESSION_INVALID; + return -1; + } if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP) { *status = ODP_CRYPTO_SES_ERR_PARAMS; *session_out = ODP_CRYPTO_SESSION_INVALID; From 3834eb5e9f11f5803e38de766a08c3876c0e9923 Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Thu, 13 Jul 2023 09:37:35 +0300 Subject: [PATCH 008/192] validation: crypto: test that session creation fails when it must MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ODP API specifies that session creation shall fail (as opposed to some undefined behaviour) if {cipher,auth}_range_in_bits session parameter is true when the corresponding bit_mode capability is not present. Now the validation test code does not attempt such session creation. Improve test coverage by trying to create such sessions and checking that the creation fails. Signed-off-by: Janne Peltonen Reviewed-by: Jere Leppänen --- .../api/crypto/odp_crypto_test_inp.c | 75 ++++++++++--------- 1 file changed, 41 insertions(+), 34 deletions(-) diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index 0cc01b8e42..d49a8d002e 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -150,7 +150,8 @@ typedef enum { static int session_create(crypto_session_t *session, alg_order_t order, crypto_test_reference_t *ref, - hash_test_mode_t hash_mode) + hash_test_mode_t hash_mode, + odp_bool_t must_fail) { int rc; odp_crypto_ses_create_err_t status; @@ -190,6 +191,15 @@ static int session_create(crypto_session_t *session, ses_params.hash_result_in_auth_range = (hash_mode == HASH_OVERLAP); rc = odp_crypto_session_create(&ses_params, &session->session, &status); + if (must_fail) { + CU_ASSERT(rc < 0); + if (rc == 0) { + rc = odp_crypto_session_destroy(session->session); + CU_ASSERT(rc == 0); + } + return -1; + } + if (rc < 0 && status == ODP_CRYPTO_SES_ERR_ALG_COMBO) { if (!combo_warning_shown) { combo_warning_shown = 1; @@ -247,7 +257,8 @@ static void alg_test_ses(odp_crypto_op_t op, odp_packet_data_range_t auth_range, uint32_t digest_offset, odp_bool_t cipher_range_in_bits, - odp_bool_t auth_range_in_bits) + odp_bool_t auth_range_in_bits, + odp_bool_t session_creation_must_fail) { unsigned int initial_num_failures = CU_get_number_of_failures(); const uint32_t reflength = ref_length_in_bytes(ref); @@ -267,7 +278,7 @@ static void alg_test_ses(odp_crypto_op_t op, test_param.session.op_type = op_type; test_param.session.cipher_range_in_bits = cipher_range_in_bits; test_param.session.auth_range_in_bits = auth_range_in_bits; - if (session_create(&test_param.session, order, ref, hash_mode)) + if (session_create(&test_param.session, order, ref, hash_mode, session_creation_must_fail)) return; test_param.ref = ref; test_param.cipher_range = cipher_range; @@ -324,7 +335,8 @@ static void alg_test_op_types(odp_crypto_op_t op, odp_packet_data_range_t auth_range, uint32_t digest_offset, odp_bool_t cipher_range_in_bits, - odp_bool_t auth_range_in_bits) + odp_bool_t auth_range_in_bits, + odp_bool_t session_creation_must_fail) { odp_crypto_op_type_t op_types[] = { ODP_CRYPTO_OP_TYPE_LEGACY, @@ -341,7 +353,8 @@ static void alg_test_op_types(odp_crypto_op_t op, auth_range, digest_offset, cipher_range_in_bits, - auth_range_in_bits); + auth_range_in_bits, + session_creation_must_fail); } } @@ -360,13 +373,11 @@ static void alg_test(odp_crypto_op_t op, for (int cr_in_bits = 0; cr_in_bits <= 1; cr_in_bits++) { if (!cr_in_bits && cipher_bit_range.length % 8 != 0) continue; - if (cr_in_bits && !is_bit_mode_cipher) - continue; for (int ar_in_bits = 0; ar_in_bits <= 1; ar_in_bits++) { + odp_bool_t session_creation_must_fail; + if (!ar_in_bits && auth_bit_range.length % 8 != 0) continue; - if (ar_in_bits && !is_bit_mode_auth) - continue; cipher_range = cipher_bit_range; auth_range = auth_bit_range; @@ -378,8 +389,11 @@ static void alg_test(odp_crypto_op_t op, auth_range.offset /= 8; auth_range.length /= 8; } + session_creation_must_fail = ((ar_in_bits && !is_bit_mode_auth) || + (cr_in_bits && !is_bit_mode_cipher)); alg_test_op_types(op, order, ref, cipher_range, auth_range, - digest_offset, cr_in_bits, ar_in_bits); + digest_offset, cr_in_bits, ar_in_bits, + session_creation_must_fail); } } } @@ -433,25 +447,17 @@ static void check_alg(odp_crypto_op_t op, for (idx = 0; idx < count; idx++) { int cipher_idx = -1, auth_idx = -1; - odp_bool_t bit_mode_needed = false; odp_bool_t is_bit_mode_cipher = false; odp_bool_t is_bit_mode_auth = false; uint32_t digest_offs = ref_length_in_bytes(&ref[idx]); odp_packet_data_range_t cipher_bit_range = {.offset = 0}; odp_packet_data_range_t auth_bit_range = {.offset = 0}; - if (ref_length_in_bits(&ref[idx]) % 8 != 0) - bit_mode_needed = true; - for (i = 0; i < cipher_num; i++) { if (cipher_capa[i].key_len == ref[idx].cipher_key_length && cipher_capa[i].iv_len == ref[idx].cipher_iv_length) { - if (bit_mode_needed && - cipher_alg != ODP_CIPHER_ALG_NULL && - !cipher_capa[i].bit_mode) - continue; cipher_idx = i; is_bit_mode_cipher = cipher_capa[i].bit_mode; break; @@ -460,11 +466,10 @@ static void check_alg(odp_crypto_op_t op, if (cipher_idx < 0) { printf("\n Unsupported: alg=%s, key_len=%" PRIu32 - ", iv_len=%" PRIu32 "%s\n", + ", iv_len=%" PRIu32 "\n", cipher_alg_name(cipher_alg), ref[idx].cipher_key_length, - ref[idx].cipher_iv_length, - bit_mode_needed ? ", bit mode" : ""); + ref[idx].cipher_iv_length); continue; } @@ -476,10 +481,6 @@ static void check_alg(odp_crypto_op_t op, auth_capa[i].key_len == ref[idx].auth_key_length && aad_len_ok(&auth_capa[i], ref[idx].aad_length)) { - if (bit_mode_needed && - auth_alg != ODP_AUTH_ALG_NULL && - !auth_capa[i].bit_mode) - continue; auth_idx = i; is_bit_mode_auth = auth_capa[i].bit_mode; break; @@ -489,12 +490,11 @@ static void check_alg(odp_crypto_op_t op, if (auth_idx < 0) { printf("\n Unsupported: alg=%s, key_len=%" PRIu32 ", iv_len=%" PRIu32 ", digest_len=%" PRIu32 - "%s\n", + "\n", auth_alg_name(auth_alg), ref[idx].auth_key_length, ref[idx].auth_iv_length, - ref[idx].digest_length, - bit_mode_needed ? ", bit mode" : ""); + ref[idx].digest_length); continue; } @@ -603,7 +603,7 @@ static int create_hash_test_reference(odp_auth_alg_t auth, session.op_type = ODP_CRYPTO_OP_TYPE_LEGACY; session.cipher_range_in_bits = false; session.auth_range_in_bits = false; - if (session_create(&session, AUTH_PLAINTEXT, ref, HASH_NO_OVERLAP)) + if (session_create(&session, AUTH_PLAINTEXT, ref, HASH_NO_OVERLAP, false)) return -1; odp_crypto_packet_op_param_t op_params = { @@ -649,6 +649,7 @@ static int create_hash_test_reference(odp_auth_alg_t auth, static void test_auth_hash_in_auth_range(odp_auth_alg_t auth, const odp_crypto_auth_capability_t *capa, + odp_bool_t is_bit_mode_cipher, alg_order_t order) { static crypto_test_reference_t ref = {.length = 0}; @@ -681,7 +682,7 @@ static void test_auth_hash_in_auth_range(odp_auth_alg_t auth, &ref, cipher_bit_range, auth_bit_range, digest_offset, - false, + is_bit_mode_cipher, capa->bit_mode); /* @@ -706,7 +707,7 @@ static void test_auth_hash_in_auth_range(odp_auth_alg_t auth, &ref, cipher_bit_range, auth_bit_range, digest_offset, - false, + is_bit_mode_cipher, capa->bit_mode); } @@ -760,11 +761,15 @@ static void test_auth_hashes_in_auth_range(void) { for (size_t n = 0; n < ARRAY_SIZE(auth_algs); n++) { odp_auth_alg_t auth = auth_algs[n]; + odp_crypto_cipher_capability_t c_capa; int num; if (check_alg_support(ODP_CIPHER_ALG_NULL, auth) == ODP_TEST_INACTIVE) continue; + num = odp_crypto_cipher_capability(ODP_CIPHER_ALG_NULL, &c_capa, 1); + CU_ASSERT_FATAL(num == 1); + num = odp_crypto_auth_capability(auth, NULL, 0); CU_ASSERT_FATAL(num > 0); @@ -773,8 +778,10 @@ static void test_auth_hashes_in_auth_range(void) num = odp_crypto_auth_capability(auth, capa, num); for (int i = 0; i < num; i++) { - test_auth_hash_in_auth_range(auth, &capa[i], AUTH_PLAINTEXT); - test_auth_hash_in_auth_range(auth, &capa[i], AUTH_CIPHERTEXT); + test_auth_hash_in_auth_range(auth, &capa[i], c_capa.bit_mode, + AUTH_PLAINTEXT); + test_auth_hash_in_auth_range(auth, &capa[i], c_capa.bit_mode, + AUTH_CIPHERTEXT); } } } @@ -803,7 +810,7 @@ static int crypto_encode_ref(crypto_test_reference_t *ref, session.op_type = ODP_CRYPTO_OP_TYPE_LEGACY; session.cipher_range_in_bits = false; session.auth_range_in_bits = false; - if (session_create(&session, AUTH_PLAINTEXT, ref, HASH_OVERLAP)) { + if (session_create(&session, AUTH_PLAINTEXT, ref, HASH_OVERLAP, false)) { odp_packet_free(pkt); return 1; } From 35b717b48c9af3690e47fea42faa5321cfbb8bff Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Thu, 13 Jul 2023 13:04:07 +0000 Subject: [PATCH 009/192] test: ipsecfwd: improve help text Clearly state which options are mandatory and which are optional in tester help text. Signed-off-by: Tuomas Taipale Reviewed-by: Janne Peltonen --- test/performance/odp_ipsecfwd.c | 115 ++++++++++++++++---------------- 1 file changed, 59 insertions(+), 56 deletions(-) diff --git a/test/performance/odp_ipsecfwd.c b/test/performance/odp_ipsecfwd.c index 16c745afa4..34110bea93 100644 --- a/test/performance/odp_ipsecfwd.c +++ b/test/performance/odp_ipsecfwd.c @@ -326,66 +326,59 @@ static void print_usage(void) } printf("\n" - "Simple IPsec performance tester. Forward and process plain and ipsec packets.\n" + "Simple IPsec performance tester. Forward and process plain and IPsec packets.\n" "\n" - "Examples:\n" - " %s -i ens9f1 -C /etc/odp/ipsecfwd.conf\n" + "Usage: %s OPTIONS\n" "\n" - " With ipsecfwd.conf containing, for example:\n" - " default: {\n" - " dir = 1\n" - " proto = 0\n" - " mode = 0\n" - " crypto: {\n" - " cipher_alg = 4\n" - " cipher_key = \"jWnZr4t7w!zwC*F-\"\n" - " auth_alg = 2\n" - " auth_key = \"n2r5u7x!A%%D*\"\n" - " icv_len = 12\n" - " };\n" - " };\n" + " E.g. %s -i ens9f1 -C /etc/odp/ipsecfwd.conf\n" "\n" - " sa: (\n" - " {\n" - " spi = 1337\n" - " outbound: {\n" - " tunnel: {\n" - " src_addr = \"192.168.1.10\"\n" - " dst_addr = \"192.168.1.16\"\n" - " };\n" - " };\n" - " },\n" - " {\n" - " spi = 1338\n" - " outbound: {\n" - " tunnel: {\n" - " src_addr = \"192.168.3.110\"\n" - " dst_addr = \"192.168.3.116\"\n" - " };\n" - " };\n" - " }\n" - " );\n" + " With ipsecfwd.conf containing, for example:\n" + " default: {\n" + " dir = 1\n" + " proto = 0\n" + " mode = 0\n" + " crypto: {\n" + " cipher_alg = 4\n" + " cipher_key = \"jWnZr4t7w!zwC*F-\"\n" + " auth_alg = 2\n" + " auth_key = \"n2r5u7x!A%%D*\"\n" + " icv_len = 12\n" + " };\n" + " };\n" "\n" - " fwd: (\n" - " {\n" - " prefix: \"192.168.1.0/24\"\n" - " if: \"ens9f1\"\n" - " dst_mac: \"00:00:05:00:07:00\"\n" - " }\n" - " );\n" + " sa: (\n" + " {\n" + " spi = 1337\n" + " outbound: {\n" + " tunnel: {\n" + " src_addr = \"192.168.1.10\"\n" + " dst_addr = \"192.168.1.16\"\n" + " };\n" + " };\n" + " },\n" + " {\n" + " spi = 1338\n" + " outbound: {\n" + " tunnel: {\n" + " src_addr = \"192.168.3.110\"\n" + " dst_addr = \"192.168.3.116\"\n" + " };\n" + " };\n" + " }\n" + " );\n" "\n" - "Usage: %s [options]\n" + " fwd: (\n" + " {\n" + " prefix: \"192.168.1.0/24\"\n" + " if: \"ens9f1\"\n" + " dst_mac: \"00:00:05:00:07:00\"\n" + " }\n" + " );\n" + "\n" + "Mandatory OPTIONS:\n" "\n" " -i, --interfaces Ethernet interfaces for packet I/O, comma-separated,\n" " no spaces.\n" - " -n, --num_pkts Number of packet buffers allocated for packet I/O pool.\n" - " %u by default.\n" - " -l, --pkt_len Maximum size of packet buffers in packet I/O pool. %u by\n" - " default.\n" - " -c, --count Worker thread count, 1 by default.\n" - " -m, --mode Queueing mode.\n" - " 0: ordered (default)\n" - " 1: parallel\n" " -C, --conf Configuration file. 'libconfig' syntax is expected.\n" " SA configuration supports default fallback, i.e.\n" " individual SA configuration blocks may omit some\n" @@ -405,10 +398,20 @@ static void print_usage(void) " potential SA and forwarding configuration.\n" "\n" " Supported cipher and authentication algorithms for SAs:\n", - PROG_NAME, PROG_NAME, MIN(pool_capa.pkt.max_num, PKT_CNT), - MIN(pool_capa.pkt.max_len, PKT_SIZE)); + PROG_NAME, PROG_NAME); print_supported_algos(&ipsec_capa); - printf(" -I, --num_input_qs Input queue count. 1 by default.\n" + printf("\n" + "Optional OPTIONS:\n" + "\n" + " -n, --num_pkts Number of packet buffers allocated for packet I/O pool.\n" + " %u by default.\n" + " -l, --pkt_len Maximum size of packet buffers in packet I/O pool. %u by\n" + " default.\n" + " -c, --count Worker thread count. 1 by default.\n" + " -m, --mode Queueing mode.\n" + " 0: ordered (default)\n" + " 1: parallel\n" + " -I, --num_input_qs Input queue count. 1 by default.\n" " -S, --num_sa_qs SA queue count. 1 by default.\n" " -O, --num_output_qs Output queue count. 1 by default.\n" " -d, --direct_rx Use direct RX. Interfaces will be polled by workers\n" @@ -416,7 +419,7 @@ static void print_usage(void) " options are ignored, input and output queue counts will\n" " match worker count.\n" " -h, --help This help.\n" - "\n"); + "\n", MIN(pool_capa.pkt.max_num, PKT_CNT), MIN(pool_capa.pkt.max_len, PKT_SIZE)); } static inline odp_ipsec_sa_t *get_in_sa(odp_packet_t pkt) From 183eeb8732823be8e4a39af979df762ffdbeab16 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Fri, 14 Jul 2023 11:54:28 +0000 Subject: [PATCH 010/192] test: dma_perf: improve help text Unify help text formatting of the tester to match style used in other ODP testers. Signed-off-by: Tuomas Taipale Reviewed-by: Janne Peltonen --- test/performance/odp_dma_perf.c | 78 ++++++++++++++++----------------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/test/performance/odp_dma_perf.c b/test/performance/odp_dma_perf.c index be23f27ca1..b37b2667c5 100644 --- a/test/performance/odp_dma_perf.c +++ b/test/performance/odp_dma_perf.c @@ -250,48 +250,46 @@ static void print_usage(void) printf("\n" "DMA performance test. Load DMA subsystem from several workers.\n" "\n" - "Examples:\n" - " " PROG_NAME "\n" - " " PROG_NAME " -s 10240\n" - " " PROG_NAME " -t 0 -i 1 -o 1 -s 51200 -S 1 -f 64 -T 10\n" - " " PROG_NAME " -t 1 -i 10 -o 10 -s 4096 -S 0 -m 1 -f 10 -c 4 -p 1\n" + "Usage: " PROG_NAME " [OPTIONS]\n" "\n" - "Usage: " PROG_NAME " [options]\n" + " E.g. " PROG_NAME "\n" + " " PROG_NAME " -s 10240\n" + " " PROG_NAME " -t 0 -i 1 -o 1 -s 51200 -S 1 -f 64 -T 10\n" + " " PROG_NAME " -t 1 -i 10 -o 10 -s 4096 -S 0 -m 1 -f 10 -c 4 -p 1\n" "\n" - " -t, --trs_type Transfer type for test data. %u by default.\n" - " Types:\n" - " 0: synchronous\n" - " 1: asynchronous\n" - " -i, --num_in_seg Number of input segments to transfer. 0 means the\n" - " maximum count supported by the implementation. %u by\n" - " default.\n" - " -o, --num_out_seg Number of output segments to transfer to. 0 means\n" - " the maximum count supported by the implementation.\n" - " %u by default.\n" - " -s, --in_seg_len Input segment length in bytes. 0 length means\n" - " maximum segment length supported by implementation.\n" - " The actual maximum might be limited by what type of\n" - " data is transferred (packet/memory).\n" - " %u by default.\n" - " -S, --in_seg_type Input segment data type. %u by default.\n" - " Types:\n" - " 0: packet\n" - " 1: memory\n" - " -m, --compl_mode Completion mode for transfers. %u by default.\n" - " Modes:\n" - " 0: poll\n" - " 1: event\n" - " -f, --max_in_flight Max transfers in-flight per session. 0 means the\n" - " maximum supported by tester/implementation. %u by\n" - " default.\n" - " -T, --time_sec Time in seconds to run. 0 means infinite. %u by\n" - " default.\n" - " -c, --worker_count Amount of workers. %u by default.\n" - " -p, --policy DMA session policy. %u by default.\n" - " Policies:\n" - " 0: One session shared by workers\n" - " 1: One session per worker\n" - " -h, --help This help.\n" + "Optional OPTIONS:\n" + "\n" + " -t, --trs_type Transfer type for test data. %u by default.\n" + " Types:\n" + " 0: synchronous\n" + " 1: asynchronous\n" + " -i, --num_in_seg Number of input segments to transfer. 0 means the maximum\n" + " count supported by the implementation. %u by default.\n" + " -o, --num_out_seg Number of output segments to transfer to. 0 means the\n" + " maximum count supported by the implementation. %u by\n" + " default.\n" + " -s, --in_seg_len Input segment length in bytes. 0 length means the maximum\n" + " segment length supported by the implementation. The actual\n" + " maximum might be limited by what type of data is\n" + " transferred (packet/memory). %u by default.\n" + " -S, --in_seg_type Input segment data type. %u by default.\n" + " Types:\n" + " 0: packet\n" + " 1: memory\n" + " -m, --compl_mode Completion mode for transfers. %u by default.\n" + " Modes:\n" + " 0: poll\n" + " 1: event\n" + " -f, --max_in_flight Maximum transfers in-flight per session. 0 means the\n" + " maximum supported by the tester/implementation. %u by\n" + " default.\n" + " -T, --time_sec Time in seconds to run. 0 means infinite. %u by default.\n" + " -c, --worker_count Amount of workers. %u by default.\n" + " -p, --policy DMA session policy. %u by default.\n" + " Policies:\n" + " 0: One session shared by workers\n" + " 1: One session per worker\n" + " -h, --help This help.\n" "\n", DEF_TRS_TYPE, DEF_SEG_CNT, DEF_SEG_CNT, DEF_LEN, DEF_SEG_TYPE, DEF_MODE, DEF_INFLIGHT, DEF_TIME, DEF_WORKERS, DEF_POLICY); } From 1106a1de2d578a7b0638c10017fcf80ecd168864 Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Wed, 19 Jul 2023 23:34:47 +0530 Subject: [PATCH 011/192] validation: dma: fix max segment length Max segment length should be calculated based on the DMA device capabilities such as max supported segments and segment length. Fixes: 1aaf5cf55a0c ("validation: dma: add tests for maximum segment amount transfers") Signed-off-by: Pavan Nikhilesh Reviewed-by: Tuomas Taipale --- test/validation/api/dma/dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/validation/api/dma/dma.c b/test/validation/api/dma/dma.c index 05771e3cbf..36a025b0dc 100644 --- a/test/validation/api/dma/dma.c +++ b/test/validation/api/dma/dma.c @@ -1318,8 +1318,9 @@ static void test_dma_addr_to_addr_sync_res(void) static void get_seg_lens(uint32_t max_len, uint32_t *src, uint32_t *dst) { - uint32_t src_segs = *src, dst_segs = *dst; + uint32_t src_segs = *src, dst_segs = *dst, denom = MIN(src_segs, dst_segs); + max_len = MIN(max_len / denom, global.dma_capa.max_seg_len) * denom; *src = max_len / src_segs; *dst = *src * src_segs / dst_segs + *src * src_segs % dst_segs; } From 56c22737d725012d71ffc36c8fe6bdd34fdc9a1d Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 10 Aug 2023 08:38:57 +0300 Subject: [PATCH 012/192] github_ci: disable coverage test Speed up CI by disabling coverage test (takes over 30 minutes). Also, the coverage report processing in Codecov has been broken for a while. The test can be added back once the report processing is fixed. Signed-off-by: Matias Elo Reviewed-by: Janne Peltonen --- .github/workflows/ci-pipeline.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index c84c24c160..097008aca0 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -300,18 +300,6 @@ jobs: if: ${{ failure() }} run: find . -name config.log -exec cat {} \; - Run_coverage: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" - -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/coverage.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done - - name: Upload to Codecov - uses: codecov/codecov-action@v3 - Run_distcheck: runs-on: ubuntu-20.04 strategy: From 1ece8474ab1b6fff3f5f0884fa0b45a41a94d72b Mon Sep 17 00:00:00 2001 From: Tianyu Li Date: Fri, 11 Aug 2023 08:10:54 +0000 Subject: [PATCH 013/192] changelog: fix typos Fix spelling errors found by crate-ci/typos. Signed-off-by: Tianyu Li Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- CHANGELOG | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 08bf49d758..82d0cd1baf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2673,7 +2673,7 @@ The ODP Reference Implementation corporates a number of improvements that result in better code organization as well as improved processing efficiency. ==== Pktio null device support -In the LNG Reference Implemenations of ODP, the `odp_pktio_open()` API may now +In the LNG Reference Implementations of ODP, the `odp_pktio_open()` API may now specify devices of class `null` to indicate the PktIO is treated as a dummy device. Null devices behave just like Linux `/dev/null` in that they never receive packets and simply discard any packets sent to them. @@ -3750,7 +3750,7 @@ directory to provide stress-testing of packet ordering features of ODP. === Documentation In addition to expanded documentation related to the new packet reference APIs, -a section on applicatin portability has been added that discusses the types +a section on application portability has been added that discusses the types of portability offered by ODP and the tradeoffs that application writers should consider when using ODP. @@ -3934,7 +3934,7 @@ manipulation. ==== Ordered Queue Improvements The implementation of ordered queues has been streamlined and made more -scaleable in multi-core systems. +scalable in multi-core systems. ==== Packet Segmentation Improvements The more advance segmentation capabilities present in the new ODP packet @@ -4440,9 +4440,9 @@ containing a larger number of CPUs (typically 24 or more). implementation-specific capability limits for enhanced program portability. ==== Classification -* Addtion of a structure that defines system level classification capability +* Addition of a structure that defines system level classification capability * Addition of range PMRs to complement the existing value PMRs to permit - application to specifiy classification rules over a range of values. + application to specify classification rules over a range of values. ==== Cryptography * Provides a way to get the available cipher and authentication algorithms. @@ -4467,13 +4467,13 @@ containing a larger number of CPUs (typically 24 or more). * Replaced config definition for maximum pktio entries with maximum packet IO index call * Added the classify_enable bit to the odp_pktin_queue_param_t that allows - applications to explicity control which pktin queues are subject to full + applications to explicitly control which pktin queues are subject to full classifier support. * Addition of pktin configuration options to control packet timestamping and checksum validation processing. * Addition of pktout configuration options to control packet checksum offload processing. -* Add the ability to query (via capabilties) whether a pktio interface +* Add the ability to query (via capabilities) whether a pktio interface supports operating in loopback mode and if so to enable/disable this mode of operation. * Round out the polling APIs be adding the ability to receive packets in @@ -4499,8 +4499,8 @@ containing a larger number of CPUs (typically 24 or more). * Add a capability inquiry API to obtain implementation traffic mngr limits. * Split TOS marking into two separate calls. * Add new APIs to support VLAN, ECN, and drop precedence marking. -* Add destroy APIs for shapers, scheduler profiles, threshholds, WRED profiles, - TM queues, and TM nodes for symmetry and completeness to allow applictions +* Add destroy APIs for shapers, scheduler profiles, thresholds, WRED profiles, + TM queues, and TM nodes for symmetry and completeness to allow applications to terminate gracefully without resource leakage. * Add the ability to disconnect TM queues from their fanouts. * Add TM node contexts to permit applications to anchor user context areas @@ -4585,7 +4585,7 @@ opendataplane (1.8.0.0) - test: performance: crypto: measure crypto operation performance - test: pktio_perf: finalize port to use new pktio api - test: pktio_perf: port to use new pktio api - - validataion: packet: add tests for broadcast and multicast flags + - validation: packet: add tests for broadcast and multicast flags - validation: classification: add test case for odp_cos_drop() function - validation: classifier: port to use new pktio api - validation: packet: test if user area is properly set @@ -4827,10 +4827,10 @@ opendataplane (1.7.0.0) - linux-generic: sysinfo: make the cpu_hz per-CPU data - linux-generic: sysinfo: make the model_str per-CPU data - linux-generic: sysinfo: move ARM system info codes to default arch file - - linux-generic: sysinfo: move MIPS system info codes to its plarform file - - linux-generic: sysinfo: move PowerPC system info codes to its plarform file + - linux-generic: sysinfo: move MIPS system info codes to its platform file + - linux-generic: sysinfo: move PowerPC system info codes to its platform file - linux-generic: sysinfo: move cpu_arch_str to odp_system_info_t - - linux-generic: sysinfo: move x86 system info codes to its plarform file + - linux-generic: sysinfo: move x86 system info codes to its platform file - linux-generic: sysinfo: rename odp_cpu_hz_current with odp_ prefix - linux-generic: sysinfo: rename variable cpu_hz to cpu_hz_max - linux-generic: sysinfo: revise odp_cpu_hz() to return current frequency @@ -5043,7 +5043,7 @@ opendataplane (1.4.0.0) - odp_cpumask_def_control() renamed to odp_cpumask_default_control() - odp init extended with num worker and control threads - new: int odp_queue_lock_count(odp_queue_t queue); - - refine api doc for scheduler and schedule orderd locks + - refine api doc for scheduler and schedule ordered locks - argument of odp_schedule_order_lock() and odp_schedule_order_unlock changed to unsigned - new: int odp_thread_count_max(void) - ** Packet ** @@ -5120,7 +5120,7 @@ opendataplane (1.4.0.0) - pktio: fill in L2 parse results by default - pktio: implement odp_pktio_param_init() API - packet: implement flow hash support - - schedule: fix odp_schdule_wait_time + - schedule: fix odp_schedule_wait_time - queue: change lock_index from uint32_t to unsigned to match API - queue: direct internal enqueues to target queue - queue: fix pktout_enqueue() logic @@ -5217,7 +5217,7 @@ opendataplane (1.3.0.0) opendataplane (1.2.0.0) * API: - docs: doxygen grouping clean up and remove excess references to ODP - - pool: remove shm paramter from odp_pool_create() + - pool: remove shm parameter from odp_pool_create() - packet_io: clarify what happens when not all packets are sent - cpumask: added default masks and cpumask_setall - thrmask: added thread mask @@ -5232,7 +5232,7 @@ opendataplane (1.2.0.0) - deleted odph_linux_cpumask_default * test: * validation: - - tests execution moved to platfrom side + - tests execution moved to platform side - test: pktio_perf: add missing atomic init - test: synchronizers: use thread_id instead of cpu_id to detect slow threa - validation: pktio: do not dequeue from scheduled queue @@ -5393,7 +5393,7 @@ opendataplane (1.0.2) - example: l2fwd print packets per second - linux-generic: linux: destroy used pthread attr * bugs: - - validation: packet: use non-zero as true indicato + - validation: packet: use non-zero as true indication - linux-generic: pktio check for NULL entry - linux-generic: fix incorrect pmr_term_value update in odp_pmr_create_xxx() function - replace strtok_r with strtok and fix leaks From 87bc681244326e624a7dbd0e76410c7757c485c8 Mon Sep 17 00:00:00 2001 From: Tianyu Li Date: Fri, 11 Aug 2023 08:12:02 +0000 Subject: [PATCH 014/192] doc: users-guide: fix typos Fix spelling errors found by crate-ci/typos. Signed-off-by: Tianyu Li Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- doc/users-guide/users-guide-cls.adoc | 2 +- doc/users-guide/users-guide-pktio.adoc | 2 +- doc/users-guide/users-guide-timer.adoc | 2 +- doc/users-guide/users-guide.adoc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/users-guide/users-guide-cls.adoc b/doc/users-guide/users-guide-cls.adoc index 359d225d8f..59163a2da5 100644 --- a/doc/users-guide/users-guide-cls.adoc +++ b/doc/users-guide/users-guide-cls.adoc @@ -203,7 +203,7 @@ with either cost1, cos11, cos12. In this case the packet was subjected to two match attempts in total. The remaining two lines illustrate how a packet that matches pmr_match11 could -end up wth either cos11, cos21 or cos31, depending on whether it matches +end up with either cos11, cos21 or cos31, depending on whether it matches pmr_march1, pmr_march2 or pmr_match3. === Practical example diff --git a/doc/users-guide/users-guide-pktio.adoc b/doc/users-guide/users-guide-pktio.adoc index 1698060e9e..b7da188d0f 100644 --- a/doc/users-guide/users-guide-pktio.adoc +++ b/doc/users-guide/users-guide-pktio.adoc @@ -314,7 +314,7 @@ typedef union odp_pktin_config_opt_t { uint64_t all_bits; } odp_pktin_config_opt_t; ----- -These are used to control packet timestamping as well as default packet checkum +These are used to control packet timestamping as well as default packet checksum verification processing. ==== PktIO Parsing Configuration diff --git a/doc/users-guide/users-guide-timer.adoc b/doc/users-guide/users-guide-timer.adoc index e854b5f2d2..f644477a0b 100644 --- a/doc/users-guide/users-guide-timer.adoc +++ b/doc/users-guide/users-guide-timer.adoc @@ -29,7 +29,7 @@ _i.e.,_ trigger both state machines. .ODP Timers lifecycle State Diagram image::timer_fsm.svg[align="center"] -.ODP Timeout event lifecyle State Diagram +.ODP Timeout event lifecycle State Diagram image::timeout_fsm.svg[align="center"] Reminder: diff --git a/doc/users-guide/users-guide.adoc b/doc/users-guide/users-guide.adoc index eaff6867e3..73ec55c414 100644 --- a/doc/users-guide/users-guide.adoc +++ b/doc/users-guide/users-guide.adoc @@ -1317,7 +1317,7 @@ typedef struct odp_schedule_config_t { * scheduling of the event and synchronization is maintained per flow * within each queue. * - * Depeding on implementation, there may be much more flows supported + * Depending on implementation, there may be much more flows supported * than queues, as flows are lightweight entities. * * @see odp_schedule_capability_t, odp_event_flow_id() From ee18d27f26b5f922c3f2b1fb7cb085cc628b3962 Mon Sep 17 00:00:00 2001 From: Tianyu Li Date: Fri, 11 Aug 2023 08:13:12 +0000 Subject: [PATCH 015/192] example: fix typos Fix spelling errors found by crate-ci/typos. Signed-off-by: Tianyu Li Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- example/classifier/odp_classifier.c | 2 +- example/generator/odp_generator.c | 4 ++-- example/ipsec_api/odp_ipsec.c | 2 +- example/ipsec_crypto/odp_ipsec.c | 6 +++--- example/ipsec_crypto/odp_ipsec_fwd_db.h | 2 +- example/ipsec_crypto/odp_ipsec_misc.h | 2 +- example/ipsec_crypto/odp_ipsec_sa_db.h | 2 +- example/packet/odp_pktio.c | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c index 5b66003fe9..4f71c835b8 100644 --- a/example/classifier/odp_classifier.c +++ b/example/classifier/odp_classifier.c @@ -1303,7 +1303,7 @@ static void print_info(char *progname, appl_args_t *appl_args) } /** - * Prinf usage information + * Print usage information */ static void usage(void) { diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index b980ee180e..cefe136830 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -119,7 +119,7 @@ typedef struct { /** * Thread specific arguments */ typedef struct { - counters_t counters; /**< Packet conters */ + counters_t counters; /**< Packet counters */ odp_bool_t stop; /**< Stop packet processing */ union { struct { @@ -1700,7 +1700,7 @@ static void print_info(char *progname, appl_args_t *appl_args) } /** - * Prinf usage information + * Print usage information */ static void usage(char *progname) { diff --git a/example/ipsec_api/odp_ipsec.c b/example/ipsec_api/odp_ipsec.c index 8491eeabcd..524b1ae769 100644 --- a/example/ipsec_api/odp_ipsec.c +++ b/example/ipsec_api/odp_ipsec.c @@ -1350,7 +1350,7 @@ static void print_info(char *progname, appl_args_t *appl_args) } /** - * Prinf usage information + * Print usage information */ static void usage(char *progname) { diff --git a/example/ipsec_crypto/odp_ipsec.c b/example/ipsec_crypto/odp_ipsec.c index ca7a534d49..06d52c311b 100644 --- a/example/ipsec_crypto/odp_ipsec.c +++ b/example/ipsec_crypto/odp_ipsec.c @@ -317,7 +317,7 @@ odp_event_t polled_odp_schedule_cb(odp_queue_t *from) } /** - * IPsec pre argument processing intialization + * IPsec pre argument processing initialization */ static void ipsec_init_pre(void) @@ -376,7 +376,7 @@ void ipsec_init_pre(void) } /** - * IPsec post argument processing intialization + * IPsec post argument processing initialization * * Resolve SP DB with SA DB and create corresponding IPsec cache entries * @@ -1629,7 +1629,7 @@ static void print_info(char *progname, appl_args_t *appl_args) } /** - * Prinf usage information + * Print usage information */ static void usage(char *progname) { diff --git a/example/ipsec_crypto/odp_ipsec_fwd_db.h b/example/ipsec_crypto/odp_ipsec_fwd_db.h index 46fda2b87b..c6d9c6c990 100644 --- a/example/ipsec_crypto/odp_ipsec_fwd_db.h +++ b/example/ipsec_crypto/odp_ipsec_fwd_db.h @@ -71,7 +71,7 @@ void resolve_fwd_db(char *intf, odp_pktio_t pktio, odp_pktout_queue_t pktout, uint8_t *mac); /** - * Display one fowarding database entry + * Display one forwarding database entry * * @param entry Pointer to entry to display */ diff --git a/example/ipsec_crypto/odp_ipsec_misc.h b/example/ipsec_crypto/odp_ipsec_misc.h index 9f9985c570..69788d1151 100644 --- a/example/ipsec_crypto/odp_ipsec_misc.h +++ b/example/ipsec_crypto/odp_ipsec_misc.h @@ -30,7 +30,7 @@ extern "C" { #define KEY_BITS_SHA1_96 160 /**< MD5_96 auth key length in bits */ #define KEY_BITS_SHA256_128 256 /**< SHA256_128 auth key length in bits */ -/**< Number of bits represnted by a string of hexadecimal characters */ +/**< Number of bits represented by a string of hexadecimal characters */ #define KEY_STR_BITS(str) (4 * strlen(str)) /** IPv4 helpers for data length and uint8t pointer */ diff --git a/example/ipsec_crypto/odp_ipsec_sa_db.h b/example/ipsec_crypto/odp_ipsec_sa_db.h index 771fcb2156..72231369fc 100644 --- a/example/ipsec_crypto/odp_ipsec_sa_db.h +++ b/example/ipsec_crypto/odp_ipsec_sa_db.h @@ -29,7 +29,7 @@ typedef enum sa_flags_s { typedef struct sa_db_entry_s { struct sa_db_entry_s *next; /**< Next entry on list */ uint32_t src_ip; /**< Source IPv4 address */ - uint32_t dst_ip; /**< Desitnation IPv4 address */ + uint32_t dst_ip; /**< Destination IPv4 address */ uint32_t spi; /**< Security Parameter Index */ ipsec_alg_t alg; /**< Cipher/auth algorithm */ ipsec_key_t key; /**< Cipher/auth key */ diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index 8b2bb55e3a..df4528d18a 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -718,7 +718,7 @@ static void print_info(char *progname, appl_args_t *appl_args) } /** - * Prinf usage information + * Print usage information */ static void usage(char *progname) { From ea2485ed5455d20e1ac09c33fafade8dd2ca3cde Mon Sep 17 00:00:00 2001 From: Tianyu Li Date: Fri, 11 Aug 2023 08:14:04 +0000 Subject: [PATCH 016/192] helper: fix typos Fix spelling errors found by crate-ci/typos. Signed-off-by: Tianyu Li Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- helper/cuckootable.c | 2 +- helper/hashtable.c | 2 +- helper/include/odp/helper/linux/process.h | 2 +- helper/include/odp/helper/linux/pthread.h | 2 +- helper/include/odp/helper/table.h | 4 ++-- helper/include/odp/helper/threads.h | 2 +- helper/iplookuptable.c | 2 +- helper/lineartable.c | 6 +++--- helper/test/cuckootable.c | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/helper/cuckootable.c b/helper/cuckootable.c index ecf95a83aa..0a71ca3889 100644 --- a/helper/cuckootable.c +++ b/helper/cuckootable.c @@ -87,7 +87,7 @@ struct cuckoo_table_key_value { }; /** @internal bucket structure - * Put the elements with defferent keys but a same signature + * Put the elements with different keys but a same signature * into a bucket, and each bucket has at most HASH_BUCKET_ENTRIES * elements. */ diff --git a/helper/hashtable.c b/helper/hashtable.c index 0c571db911..fc1774bb08 100644 --- a/helper/hashtable.c +++ b/helper/hashtable.c @@ -27,7 +27,7 @@ #define ODPH_MAX_BUCKET_NUM 0x10000 /** @inner element structure of hash table - * To resolve the hash confict: + * To resolve the hash conflict: * we put the elements with different keys but a same HASH-value * into a list */ diff --git a/helper/include/odp/helper/linux/process.h b/helper/include/odp/helper/linux/process.h index 620db74056..8d53c7191f 100644 --- a/helper/include/odp/helper/linux/process.h +++ b/helper/include/odp/helper/linux/process.h @@ -11,7 +11,7 @@ * * This file is not part of ODP APIs, but can be optionally used to ease common * setups in a Linux system. User is free to implement the same setups in - * otherways (not via this file). + * other ways (not via this file). */ #ifndef ODPH_LINUX_PROCESS_H_ diff --git a/helper/include/odp/helper/linux/pthread.h b/helper/include/odp/helper/linux/pthread.h index 2985368933..910c27cd3c 100644 --- a/helper/include/odp/helper/linux/pthread.h +++ b/helper/include/odp/helper/linux/pthread.h @@ -11,7 +11,7 @@ * * This file is not part of ODP APIs, but can be optionally used to ease common * setups in a Linux system. User is free to implement the same setups in - * otherways (not via this file). + * other ways (not via this file). */ #ifndef ODPH_LINUX_PTHREAD_H_ diff --git a/helper/include/odp/helper/table.h b/helper/include/odp/helper/table.h index b1f8b44699..73dfafc920 100644 --- a/helper/include/odp/helper/table.h +++ b/helper/include/odp/helper/table.h @@ -56,7 +56,7 @@ * actions and action meta-data describing what processing to be * applied for the packets of the current flow, such as whether * encryption/decryption is required on this packet, what kind of cipher - * algorithm should be chosed. + * algorithm should be chosen. *
  • Algorithm: Hash * * @@ -149,7 +149,7 @@ typedef int (*odph_table_destroy)(odph_table_t table); /** * Add (key,associated data) pair into the specific table. - * When no associated data is currently assocated with key, + * When no associated data is currently associated with key, * then the (key,assocatied data) association is created. * When key is already associated with data0, then association (key, data0) * will be removed and association (key, associated data) is created. diff --git a/helper/include/odp/helper/threads.h b/helper/include/odp/helper/threads.h index 00f47fd76d..fc79edffae 100644 --- a/helper/include/odp/helper/threads.h +++ b/helper/include/odp/helper/threads.h @@ -13,7 +13,7 @@ * * This file is an optional helper to ODP APIs. These functions are provided * to ease common setups in a Linux system. User is free to implement the same - * setups in otherways (not via this API). + * setups in other ways (not via this API). */ #ifndef ODPH_LINUX_H_ diff --git a/helper/iplookuptable.c b/helper/iplookuptable.c index f8f8e9cc5c..22fd6e56c3 100644 --- a/helper/iplookuptable.c +++ b/helper/iplookuptable.c @@ -155,7 +155,7 @@ cache_destroy(odph_iplookup_table_impl *impl) } } -/** According to the type of cahce, set the value of +/** According to the type of cache, set the value of * a buffer to the initial value. */ static void diff --git a/helper/lineartable.c b/helper/lineartable.c index 5362d80f5e..a81e4301c8 100644 --- a/helper/lineartable.c +++ b/helper/lineartable.c @@ -28,7 +28,7 @@ typedef struct { uint32_t magicword; /**< for check */ uint32_t init_cap; /**< input param of capacity */ - /** given the capacity, caculate out the max supported nodes number */ + /** given the capacity, calculate out the max supported nodes number */ uint32_t node_sum; /** size of a lineartable element,including the rwlock in the head */ uint32_t value_size; @@ -54,7 +54,7 @@ odph_table_t odph_linear_table_create(const char *name, uint32_t capacity, printf("create para input error or less than !"); return NULL; } - /* check name confict in shm*/ + /* check name conflict in shm*/ if (odp_shm_lookup(name) != ODP_SHM_INVALID) { ODPH_DBG("name already exist\n"); return NULL; @@ -75,7 +75,7 @@ odph_table_t odph_linear_table_create(const char *name, uint32_t capacity, strncpy(tbl->name, name, ODPH_TABLE_NAME_LEN - 1); - /* for linear table, the key is just the index, without confict + /* for linear table, the key is just the index, without conflict * so we just need to record the value content * there is a rwlock in the head of every node */ diff --git a/helper/test/cuckootable.c b/helper/test/cuckootable.c index d11e944f99..06d207f073 100644 --- a/helper/test/cuckootable.c +++ b/helper/test/cuckootable.c @@ -392,7 +392,7 @@ static int test_five_keys(void) #define BUCKET_ENTRIES 4 #define HASH_ENTRIES_MAX 1048576 /* - * Do tests for cuchoo tabke creation with bad parameters. + * Do tests for cuchoo table creation with bad parameters. */ static int test_creation_with_bad_parameters(void) { From 7444487ad4e63be387ccd44f5709c1651212db3d Mon Sep 17 00:00:00 2001 From: Tianyu Li Date: Fri, 11 Aug 2023 08:14:54 +0000 Subject: [PATCH 017/192] api: fix typos Fix spelling errors found by crate-ci/typos. Signed-off-by: Tianyu Li Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- include/odp/api/rwlock_recursive.h | 2 +- include/odp/api/spec/classification.h | 2 +- include/odp/api/spec/comp.h | 2 +- include/odp/api/spec/crypto_types.h | 2 +- include/odp/api/spec/ipsec_types.h | 2 +- include/odp/api/spinlock_recursive.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/odp/api/rwlock_recursive.h b/include/odp/api/rwlock_recursive.h index 1b33039f32..4be8a571f0 100644 --- a/include/odp/api/rwlock_recursive.h +++ b/include/odp/api/rwlock_recursive.h @@ -7,7 +7,7 @@ /** * @file * - * ODP resursive read/write lock + * ODP recursive read/write lock */ #ifndef ODP_API_RWLOCK_RECURSIVE_H_ diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index aefe2845a4..4d5bff3375 100644 --- a/include/odp/api/spec/classification.h +++ b/include/odp/api/spec/classification.h @@ -550,7 +550,7 @@ typedef struct odp_cls_capability_t { * supported. */ uint32_t max_cos_stats; - /** Maximun number of queues supported per CoS + /** Maximum number of queues supported per CoS * if the value is 1, then hashing is not supported*/ uint32_t max_hash_queues; diff --git a/include/odp/api/spec/comp.h b/include/odp/api/spec/comp.h index a1f6f48fb4..2a04927883 100644 --- a/include/odp/api/spec/comp.h +++ b/include/odp/api/spec/comp.h @@ -184,7 +184,7 @@ typedef struct odp_comp_capability_t { /** Synchronous compression mode support (ODP_COMP_OP_MODE_SYNC) */ odp_support_t sync; - /** Aynchronous compression mode support (ODP_COMP_OP_MODE_ASYNC) */ + /** Asynchronous compression mode support (ODP_COMP_OP_MODE_ASYNC) */ odp_support_t async; } odp_comp_capability_t; diff --git a/include/odp/api/spec/crypto_types.h b/include/odp/api/spec/crypto_types.h index 6aa3f38a68..8b7c3b3823 100644 --- a/include/odp/api/spec/crypto_types.h +++ b/include/odp/api/spec/crypto_types.h @@ -887,7 +887,7 @@ typedef enum { } ODP_DEPRECATE(odp_crypto_hw_err_t); /** - * Cryto API per packet operation completion status + * Crypto API per packet operation completion status */ typedef struct odp_crypto_op_status { /** Algorithm specific return code */ diff --git a/include/odp/api/spec/ipsec_types.h b/include/odp/api/spec/ipsec_types.h index b34fb5982d..4ee7b36490 100644 --- a/include/odp/api/spec/ipsec_types.h +++ b/include/odp/api/spec/ipsec_types.h @@ -1001,7 +1001,7 @@ typedef struct odp_ipsec_stats_t { /** Number of packets with algorithm errors */ uint64_t alg_err; - /** Number of packes with MTU errors */ + /** Number of packets with MTU errors */ uint64_t mtu_err; /** Number of packets with hard lifetime(bytes) expired */ diff --git a/include/odp/api/spinlock_recursive.h b/include/odp/api/spinlock_recursive.h index 403510e77a..7af0b59e87 100644 --- a/include/odp/api/spinlock_recursive.h +++ b/include/odp/api/spinlock_recursive.h @@ -7,7 +7,7 @@ /** * @file * - * ODP resursive spinlock + * ODP recursive spinlock */ #ifndef ODP_API_SPINLOCK_RECURSIVE_H_ From 30c50f461b31e794aab51d7d09d058cac4327f91 Mon Sep 17 00:00:00 2001 From: Tianyu Li Date: Fri, 11 Aug 2023 08:15:52 +0000 Subject: [PATCH 018/192] linux-gen: fix typos Fix spelling errors found by crate-ci/typos. Signed-off-by: Tianyu Li Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- .../include/odp_classification_datamodel.h | 2 +- .../include/odp_fdserver_internal.h | 2 +- .../linux-generic/include/odp_global_data.h | 2 +- platform/linux-generic/m4/odp_dpdk.m4 | 2 +- platform/linux-generic/odp_fdserver.c | 6 ++-- platform/linux-generic/odp_ipsec.c | 2 +- platform/linux-generic/odp_ipsec_sad.c | 2 +- platform/linux-generic/odp_ishmpool.c | 4 +-- .../linux-generic/odp_schedule_scalable.c | 2 +- platform/linux-generic/odp_system_info.c | 2 +- platform/linux-generic/pktio/dpdk.c | 2 +- platform/linux-generic/pktio/ipc.c | 2 +- .../linux-generic/test/pktio_ipc/ipc_common.c | 2 +- .../test/validation/api/shmem/shmem_linux.c | 36 +++++++++---------- .../test/validation/api/shmem/shmem_odp2.c | 4 +-- 15 files changed, 36 insertions(+), 36 deletions(-) diff --git a/platform/linux-generic/include/odp_classification_datamodel.h b/platform/linux-generic/include/odp_classification_datamodel.h index daa783b075..376dbd1dbb 100644 --- a/platform/linux-generic/include/odp_classification_datamodel.h +++ b/platform/linux-generic/include/odp_classification_datamodel.h @@ -59,7 +59,7 @@ extern "C" { ODP_STATIC_ASSERT(CLS_COS_MAX_ENTRY <= UINT16_MAX, "CoS_does_not_fit_16_bits"); typedef union { - /* All proto fileds */ + /* All proto fields */ uint32_t all; struct { diff --git a/platform/linux-generic/include/odp_fdserver_internal.h b/platform/linux-generic/include/odp_fdserver_internal.h index 8518a5b7e9..0b0a9bb0ef 100644 --- a/platform/linux-generic/include/odp_fdserver_internal.h +++ b/platform/linux-generic/include/odp_fdserver_internal.h @@ -12,7 +12,7 @@ extern "C" { #endif /* - * the following enum defines the different contextes by which the + * the following enum defines the different contexts by which the * FD server may be used: In the FD server, the keys used to store/retrieve * a file descriptor are actually context based: * Both the context and the key are stored at fd registration time, diff --git a/platform/linux-generic/include/odp_global_data.h b/platform/linux-generic/include/odp_global_data.h index 67b7572ef6..f883cefd96 100644 --- a/platform/linux-generic/include/odp_global_data.h +++ b/platform/linux-generic/include/odp_global_data.h @@ -53,7 +53,7 @@ typedef struct { * to enable process more support. */ typedef struct odp_global_data_ro_t { odp_init_t init_param; - /* directory for odp mmaped files */ + /* directory for odp mapped files */ char *shm_dir; /* overload default with env */ int shm_dir_from_env; diff --git a/platform/linux-generic/m4/odp_dpdk.m4 b/platform/linux-generic/m4/odp_dpdk.m4 index f61c38a8e5..dc3c9610e5 100644 --- a/platform/linux-generic/m4/odp_dpdk.m4 +++ b/platform/linux-generic/m4/odp_dpdk.m4 @@ -41,7 +41,7 @@ AC_ARG_ENABLE([dpdk-zero-copy], # Check for DPDK availability # # DPDK pmd drivers are not linked unless the --whole-archive option is -# used. No spaces are allowed between the --whole-arhive flags. +# used. No spaces are allowed between the --whole-archive flags. ########################################################################## if test x$pktio_dpdk_support = xyes then diff --git a/platform/linux-generic/odp_fdserver.c b/platform/linux-generic/odp_fdserver.c index af9c1b498a..4995efb94b 100644 --- a/platform/linux-generic/odp_fdserver.c +++ b/platform/linux-generic/odp_fdserver.c @@ -29,7 +29,7 @@ * _odp_fdserver_deregister_fd(context, key); * _odp_fdserver_lookup_fd(context, key); * - * which are used to register/deregister or querry for file descriptor based + * which are used to register/deregister or query for file descriptor based * on a context and key value couple, which has to be unique. * * Note again that the file descriptors stored here are local to this server @@ -129,7 +129,7 @@ static int send_fdserver_msg(int sock, int command, char ancillary_data[CMSG_SPACE(sizeof(int))]; - /* prepare the register request body (single framgent): */ + /* prepare the register request body (single fragment): */ msg.command = command; msg.context = context; msg.key = key; @@ -387,7 +387,7 @@ int _odp_fdserver_lookup_fd(fd_server_context_e context, uint64_t key) } /* - * request server terminaison: + * request server termination: */ static int stop_server(void) { diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index 861dc1337b..8c97a0f550 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -2206,7 +2206,7 @@ static void ipsec_out_prepare(const odp_packet_t pkt_in[], odp_packet_t pkt_out[ opt_inc = (param->num_opt > 1) ? 1 : 0; /* No need to do _odp_ipsec_sa_use() here since an ODP application is not allowed to do * call IPsec output before SA creation has completed nor call odp_ipsec_sa_disable() - * before IPsec output has completed. IOW, the needed sychronization between threads is + * before IPsec output has completed. IOW, the needed synchronization between threads is * done by the application. */ *num_crypto = 0; diff --git a/platform/linux-generic/odp_ipsec_sad.c b/platform/linux-generic/odp_ipsec_sad.c index daa80c7e65..89cc8aef72 100644 --- a/platform/linux-generic/odp_ipsec_sad.c +++ b/platform/linux-generic/odp_ipsec_sad.c @@ -837,7 +837,7 @@ int odp_ipsec_sa_destroy(odp_ipsec_sa_t sa) uint32_t state = odp_atomic_load_u32(&ipsec_sa->state); if (IPSEC_SA_STATE_DISABLE != state) { - _ODP_ERR("Distroying not disabled ipsec_sa: %u\n", ipsec_sa->ipsec_sa_idx); + _ODP_ERR("Destroying not disabled ipsec_sa: %u\n", ipsec_sa->ipsec_sa_idx); return -1; } diff --git a/platform/linux-generic/odp_ishmpool.c b/platform/linux-generic/odp_ishmpool.c index 5bcb2c2eac..9b6340d7e6 100644 --- a/platform/linux-generic/odp_ishmpool.c +++ b/platform/linux-generic/odp_ishmpool.c @@ -32,7 +32,7 @@ * returned to this same queue when freed. * * The reason for not using malloc() is that malloc does not guarantee - * memory sharability between ODP threads (regardless of their implememtation) + * memory sharability between ODP threads (regardless of their implementation) * which ishm_reserve() can do. see the comments around * _odp_ishmbud_pool_create() and ishm_reserve() for more details. * @@ -401,7 +401,7 @@ static int _odp_ishmbud_free(pool_t *bpool, void *addr) /*merge: make sure we point at start of block: */ if (bblock > buddy) bblock = buddy; - /*merge: size of bloack has dubbled: increse order: */ + /*merge: size of block has doubled: increase order: */ order++; } diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c index bca88e4b5a..28245f66b5 100644 --- a/platform/linux-generic/odp_schedule_scalable.c +++ b/platform/linux-generic/odp_schedule_scalable.c @@ -349,7 +349,7 @@ sched_update_deq(sched_elem_t *q, if ((oss.numevts > 0 && nss.numevts <= 0) || oss.wrr_budget <= actual) { /* If we have emptied parallel/ordered queue or - * exchausted its WRR budget, we need a ticket + * exhausted its WRR budget, we need a ticket * for a later pop. */ ticket = nss.nxt_ticket++; diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index 7864a3d17a..6281bee750 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -83,7 +83,7 @@ static uint64_t default_huge_page_size(void) while (fgets(str, sizeof(str), file) != NULL) { if (sscanf(str, "Hugepagesize: %8lu kB", &sz) == 1) { - _ODP_DBG("defaut hp size is %lu kB\n", sz); + _ODP_DBG("default hp size is %lu kB\n", sz); fclose(file); return (uint64_t)sz * 1024; } diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 54c54ff102..84d5f5e5f7 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -2098,7 +2098,7 @@ static int dpdk_start(pktio_entry_t *pktio_entry) if (dpdk_setup_eth_rx(pktio_entry, pkt_dpdk, &dev_info)) return -1; - /* Restore MTU value resetted by dpdk_setup_eth_rx() */ + /* Restore MTU value reset by dpdk_setup_eth_rx() */ if (pkt_dpdk->mtu_set && pktio_entry->capa.set_op.op.maxlen) { ret = dpdk_maxlen_set(pktio_entry, pkt_dpdk->mtu, 0); if (ret) { diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c index 01d25e11de..0c1ecc4750 100644 --- a/platform/linux-generic/pktio/ipc.c +++ b/platform/linux-generic/pktio/ipc.c @@ -709,7 +709,7 @@ static int ipc_pktio_recv_lockless(pktio_entry_t *pktio_entry, pkt_table[i] = pkt; } - /* put back to rx ring dequed but not processed packets*/ + /* put back to rx ring dequeued but not processed packets*/ if (pkts != i) { ipcbufs_p = (void *)&offsets[i]; r_p = pktio_ipc->rx.cache; diff --git a/platform/linux-generic/test/pktio_ipc/ipc_common.c b/platform/linux-generic/test/pktio_ipc/ipc_common.c index 655cd80d54..d30aaf4731 100644 --- a/platform/linux-generic/test/pktio_ipc/ipc_common.c +++ b/platform/linux-generic/test/pktio_ipc/ipc_common.c @@ -147,7 +147,7 @@ void print_info(char *progname) } /** - * Prinf usage information + * Print usage information */ void usage(char *progname) { 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 43a640c49f..03a9255f76 100644 --- a/platform/linux-generic/test/validation/api/shmem/shmem_linux.c +++ b/platform/linux-generic/test/validation/api/shmem/shmem_linux.c @@ -39,7 +39,7 @@ * exit with failure code. | ------------------- * | * forks odp app2 process | ODP APP2 process - * wait for child terminaison & status| (shmem_odp2.c) + * wait for child termination & status| (shmem_odp2.c) * | lookup ODP_APP1 shared memory, * | check if memory contents is OK * | Exit(0) on success, exit(1) on fail @@ -47,7 +47,7 @@ * exit with failure code. | ------------------- * | * OK, write "S" in fifo, | - * wait for child terminaison & status| + * wait for child termination & status| * terminate with same status as child| * | ODP APP1 process * | (shmem_odp1.c) @@ -56,7 +56,7 @@ * | read S(success) or F(fail) from fifo * | report success or failure to C-Unit * | Exit(0) on success, exit(1) on fail - * wait for child terminaison & status | + * wait for child termination & status | * terminate with same status as child | * | * \|/ @@ -91,25 +91,25 @@ #define MAX_FIFO_WAIT 30 /* Max time waiting for the fifo (sec) */ /* - * read the attributes of a externaly shared mem object: + * read the attributes of an externally shared mem object: * input: ext_odp_pid, blockname: the remote ODP instance and the exported * block name to be searched. - * Output: filename: the memory block underlaying file to be opened + * Output: filename: the memory block underlying file to be opened * (the given buffer should be big enough i.e. at * least ISHM_FILENAME_MAXLEN bytes) * The 3 following parameters are really here for debug - * as they are really meaningles in a non-odp process: + * as they are really meaningless in a non-odp process: * len: the block real length (bytes, multiple of page sz) * flags: the _ishm flags setting the block was created with - * align: the alignement setting the block was created with + * align: the alignment setting the block was created with * * return 0 on success, non zero on error */ -static int read_shmem_attribues(uint64_t ext_odp_pid, const char *blockname, - char *filename, uint64_t *len, - uint32_t *flags, uint64_t *user_len, - uint32_t *user_flags, uint32_t *align, - uint64_t *offset) +static int read_shmem_attributes(uint64_t ext_odp_pid, const char *blockname, + char *filename, uint64_t *len, + uint32_t *flags, uint64_t *user_len, + uint32_t *user_flags, uint32_t *align, + uint64_t *offset) { char shm_attr_filename[PATH_MAX]; FILE *export_file; @@ -261,11 +261,11 @@ int main(int argc __attribute__((unused)), char *argv[]) * check to see if linux can see the created shared memory: */ /* read the shared memory attributes (includes the shm filename): */ - if (read_shmem_attribues(odp_app1, SHM_NAME, - shm_filename, &len, &flags, - &user_len, &user_flags, &align, - &offset) != 0) { - printf("error read_shmem_attribues\n"); + if (read_shmem_attributes(odp_app1, SHM_NAME, + shm_filename, &len, &flags, + &user_len, &user_flags, &align, + &offset) != 0) { + printf("error read_shmem_attributes\n"); test_failure(fifo_name, fifo_fd, odp_app1); } @@ -279,7 +279,7 @@ int main(int argc __attribute__((unused)), char *argv[]) test_failure(fifo_name, fifo_fd, odp_app1); /* no return */ } - /* linux ODP guarantees page size alignement. Larger alignment may + /* linux ODP guarantees page size alignment. Larger alignment may * fail as 2 different processes will have fully unrelated * virtual spaces. */ 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 1f2637a6a8..14ad2d82ed 100644 --- a/platform/linux-generic/test/validation/api/shmem/shmem_odp2.c +++ b/platform/linux-generic/test/validation/api/shmem/shmem_odp2.c @@ -23,7 +23,7 @@ #define TEST_SHARE_BAR (0xf0f0f0f) /* The C unit test harness is run by ODP1 app which will be told the return - * staus of this process. See top of shmem_linux.c for chart flow of events + * status of this process. See top of shmem_linux.c for chart flow of events */ int main(int argc, char *argv[]) { @@ -100,6 +100,6 @@ int main(int argc, char *argv[]) return 1; } - printf("%s SUCSESS\n", __FILE__); + printf("%s SUCCESS\n", __FILE__); return 0; } From 51aed67fce52e8bd727591769093e82a0b9618d7 Mon Sep 17 00:00:00 2001 From: Tianyu Li Date: Fri, 11 Aug 2023 08:16:07 +0000 Subject: [PATCH 019/192] test: fix typos Fix spelling errors found by crate-ci/typos. Signed-off-by: Tianyu Li Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- test/performance/odp_bench_packet.c | 2 +- test/performance/odp_cpu_bench.c | 2 +- test/performance/odp_ipsec.c | 2 +- test/performance/odp_l2fwd.c | 2 +- test/performance/odp_pktio_ordered.c | 2 +- test/performance/odp_sched_perf.c | 2 +- .../validation/api/classification/odp_classification_common.c | 2 +- test/validation/api/lock/lock.c | 4 ++-- test/validation/api/scheduler/scheduler.c | 2 +- test/validation/api/traffic_mngr/traffic_mngr.c | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/performance/odp_bench_packet.c b/test/performance/odp_bench_packet.c index aaf725b570..8da2d736a0 100644 --- a/test/performance/odp_bench_packet.c +++ b/test/performance/odp_bench_packet.c @@ -1466,7 +1466,7 @@ static int packet_parse_multi(void) } /** - * Prinf usage information + * Print usage information */ static void usage(char *progname) { diff --git a/test/performance/odp_cpu_bench.c b/test/performance/odp_cpu_bench.c index e912e167d9..7ef12dc30e 100644 --- a/test/performance/odp_cpu_bench.c +++ b/test/performance/odp_cpu_bench.c @@ -339,7 +339,7 @@ static int run_thread(void *arg) } /* - * Prinf usage information + * Print usage information */ static void usage(char *progname) { diff --git a/test/performance/odp_ipsec.c b/test/performance/odp_ipsec.c index 677e7762fc..6ad6037efc 100644 --- a/test/performance/odp_ipsec.c +++ b/test/performance/odp_ipsec.c @@ -1022,7 +1022,7 @@ static int run_thr_func(void *arg) } /** - * Prinf usage information + * Print usage information */ static void usage(char *progname) { diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index 61e891de1f..853f292694 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -1421,7 +1421,7 @@ static void init_port_lookup_tbl(void) } /* - * Prinf usage information + * Print usage information */ static void usage(char *progname) { diff --git a/test/performance/odp_pktio_ordered.c b/test/performance/odp_pktio_ordered.c index 2ad1e67be1..bd43ad53d4 100644 --- a/test/performance/odp_pktio_ordered.c +++ b/test/performance/odp_pktio_ordered.c @@ -809,7 +809,7 @@ static void init_forwarding_tbl(void) } /** - * Prinf usage information + * Print usage information */ static void usage(char *progname) { diff --git a/test/performance/odp_sched_perf.c b/test/performance/odp_sched_perf.c index a97686c121..f897055764 100644 --- a/test/performance/odp_sched_perf.c +++ b/test/performance/odp_sched_perf.c @@ -1148,7 +1148,7 @@ static int start_workers(test_global_t *global, odp_instance_t instance) if (num_group > 0 && num_join) { /* Each thread joins only num_join groups, starting - * from this group index and wraping around the group + * from this group index and wrapping around the group * table. */ int first_group = (i * num_join) % num_group; diff --git a/test/validation/api/classification/odp_classification_common.c b/test/validation/api/classification/odp_classification_common.c index fe76770440..d057ea40b6 100644 --- a/test/validation/api/classification/odp_classification_common.c +++ b/test/validation/api/classification/odp_classification_common.c @@ -113,7 +113,7 @@ static uint32_t seqno_offset(odp_packet_t pkt) CU_ASSERT_FATAL(rc == 0); len = sizeof(ip) + odp_be_to_cpu_16(ip.payload_len); } else { - CU_FAIL_FATAL("Unexcpected packet type"); + CU_FAIL_FATAL("Unexpected packet type"); } return l3_offset + len - sizeof(cls_test_packet_t); diff --git a/test/validation/api/lock/lock.c b/test/validation/api/lock/lock.c index 5210f7e5d4..78c6ee79be 100644 --- a/test/validation/api/lock/lock.c +++ b/test/validation/api/lock/lock.c @@ -400,7 +400,7 @@ static int no_lock_functional_test(void *arg UNUSED) lock_owner_delay = BASE_DELAY; /* - * Tunning the iteration number: + * Tuning the iteration number: * Here, we search for an iteration number that guarantees to show * race conditions between the odp threads. * Iterations is set to ITER_MPLY_FACTOR * cnt where cnt is when @@ -470,7 +470,7 @@ static int no_lock_functional_test(void *arg UNUSED) CU_ASSERT(sync_failures != 0 || global_mem->g_num_threads == 1); /* - * set the iterration for the future tests to be far above the + * set the iteration for the future tests to be far above the * contention level */ iterations *= ITER_MPLY_FACTOR; diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c index ec06cf27d9..e735faa93d 100644 --- a/test/validation/api/scheduler/scheduler.c +++ b/test/validation/api/scheduler/scheduler.c @@ -1250,7 +1250,7 @@ static void scheduler_test_groups(void) num--; } - /* Release schduler context and leave groups */ + /* Release scheduler context and leave groups */ odp_schedule_group_join(mygrp1, &mymask); odp_schedule_group_join(mygrp2, &mymask); CU_ASSERT(drain_queues() == 0); diff --git a/test/validation/api/traffic_mngr/traffic_mngr.c b/test/validation/api/traffic_mngr/traffic_mngr.c index c83cc105f9..28d163fd34 100644 --- a/test/validation/api/traffic_mngr/traffic_mngr.c +++ b/test/validation/api/traffic_mngr/traffic_mngr.c @@ -211,7 +211,7 @@ static const char ALPHABET[] = /* The following constant table determines the minimum and maximum number of * pkts that will be received when sending 100 pkts through a system with a * drop probability of p% (using a uniform probability distribution), with a - * confidence of 99.9% 99.99% and 99.999%. The confidence is interepreted as + * confidence of 99.9% 99.99% and 99.999%. The confidence is interpreted as * follows: a 99.99% confidence says that receiving LESS pkts than the given * minimum or receiving MORE pkts than the given maximum (assuming a uniform * drop percent of p) will happen less than 1 time in 10,000 trials. From 30ee4db2240a2fec844f93fce675324a881e5106 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Wed, 9 Aug 2023 12:24:17 +0000 Subject: [PATCH 020/192] github_ci: add github actions for build and run logging Move existing build and run failure logging to repository-local github actions. Additionally, add a new logging action to display logs of successful runs. This enables inspection of e.g. validation test prints after a successful CI run. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- .github/actions/build-failure-log/action.yml | 7 +++++++ .github/actions/dump-log/action.yml | 7 +++++++ .github/actions/run-failure-log/action.yml | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 .github/actions/build-failure-log/action.yml create mode 100644 .github/actions/dump-log/action.yml create mode 100644 .github/actions/run-failure-log/action.yml diff --git a/.github/actions/build-failure-log/action.yml b/.github/actions/build-failure-log/action.yml new file mode 100644 index 0000000000..571274c410 --- /dev/null +++ b/.github/actions/build-failure-log/action.yml @@ -0,0 +1,7 @@ +name: 'Build Failure Logger' +description: 'Log output of failing build' +runs: + using: 'composite' + steps: + - run: find . -name config.log -exec cat {} \; + shell: bash diff --git a/.github/actions/dump-log/action.yml b/.github/actions/dump-log/action.yml new file mode 100644 index 0000000000..039583686a --- /dev/null +++ b/.github/actions/dump-log/action.yml @@ -0,0 +1,7 @@ +name: 'Dump Logs' +description: 'Dump logs of successful run' +runs: + using: 'composite' + steps: + - run: find . -name "*.log" -exec echo -e "\n\n @@@@@ {} @@@@@\n\n" \; -exec cat {} \; + shell: bash diff --git a/.github/actions/run-failure-log/action.yml b/.github/actions/run-failure-log/action.yml new file mode 100644 index 0000000000..520d178c8f --- /dev/null +++ b/.github/actions/run-failure-log/action.yml @@ -0,0 +1,7 @@ +name: 'Run Failure Logger' +description: 'Log output of failing run' +runs: + using: 'composite' + steps: + - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + shell: bash From dcea93db1f8b947c1378bb943a01a9b0e1eca6c2 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Fri, 11 Aug 2023 05:26:36 +0000 Subject: [PATCH 021/192] github_ci: utilize new logging actions Take newly added local github actions into use. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- .github/workflows/ci-pipeline-arm64.yml | 102 ++++++++---------- .github/workflows/ci-pipeline.yml | 138 ++++++++++-------------- 2 files changed, 99 insertions(+), 141 deletions(-) diff --git a/.github/workflows/ci-pipeline-arm64.yml b/.github/workflows/ci-pipeline-arm64.yml index 1b516b274b..c6825668e9 100644 --- a/.github/workflows/ci-pipeline-arm64.yml +++ b/.github/workflows/ci-pipeline-arm64.yml @@ -31,9 +31,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/build_${ARCH}.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_static_u22: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -51,9 +50,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="gcc-${{matrix.cc_ver}}" -e CXX="g++-${{matrix.cc_ver}}" -e CONF="${CONF} ${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/build_static.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_OS: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -68,9 +66,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${{matrix.os}}-${ARCH}-native /odp/scripts/ci/build_${ARCH}.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_gcc_u22: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -87,9 +84,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="gcc-${{matrix.cc_ver}}" -e CXX="g++-${{matrix.cc_ver}}" -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/build_${ARCH}.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_out-of-tree: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -99,9 +95,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/out_of_tree.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_XDP: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -118,9 +113,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/build_${ARCH}.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Run_distcheck: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -134,9 +128,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/distcheck.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -155,9 +148,10 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e ARCH="${ARCH}" -e CXX=g++-10 -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log + - if: ${{ success() }} + uses: ./.github/actions/dump-log Run_CFLAGS: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -172,9 +166,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e ARCH="${ARCH}" -e CXX=g++-10 -e CFLAGS="${{matrix.cflags}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_OS: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -188,9 +181,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${{matrix.os}}-${ARCH}-native /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_sched_config: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -200,9 +192,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-generic/test/sched-basic.conf $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_stash_config: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -212,9 +203,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-generic/test/stash-custom.conf $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_scheduler_sp: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -224,9 +214,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" -e ODP_SCHEDULER=sp $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_scheduler_scalable: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -236,9 +225,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" -e ODP_SCHEDULER=scalable -e CI_SKIP=pktio_test_pktin_event_sched $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_process_mode: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -249,9 +237,8 @@ jobs: - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-generic/test/process-mode.conf -e ODPH_PROC_MODE=1 $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_inline_timer: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -262,9 +249,8 @@ jobs: - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-generic/test/inline-timer.conf $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/check_inline_timer.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_packet_align: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -275,9 +261,8 @@ jobs: - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-generic/test/packet_align.conf $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native /odp/scripts/ci/check_pktio.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_dpdk-19_11: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -287,9 +272,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native-dpdk_19.11 /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_dpdk-20_11: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -299,9 +283,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native-dpdk_20.11 /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_dpdk-21_11: if: ${{ github.repository == 'OpenDataPlane/odp' }} @@ -311,6 +294,5 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-native-dpdk_21.11 /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 097008aca0..e0af6dfc18 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -78,9 +78,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_static_u20: runs-on: ubuntu-20.04 @@ -95,9 +94,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="gcc-${{matrix.cc_ver}}" -e CXX="g++-${{matrix.cc_ver}}" -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_static.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_static_u22: runs-on: ubuntu-20.04 @@ -113,9 +111,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="gcc-${{matrix.cc_ver}}" -e CXX="g++-${{matrix.cc_ver}}" -e CONF="${CONF} ${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_static.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_arm64: runs-on: ubuntu-20.04 @@ -132,9 +129,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e CONF="${CONF} ${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_arm64_u18: runs-on: ubuntu-20.04 @@ -149,9 +145,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_armhf: runs-on: ubuntu-20.04 @@ -166,9 +161,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_ppc64el: runs-on: ubuntu-20.04 @@ -184,9 +178,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e CONF="${CONF} ${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_i386: runs-on: ubuntu-20.04 @@ -202,9 +195,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_riscv64: runs-on: ubuntu-20.04 @@ -219,9 +211,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_OS: runs-on: ubuntu-20.04 @@ -235,9 +226,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${{matrix.os}}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_gcc_u18: runs-on: ubuntu-20.04 @@ -252,9 +242,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="gcc-${{matrix.cc_ver}}" -e CXX="g++-${{matrix.cc_ver}}" -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_gcc_u22: runs-on: ubuntu-20.04 @@ -269,9 +258,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="gcc-${{matrix.cc_ver}}" -e CXX="g++-${{matrix.cc_ver}}" -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_out-of-tree: runs-on: ubuntu-20.04 @@ -279,9 +267,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/out_of_tree.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_XDP: runs-on: ubuntu-20.04 @@ -296,9 +283,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/build_${ARCH}.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name config.log -exec cat {} \; + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Run_distcheck: runs-on: ubuntu-20.04 @@ -310,9 +296,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/distcheck.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run: runs-on: ubuntu-20.04 @@ -329,9 +314,11 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e ARCH="${ARCH}" -e CXX=g++-10 -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log + - if: ${{ success() }} + uses: ./.github/actions/dump-log + Run_OS: runs-on: ubuntu-20.04 @@ -344,9 +331,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" -e ARCH="${ARCH}" -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${{matrix.os}}-${ARCH} /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_sched_config: runs-on: ubuntu-20.04 @@ -354,9 +340,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-generic/test/sched-basic.conf $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_stash_config: runs-on: ubuntu-20.04 @@ -364,9 +349,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-generic/test/stash-custom.conf $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_scheduler_sp: runs-on: ubuntu-20.04 @@ -374,9 +358,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" -e ODP_SCHEDULER=sp $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_scheduler_scalable: runs-on: ubuntu-20.04 @@ -384,9 +367,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" -e ODP_SCHEDULER=scalable -e CI_SKIP=pktio_test_pktin_event_sched $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_process_mode: runs-on: ubuntu-20.04 @@ -395,9 +377,8 @@ jobs: - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-generic/test/process-mode.conf -e ODPH_PROC_MODE=1 $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_inline_timer: runs-on: ubuntu-20.04 @@ -406,9 +387,8 @@ jobs: - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-generic/test/inline-timer.conf $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check_inline_timer.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_packet_align: runs-on: ubuntu-20.04 @@ -417,9 +397,8 @@ jobs: - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" -e ODP_CONFIG_FILE=/odp/platform/linux-generic/test/packet_align.conf $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check_pktio.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_dpdk-19_11: runs-on: ubuntu-20.04 @@ -427,9 +406,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-dpdk_19.11 /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_dpdk-20_11: runs-on: ubuntu-20.04 @@ -437,9 +415,8 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-dpdk_20.11 /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run_dpdk-21_11: runs-on: ubuntu-20.04 @@ -447,6 +424,5 @@ jobs: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH}-dpdk_21.11 /odp/scripts/ci/check.sh - - name: Failure log - if: ${{ failure() }} - run: find . -name "*.trs" | xargs grep -l '^.test-result. FAIL' | while read trs ; do echo FAILURE detected at $trs; cat ${trs%%.trs}.log ; done + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log From 143df42d914916272a38545a0dd2ec0c0ddd62b9 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Fri, 11 Aug 2023 08:02:34 +0000 Subject: [PATCH 022/192] github_ci: unify style Indent subelements of an element and use newlines uniformly. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- .github/workflows/ci-pipeline-arm64.yml | 1 - .github/workflows/ci-pipeline.yml | 107 +++++++++++------------- 2 files changed, 51 insertions(+), 57 deletions(-) diff --git a/.github/workflows/ci-pipeline-arm64.yml b/.github/workflows/ci-pipeline-arm64.yml index c6825668e9..668c841a01 100644 --- a/.github/workflows/ci-pipeline-arm64.yml +++ b/.github/workflows/ci-pipeline-arm64.yml @@ -11,7 +11,6 @@ env: OS: ubuntu_20.04 jobs: - Build: if: ${{ github.repository == 'OpenDataPlane/odp' }} runs-on: [self-hosted, ARM64] diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index e0af6dfc18..818a9772cb 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -11,55 +11,51 @@ jobs: Checkpatch: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install dependencies - run: | - sudo apt update - sudo apt install codespell - - - name: Check pull request - if: github.event_name == 'pull_request' - env: - CHECKPATCH_COMMAND: ./scripts/checkpatch.pl - uses: webispy/checkpatch-action@v8 - - - name: Check push - if: github.event_name == 'push' && github.ref != 'refs/heads/master' - run: | - AFTER=${{ github.event.after }} - BEFORE=${{ github.event.before }} - if [ -z "${BEFORE//0}" ] || [ -z "${AFTER//0}" ]; then - COMMIT_RANGE="" - else - COMMIT_RANGE="${BEFORE}..${AFTER}" - fi - ./scripts/ci-checkpatches.sh ${COMMIT_RANGE} + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Install dependencies + run: | + sudo apt update + sudo apt install codespell + - name: Check pull request + if: github.event_name == 'pull_request' + env: + CHECKPATCH_COMMAND: ./scripts/checkpatch.pl + uses: webispy/checkpatch-action@v8 + - name: Check push + if: github.event_name == 'push' && github.ref != 'refs/heads/master' + run: | + AFTER=${{ github.event.after }} + BEFORE=${{ github.event.before }} + if [ -z "${BEFORE//0}" ] || [ -z "${AFTER//0}" ]; then + COMMIT_RANGE="" + else + COMMIT_RANGE="${BEFORE}..${AFTER}" + fi + ./scripts/ci-checkpatches.sh ${COMMIT_RANGE} Documentation: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - - name: Install dependencies - run: | - sudo apt update - sudo apt install doxygen asciidoctor libconfig-dev libssl-dev mscgen cmake graphviz - sudo gem install asciidoctor - - name: Build - shell: bash - run: | - ./bootstrap - ./configure --enable-user-guides - pushd doc - make - popd - touch ./doxygen.log - # Doxygen does not trap on warnings, check for them here. - make doxygen-doc 2>&1 | tee ./doxygen.log - ! fgrep -rq warning ./doxygen.log + - uses: actions/checkout@v3 + - name: Install dependencies + run: | + sudo apt update + sudo apt install doxygen asciidoctor libconfig-dev libssl-dev mscgen cmake graphviz + sudo gem install asciidoctor + - name: Build + shell: bash + run: | + ./bootstrap + ./configure --enable-user-guides + pushd doc + make + popd + touch ./doxygen.log + # Doxygen does not trap on warnings, check for them here. + make doxygen-doc 2>&1 | tee ./doxygen.log + ! fgrep -rq warning ./doxygen.log Build: runs-on: ubuntu-20.04 @@ -264,11 +260,11 @@ jobs: Build_out-of-tree: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" - -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/out_of_tree.sh - - if: ${{ failure() }} - uses: ./.github/actions/build-failure-log + - uses: actions/checkout@v3 + - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" + -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/out_of_tree.sh + - if: ${{ failure() }} + uses: ./.github/actions/build-failure-log Build_XDP: runs-on: ubuntu-20.04 @@ -293,11 +289,11 @@ jobs: matrix: conf: ['--enable-user-guides', '--enable-user-guides --enable-abi-compat'] steps: - - uses: actions/checkout@v3 - - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" - -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/distcheck.sh - - if: ${{ failure() }} - uses: ./.github/actions/run-failure-log + - uses: actions/checkout@v3 + - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${{matrix.cc}}" + -e CONF="${{matrix.conf}}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/distcheck.sh + - if: ${{ failure() }} + uses: ./.github/actions/run-failure-log Run: runs-on: ubuntu-20.04 @@ -319,7 +315,6 @@ jobs: - if: ${{ success() }} uses: ./.github/actions/dump-log - Run_OS: runs-on: ubuntu-20.04 strategy: From 9122a740eaea635163db8daae8e5d7e5b1aee125 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 16 Aug 2023 15:20:28 +0300 Subject: [PATCH 023/192] test: bench_misc: add new tests Add new tests for CPU API functions odp_cpu_hz_id(), odp_cpu_hz_max_id(), and odp_cpu_cycles_resolution(). Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale --- test/performance/odp_bench_misc.c | 40 ++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/test/performance/odp_bench_misc.c b/test/performance/odp_bench_misc.c index 8b9e27bf27..3da4a66161 100644 --- a/test/performance/odp_bench_misc.c +++ b/test/performance/odp_bench_misc.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2022, Nokia +/* Copyright (c) 2022-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -521,6 +521,18 @@ static int cpu_hz(void) return i; } +static int cpu_hz_id(void) +{ + int i; + const int id = odp_cpu_id(); + uint64_t *a1 = gbl_args->a1; + + for (i = 0; i < REPEAT_COUNT; i++) + a1[i] = odp_cpu_hz_id(id); + + return i; +} + static int cpu_hz_max(void) { int i; @@ -532,6 +544,18 @@ static int cpu_hz_max(void) return i; } +static int cpu_hz_max_id(void) +{ + int i; + const int id = odp_cpu_id(); + uint64_t *a1 = gbl_args->a1; + + for (i = 0; i < REPEAT_COUNT; i++) + a1[i] = odp_cpu_hz_max_id(id); + + return i; +} + static int cpu_cycles(void) { int i; @@ -569,6 +593,17 @@ static int cpu_cycles_max(void) return i; } +static int cpu_cycles_resolution(void) +{ + int i; + uint64_t *a1 = gbl_args->a1; + + for (i = 0; i < REPEAT_COUNT; i++) + a1[i] = odp_cpu_cycles_resolution(); + + return i; +} + static int cpu_pause(void) { int i; @@ -819,10 +854,13 @@ bench_info_t test_suite[] = { BENCH_INFO(cpu_id, NULL, 0, NULL), BENCH_INFO(cpu_count, NULL, 0, NULL), BENCH_INFO(cpu_hz, NULL, 1, NULL), + BENCH_INFO(cpu_hz_id, NULL, 1, NULL), BENCH_INFO(cpu_hz_max, NULL, 0, NULL), + BENCH_INFO(cpu_hz_max_id, NULL, 0, NULL), BENCH_INFO(cpu_cycles, NULL, 0, NULL), BENCH_INFO(cpu_cycles_diff, init_cpu_cycles, 0, NULL), BENCH_INFO(cpu_cycles_max, NULL, 0, NULL), + BENCH_INFO(cpu_cycles_resolution, NULL, 0, NULL), BENCH_INFO(cpu_pause, NULL, 0, NULL), BENCH_INFO(thread_id, NULL, 0, NULL), BENCH_INFO(thread_count, NULL, 0, NULL), From 9dd86d49426e57c4a91e2d322b5689f7bd3e004e Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 15 Jun 2023 17:03:00 +0300 Subject: [PATCH 024/192] linux-gen: cpu: optimize aarch64 odp_cpu_cycles() implementation Implement odp_cpu_cycles() function using 'cntvct_el0' virtual counter register on aarch64. With a 1 GHz time counter the ODP CPU cycle count wraps every 78 hours. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale --- platform/linux-generic/Makefile.am | 2 +- .../arch/aarch64/odp/api/abi/cpu_inlines.h | 34 +++++++++++-- .../arch/aarch64/odp_cpu_cycles.c | 48 +++++++++++++++++++ .../include/odp/api/plat/cpu_inlines.h | 4 +- platform/linux-generic/odp_init.c | 17 ++++--- 5 files changed, 90 insertions(+), 15 deletions(-) create mode 100644 platform/linux-generic/arch/aarch64/odp_cpu_cycles.c diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 7afdbf6202..92d87b441d 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -353,7 +353,7 @@ noinst_HEADERS += arch/arm/odp_atomic.h \ endif if ARCH_IS_AARCH64 __LIB__libodp_linux_la_SOURCES += arch/aarch64/odp_atomic.c \ - arch/default/odp_cpu_cycles.c \ + arch/aarch64/odp_cpu_cycles.c \ arch/aarch64/cpu_flags.c \ arch/default/odp_hash_crc32.c \ arch/default/odp_random.c \ 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 bf44806a05..a26908e666 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,5 +1,5 @@ /* Copyright (c) 2016-2018, Linaro Limited - * Copyright (c) 2021, Nokia + * Copyright (c) 2021-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -12,6 +12,22 @@ extern "C" { #endif +#include + +#include + +/* CPU frequency is shifted to decrease integer division error */ +#define _ODP_CPU_FREQ_SHIFT 16 + +typedef struct _odp_cpu_cycles_global_t { + uint64_t res; + uint64_t res_shifted; + uint64_t max; + +} _odp_cpu_cycles_global_t; + +extern _odp_cpu_cycles_global_t _odp_cpu_cycles_glob; + static inline void _odp_cpu_pause(void) { /* YIELD hints the CPU to switch to another thread if possible @@ -22,8 +38,20 @@ static inline void _odp_cpu_pause(void) __asm volatile("isb" ::: "memory"); } -/* Use generic implementations for the rest of the functions */ -#include +static inline uint64_t _odp_cpu_cycles(void) +{ + return (_odp_time_cpu_global() * _odp_cpu_cycles_glob.res_shifted) >> _ODP_CPU_FREQ_SHIFT; +} + +static inline uint64_t _odp_cpu_cycles_resolution(void) +{ + return _odp_cpu_cycles_glob.res; +} + +static inline uint64_t _odp_cpu_cycles_max(void) +{ + return _odp_cpu_cycles_glob.max; +} #ifdef __cplusplus } diff --git a/platform/linux-generic/arch/aarch64/odp_cpu_cycles.c b/platform/linux-generic/arch/aarch64/odp_cpu_cycles.c new file mode 100644 index 0000000000..fba263ee4c --- /dev/null +++ b/platform/linux-generic/arch/aarch64/odp_cpu_cycles.c @@ -0,0 +1,48 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia + */ + +#include + +#include +#include + +#include +#include + +#include + +#include + +_odp_cpu_cycles_global_t _odp_cpu_cycles_glob; + +#include + +int _odp_cpu_cycles_init_global(void) +{ + uint64_t cpu_hz, cpu_time_hz; + + memset(&_odp_cpu_cycles_glob, 0, sizeof(_odp_cpu_cycles_global_t)); + + cpu_time_hz = _odp_time_cpu_global_freq(); + if (cpu_time_hz == 0) { + _ODP_ERR("CPU time counter frequency not available\n"); + return -1; + } + + cpu_hz = odp_cpu_hz_max_id(0); + if (cpu_hz == 0) { + _ODP_ERR("CPU frequency not available\n"); + return -1; + } + + _odp_cpu_cycles_glob.res_shifted = (cpu_hz << _ODP_CPU_FREQ_SHIFT) / cpu_time_hz; + + _odp_cpu_cycles_glob.res = cpu_hz > cpu_time_hz ? + (_odp_cpu_cycles_glob.res_shifted >> _ODP_CPU_FREQ_SHIFT) : 1; + + _odp_cpu_cycles_glob.max = (UINT64_MAX >> _ODP_CPU_FREQ_SHIFT) - + (UINT64_MAX % _odp_cpu_cycles_glob.res); + + return 0; +} 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 60c4bb9202..bb1b89154e 100644 --- a/platform/linux-generic/include/odp/api/plat/cpu_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/cpu_inlines.h @@ -1,5 +1,5 @@ /* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2021, Nokia + * Copyright (c) 2021-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -53,7 +53,7 @@ _ODP_INLINE uint64_t odp_cpu_cycles_diff(uint64_t c2, uint64_t c1) if (odp_likely(c2 >= c1)) return c2 - c1; - return c2 + (odp_cpu_cycles_max() - c1) + 1; + return c2 + (odp_cpu_cycles_max() - c1) + _odp_cpu_cycles_resolution(); } /** @endcond */ diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index e6ea8bc0c4..05b693c94e 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -26,8 +26,8 @@ enum init_stage { NO_INIT = 0, /* No init stages completed */ LIBCONFIG_INIT, CPUMASK_INIT, - CPU_CYCLES_INIT, SYSINFO_INIT, + CPU_CYCLES_INIT, TIME_INIT, ISHM_INIT, FDSERVER_INIT, @@ -299,6 +299,7 @@ static int term_global(enum init_stage stage) } /* Fall through */ + case CPU_CYCLES_INIT: case SYSINFO_INIT: if (_odp_system_info_term()) { _ODP_ERR("ODP system info term failed.\n"); @@ -306,8 +307,6 @@ static int term_global(enum init_stage stage) } /* Fall through */ - case CPU_CYCLES_INIT: - /* Fall through */ case CPUMASK_INIT: if (_odp_cpumask_term_global()) { _ODP_ERR("ODP cpumask term failed.\n"); @@ -366,18 +365,18 @@ int odp_init_global(odp_instance_t *instance, } stage = CPUMASK_INIT; - if (_odp_cpu_cycles_init_global()) { - _ODP_ERR("ODP cpu cycle init failed.\n"); - goto init_failed; - } - stage = CPU_CYCLES_INIT; - if (_odp_system_info_init()) { _ODP_ERR("ODP system_info init failed.\n"); goto init_failed; } stage = SYSINFO_INIT; + if (_odp_cpu_cycles_init_global()) { + _ODP_ERR("ODP cpu cycle init failed.\n"); + goto init_failed; + } + stage = CPU_CYCLES_INIT; + if (_odp_time_init_global()) { _ODP_ERR("ODP time init failed.\n"); goto init_failed; From 2f7e7554fff8612448e031ed861af0594f776ac7 Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Fri, 11 Aug 2023 13:00:21 +0530 Subject: [PATCH 025/192] test: dma_perf: drain poll transfers before teardown Wait for transfers to complete in asynchronous poll mode before tearing down the associated memory. Signed-off-by: Pavan Nikhilesh Reviewed-by: Tuomas Taipale --- test/performance/odp_dma_perf.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/test/performance/odp_dma_perf.c b/test/performance/odp_dma_perf.c index b37b2667c5..b47d222e25 100644 --- a/test/performance/odp_dma_perf.c +++ b/test/performance/odp_dma_perf.c @@ -156,7 +156,7 @@ typedef struct { /* Wait and handle finished transfer. */ void (*wait_fn)(sd_t *sd, stats_t *stats); /* Handle all unfinished transfers after main test has been stopped. */ - void (*drain_fn)(void); + void (*drain_fn)(sd_t *sd); /* Free any resources that might have been allocated during setup phase. */ void (*free_fn)(const sd_t *sd); } test_api_t; @@ -1111,7 +1111,7 @@ static void wait_compl_event(sd_t *sd, stats_t *stats) } } -static void drain_compl_events(void) +static void drain_compl_events(ODP_UNUSED sd_t *sd) { odp_event_t ev; @@ -1123,6 +1123,25 @@ static void drain_compl_events(void) } } +static void drain_poll_transfers(sd_t *sd) +{ + const uint32_t count = sd->dma.num_inflight; + trs_info_t *infos = sd->dma.infos, *info; + odp_dma_t handle = sd->dma.handle; + int rc; + + for (uint32_t i = 0U; i < count; ++i) { + info = &infos[i]; + + if (info->is_running) { + do { + rc = odp_dma_transfer_done(handle, info->compl_param.transfer_id, + NULL); + } while (rc == 0); + } + } +} + static void setup_api(prog_config_t *config) { if (config->seg_type == PACKET) { @@ -1147,7 +1166,7 @@ static void setup_api(prog_config_t *config) config->api.bootstrap_fn = NULL; config->api.wait_fn = config->num_workers == 1 || config->policy == MANY ? poll_transfers_mt_unsafe : poll_transfers_mt_safe; - config->api.drain_fn = NULL; + config->api.drain_fn = drain_poll_transfers; } else { config->api.session_cfg_fn = configure_event_compl_session; config->api.compl_fn = configure_event_compl; @@ -1245,7 +1264,7 @@ static int transfer(void *args) thr_config->stats.tot_tm = end_tm - start_tm; if (api->drain_fn != NULL) - api->drain_fn(); + api->drain_fn(sd); out: odp_barrier_wait(&prog_config->term_barrier); From 1edb4b4eca88e92a15522c0d151454850e5a5c5a Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Thu, 10 Aug 2023 20:27:40 +0530 Subject: [PATCH 026/192] test: sched_pktio: remove unnecessary delay first tick Remove unnecessary delay for the first tick as it might cause ODP_TIMER_TOO_FAR error base on the timer pool created. Reorder start_pktios with start_timers to prevent timeouts due to delays in pktio start. Signed-off-by: Pavan Nikhilesh Reviewed-by: Matias Elo --- test/performance/odp_sched_pktio.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/test/performance/odp_sched_pktio.c b/test/performance/odp_sched_pktio.c index b3356e2b15..e8532e0f10 100644 --- a/test/performance/odp_sched_pktio.c +++ b/test/performance/odp_sched_pktio.c @@ -26,7 +26,6 @@ #define MIN_PKT_SEG_LEN 64 #define CHECK_PERIOD 10000 #define TEST_PASSED_LIMIT 5000 -#define TIMEOUT_OFFSET_NS 1000000 #define SCHED_MODE_PARAL 1 #define SCHED_MODE_ATOMIC 2 #define SCHED_MODE_ORDER 3 @@ -1337,10 +1336,6 @@ static int start_timers(test_global_t *test_global) if (test_global->opt.timeout_us == 0) return 0; - /* Delay the first timeout so that workers have time to startup */ - timeout_tick += odp_timer_ns_to_tick(test_global->timer.timer_pool, - TIMEOUT_OFFSET_NS); - start_param.tick_type = ODP_TIMER_TICK_REL; start_param.tick = timeout_tick; @@ -1532,7 +1527,7 @@ int main(int argc, char *argv[]) if (create_timers(test_global)) goto quit; - if (start_timers(test_global)) + if (start_pktios(test_global)) goto quit; odp_barrier_init(&test_global->worker_start, @@ -1540,15 +1535,15 @@ int main(int argc, char *argv[]) start_workers(thread, test_global); - /* Synchronize pktio configuration with workers. Worker are now ready - * to process packets. */ - odp_barrier_wait(&test_global->worker_start); - - if (start_pktios(test_global)) { + if (start_timers(test_global)) { test_global->stop_workers = 1; odp_mb_full(); } + /* Synchronize pktio configuration with workers. Worker are now ready + * to process packets. */ + odp_barrier_wait(&test_global->worker_start); + t1 = odp_time_local(); wait_workers(thread, test_global); From 3acb2035e9e7bc70b44eaaf8e442d35907eacb18 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Tue, 22 Aug 2023 15:12:36 +0300 Subject: [PATCH 027/192] test: queue_perf: add retry to odp_queue_enq_multi() operations Depending on the ODP implementation odp_queue_enq_multi() may not be able to always enqueue all events, so add retry for the remaining events. Print the total number of dequeue/enqueue retries in results as the average value per seconds easily rounds down to zero. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen Reported-by: Fan Hong --- test/performance/odp_queue_perf.c | 49 +++++++++++++++++++------------ 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/test/performance/odp_queue_perf.c b/test/performance/odp_queue_perf.c index 320f2f35a0..4e44466103 100644 --- a/test/performance/odp_queue_perf.c +++ b/test/performance/odp_queue_perf.c @@ -1,5 +1,5 @@ /* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2021, Nokia + * Copyright (c) 2021-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -34,6 +34,7 @@ typedef struct test_stat_t { uint64_t nsec; uint64_t cycles; uint64_t deq_retry; + uint64_t enq_retry; } test_stat_t; @@ -364,7 +365,8 @@ static int run_test(void *arg) test_global_t *global = arg; test_options_t *test_options = &global->options; odp_queue_t queue; - uint64_t num_retry = 0; + uint64_t num_deq_retry = 0; + uint64_t num_enq_retry = 0; uint64_t events = 0; uint32_t num_queue = test_options->num_queue; uint32_t num_round = test_options->num_round; @@ -383,6 +385,8 @@ static int run_test(void *arg) c1 = odp_cpu_cycles(); for (rounds = 0; rounds < num_round; rounds++) { + int num_enq = 0; + do { queue = global->queue[i++]; @@ -391,17 +395,25 @@ static int run_test(void *arg) num_ev = odp_queue_deq_multi(queue, ev, max_burst); - if (odp_unlikely(num_ev <= 0)) - num_retry++; + if (odp_unlikely(num_ev < 0)) + ODPH_ABORT("odp_queue_deq_multi() failed\n"); - } while (num_ev <= 0); + if (odp_unlikely(num_ev == 0)) + num_deq_retry++; - if (odp_queue_enq_multi(queue, ev, num_ev) != num_ev) { - printf("Error: Queue enq failed %u\n", i); - ret = -1; - goto error; - } + } while (num_ev == 0); + + while (num_enq < num_ev) { + int num = odp_queue_enq_multi(queue, &ev[num_enq], num_ev - num_enq); + if (odp_unlikely(num < 0)) + ODPH_ABORT("odp_queue_enq_multi() failed\n"); + + num_enq += num; + + if (odp_unlikely(num_enq != num_ev)) + num_enq_retry++; + } events += num_ev; } @@ -415,9 +427,9 @@ static int run_test(void *arg) stat->events = events; stat->nsec = nsec; stat->cycles = cycles; - stat->deq_retry = num_retry; + stat->deq_retry = num_deq_retry; + stat->enq_retry = num_enq_retry; -error: return ret; } @@ -467,14 +479,15 @@ static int start_workers(test_global_t *global) static void print_stat(test_global_t *global) { int i, num; - double rounds_ave, events_ave, nsec_ave, cycles_ave, retry_ave; + double rounds_ave, events_ave, nsec_ave, cycles_ave; test_options_t *test_options = &global->options; int num_cpu = test_options->num_cpu; uint64_t rounds_sum = 0; uint64_t events_sum = 0; uint64_t nsec_sum = 0; uint64_t cycles_sum = 0; - uint64_t retry_sum = 0; + uint64_t deq_retry_sum = 0; + uint64_t enq_retry_sum = 0; /* Averages */ for (i = 0; i < ODP_THREAD_COUNT_MAX; i++) { @@ -482,7 +495,8 @@ static void print_stat(test_global_t *global) events_sum += global->stat[i].events; nsec_sum += global->stat[i].nsec; cycles_sum += global->stat[i].cycles; - retry_sum += global->stat[i].deq_retry; + deq_retry_sum += global->stat[i].deq_retry; + enq_retry_sum += global->stat[i].enq_retry; } if (rounds_sum == 0) { @@ -494,7 +508,6 @@ static void print_stat(test_global_t *global) events_ave = events_sum / num_cpu; nsec_ave = nsec_sum / num_cpu; cycles_ave = cycles_sum / num_cpu; - retry_ave = retry_sum / num_cpu; num = 0; printf("RESULTS - per thread (Million events per sec):\n"); @@ -521,8 +534,8 @@ static void print_stat(test_global_t *global) events_ave / rounds_ave); printf(" cycles per event: %.3f\n", cycles_ave / events_ave); - printf(" deq retries per sec: %.3f k\n", - (1000000.0 * retry_ave) / nsec_ave); + printf(" dequeue retries: %" PRIu64 "\n", deq_retry_sum); + printf(" enqueue retries: %" PRIu64 "\n", enq_retry_sum); printf(" events per sec: %.3f M\n\n", (1000.0 * events_ave) / nsec_ave); From ee1e983c0004f1d1d2b3bf15236a8a539f056cd0 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 23 Aug 2023 13:54:07 +0300 Subject: [PATCH 028/192] linux-gen: ring: fix ring size detection Previously, _RING_MPMC_ENQ_MULTI() and _RING_MPMC_ENQ_BATCH() could return zero even though the ring was not actually full. Read w_head before r_tail, which guarantees that w_head - r_tail <= size. Any additional delay in reading r_tail makes the subtraction result only smaller. This avoids returning zero when the ring is not actually full. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen Reported-by: Fan Hong --- .../include/odp_ring_mpmc_internal.h | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/platform/linux-generic/include/odp_ring_mpmc_internal.h b/platform/linux-generic/include/odp_ring_mpmc_internal.h index e351792673..c03a8e9a0d 100644 --- a/platform/linux-generic/include/odp_ring_mpmc_internal.h +++ b/platform/linux-generic/include/odp_ring_mpmc_internal.h @@ -212,13 +212,17 @@ static inline uint32_t _RING_MPMC_ENQ_MULTI(_ring_mpmc_gen_t *ring, uint32_t old_head, new_head, r_tail, num_free, i; uint32_t size = ring_mask + 1; - /* Load acquires ensure that w_head load happens after r_tail load, - * and thus r_tail value is always behind or equal to w_head value. - * When CAS operation succeeds, this thread owns data between old - * and new w_head. */ + /* The CAS operation guarantees that w_head value is up to date. Load + * acquire is used to ensure that r_tail is read after w_head. This + * guarantees that w_head - r_tail <= size. Any additional delay in + * reading r_tail makes the subtraction result only smaller. This + * avoids returning zero when the ring is not actually full. + * + * When CAS operation succeeds, this thread owns data between old and + * new w_head. */ do { - r_tail = odp_atomic_load_acq_u32(&ring->r.r_tail); old_head = odp_atomic_load_acq_u32(&ring->r.w_head); + r_tail = odp_atomic_load_acq_u32(&ring->r.r_tail); num_free = size - (old_head - r_tail); @@ -259,13 +263,17 @@ static inline uint32_t _RING_MPMC_ENQ_BATCH(_ring_mpmc_gen_t *ring, uint32_t old_head, new_head, r_tail, num_free, i; uint32_t size = ring_mask + 1; - /* Load acquires ensure that w_head load happens after r_tail load, - * and thus r_tail value is always behind or equal to w_head value. - * When CAS operation succeeds, this thread owns data between old - * and new w_head. */ + /* The CAS operation guarantees that w_head value is up to date. Load + * acquire is used to ensure that r_tail is read after w_head. This + * guarantees that w_head - r_tail <= size. Any additional delay in + * reading r_tail makes the subtraction result only smaller. This + * avoids returning zero when the ring is not actually full. + * + * When CAS operation succeeds, this thread owns data between old and + * new w_head. */ do { - r_tail = odp_atomic_load_acq_u32(&ring->r.r_tail); old_head = odp_atomic_load_acq_u32(&ring->r.w_head); + r_tail = odp_atomic_load_acq_u32(&ring->r.r_tail); num_free = size - (old_head - r_tail); From 5413bb6f28b05e3af704c720d05f891b8b27cbb2 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 23 Aug 2023 13:56:57 +0300 Subject: [PATCH 029/192] linux-gen: ring: improve documentation Improve ring documentation by adding additional example figures of ring operation. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- .../include/odp_ring_mpmc_internal.h | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/include/odp_ring_mpmc_internal.h b/platform/linux-generic/include/odp_ring_mpmc_internal.h index c03a8e9a0d..3526b3866c 100644 --- a/platform/linux-generic/include/odp_ring_mpmc_internal.h +++ b/platform/linux-generic/include/odp_ring_mpmc_internal.h @@ -22,20 +22,47 @@ extern "C" { #include -/* Ring of uint32_t data +/* Ring of uint32_t/uint64_t data * * Ring stores head and tail counters. Ring indexes are formed from these * counters with a mask (mask = ring_size - 1), which requires that ring size * must be a power of two. * + * The following figures depict an example where a ring is being simultaneously + * enqueued to and dequeued from. Ring slots containing data are marked with + * letter D, empty slots with E, and slots being modified with X. + * + * Ring status before enq/deq operations. + * * 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ - * | E | E | | | | | | | | | | E | E | E | E | E | + * | E | E | D | D | D | D | D | D | E | E | E | E | E | E | E | E | + * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + * ^ ^ + * | | + * r_head w_head + * r_tail w_tail + * + * Ring status while being enqueued and dequeued. + * + * 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + * | E | E | X | X | D | D | D | D | X | X | X | E | E | E | E | E | * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ * ^ ^ ^ ^ * | | | | * r_tail r_head w_tail w_head * + * Ring status after enq/deq operations. + * + * 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + * | E | E | E | E | D | D | D | D | D | D | D | E | E | E | E | E | + * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + * ^ ^ + * | | + * r_head w_head + * r_tail w_tail */ struct ring_mpmc_common { From 23a16b91f97efca1e9f6e65e77a2042e07cd9fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= Date: Thu, 13 Jul 2023 16:46:04 +0300 Subject: [PATCH 030/192] test: timer_perf: add new mode which starts timers again as they expire MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add new mode (-m 2), which measures odp_schedule() overhead while continuously restarting expiring timers. Signed-off-by: Jere Leppänen Reviewed-by: Petri Savolainen --- test/performance/odp_timer_perf.c | 158 +++++++++++++++++++++++++++++- 1 file changed, 154 insertions(+), 4 deletions(-) diff --git a/test/performance/odp_timer_perf.c b/test/performance/odp_timer_perf.c index a7d98e68ff..279c5600ec 100644 --- a/test/performance/odp_timer_perf.c +++ b/test/performance/odp_timer_perf.c @@ -16,7 +16,8 @@ #include #define MODE_SCHED_OVERH 0 -#define MODE_SET_CANCEL 1 +#define MODE_START_CANCEL 1 +#define MODE_START_EXPIRE 2 #define MAX_TIMER_POOLS 32 #define MAX_TIMERS 10000 #define START_NS (100 * ODP_TIME_MSEC_IN_NS) @@ -79,6 +80,7 @@ typedef struct thread_arg_t { typedef struct timer_ctx_t { uint64_t target_ns; + uint64_t target_tick; uint32_t tp_idx; uint32_t timer_idx; int last; @@ -131,6 +133,7 @@ static void print_usage(void) " -m, --mode Select test mode. Default: 0\n" " 0: Measure odp_schedule() overhead when using timers\n" " 1: Measure timer set + cancel performance\n" + " 2: Measure odp_schedule() overhead while continuously restarting expiring timers\n" " -R, --rounds Number of test rounds in timer set + cancel test.\n" " Default: 100000\n" " -h, --help This help\n" @@ -280,6 +283,16 @@ static int create_timer_pools(test_global_t *global) max_tmo_ns = START_NS + (num_timer * period_ns); min_tmo_ns = START_NS / 2; + if (test_options->mode == MODE_START_EXPIRE) { + /* + * Timers are set to 1-2 periods from current time. Add an + * arbitrary margin of one period, resulting in maximum of + * three periods. + */ + max_tmo_ns = period_ns * 3; + min_tmo_ns = test_options->res_ns / 2; + } + priv = 0; if (test_options->shared == 0) priv = 1; @@ -463,6 +476,14 @@ static int set_timers(test_global_t *global) start_param.tick = tick_cur + tick_ns; start_param.tmo_ev = ev; + if (test_options->mode == MODE_START_EXPIRE) { + uint64_t offset_ns = period_ns + j * period_ns / num_timer; + + ctx->target_ns = time_ns + offset_ns; + ctx->target_tick = tick_cur + odp_timer_ns_to_tick(tp, offset_ns); + start_param.tick = ctx->target_tick; + } + status = odp_timer_start(timer, &start_param); if (status != ODP_TIMER_SUCCESS) { ODPH_ERR("Timer set %i/%i (ret %i)\n", i, j, status); @@ -805,6 +826,128 @@ static int set_cancel_mode_worker(void *arg) return ret; } +static int set_expire_mode_worker(void *arg) +{ + int status, thr; + uint32_t i, j, exit_test; + odp_event_t ev; + odp_timeout_t tmo; + uint64_t c2, diff, nsec, time_ns, target_ns, period_tick; + odp_timer_t timer; + odp_timer_start_t start_param; + odp_time_t t1, t2; + time_stat_t before, after; + timer_ctx_t *ctx; + thread_arg_t *thread_arg = arg; + test_global_t *global = thread_arg->global; + test_options_t *opt = &global->test_options; + uint32_t num_tp = opt->num_tp; + uint64_t cycles = 0; + uint64_t events = 0; + uint64_t rounds = 0; + uint64_t c1 = 0; + int meas = 1; + int ret = 0; + + memset(&before, 0, sizeof(time_stat_t)); + memset(&after, 0, sizeof(time_stat_t)); + + thr = odp_thread_id(); + + /* Start all workers at the same time */ + odp_barrier_wait(&global->barrier); + + t1 = odp_time_local(); + + while (events < opt->test_rounds * opt->num_timer / opt->num_cpu) { + if (meas) { + c1 = odp_cpu_cycles(); + meas = 0; + } + + ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT); + rounds++; + + exit_test = odp_atomic_load_u32(&global->exit_test); + if (odp_likely(ev == ODP_EVENT_INVALID && exit_test < num_tp)) + continue; + + c2 = odp_cpu_cycles(); + diff = odp_cpu_cycles_diff(c2, c1); + cycles += diff; + + if (ev == ODP_EVENT_INVALID && exit_test >= num_tp) + break; + + events++; + meas = 1; + tmo = odp_timeout_from_event(ev); + ctx = odp_timeout_user_ptr(tmo); + i = ctx->tp_idx; + j = ctx->timer_idx; + timer = global->timer[i][j]; + period_tick = global->timer_pool[i].period_tick; + time_ns = odp_time_global_ns(); + target_ns = ctx->target_ns; + + if (time_ns < target_ns) { + diff = target_ns - time_ns; + before.num++; + before.sum_ns += diff; + if (diff > before.max_ns) + before.max_ns = diff; + + ODPH_DBG("before %" PRIu64 "\n", diff); + } else { + diff = time_ns - target_ns; + after.num++; + after.sum_ns += diff; + if (diff > after.max_ns) + after.max_ns = diff; + + ODPH_DBG("after %" PRIu64 "\n", diff); + } + + /* Start the timer again */ + start_param.tick_type = ODP_TIMER_TICK_ABS; + ctx->target_ns += opt->period_ns; + ctx->target_tick += period_tick; + start_param.tick = ctx->target_tick; + start_param.tmo_ev = ev; + status = odp_timer_start(timer, &start_param); + + if (status != ODP_TIMER_SUCCESS) { + ODPH_ERR("Timer set (tmo) failed (ret %i)\n", status); + ret = -1; + break; + } + } + + t2 = odp_time_local(); + nsec = odp_time_diff_ns(t2, t1); + + /* Cancel all timers that belong to this thread */ + cancel_timers(global, thread_arg->worker_idx); + + /* Free already scheduled events */ + while (1) { + ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT); + if (ev == ODP_EVENT_INVALID) + break; + odp_event_free(ev); + } + + /* Update stats*/ + global->stat[thr].events = events; + global->stat[thr].cycles = cycles; + global->stat[thr].rounds = rounds; + global->stat[thr].nsec = nsec; + global->stat[thr].before = before; + global->stat[thr].after = after; + + return ret; +} + static int start_workers(test_global_t *global, odp_instance_t instance) { odph_thread_common_param_t thr_common; @@ -824,8 +967,10 @@ static int start_workers(test_global_t *global, odp_instance_t instance) if (test_options->mode == MODE_SCHED_OVERH) thr_param[i].start = sched_mode_worker; - else + else if (test_options->mode == MODE_START_CANCEL) thr_param[i].start = set_cancel_mode_worker; + else + thr_param[i].start = set_expire_mode_worker; thr_param[i].arg = &global->thread_arg[i]; thr_param[i].thr_type = ODP_THREAD_WORKER; @@ -1076,11 +1221,16 @@ int main(int argc, char **argv) ODPH_ERR("Sched_mode_worker failed\n"); return -1; } - } else { + } else if (mode == MODE_START_CANCEL) { if (set_cancel_mode_worker(&global->thread_arg[0])) { ODPH_ERR("Set_cancel_mode_worker failed\n"); return -1; } + } else { + if (set_expire_mode_worker(&global->thread_arg[0])) { + ODPH_ERR("Set_expire_mode_worker failed\n"); + return -1; + } } } else { /* Wait workers to exit */ @@ -1090,7 +1240,7 @@ int main(int argc, char **argv) sum_stat(global); - if (mode == MODE_SCHED_OVERH) + if (mode == MODE_SCHED_OVERH || mode == MODE_START_EXPIRE) print_stat_sched_mode(global); else print_stat_set_cancel_mode(global); From 16642394ba709e649452f9772e158df07ebc5ca3 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Wed, 23 Aug 2023 08:33:17 +0000 Subject: [PATCH 031/192] test: ipsecfwd: fix capability check Some packet pool capabilities are allowed to be zero (namely `max_num` and `max_len`) to signal memory-bound-only capabilities. In these cases, fix default and capability checking to take the zero-case into account. Signed-off-by: Tuomas Taipale Reviewed-by: Janne Peltonen --- test/performance/odp_ipsecfwd.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/performance/odp_ipsecfwd.c b/test/performance/odp_ipsecfwd.c index 34110bea93..28d3b8fbf3 100644 --- a/test/performance/odp_ipsecfwd.c +++ b/test/performance/odp_ipsecfwd.c @@ -1,8 +1,5 @@ -/* Copyright (c) 2022, Nokia - * - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022-2023 Nokia */ #ifndef _GNU_SOURCE @@ -419,7 +416,8 @@ static void print_usage(void) " options are ignored, input and output queue counts will\n" " match worker count.\n" " -h, --help This help.\n" - "\n", MIN(pool_capa.pkt.max_num, PKT_CNT), MIN(pool_capa.pkt.max_len, PKT_SIZE)); + "\n", pool_capa.pkt.max_num > 0U ? MIN(pool_capa.pkt.max_num, PKT_CNT) : PKT_CNT, + pool_capa.pkt.max_len > 0U ? MIN(pool_capa.pkt.max_len, PKT_SIZE) : PKT_SIZE); } static inline odp_ipsec_sa_t *get_in_sa(odp_packet_t pkt) @@ -1394,23 +1392,25 @@ static parse_result_t check_options(prog_config_t *config) return PRS_NOK; } - if (config->num_pkts > pool_capa.pkt.max_num) { + if (pool_capa.pkt.max_num > 0U && config->num_pkts > pool_capa.pkt.max_num) { ODPH_ERR("Invalid pool packet count: %u (max: %u)\n", config->num_pkts, pool_capa.pkt.max_num); return PRS_NOK; } if (config->num_pkts == 0U) - config->num_pkts = MIN(pool_capa.pkt.max_num, PKT_CNT); + config->num_pkts = pool_capa.pkt.max_num > 0U ? + MIN(pool_capa.pkt.max_num, PKT_CNT) : PKT_CNT; - if (config->pkt_len > pool_capa.pkt.max_len) { + if (pool_capa.pkt.max_len > 0U && config->pkt_len > pool_capa.pkt.max_len) { ODPH_ERR("Invalid pool packet length: %u (max: %u)\n", config->pkt_len, pool_capa.pkt.max_len); return PRS_NOK; } if (config->pkt_len == 0U) - config->pkt_len = MIN(pool_capa.pkt.max_len, PKT_SIZE); + config->pkt_len = pool_capa.pkt.max_len > 0U ? + MIN(pool_capa.pkt.max_len, PKT_SIZE) : PKT_SIZE; if (config->num_thrs <= 0 || config->num_thrs > MAX_WORKERS) { ODPH_ERR("Invalid thread count: %d (min: 1, max: %d)\n", config->num_thrs, From 1c0288cd5c1b9b46a7c05f76f9e8f7d526fd8f93 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Wed, 23 Aug 2023 08:47:09 +0000 Subject: [PATCH 032/192] test: ipsecfwd: improve post-test stats summary Print key test options in the post-test statistics summary. Signed-off-by: Tuomas Taipale Reviewed-by: Janne Peltonen --- test/performance/odp_ipsecfwd.c | 56 ++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/test/performance/odp_ipsecfwd.c b/test/performance/odp_ipsecfwd.c index 28d3b8fbf3..ecc6010329 100644 --- a/test/performance/odp_ipsecfwd.c +++ b/test/performance/odp_ipsecfwd.c @@ -1866,6 +1866,40 @@ static void stop_test(prog_config_t *config) (void)odph_thread_join(config->thread_tbl, config->num_thrs); } +static void print_stats(const prog_config_t *config) +{ + const stats_t *stats; + + printf("\n====================\n\n" + "IPsec forwarder done\n\n" + " configuration file: %s\n" + " queuing mode: %s\n" + " input queue count: %u\n" + " SA queue count: %u\n" + " output queue count: %u\n" + " RX mode: %s\n", config->conf_file, + config->mode == ORDERED ? "ordered" : "parallel", config->num_input_qs, + config->num_sa_qs, config->num_output_qs, + config->is_dir_rx ? "direct" : "scheduled"); + + for (int i = 0; i < config->num_thrs; ++i) { + stats = &config->thread_config[i].stats; + + printf("\n worker %d:\n" + " IPsec in packets: %" PRIu64 "\n" + " IPsec out packets: %" PRIu64 "\n" + " IPsec in packet errors: %" PRIu64 "\n" + " IPsec out packet errors: %" PRIu64 "\n" + " IPsec status errors: %" PRIu64 "\n" + " packets forwarded: %" PRIu64 "\n" + " packets dropped: %" PRIu64 "\n", i, stats->ipsec_in_pkts, + stats->ipsec_out_pkts, stats->ipsec_in_errs, stats->ipsec_out_errs, + stats->status_errs, stats->fwd_pkts, stats->discards); + } + + printf("\n====================\n"); +} + static void wait_sas_disabled(uint32_t num_sas) { uint32_t num_sas_dis = 0U; @@ -1927,28 +1961,6 @@ static void teardown_test(const prog_config_t *config) free(config->conf_file); } -static void print_stats(const prog_config_t *config) -{ - const stats_t *stats; - - printf("\nProgram finished:\n"); - - for (int i = 0; i < config->num_thrs; ++i) { - stats = &config->thread_config[i].stats; - - printf("\n Worker %d:\n" - " IPsec in packets: %" PRIu64 "\n" - " IPsec out packets: %" PRIu64 "\n" - " IPsec in packet errors: %" PRIu64 "\n" - " IPsec out packet errors: %" PRIu64 "\n" - " IPsec status errors: %" PRIu64 "\n" - " Packets forwarded: %" PRIu64 "\n" - " Packets dropped: %" PRIu64 "\n", i, stats->ipsec_in_pkts, - stats->ipsec_out_pkts, stats->ipsec_in_errs, stats->ipsec_out_errs, - stats->status_errs, stats->fwd_pkts, stats->discards); - } -} - int main(int argc, char **argv) { odph_helper_options_t odph_opts; From 75b3528a3245138bb8387dfd1e39e3a04d96e3cc Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Thu, 13 Jul 2023 12:51:33 +0000 Subject: [PATCH 033/192] test: performance: add DMA performance tester with packet I/O `odp_dmafwd` is a simple tester to compare packet forwarding throughput when received packets are first copied either with software memory copy or with DMA offload and then echoed back to sender(s). Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- test/performance/.gitignore | 1 + test/performance/Makefile.am | 2 + test/performance/odp_dmafwd.c | 1121 +++++++++++++++++++++++++++++++++ 3 files changed, 1124 insertions(+) create mode 100644 test/performance/odp_dmafwd.c diff --git a/test/performance/.gitignore b/test/performance/.gitignore index 087a163d80..dfaef699c7 100644 --- a/test/performance/.gitignore +++ b/test/performance/.gitignore @@ -9,6 +9,7 @@ odp_bench_timer odp_cpu_bench odp_crc odp_crypto +odp_dmafwd odp_dma_perf odp_ipsec odp_ipsecfwd diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am index 9d9c2dfd10..b995a9d6a7 100644 --- a/test/performance/Makefile.am +++ b/test/performance/Makefile.am @@ -18,6 +18,7 @@ EXECUTABLES = odp_atomic_perf \ COMPILE_ONLY = odp_cpu_bench \ odp_crypto \ + odp_dmafwd \ odp_dma_perf \ odp_ipsec \ odp_l2fwd \ @@ -65,6 +66,7 @@ odp_bench_timer_SOURCES = odp_bench_timer.c odp_cpu_bench_SOURCES = odp_cpu_bench.c odp_crc_SOURCES = odp_crc.c odp_crypto_SOURCES = odp_crypto.c +odp_dmafwd_SOURCES = odp_dmafwd.c odp_dma_perf_SOURCES = odp_dma_perf.c odp_ipsec_SOURCES = odp_ipsec.c odp_lock_perf_SOURCES = odp_lock_perf.c diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c new file mode 100644 index 0000000000..8375a434b7 --- /dev/null +++ b/test/performance/odp_dmafwd.c @@ -0,0 +1,1121 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia + */ + +/** + * DMA forwarder + * + * This tester application can be used to profile the performance of an ODP DMA implementation. + * Tester workflow consists of packet reception, copy and forwarding steps. Packets are first + * received from configured interfaces after which packets are copied, either with plain SW memory + * copy or with DMA offload copy. Finally, copied packets are echoed back to the sender(s). + */ + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + +#include +#include +#include +#include + +#include +#include + +#define PROG_NAME "odp_dmafwd" +#define DELIMITER "," + +enum { + SW_COPY = 0U, + DMA_COPY +}; + +#define DEF_CPY_TYPE SW_COPY +#define DEF_CNT 32768U +#define DEF_LEN 1024U +#define DEF_WORKERS 1U + +#define MAX_IFS 2U +#define MAX_OUT_QS 32U +#define MAX_BURST 32U +#define MAX_WORKERS (ODP_THREAD_COUNT_MAX - 1) +#define MAX_PKTIO_INDEXES 1024U + +#define MIN(a, b) (((a) <= (b)) ? (a) : (b)) +#define DIV_IF(a, b) ((b) > 0U ? ((a) / (b)) : 0U) + +ODP_STATIC_ASSERT(MAX_IFS < UINT8_MAX, "Too large maximum interface count"); +ODP_STATIC_ASSERT(MAX_OUT_QS < UINT8_MAX, "Too large maximum output queue count"); + +typedef struct { + uint32_t burst_size; + uint32_t num_pkts; + uint32_t pkt_len; + uint32_t cache_size; +} dynamic_defs_t; + +typedef enum { + PRS_OK, + PRS_NOK, + PRS_TERM +} parse_result_t; + +typedef struct prog_config_s prog_config_t; + +typedef struct { + uint64_t copy_errs; + uint64_t trs; + uint64_t start_errs; + uint64_t trs_errs; + uint64_t buf_alloc_errs; + uint64_t compl_alloc_errs; + uint64_t pkt_alloc_errs; + uint64_t fwd_pkts; + uint64_t discards; + uint64_t sched_cc; + uint64_t tot_cc; + uint64_t sched_rounds; +} stats_t; + +typedef struct ODP_ALIGNED_CACHE { + prog_config_t *prog_config; + odp_dma_t dma_handle; + odp_pool_t compl_pool; + odp_pool_t copy_pool; + odp_pool_t trs_pool; + odp_queue_t compl_q; + stats_t stats; + int thr_idx; +} thread_config_t; + +typedef struct pktio_s { + odp_pktout_queue_t out_qs[MAX_OUT_QS]; + char *name; + odp_pktio_t handle; + uint8_t num_out_qs; +} pktio_t; + +typedef void (*ev_fn_t)(odp_dma_compl_t compl_ev, thread_config_t *config); +typedef void (*pkt_fn_t)(odp_packet_t pkts[], int num, pktio_t *pktio, thread_config_t *config); + +typedef struct prog_config_s { + uint8_t pktio_idx_map[MAX_PKTIO_INDEXES]; + odph_thread_t thread_tbl[MAX_WORKERS]; + thread_config_t thread_config[MAX_WORKERS]; + pktio_t pktios[MAX_IFS]; + dynamic_defs_t dyn_defs; + odp_instance_t odp_instance; + odp_barrier_t init_barrier; + odp_barrier_t term_barrier; + odp_atomic_u32_t is_running; + odp_pool_t pktio_pool; + odp_pool_t copy_pool; + odp_pool_t trs_pool; + ev_fn_t ev_fn; + pkt_fn_t pkt_fn; + uint32_t burst_size; + uint32_t num_pkts; + uint32_t pkt_len; + uint32_t cache_size; + int num_thrs; + uint8_t num_ifs; + uint8_t copy_type; +} prog_config_t; + +typedef struct { + odp_packet_t pkts[MAX_BURST * 2U]; + pktio_t *pktio; + int num; +} pkt_vec_t; + +typedef struct { + odp_packet_t src_pkts[MAX_BURST]; + odp_packet_t dst_pkts[MAX_BURST]; + pktio_t *pktio; + int num; +} transfer_t; + +static prog_config_t *prog_conf; + +static void terminate(int signal ODP_UNUSED) +{ + odp_atomic_store_u32(&prog_conf->is_running, 0U); +} + +static void init_config(prog_config_t *config) +{ + odp_dma_capability_t dma_capa; + uint32_t burst_size; + odp_pool_capability_t pool_capa; + odp_pool_param_t pool_param; + thread_config_t *thr; + + memset(config, 0, sizeof(*config)); + + if (odp_dma_capability(&dma_capa) == 0) { + burst_size = MIN(dma_capa.max_src_segs, dma_capa.max_dst_segs); + burst_size = MIN(burst_size, MAX_BURST); + config->dyn_defs.burst_size = burst_size; + } + + if (odp_pool_capability(&pool_capa) == 0) { + config->dyn_defs.num_pkts = pool_capa.pkt.max_num > 0U ? + MIN(pool_capa.pkt.max_num, DEF_CNT) : DEF_CNT; + config->dyn_defs.pkt_len = pool_capa.pkt.max_len > 0U ? + MIN(pool_capa.pkt.max_len, DEF_LEN) : DEF_LEN; + odp_pool_param_init(&pool_param); + config->dyn_defs.cache_size = pool_param.pkt.cache_size; + } + + config->pktio_pool = ODP_POOL_INVALID; + config->copy_pool = ODP_POOL_INVALID; + config->trs_pool = ODP_POOL_INVALID; + config->burst_size = config->dyn_defs.burst_size; + config->num_pkts = config->dyn_defs.num_pkts; + config->pkt_len = config->dyn_defs.pkt_len; + config->cache_size = config->dyn_defs.cache_size; + config->num_thrs = DEF_WORKERS; + config->copy_type = DEF_CPY_TYPE; + + for (int i = 0; i < MAX_WORKERS; ++i) { + thr = &config->thread_config[i]; + thr->dma_handle = ODP_DMA_INVALID; + thr->compl_pool = ODP_POOL_INVALID; + thr->compl_q = ODP_QUEUE_INVALID; + } + + for (uint32_t i = 0U; i < MAX_IFS; ++i) + config->pktios[i].handle = ODP_PKTIO_INVALID; +} + +static void print_usage(dynamic_defs_t *dyn_defs) +{ + printf("\n" + "DMA performance tester with packet I/O. Receive and forward packets after\n" + "software copy or DMA offload copy.\n" + "\n" + "Usage: " PROG_NAME " OPTIONS\n" + "\n" + " E.g. " PROG_NAME " -i eth0\n" + " " PROG_NAME " -i eth0 -t 0\n" + " " PROG_NAME " -i eth0 -t 1 -b 15 -l 4096 -c 5\n" + "\n" + "Mandatory OPTIONS:\n" + "\n" + " -i, --interfaces Ethernet interfaces for packet I/O, comma-separated, no\n" + " spaces.\n" + "\n" + "Optional OPTIONS:\n" + "\n" + " -t, --copy_type Type of copy. %u by default.\n" + " 0: SW\n" + " 1: DMA\n" + " -b, --burst_size Copy burst size. This many packets are accumulated before\n" + " copy. %u by default.\n" + " -n, --num_pkts Number of packet buffers allocated for packet I/O pool.\n" + " %u by default.\n" + " -l, --pkt_len Maximum size of packet buffers in packet I/O pool. %u by\n" + " default.\n" + " -c, --worker_count Amount of workers. %u by default.\n" + " -C, --cache_size Packet pool cache size. %u by default.\n" + " -h, --help This help.\n" + "\n", DEF_CPY_TYPE, dyn_defs->burst_size, dyn_defs->num_pkts, dyn_defs->pkt_len, + DEF_WORKERS, dyn_defs->cache_size); +} + +static void parse_interfaces(prog_config_t *config, const char *optarg) +{ + char *tmp_str = strdup(optarg), *tmp; + + if (tmp_str == NULL) + return; + + tmp = strtok(tmp_str, DELIMITER); + + while (tmp && config->num_ifs < MAX_IFS) { + config->pktios[config->num_ifs].name = strdup(tmp); + + if (config->pktios[config->num_ifs].name != NULL) + ++config->num_ifs; + + tmp = strtok(NULL, DELIMITER); + } + + free(tmp_str); +} + +static parse_result_t check_options(prog_config_t *config) +{ + unsigned int idx = odp_pktio_max_index(); + odp_dma_capability_t dma_capa; + uint32_t burst_size; + odp_pool_capability_t pool_capa; + + if (config->num_ifs == 0U) { + ODPH_ERR("Invalid number of interfaces: %u (min: 1, max: %u)\n", config->num_ifs, + MAX_IFS); + return PRS_NOK; + } + + if (idx >= MAX_PKTIO_INDEXES) { + ODPH_ERR("Invalid packet I/O maximum index: %u (max: %u)\n", idx, + MAX_PKTIO_INDEXES); + } + + if (config->copy_type != SW_COPY && config->copy_type != DMA_COPY) { + ODPH_ERR("Invalid copy type: %u\n", config->copy_type); + return PRS_NOK; + } + + if (config->num_thrs <= 0 || config->num_thrs > MAX_WORKERS) { + ODPH_ERR("Invalid worker count: %d (min: 1, max: %d)\n", config->num_thrs, + MAX_WORKERS); + return PRS_NOK; + } + + if (odp_dma_capability(&dma_capa) < 0) { + ODPH_ERR("Error querying DMA capabilities\n"); + return PRS_NOK; + } + + if ((uint32_t)config->num_thrs > dma_capa.max_sessions) { + ODPH_ERR("Not enough DMA sessions supported: %d (max: %u)\n", config->num_thrs, + dma_capa.max_sessions); + return PRS_NOK; + } + + burst_size = MIN(dma_capa.max_src_segs, dma_capa.max_dst_segs); + burst_size = MIN(burst_size, MAX_BURST); + + if (config->burst_size == 0U || config->burst_size > burst_size) { + ODPH_ERR("Unsupported segment count for DMA: %u (min: 1, max: %u)\n", + config->burst_size, burst_size); + return PRS_NOK; + } + + if (config->pkt_len > dma_capa.max_seg_len) { + ODPH_ERR("Unsupported packet length for DMA: %u (max: %u)\n", config->pkt_len, + dma_capa.max_seg_len); + return PRS_NOK; + } + + if ((dma_capa.compl_mode_mask & ODP_DMA_COMPL_EVENT) == 0U || !dma_capa.queue_type_sched) { + ODPH_ERR("Unsupported completion mode (mode support: %x, scheduled queue " + "support: %u\n", dma_capa.compl_mode_mask, dma_capa.queue_type_sched); + return PRS_NOK; + } + + if ((uint32_t)config->num_thrs > dma_capa.pool.max_pools) { + ODPH_ERR("Unsupported amount of completion pools: %d (max: %u)\n", + config->num_thrs, dma_capa.pool.max_pools); + return PRS_NOK; + } + + if (odp_pool_capability(&pool_capa) < 0) { + ODPH_ERR("Error querying pool capabilities\n"); + return PRS_NOK; + } + + if (config->num_pkts == 0U || + (pool_capa.pkt.max_num > 0U && config->num_pkts > pool_capa.pkt.max_num)) { + ODPH_ERR("Invalid pool packet count: %u (min: 1, max: %u)\n", config->num_pkts, + pool_capa.pkt.max_num); + return PRS_NOK; + } + + if (config->pkt_len == 0U || + (pool_capa.pkt.max_len > 0U && config->pkt_len > pool_capa.pkt.max_len)) { + ODPH_ERR("Invalid pool packet length: %u (min: 1, max: %u)\n", config->pkt_len, + pool_capa.pkt.max_len); + return PRS_NOK; + } + + if (config->cache_size < pool_capa.pkt.min_cache_size || + config->cache_size > pool_capa.pkt.max_cache_size) { + ODPH_ERR("Invalid pool cache size: %u (min: %u, max: %u)\n", config->cache_size, + pool_capa.pkt.min_cache_size, pool_capa.pkt.max_cache_size); + return PRS_NOK; + } + + return PRS_OK; +} + +static parse_result_t parse_options(int argc, char **argv, prog_config_t *config) +{ + int opt, long_index; + + static const struct option longopts[] = { + { "interfaces", required_argument, NULL, 'i' }, + { "copy_type", required_argument, NULL, 't' }, + { "burst_size", required_argument, NULL, 'b' }, + { "num_pkts", required_argument, NULL, 'n' }, + { "pkt_len", required_argument, NULL, 'l' }, + { "worker_count", required_argument, NULL, 'c' }, + { "cache_size", required_argument, NULL, 'C' }, + { "help", no_argument, NULL, 'h' }, + { NULL, 0, NULL, 0 } + }; + + static const char *shortopts = "i:t:b:n:l:c:C:h"; + + init_config(config); + + while (1) { + opt = getopt_long(argc, argv, shortopts, longopts, &long_index); + + if (opt == -1) + break; + + switch (opt) { + case 'i': + parse_interfaces(config, optarg); + break; + case 't': + config->copy_type = atoi(optarg); + break; + case 'b': + config->burst_size = atoi(optarg); + break; + case 'n': + config->num_pkts = atoi(optarg); + break; + case 'l': + config->pkt_len = atoi(optarg); + break; + case 'c': + config->num_thrs = atoi(optarg); + break; + case 'C': + config->cache_size = atoi(optarg); + break; + case 'h': + print_usage(&config->dyn_defs); + return PRS_TERM; + case '?': + default: + print_usage(&config->dyn_defs); + return PRS_NOK; + } + } + + return check_options(config); +} + +static parse_result_t setup_program(int argc, char **argv, prog_config_t *config) +{ + struct sigaction action = { .sa_handler = terminate }; + + if (sigemptyset(&action.sa_mask) == -1 || sigaddset(&action.sa_mask, SIGINT) == -1 || + sigaddset(&action.sa_mask, SIGTERM) == -1 || + sigaddset(&action.sa_mask, SIGHUP) == -1 || sigaction(SIGINT, &action, NULL) == -1 || + sigaction(SIGTERM, &action, NULL) == -1 || sigaction(SIGHUP, &action, NULL) == -1) { + ODPH_ERR("Error installing signal handler\n"); + return PRS_NOK; + } + + return parse_options(argc, argv, config); +} + +static inline int send_packets(odp_pktout_queue_t queue, odp_packet_t pkts[], int num) +{ + int ret = odp_pktout_send(queue, pkts, num); + + if (odp_unlikely(ret < num)) { + ret = ret < 0 ? 0 : ret; + odp_packet_free_multi(&pkts[ret], num - ret); + } + + return ret; +} + +static void sw_copy_and_send_packets(odp_packet_t pkts[], int num, pktio_t *pktio, + thread_config_t *config) +{ + odp_packet_t old_pkt, new_pkt; + odp_pool_t copy_pool = config->copy_pool; + odp_packet_t out_pkts[num]; + int num_out_pkts = 0, num_sent; + stats_t *stats = &config->stats; + + for (int i = 0; i < num; ++i) { + old_pkt = pkts[i]; + new_pkt = odp_packet_copy(old_pkt, copy_pool); + + if (new_pkt != ODP_PACKET_INVALID) + out_pkts[num_out_pkts++] = new_pkt; + else + ++stats->copy_errs; + + odp_packet_free(old_pkt); + } + + if (num_out_pkts > 0) { + num_sent = send_packets(pktio->out_qs[config->thr_idx % pktio->num_out_qs], + out_pkts, num_out_pkts); + stats->fwd_pkts += num_sent; + stats->discards += num_out_pkts - num_sent; + } +} + +static inline void send_dma_trs_packets(odp_dma_compl_t compl_ev, thread_config_t *config) +{ + odp_dma_result_t res; + odp_buffer_t buf; + transfer_t *trs; + pktio_t *pktio; + int num_sent; + stats_t *stats = &config->stats; + + memset(&res, 0, sizeof(res)); + odp_dma_compl_result(compl_ev, &res); + buf = (odp_buffer_t)res.user_ptr; + trs = (transfer_t *)odp_buffer_addr(buf); + pktio = trs->pktio; + + if (res.success) { + num_sent = send_packets(pktio->out_qs[config->thr_idx % pktio->num_out_qs], + trs->dst_pkts, trs->num); + ++stats->trs; + stats->fwd_pkts += num_sent; + stats->discards += trs->num - num_sent; + } else { + odp_packet_free_multi(trs->dst_pkts, trs->num); + ++stats->trs_errs; + } + + odp_packet_free_multi(trs->src_pkts, trs->num); + odp_buffer_free(buf); + odp_dma_compl_free(compl_ev); +} + +static inline transfer_t *init_dma_trs(odp_dma_transfer_param_t *trs_param, + odp_dma_compl_param_t *compl_param, odp_dma_seg_t *src_segs, + odp_dma_seg_t *dst_segs, pktio_t *pktio, + thread_config_t *config) +{ + odp_buffer_t buf; + stats_t *stats = &config->stats; + transfer_t *trs; + odp_dma_compl_t c_ev; + + buf = odp_buffer_alloc(config->trs_pool); + + if (odp_unlikely(buf == ODP_BUFFER_INVALID)) { + ++stats->buf_alloc_errs; + return NULL; + } + + trs = (transfer_t *)odp_buffer_addr(buf); + trs->num = 0; + trs->pktio = pktio; + trs_param->src_format = ODP_DMA_FORMAT_PACKET; + trs_param->dst_format = ODP_DMA_FORMAT_PACKET; + trs_param->num_src = 0U; + trs_param->num_dst = 0U; + trs_param->src_seg = src_segs; + trs_param->dst_seg = dst_segs; + compl_param->compl_mode = ODP_DMA_COMPL_EVENT; + c_ev = odp_dma_compl_alloc(config->compl_pool); + + if (odp_unlikely(c_ev == ODP_DMA_COMPL_INVALID)) { + odp_buffer_free(buf); + ++stats->compl_alloc_errs; + return NULL; + } + + compl_param->event = odp_dma_compl_to_event(c_ev); + compl_param->queue = config->compl_q; + compl_param->user_ptr = buf; + memset(src_segs, 0, sizeof(*src_segs) * MAX_BURST); + memset(dst_segs, 0, sizeof(*dst_segs) * MAX_BURST); + + return trs; +} + +static void dma_copy(odp_packet_t pkts[], int num, pktio_t *pktio, thread_config_t *config) +{ + odp_dma_transfer_param_t trs_param; + odp_dma_compl_param_t compl_param; + odp_packet_t pkt; + transfer_t *trs = NULL; + odp_dma_seg_t src_segs[MAX_BURST], dst_segs[MAX_BURST]; + uint32_t num_segs = 0U, pkt_len; + odp_pool_t copy_pool = config->copy_pool; + stats_t *stats = &config->stats; + + odp_dma_transfer_param_init(&trs_param); + odp_dma_compl_param_init(&compl_param); + + for (int i = 0; i < num; ++i) { + pkt = pkts[i]; + + if (odp_unlikely(trs == NULL)) { + trs = init_dma_trs(&trs_param, &compl_param, src_segs, dst_segs, pktio, + config); + + if (trs == NULL) { + odp_packet_free(pkt); + continue; + } + } + + pkt_len = odp_packet_len(pkt); + src_segs[num_segs].packet = pkt; + src_segs[num_segs].len = pkt_len; + dst_segs[num_segs].packet = odp_packet_alloc(copy_pool, pkt_len); + + if (odp_unlikely(dst_segs[num_segs].packet == ODP_PACKET_INVALID)) { + odp_packet_free(pkt); + ++stats->pkt_alloc_errs; + continue; + } + + dst_segs[num_segs].len = pkt_len; + trs->src_pkts[num_segs] = src_segs[num_segs].packet; + trs->dst_pkts[num_segs] = dst_segs[num_segs].packet; + ++trs->num; + ++trs_param.num_src; + ++trs_param.num_dst; + ++num_segs; + } + + if (num_segs > 0U) + if (odp_dma_transfer_start(config->dma_handle, &trs_param, &compl_param) <= 0) { + odp_packet_free_multi(trs->src_pkts, trs->num); + odp_packet_free_multi(trs->dst_pkts, trs->num); + ++stats->start_errs; + } +} + +static odp_bool_t setup_copy(prog_config_t *config) +{ + odp_pool_param_t pool_param; + thread_config_t *thr; + const odp_dma_param_t dma_params = { + .direction = ODP_DMA_MAIN_TO_MAIN, + .type = ODP_DMA_TYPE_COPY, + .compl_mode_mask = ODP_DMA_COMPL_EVENT, + .mt_mode = ODP_DMA_MT_SERIAL, + .order = ODP_DMA_ORDER_NONE }; + odp_dma_pool_param_t compl_pool_param; + odp_queue_param_t queue_param; + + odp_pool_param_init(&pool_param); + pool_param.pkt.seg_len = config->pkt_len; + pool_param.pkt.len = config->pkt_len; + pool_param.pkt.num = config->num_pkts; + pool_param.pkt.cache_size = config->cache_size; + pool_param.type = ODP_POOL_PACKET; + config->copy_pool = odp_pool_create(PROG_NAME "_copy", &pool_param); + + if (config->copy_pool == ODP_POOL_INVALID) { + ODPH_ERR("Error creating packet copy pool\n"); + return false; + } + + if (config->copy_type == SW_COPY) { + config->ev_fn = NULL; + config->pkt_fn = sw_copy_and_send_packets; + + for (int i = 0; i < config->num_thrs; ++i) + config->thread_config[i].copy_pool = config->copy_pool; + + return true; + } + + pool_param.buf.num = config->num_pkts; + pool_param.buf.size = sizeof(transfer_t); + pool_param.type = ODP_POOL_BUFFER; + config->trs_pool = odp_pool_create(PROG_NAME "_dma_trs", &pool_param); + + if (config->trs_pool == ODP_POOL_INVALID) { + ODPH_ERR("Error creating DMA transfer tracking pool\n"); + return false; + } + + for (int i = 0; i < config->num_thrs; ++i) { + thr = &config->thread_config[i]; + thr->dma_handle = odp_dma_create(PROG_NAME "_dma", &dma_params); + + if (thr->dma_handle == ODP_DMA_INVALID) { + ODPH_ERR("Error creating DMA session\n"); + return false; + } + + odp_dma_pool_param_init(&compl_pool_param); + compl_pool_param.num = config->num_pkts; + thr->compl_pool = odp_dma_pool_create(PROG_NAME "_dma_compl", &compl_pool_param); + + if (thr->compl_pool == ODP_POOL_INVALID) { + ODPH_ERR("Error creating DMA event completion pool\n"); + return false; + } + + thr->copy_pool = config->copy_pool; + thr->trs_pool = config->trs_pool; + odp_queue_param_init(&queue_param); + queue_param.type = ODP_QUEUE_TYPE_SCHED; + queue_param.sched.sync = ODP_SCHED_SYNC_PARALLEL; + queue_param.sched.prio = odp_schedule_max_prio(); + thr->compl_q = odp_queue_create(PROG_NAME "_dma_compl", &queue_param); + + if (thr->compl_q == ODP_QUEUE_INVALID) { + ODPH_ERR("Error creating DMA completion queue\n"); + return false; + } + } + + config->ev_fn = send_dma_trs_packets; + config->pkt_fn = dma_copy; + + return true; +} + +static odp_bool_t setup_pktios(prog_config_t *config) +{ + odp_pool_param_t pool_param; + pktio_t *pktio; + odp_pktio_param_t pktio_param; + odp_pktio_capability_t capa; + uint32_t num_input_qs, num_output_qs; + odp_pktin_queue_param_t pktin_param; + odp_pktout_queue_param_t pktout_param; + + odp_pool_param_init(&pool_param); + pool_param.pkt.seg_len = config->pkt_len; + pool_param.pkt.len = config->pkt_len; + pool_param.pkt.num = config->num_pkts; + pool_param.pkt.cache_size = config->cache_size; + pool_param.type = ODP_POOL_PACKET; + config->pktio_pool = odp_pool_create(PROG_NAME, &pool_param); + + if (config->pktio_pool == ODP_POOL_INVALID) { + ODPH_ERR("Error creating packet I/O pool\n"); + return false; + } + + for (uint32_t i = 0U; i < config->num_ifs; ++i) { + pktio = &config->pktios[i]; + odp_pktio_param_init(&pktio_param); + pktio_param.in_mode = ODP_PKTIN_MODE_SCHED; + pktio_param.out_mode = ODP_PKTOUT_MODE_DIRECT; + pktio->handle = odp_pktio_open(pktio->name, config->pktio_pool, &pktio_param); + + if (pktio->handle == ODP_PKTIO_INVALID) { + ODPH_ERR("Error opening packet I/O (%s)\n", pktio->name); + return false; + } + + config->pktio_idx_map[odp_pktio_index(pktio->handle)] = i; + + if (odp_pktio_capability(pktio->handle, &capa) < 0) { + ODPH_ERR("Error querying packet I/O capabilities (%s)\n", pktio->name); + return false; + } + + num_input_qs = MIN((uint32_t)config->num_thrs, capa.max_input_queues); + num_output_qs = MIN((uint32_t)config->num_thrs, capa.max_output_queues); + num_output_qs = MIN(num_output_qs, MAX_OUT_QS); + odp_pktin_queue_param_init(&pktin_param); + + if (num_input_qs > 1) { + pktin_param.hash_enable = true; + pktin_param.hash_proto.proto.ipv4 = 1U; + } + + pktin_param.num_queues = num_input_qs; + pktin_param.queue_param.sched.prio = odp_schedule_default_prio(); + + if (odp_pktin_queue_config(pktio->handle, &pktin_param) < 0) { + ODPH_ERR("Error configuring packet I/O input queues (%s)\n", pktio->name); + return false; + } + + odp_pktout_queue_param_init(&pktout_param); + + if (num_output_qs == (uint32_t)config->num_thrs) + pktout_param.op_mode = ODP_PKTIO_OP_MT_UNSAFE; + + pktout_param.num_queues = num_output_qs; + pktio->num_out_qs = num_output_qs; + + if (odp_pktout_queue_config(pktio->handle, &pktout_param) < 0) { + ODPH_ERR("Error configuring packet I/O output queues (%s)\n", pktio->name); + return false; + } + + if (odp_pktout_queue(pktio->handle, pktio->out_qs, num_output_qs) != + (int)num_output_qs) { + ODPH_ERR("Error querying packet I/O output queues (%s)\n", pktio->name); + return false; + } + + if (odp_pktio_start(pktio->handle) < 0) { + ODPH_ERR("Error starting packet I/O (%s)\n", pktio->name); + return false; + } + } + + return true; +} + +static inline void push_packet(odp_packet_t pkt, pkt_vec_t pkt_vecs[], uint8_t *pktio_idx_map) +{ + uint8_t idx = pktio_idx_map[odp_packet_input_index(pkt)]; + pkt_vec_t *pkt_vec = &pkt_vecs[idx]; + + pkt_vec->pkts[pkt_vec->num++] = pkt; +} + +static inline void pop_packets(pkt_vec_t *pkt_vec, int num_procd) +{ + pkt_vec->num -= num_procd; + + for (int i = 0, j = num_procd; i < pkt_vec->num; ++i, ++j) + pkt_vec->pkts[i] = pkt_vec->pkts[j]; +} + +static void free_pending_packets(pkt_vec_t pkt_vecs[], uint32_t num_ifs) +{ + for (uint32_t i = 0U; i < num_ifs; ++i) + odp_packet_free_multi(pkt_vecs[i].pkts, pkt_vecs[i].num); +} + +static void drain(void) +{ + odp_event_t ev; + odp_event_type_t type; + odp_dma_result_t res; + odp_buffer_t buf; + transfer_t *trs; + + while (true) { + ev = odp_schedule(NULL, odp_schedule_wait_time(ODP_TIME_SEC_IN_NS * 2U)); + + if (ev == ODP_EVENT_INVALID) + break; + + type = odp_event_type(ev); + + if (type == ODP_EVENT_DMA_COMPL) { + memset(&res, 0, sizeof(res)); + odp_dma_compl_result(odp_dma_compl_from_event(ev), &res); + buf = (odp_buffer_t)res.user_ptr; + trs = (transfer_t *)odp_buffer_addr(buf); + odp_packet_free_multi(trs->src_pkts, trs->num); + odp_packet_free_multi(trs->dst_pkts, trs->num); + odp_buffer_free(buf); + } + + odp_event_free(ev); + } +} + +static int process_packets(void *args) +{ + thread_config_t *config = args; + const uint8_t num_ifs = config->prog_config->num_ifs; + pkt_vec_t pkt_vecs[num_ifs], *pkt_vec; + odp_atomic_u32_t *is_running = &config->prog_config->is_running; + uint64_t c1, c2, c3, c4, cdiff = 0U, rounds = 0U; + const int burst_size = config->prog_config->burst_size; + odp_event_t evs[burst_size]; + int num_evs; + odp_event_t ev; + odp_event_type_t type; + ev_fn_t ev_fn = config->prog_config->ev_fn; + uint8_t *pktio_map = config->prog_config->pktio_idx_map; + stats_t *stats = &config->stats; + pkt_fn_t pkt_fn = config->prog_config->pkt_fn; + + for (uint32_t i = 0U; i < num_ifs; ++i) { + pkt_vecs[i].pktio = &config->prog_config->pktios[i]; + pkt_vecs[i].num = 0; + } + + config->thr_idx = odp_thread_id(); + odp_barrier_wait(&config->prog_config->init_barrier); + c1 = odp_cpu_cycles(); + + while (odp_atomic_load_u32(is_running)) { + c3 = odp_cpu_cycles(); + num_evs = odp_schedule_multi_no_wait(NULL, evs, burst_size); + c4 = odp_cpu_cycles(); + cdiff += odp_cpu_cycles_diff(c4, c3); + ++rounds; + + if (num_evs == 0) + continue; + + for (int i = 0; i < num_evs; ++i) { + ev = evs[i]; + type = odp_event_type(ev); + + if (type == ODP_EVENT_DMA_COMPL) { + if (ev_fn) + ev_fn(odp_dma_compl_from_event(ev), config); + } else if (type == ODP_EVENT_PACKET) { + push_packet(odp_packet_from_event(ev), pkt_vecs, pktio_map); + } else { + odp_event_free(ev); + ++stats->discards; + } + } + + for (uint32_t i = 0U; i < num_ifs; ++i) { + pkt_vec = &pkt_vecs[i]; + + if (pkt_vec->num >= burst_size) { + pkt_fn(pkt_vec->pkts, burst_size, pkt_vec->pktio, config); + pop_packets(pkt_vec, burst_size); + } + } + } + + c2 = odp_cpu_cycles(); + stats->sched_cc = cdiff; + stats->tot_cc = odp_cpu_cycles_diff(c2, c1); + stats->sched_rounds = rounds; + free_pending_packets(pkt_vecs, num_ifs); + odp_barrier_wait(&config->prog_config->term_barrier); + drain(); + + return 0; +} + +static odp_bool_t setup_workers(prog_config_t *config) +{ + odp_cpumask_t cpumask; + int num_workers; + odph_thread_common_param_t thr_common; + odph_thread_param_t thr_param[config->num_thrs]; + + num_workers = odp_cpumask_default_worker(&cpumask, config->num_thrs); + odph_thread_common_param_init(&thr_common); + thr_common.instance = config->odp_instance; + thr_common.cpumask = &cpumask; + + for (int i = 0; i < config->num_thrs; ++i) { + odph_thread_param_init(&thr_param[i]); + thr_param[i].start = process_packets; + thr_param[i].thr_type = ODP_THREAD_WORKER; + config->thread_config[i].prog_config = config; + thr_param[i].arg = &config->thread_config[i]; + } + + num_workers = odph_thread_create(config->thread_tbl, &thr_common, thr_param, num_workers); + + if (num_workers != config->num_thrs) { + ODPH_ERR("Error configuring worker threads\n"); + return false; + } + + return true; +} + +static odp_bool_t setup_test(prog_config_t *config) +{ + odp_barrier_init(&config->init_barrier, config->num_thrs + 1); + odp_barrier_init(&config->term_barrier, config->num_thrs + 1); + + if (!setup_copy(config)) + return false; + + if (!setup_pktios(config)) + return false; + + if (!setup_workers(config)) + return false; + + odp_barrier_wait(&config->init_barrier); + + return true; +} + +static void stop_test(prog_config_t *config) +{ + for (uint32_t i = 0U; i < config->num_ifs; ++i) + if (config->pktios[i].handle != ODP_PKTIO_INVALID) + (void)odp_pktio_stop(config->pktios[i].handle); + + odp_barrier_wait(&config->term_barrier); + (void)odph_thread_join(config->thread_tbl, config->num_thrs); +} + +static void teardown(prog_config_t *config) +{ + thread_config_t *thr; + + for (uint32_t i = 0U; i < config->num_ifs; ++i) + if (config->pktios[i].handle != ODP_PKTIO_INVALID) { + (void)odp_pktio_close(config->pktios[i].handle); + free(config->pktios[i].name); + } + + if (config->pktio_pool != ODP_POOL_INVALID) + (void)odp_pool_destroy(config->pktio_pool); + + for (int i = 0; i < config->num_thrs; ++i) { + thr = &config->thread_config[i]; + + if (thr->compl_q != ODP_QUEUE_INVALID) + (void)odp_queue_destroy(thr->compl_q); + + if (thr->compl_pool != ODP_POOL_INVALID) + (void)odp_pool_destroy(thr->compl_pool); + + if (thr->dma_handle != ODP_DMA_INVALID) + (void)odp_dma_destroy(thr->dma_handle); + } + + if (config->copy_pool != ODP_POOL_INVALID) + (void)odp_pool_destroy(config->copy_pool); + + if (config->trs_pool != ODP_POOL_INVALID) + (void)odp_pool_destroy(config->trs_pool); +} + +static void print_stats(const prog_config_t *config) +{ + const stats_t *stats; + const char *align = config->copy_type == SW_COPY ? " " : " "; + + printf("\n==================\n\n" + "DMA forwarder done\n\n" + " copy mode: %s\n" + " burst size: %u\n" + " packet length: %u\n" + " pool cache size: %u\n", config->copy_type == SW_COPY ? "SW" : "DMA", + config->burst_size, config->pkt_len, config->cache_size); + + for (int i = 0; i < config->num_thrs; ++i) { + stats = &config->thread_config[i].stats; + + printf("\n worker %d:\n", i); + + if (config->copy_type == SW_COPY) { + printf(" packet copy errors: %" PRIu64 "\n", + stats->copy_errs); + } else { + printf(" successful DMA transfers: %" PRIu64 "\n" + " DMA transfer start errors: %" PRIu64 "\n" + " DMA transfer errors: %" PRIu64 "\n" + " transfer buffer allocation errors: %" PRIu64 "\n" + " completion event allocation errors: %" PRIu64 "\n" + " copy packet allocation errors: %" PRIu64 "\n", + stats->trs, stats->start_errs, stats->trs_errs, + stats->buf_alloc_errs, stats->compl_alloc_errs, + stats->pkt_alloc_errs); + } + + printf(" packets forwarded:%s%" PRIu64 "\n" + " packets dropped: %s%" PRIu64 "\n" + " call cycles per schedule round:\n" + " total: %" PRIu64 "\n" + " schedule: %" PRIu64 "\n" + " rounds: %" PRIu64 "\n", align, stats->fwd_pkts, align, + stats->discards, DIV_IF(stats->tot_cc, stats->sched_rounds), + DIV_IF(stats->sched_cc, stats->sched_rounds), stats->sched_rounds); + } + + printf("\n==================\n"); +} + +int main(int argc, char **argv) +{ + odph_helper_options_t odph_opts; + odp_init_t init_param; + odp_instance_t odp_instance; + odp_shm_t shm_cfg = ODP_SHM_INVALID; + int ret = EXIT_SUCCESS; + parse_result_t parse_res; + + argc = odph_parse_options(argc, argv); + + if (odph_options(&odph_opts) == -1) { + ODPH_ERR("Error while reading ODP helper options, exiting\n"); + exit(EXIT_FAILURE); + } + + odp_init_param_init(&init_param); + init_param.mem_model = odph_opts.mem_model; + + if (odp_init_global(&odp_instance, NULL, NULL)) { + ODPH_ERR("ODP global init failed, exiting.\n"); + exit(EXIT_FAILURE); + } + + if (odp_init_local(odp_instance, ODP_THREAD_CONTROL)) { + ODPH_ERR("ODP local init failed, exiting.\n"); + exit(EXIT_FAILURE); + } + + shm_cfg = odp_shm_reserve(PROG_NAME "_cfg", sizeof(prog_config_t), ODP_CACHE_LINE_SIZE, + 0U); + + if (shm_cfg == ODP_SHM_INVALID) { + ODPH_ERR("Error reserving shared memory\n"); + ret = EXIT_FAILURE; + goto out; + } + + prog_conf = odp_shm_addr(shm_cfg); + + if (prog_conf == NULL) { + ODPH_ERR("Error resolving shared memory address\n"); + ret = EXIT_FAILURE; + goto out; + } + + parse_res = setup_program(argc, argv, prog_conf); + + if (parse_res == PRS_NOK) { + ret = EXIT_FAILURE; + goto out_test; + } + + if (parse_res == PRS_TERM) { + ret = EXIT_SUCCESS; + goto out_test; + } + + if (odp_schedule_config(NULL) < 0) { + ODPH_ERR("Error configuring scheduler\n"); + ret = EXIT_FAILURE; + goto out_test; + } + + prog_conf->odp_instance = odp_instance; + odp_atomic_init_u32(&prog_conf->is_running, 1U); + + if (!setup_test(prog_conf)) { + ret = EXIT_FAILURE; + goto out_test; + } + + while (odp_atomic_load_u32(&prog_conf->is_running)) + odp_cpu_pause(); + + stop_test(prog_conf); + print_stats(prog_conf); + +out_test: + teardown(prog_conf); + +out: + if (shm_cfg != ODP_SHM_INVALID) + (void)odp_shm_free(shm_cfg); + + if (odp_term_local()) { + ODPH_ERR("ODP local terminate failed, exiting.\n"); + exit(EXIT_FAILURE); + } + + if (odp_term_global(odp_instance)) { + ODPH_ERR("ODP global terminate failed, exiting.\n"); + exit(EXIT_FAILURE); + } + + return ret; +} From c8e9d6baed45cb1777d4170efb5572fff837143f Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Mon, 21 Aug 2023 08:55:51 +0000 Subject: [PATCH 034/192] linux-gen: pktio: move tx completion capability to drivers With zero-copy packet I/O drivers (i.e. DPDK and XDP) packet dispatching happens asynchronously in `odp_pktout_send()` context, meaning that memory areas related to packets are marked to be sent in the underlying machinery during the function execution, but the actual sending might occur after the function has returned. Because of this, current TX completion might signal packet TX completion before actual transmission. To workaround this, TX completion capability filling is moved to individual drivers and currently not supported by zero-copy DPDK and XDP drivers. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- platform/linux-generic/odp_packet_io.c | 4 ---- platform/linux-generic/pktio/dpdk.c | 7 +++++++ platform/linux-generic/pktio/ipc.c | 4 ++++ platform/linux-generic/pktio/loop.c | 4 ++++ platform/linux-generic/pktio/null.c | 4 ++++ platform/linux-generic/pktio/pcap.c | 4 ++++ platform/linux-generic/pktio/socket.c | 4 ++++ platform/linux-generic/pktio/socket_mmap.c | 4 ++++ platform/linux-generic/pktio/tap.c | 4 ++++ 9 files changed, 35 insertions(+), 4 deletions(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index c4cd87afc1..4c1178751d 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -1612,12 +1612,8 @@ int odp_pktio_capability(odp_pktio_t pktio, odp_pktio_capability_t *capa) capa->lso.proto.custom = 1; capa->lso.mod_op.add_segment_num = 1; - capa->config.pktout.bit.tx_compl_ena = 1; capa->tx_compl.queue_type_sched = 1; capa->tx_compl.queue_type_plain = 1; - capa->tx_compl.mode_all = 1; - capa->tx_compl.mode_event = 1; - capa->tx_compl.mode_poll = 0; capa->tx_compl.max_compl_id = 0; capa->free_ctrl.dont_free = 0; diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 84d5f5e5f7..cea2026cb3 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -1816,6 +1816,13 @@ static int dpdk_init_capability(pktio_entry_t *pktio_entry, capa->config.pktout.bit.tcp_chksum; capa->config.pktout.bit.ts_ena = 1; + if (!_ODP_DPDK_ZERO_COPY) { + capa->config.pktout.bit.tx_compl_ena = 1; + capa->tx_compl.mode_all = 1; + capa->tx_compl.mode_event = 1; + capa->tx_compl.mode_poll = 0; + } + /* Copy for fast path access */ pkt_dpdk->pktout_capa = capa->config.pktout; diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c index 0c1ecc4750..4222b383a5 100644 --- a/platform/linux-generic/pktio/ipc.c +++ b/platform/linux-generic/pktio/ipc.c @@ -923,6 +923,10 @@ static int ipc_capability(pktio_entry_t *pktio_entry ODP_UNUSED, odp_pktio_capab capa->max_input_queues = 1; capa->max_output_queues = 1; + capa->config.pktout.bit.tx_compl_ena = 1; + capa->tx_compl.mode_all = 1; + capa->tx_compl.mode_event = 1; + capa->tx_compl.mode_poll = 0; return 0; } diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index 08459776bf..ca6cc76561 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -674,6 +674,10 @@ static int loopback_init_capability(pktio_entry_t *pktio_entry) capa->config.pktout.bit.udp_chksum = 1; capa->config.pktout.bit.sctp_chksum = 1; capa->config.pktout.bit.ts_ena = 1; + capa->config.pktout.bit.tx_compl_ena = 1; + capa->tx_compl.mode_all = 1; + capa->tx_compl.mode_event = 1; + capa->tx_compl.mode_poll = 0; if (odp_global_ro.disable.ipsec == 0) { capa->config.inbound_ipsec = 1; diff --git a/platform/linux-generic/pktio/null.c b/platform/linux-generic/pktio/null.c index b067a68eca..b2e15f7bd7 100644 --- a/platform/linux-generic/pktio/null.c +++ b/platform/linux-generic/pktio/null.c @@ -139,6 +139,10 @@ static int null_capability(pktio_entry_t *pktio_entry ODP_UNUSED, capa->config.pktin.bit.ts_ptp = 1; capa->config.pktout.bit.ts_ena = 1; + capa->config.pktout.bit.tx_compl_ena = 1; + capa->tx_compl.mode_all = 1; + capa->tx_compl.mode_event = 1; + capa->tx_compl.mode_poll = 0; return 0; } diff --git a/platform/linux-generic/pktio/pcap.c b/platform/linux-generic/pktio/pcap.c index 6f68e95a1d..b764f9e664 100644 --- a/platform/linux-generic/pktio/pcap.c +++ b/platform/linux-generic/pktio/pcap.c @@ -505,6 +505,10 @@ static int pcapif_capability(pktio_entry_t *pktio_entry ODP_UNUSED, capa->config.pktin.bit.ts_ptp = 1; capa->config.pktout.bit.ts_ena = 1; + capa->config.pktout.bit.tx_compl_ena = 1; + capa->tx_compl.mode_all = 1; + capa->tx_compl.mode_event = 1; + capa->tx_compl.mode_poll = 0; capa->stats.pktio.counter.in_octets = 1; capa->stats.pktio.counter.in_packets = 1; diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index 609a9351f6..8a7f859edf 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -587,6 +587,10 @@ static int sock_capability(pktio_entry_t *pktio_entry, capa->config.pktin.bit.ts_ptp = 1; capa->config.pktout.bit.ts_ena = 1; + capa->config.pktout.bit.tx_compl_ena = 1; + capa->tx_compl.mode_all = 1; + capa->tx_compl.mode_event = 1; + capa->tx_compl.mode_poll = 0; /* Fill statistics capabilities */ _odp_sock_stats_capa(pktio_entry, capa); diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c index 2ca1507513..d4183f18dc 100644 --- a/platform/linux-generic/pktio/socket_mmap.c +++ b/platform/linux-generic/pktio/socket_mmap.c @@ -891,6 +891,10 @@ static int sock_mmap_capability(pktio_entry_t *pktio_entry, capa->config.pktin.bit.ts_ptp = 1; capa->config.pktout.bit.ts_ena = 1; + capa->config.pktout.bit.tx_compl_ena = 1; + capa->tx_compl.mode_all = 1; + capa->tx_compl.mode_event = 1; + capa->tx_compl.mode_poll = 0; /* Fill statistics capabilities */ _odp_sock_stats_capa(pktio_entry, capa); diff --git a/platform/linux-generic/pktio/tap.c b/platform/linux-generic/pktio/tap.c index 50d17e8883..30ac9cffdc 100644 --- a/platform/linux-generic/pktio/tap.c +++ b/platform/linux-generic/pktio/tap.c @@ -536,6 +536,10 @@ static int tap_capability(pktio_entry_t *pktio_entry ODP_UNUSED, capa->config.pktin.bit.ts_ptp = 1; capa->config.pktout.bit.ts_ena = 1; + capa->config.pktout.bit.tx_compl_ena = 1; + capa->tx_compl.mode_all = 1; + capa->tx_compl.mode_event = 1; + capa->tx_compl.mode_poll = 0; return 0; } From 92413690787a58de864243ab2ad60aabac8c7d40 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 24 Aug 2023 16:53:17 +0300 Subject: [PATCH 035/192] helper: improve doxygen module documentation Use correct Doxygen groups and improve descriptions for helper modules. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale --- helper/include/odp/helper/chksum.h | 6 +++-- helper/include/odp/helper/cli.h | 15 +++++++----- helper/include/odp/helper/eth.h | 9 ++++--- helper/include/odp/helper/gtp.h | 9 +++++++ helper/include/odp/helper/icmp.h | 5 ++-- helper/include/odp/helper/igmp.h | 17 +++++++++---- helper/include/odp/helper/ip.h | 11 ++++----- helper/include/odp/helper/ipsec.h | 5 ++-- helper/include/odp/helper/linux/process.h | 5 ++-- helper/include/odp/helper/linux/pthread.h | 5 ++-- helper/include/odp/helper/odph_cuckootable.h | 4 +++- helper/include/odp/helper/odph_debug.h | 7 ++++-- helper/include/odp/helper/odph_hashtable.h | 4 +++- .../include/odp/helper/odph_iplookuptable.h | 14 ++++++----- helper/include/odp/helper/odph_lineartable.h | 4 +++- helper/include/odp/helper/sctp.h | 5 ++-- helper/include/odp/helper/strong_types.h | 16 ++++--------- helper/include/odp/helper/table.h | 24 ++++++++++--------- helper/include/odp/helper/tcp.h | 5 ++-- helper/include/odp/helper/threads.h | 7 ++++-- helper/include/odp/helper/udp.h | 5 ++-- helper/include/odp/helper/version.h.in | 4 +++- 22 files changed, 114 insertions(+), 72 deletions(-) diff --git a/helper/include/odp/helper/chksum.h b/helper/include/odp/helper/chksum.h index 148b986010..b9d808bb29 100644 --- a/helper/include/odp/helper/chksum.h +++ b/helper/include/odp/helper/chksum.h @@ -18,8 +18,10 @@ extern "C" { #include -/** @addtogroup odph_chksum ODPH CHECK SUM - * @{ +/** @defgroup odph_chksum ODPH CHECKSUM + * TCP/UDP/SCTP checksum + * + * @{ */ /** diff --git a/helper/include/odp/helper/cli.h b/helper/include/odp/helper/cli.h index e9351147f5..57e958568a 100644 --- a/helper/include/odp/helper/cli.h +++ b/helper/include/odp/helper/cli.h @@ -7,11 +7,7 @@ /** * @file * - * ODP CLI helper API - * - * This API allows control of ODP CLI server, which may be connected to - * using a telnet client. CLI commands may be used to get information - * from an ODP instance, for debugging purposes. + * ODP CLI helper */ #ifndef ODPH_CLI_H_ @@ -25,7 +21,14 @@ extern "C" { #include /** - * @addtogroup odph_cli ODPH CLI + * @defgroup odph_cli ODPH CLI + * Command line interface + * + * @details + * This API allows control of ODP CLI server, which may be connected to using a + * telnet client. CLI commands may be used to get information from an ODP + * instance, for debugging purposes. + * * @{ */ diff --git a/helper/include/odp/helper/eth.h b/helper/include/odp/helper/eth.h index 31ced14b20..76675d65e9 100644 --- a/helper/include/odp/helper/eth.h +++ b/helper/include/odp/helper/eth.h @@ -19,8 +19,11 @@ extern "C" { #include -/** @addtogroup odph_header ODPH HEADER - * @{ +/** + * @defgroup odph_protocols ODPH PROTOCOLS + * Network protocols + * + * @{ */ #define ODPH_ETHADDR_LEN 6 /**< Ethernet address length */ @@ -51,7 +54,7 @@ extern "C" { * Ethernet MAC address */ typedef struct ODP_PACKED { - uint8_t addr[ODPH_ETHADDR_LEN]; /**< @private Address */ + uint8_t addr[ODPH_ETHADDR_LEN]; /**< Address */ } odph_ethaddr_t; /** @internal Compile time assert */ diff --git a/helper/include/odp/helper/gtp.h b/helper/include/odp/helper/gtp.h index d542dc6b32..eddfac7541 100644 --- a/helper/include/odp/helper/gtp.h +++ b/helper/include/odp/helper/gtp.h @@ -15,6 +15,11 @@ extern "C" { #include +/** + * @addtogroup odph_protocols + * @{ + */ + /** * Simplified GTP protocol header. * Contains 8-bit gtp_hdr_info, 8-bit msg_type, @@ -31,6 +36,10 @@ typedef struct ODP_PACKED { /** GTP header length */ #define ODP_GTP_HLEN sizeof(odph_gtphdr_t) +/** + * @} + */ + #ifdef __cplusplus } #endif diff --git a/helper/include/odp/helper/icmp.h b/helper/include/odp/helper/icmp.h index 3be0c345f4..1b922bcf3f 100644 --- a/helper/include/odp/helper/icmp.h +++ b/helper/include/odp/helper/icmp.h @@ -20,8 +20,9 @@ extern "C" { #include -/** @addtogroup odph_header ODPH HEADER - * @{ +/** + * @addtogroup odph_protocols + * @{ */ /** ICMP header length */ diff --git a/helper/include/odp/helper/igmp.h b/helper/include/odp/helper/igmp.h index 5cff41aabe..082da52723 100644 --- a/helper/include/odp/helper/igmp.h +++ b/helper/include/odp/helper/igmp.h @@ -16,6 +16,11 @@ extern "C" { #include +/** + * @addtogroup odph_protocols + * @{ + */ + /** * Simplified IGMP protocol header. * Contains 8-bit type, 8-bit code, @@ -23,15 +28,19 @@ extern "C" { * No optional fields and next extension header. */ typedef struct ODP_PACKED { - uint8_t type; /** Message Type */ - uint8_t code; /** Max response code */ - odp_u16be_t csum; /** Checksum */ - odp_u32be_t group; /** Group address */ + uint8_t type; /**< Message Type */ + uint8_t code; /**< Max response code */ + odp_u16be_t csum; /**< Checksum */ + odp_u32be_t group; /**< Group address */ } odph_igmphdr_t; /** IGMP header length */ #define ODP_IGMP_HLEN sizeof(odph_igmphdr_t) +/** + * @} + */ + #ifdef __cplusplus } #endif diff --git a/helper/include/odp/helper/ip.h b/helper/include/odp/helper/ip.h index 0faf47f828..af0ddb259a 100644 --- a/helper/include/odp/helper/ip.h +++ b/helper/include/odp/helper/ip.h @@ -22,8 +22,9 @@ extern "C" { #include -/** @addtogroup odph_header ODPH HEADER - * @{ +/** + * @addtogroup odph_protocols + * @{ */ #define ODPH_IPV4 4 /**< IP version 4 */ @@ -247,9 +248,9 @@ typedef struct ODP_PACKED { uint8_t filler[6]; /**< Fill out first 8 byte segment */ } odph_ipv6hdr_ext_t; -/** @name +/* * IP protocol values (IPv4:'proto' or IPv6:'next_hdr') - * @{*/ + */ #define ODPH_IPPROTO_HOPOPTS 0x00 /**< IPv6 hop-by-hop options */ #define ODPH_IPPROTO_ICMPV4 0x01 /**< Internet Control Message Protocol (1) */ #define ODPH_IPPROTO_IGMP 0x02 /**< Internet Group Message Protocol (1) */ @@ -264,8 +265,6 @@ typedef struct ODP_PACKED { (132) */ #define ODPH_IPPROTO_INVALID 0xFF /**< Reserved invalid by IANA */ -/**@}*/ - /** * Parse IPv4 address from a string * diff --git a/helper/include/odp/helper/ipsec.h b/helper/include/odp/helper/ipsec.h index 197c7f7e8a..e4f0dabbcf 100644 --- a/helper/include/odp/helper/ipsec.h +++ b/helper/include/odp/helper/ipsec.h @@ -21,8 +21,9 @@ extern "C" { #include -/** @addtogroup odph_header ODPH HEADER - * @{ +/** + * @addtogroup odph_protocols + * @{ */ #define ODPH_ESPHDR_LEN 8 /**< IPSec ESP header length */ diff --git a/helper/include/odp/helper/linux/process.h b/helper/include/odp/helper/linux/process.h index 8d53c7191f..fd7faff6c5 100644 --- a/helper/include/odp/helper/linux/process.h +++ b/helper/include/odp/helper/linux/process.h @@ -24,8 +24,9 @@ extern "C" { #endif -/** @ingroup odph_linux - * @{ +/** + * @addtogroup odph_thread + * @{ */ /** diff --git a/helper/include/odp/helper/linux/pthread.h b/helper/include/odp/helper/linux/pthread.h index 910c27cd3c..ee7700ebdd 100644 --- a/helper/include/odp/helper/linux/pthread.h +++ b/helper/include/odp/helper/linux/pthread.h @@ -24,8 +24,9 @@ extern "C" { #endif -/** @ingroup odph_linux - * @{ +/** + * @addtogroup odph_thread + * @{ */ /** diff --git a/helper/include/odp/helper/odph_cuckootable.h b/helper/include/odp/helper/odph_cuckootable.h index 5b0a48e5b7..7056c51412 100644 --- a/helper/include/odp/helper/odph_cuckootable.h +++ b/helper/include/odp/helper/odph_cuckootable.h @@ -53,7 +53,9 @@ extern "C" { #endif /** - * @addtogroup odph_cuckootable ODPH CUCKOO TABLE + * @defgroup odph_cuckootable ODPH CUCKOO TABLE + * Cuckoo table + * * @{ */ diff --git a/helper/include/odp/helper/odph_debug.h b/helper/include/odp/helper/odph_debug.h index 7cb2ee617e..c78df2238b 100644 --- a/helper/include/odp/helper/odph_debug.h +++ b/helper/include/odp/helper/odph_debug.h @@ -30,8 +30,11 @@ extern "C" { #pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" #endif -/** @addtogroup odph_debug ODPH DEBUG - * @{ +/** + * @defgroup odph_debug ODPH DEBUG + * Debug logging + * + * @{ */ /** diff --git a/helper/include/odp/helper/odph_hashtable.h b/helper/include/odp/helper/odph_hashtable.h index 03c07c4335..3921e0a2b1 100644 --- a/helper/include/odp/helper/odph_hashtable.h +++ b/helper/include/odp/helper/odph_hashtable.h @@ -20,7 +20,9 @@ extern "C" { #endif /** - * @addtogroup odph_hash_table ODPH HASH TABLE + * @defgroup odph_hash_table ODPH HASH TABLE + * Hash table + * * @{ */ diff --git a/helper/include/odp/helper/odph_iplookuptable.h b/helper/include/odp/helper/odph_iplookuptable.h index 14bb2495bc..017746d0dd 100644 --- a/helper/include/odp/helper/odph_iplookuptable.h +++ b/helper/include/odp/helper/odph_iplookuptable.h @@ -8,11 +8,6 @@ * @file * * ODP IP Lookup Table - * - * This is an implementation of the IP lookup table. The key of - * this table is IPv4 address (32 bits), and the value can be - * defined by user. This table uses the 16,8,8 ip lookup (longest - * prefix matching) algorithm. */ #ifndef ODPH_IPLOOKUP_TABLE_H_ @@ -25,7 +20,14 @@ extern "C" { #endif /** - * @addtogroup odph_iplookuptable ODPH IP LOOKUP TABLE + * @defgroup odph_iplookuptable ODPH IP LOOKUP TABLE + * IP lookup table + * + * @details + * This is an implementation of the IP lookup table. The key of this table is + * IPv4 address (32 bits), and the value can be defined by user. This table uses + * the 16,8,8 ip lookup (longest prefix matching) algorithm. + * * @{ */ diff --git a/helper/include/odp/helper/odph_lineartable.h b/helper/include/odp/helper/odph_lineartable.h index b8d8cecc6c..72b9472d06 100644 --- a/helper/include/odp/helper/odph_lineartable.h +++ b/helper/include/odp/helper/odph_lineartable.h @@ -21,7 +21,9 @@ extern "C" { #endif /** - * @addtogroup odph_lineartable ODPH LINEAR TABLE + * @defgroup odph_lineartable ODPH LINEAR TABLE + * Linear table + * * @{ */ diff --git a/helper/include/odp/helper/sctp.h b/helper/include/odp/helper/sctp.h index c81bd6313c..51604eaafe 100644 --- a/helper/include/odp/helper/sctp.h +++ b/helper/include/odp/helper/sctp.h @@ -19,8 +19,9 @@ extern "C" { #include -/** @addtogroup odph_header ODPH HEADER - * @{ +/** + * @addtogroup odph_protocols + * @{ */ /** SCTP header length */ diff --git a/helper/include/odp/helper/strong_types.h b/helper/include/odp/helper/strong_types.h index 645d0bfd68..72e3c3176a 100644 --- a/helper/include/odp/helper/strong_types.h +++ b/helper/include/odp/helper/strong_types.h @@ -8,17 +8,13 @@ * @file * * ODP Strong Types. Common macros for implementing strong typing - * for ODP abstract data types + * for ODPH abstract data types */ #ifndef ODPH_STRONG_TYPES_H_ #define ODPH_STRONG_TYPES_H_ -/** @addtogroup odph_strong_types ODPH STRONG TYPES - * @{ - */ - -/** Use strong typing for ODP types */ +/** Use strong typing for ODPH types */ #ifdef __cplusplus /** @internal C++ helper macro for strong typing @param type @return */ #define ODPH_HANDLE_T(type) struct _##type { uint8_t unused_dummy_var; } *type @@ -28,17 +24,13 @@ #define ODPH_HANDLE_T(type) odph_handle_t type #endif -/** Internal macro to get value of an ODP handle */ +/** Internal macro to get value of an ODPH handle */ #define _odph_typeval(handle) ((uintptr_t)(handle)) -/** Internal macro to get printable value of an ODP handle */ +/** Internal macro to get printable value of an ODPH handle */ #define _odph_pri(handle) ((uint64_t)(uintptr_t)(handle)) /** Internal macro to convert a scalar to a typed handle */ #define _odph_cast_scalar(type, val) ((type)(uintptr_t)(val)) -/** - * @} - */ - #endif diff --git a/helper/include/odp/helper/table.h b/helper/include/odp/helper/table.h index 73dfafc920..711f8a202a 100644 --- a/helper/include/odp/helper/table.h +++ b/helper/include/odp/helper/table.h @@ -8,7 +8,20 @@ * @file * * ODP table + */ + +#ifndef ODPH_TABLE_H_ +#define ODPH_TABLE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup odph_tables ODPH TABLES + * Table interface * + * @details * TCAM(Ternary Content Addressable Memory) is used widely in packet * forwarding to speedup the table lookup. * @@ -71,17 +84,6 @@ * notes: key/value and key/associated data mean the same thing * in this file unless otherwise mentioned. * - */ - -#ifndef ODPH_TABLE_H_ -#define ODPH_TABLE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @addtogroup odph_tables ODPH TABLES * @{ */ diff --git a/helper/include/odp/helper/tcp.h b/helper/include/odp/helper/tcp.h index ebc8ddf1b0..00dfe4e606 100644 --- a/helper/include/odp/helper/tcp.h +++ b/helper/include/odp/helper/tcp.h @@ -20,8 +20,9 @@ extern "C" { #include -/** @addtogroup odph_header ODPH HEADER - * @{ +/** + * @addtogroup odph_protocols + * @{ */ #define ODPH_TCPHDR_LEN 20 /**< Min length of TCP header (no options) */ diff --git a/helper/include/odp/helper/threads.h b/helper/include/odp/helper/threads.h index fc79edffae..785437ed17 100644 --- a/helper/include/odp/helper/threads.h +++ b/helper/include/odp/helper/threads.h @@ -30,8 +30,11 @@ extern "C" { #include #include -/** @addtogroup odph_linux ODPH LINUX - * @{ +/** + * @defgroup odph_thread ODPH THREAD + * Setup threads/processes + * + * @{ */ /** Thread parameter for Linux pthreads and processes */ diff --git a/helper/include/odp/helper/udp.h b/helper/include/odp/helper/udp.h index 17a7e7129e..76c19da9ae 100644 --- a/helper/include/odp/helper/udp.h +++ b/helper/include/odp/helper/udp.h @@ -20,8 +20,9 @@ extern "C" { #include #include -/** @addtogroup odph_header ODPH HEADER - * @{ +/** + * @addtogroup odph_protocols + * @{ */ /** UDP header length */ diff --git a/helper/include/odp/helper/version.h.in b/helper/include/odp/helper/version.h.in index 127b3ff9d2..d08b413c9f 100644 --- a/helper/include/odp/helper/version.h.in +++ b/helper/include/odp/helper/version.h.in @@ -19,7 +19,9 @@ extern "C" { #endif /** - * @defgroup odph_version VERSION + * @defgroup odph_version ODPH VERSION + * Helper library version + * * @{ */ From 65e4d3f3c4b5be8d6339a43f63b3dfe2c17c0f35 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 24 Aug 2023 17:25:22 +0300 Subject: [PATCH 036/192] helper: remove ODP_STATIC_ASSERT macros from doxygen output ODP_STATIC_ASSERT macros were previously recognized as functions by Doxygen. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale --- helper/include/odp/helper/eth.h | 17 ++++++++--------- helper/include/odp/helper/icmp.h | 3 ++- helper/include/odp/helper/ip.h | 6 ++++-- helper/include/odp/helper/ipsec.h | 17 ++++++++--------- helper/include/odp/helper/sctp.h | 3 ++- helper/include/odp/helper/udp.h | 3 ++- 6 files changed, 26 insertions(+), 23 deletions(-) diff --git a/helper/include/odp/helper/eth.h b/helper/include/odp/helper/eth.h index 76675d65e9..329a39af4f 100644 --- a/helper/include/odp/helper/eth.h +++ b/helper/include/odp/helper/eth.h @@ -57,10 +57,6 @@ typedef struct ODP_PACKED { uint8_t addr[ODPH_ETHADDR_LEN]; /**< Address */ } odph_ethaddr_t; -/** @internal Compile time assert */ -ODP_STATIC_ASSERT(sizeof(odph_ethaddr_t) == ODPH_ETHADDR_LEN, - "ODPH_ETHADDR_T__SIZE_ERROR"); - /** * Ethernet header */ @@ -70,10 +66,6 @@ typedef struct ODP_PACKED { odp_u16be_t type; /**< EtherType */ } odph_ethhdr_t; -/** @internal Compile time assert */ -ODP_STATIC_ASSERT(sizeof(odph_ethhdr_t) == ODPH_ETHHDR_LEN, - "ODPH_ETHHDR_T__SIZE_ERROR"); - /** * IEEE 802.1Q VLAN header * @@ -88,9 +80,16 @@ typedef struct ODP_PACKED { odp_u16be_t type; /**< Inner EtherType */ } odph_vlanhdr_t; -/** @internal Compile time assert */ +/** @cond _ODP_HIDE_FROM_DOXYGEN_ */ +ODP_STATIC_ASSERT(sizeof(odph_ethaddr_t) == ODPH_ETHADDR_LEN, + "ODPH_ETHADDR_T__SIZE_ERROR"); + +ODP_STATIC_ASSERT(sizeof(odph_ethhdr_t) == ODPH_ETHHDR_LEN, + "ODPH_ETHHDR_T__SIZE_ERROR"); + ODP_STATIC_ASSERT(sizeof(odph_vlanhdr_t) == ODPH_VLANHDR_LEN, "ODPH_VLANHDR_T__SIZE_ERROR"); +/** @endcond */ /* Ethernet header Ether Type ('type') values, a selected few */ #define ODPH_ETHTYPE_IPV4 0x0800 /**< Internet Protocol version 4 */ diff --git a/helper/include/odp/helper/icmp.h b/helper/include/odp/helper/icmp.h index 1b922bcf3f..c2b463a24f 100644 --- a/helper/include/odp/helper/icmp.h +++ b/helper/include/odp/helper/icmp.h @@ -95,9 +95,10 @@ typedef struct ODP_PACKED { #define ICMP_EXC_FRAGTIME 1 /**< Fragment Reass time exceeded*/ -/** @internal Compile time assert */ +/** @cond _ODP_HIDE_FROM_DOXYGEN_ */ ODP_STATIC_ASSERT(sizeof(odph_icmphdr_t) == ODPH_ICMPHDR_LEN, "ODPH_ICMPHDR_T__SIZE_ERROR"); +/** @endcond */ /** * @} diff --git a/helper/include/odp/helper/ip.h b/helper/include/odp/helper/ip.h index af0ddb259a..5deb451502 100644 --- a/helper/include/odp/helper/ip.h +++ b/helper/include/odp/helper/ip.h @@ -92,9 +92,10 @@ typedef struct ODP_PACKED { odp_u32be_t dst_addr; /**< Destination address */ } odph_ipv4hdr_t; -/** @internal Compile time assert */ +/** @cond _ODP_HIDE_FROM_DOXYGEN_ */ ODP_STATIC_ASSERT(sizeof(odph_ipv4hdr_t) == ODPH_IPV4HDR_LEN, "ODPH_IPV4HDR_T__SIZE_ERROR"); +/** @endcond */ /** * Calculate IPv4 header checksum @@ -233,9 +234,10 @@ typedef struct ODP_PACKED { uint8_t dst_addr[16]; /**< Destination address */ } odph_ipv6hdr_t; -/** @internal Compile time assert */ +/** @cond _ODP_HIDE_FROM_DOXYGEN_ */ ODP_STATIC_ASSERT(sizeof(odph_ipv6hdr_t) == ODPH_IPV6HDR_LEN, "ODPH_IPV6HDR_T__SIZE_ERROR"); +/** @endcond */ /** * IPv6 Header extensions diff --git a/helper/include/odp/helper/ipsec.h b/helper/include/odp/helper/ipsec.h index e4f0dabbcf..734c13b186 100644 --- a/helper/include/odp/helper/ipsec.h +++ b/helper/include/odp/helper/ipsec.h @@ -39,10 +39,6 @@ typedef struct ODP_PACKED { uint8_t iv[]; /**< Initialization vector */ } odph_esphdr_t; -/** @internal Compile time assert */ -ODP_STATIC_ASSERT(sizeof(odph_esphdr_t) == ODPH_ESPHDR_LEN, - "ODPH_ESPHDR_T__SIZE_ERROR"); - /** * IPSec ESP trailer */ @@ -52,10 +48,6 @@ typedef struct ODP_PACKED { uint8_t icv[]; /**< Integrity Check Value (optional) */ } odph_esptrl_t; -/** @internal Compile time assert */ -ODP_STATIC_ASSERT(sizeof(odph_esptrl_t) == ODPH_ESPTRL_LEN, - "ODPH_ESPTRL_T__SIZE_ERROR"); - /** * IPSec AH header */ @@ -68,9 +60,16 @@ typedef struct ODP_PACKED { uint8_t icv[]; /**< Integrity Check Value */ } odph_ahhdr_t; -/** @internal Compile time assert */ +/** @cond _ODP_HIDE_FROM_DOXYGEN_ */ +ODP_STATIC_ASSERT(sizeof(odph_esphdr_t) == ODPH_ESPHDR_LEN, + "ODPH_ESPHDR_T__SIZE_ERROR"); + +ODP_STATIC_ASSERT(sizeof(odph_esptrl_t) == ODPH_ESPTRL_LEN, + "ODPH_ESPTRL_T__SIZE_ERROR"); + ODP_STATIC_ASSERT(sizeof(odph_ahhdr_t) == ODPH_AHHDR_LEN, "ODPH_AHHDR_T__SIZE_ERROR"); +/** @endcond */ /** * Check IPSEC algorithm support diff --git a/helper/include/odp/helper/sctp.h b/helper/include/odp/helper/sctp.h index 51604eaafe..da9773de7c 100644 --- a/helper/include/odp/helper/sctp.h +++ b/helper/include/odp/helper/sctp.h @@ -35,9 +35,10 @@ typedef struct ODP_PACKED { odp_u32be_t chksum; /**< SCTP header and data checksum */ } odph_sctphdr_t; -/** @internal Compile time assert */ +/** @cond _ODP_HIDE_FROM_DOXYGEN_ */ ODP_STATIC_ASSERT(sizeof(odph_sctphdr_t) == ODPH_SCTPHDR_LEN, "ODPH_SCTPHDR_T__SIZE_ERROR"); +/** @endcond */ /** * @} diff --git a/helper/include/odp/helper/udp.h b/helper/include/odp/helper/udp.h index 76c19da9ae..0fe14ac482 100644 --- a/helper/include/odp/helper/udp.h +++ b/helper/include/odp/helper/udp.h @@ -53,9 +53,10 @@ static inline uint16_t odph_ipv4_udp_chksum(odp_packet_t pkt) return (rc == 0) ? chksum : 0; } -/** @internal Compile time assert */ +/** @cond _ODP_HIDE_FROM_DOXYGEN_ */ ODP_STATIC_ASSERT(sizeof(odph_udphdr_t) == ODPH_UDPHDR_LEN, "ODPH_UDPHDR_T__SIZE_ERROR"); +/** @endcond */ /** * @} From eb5960b4c26c8487524bd6933e7c71fedc386b42 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 28 Aug 2023 17:17:28 +0300 Subject: [PATCH 037/192] configure: enable parallel lto Add 'auto' argument to '-flto' to enable parallel LTO jobs, which may reduce linking duration. Also, fixes "using serial compilation of N LTRANS jobs" warnings when using GCC-12. The '-flto=auto' and '-ffat-lto-objects' options are currently not supported by clang. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- configure.ac | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0b91c6981a..69290e34b2 100644 --- a/configure.ac +++ b/configure.ac @@ -247,7 +247,14 @@ AC_ARG_ENABLE([lto], # Fat LTO object file contains GIMPLE bytecodes and the usual # final code. There are less build problems (e.g. due to older # binutils), but object files are larger. - ODP_LTO_FLAGS="-flto -ffat-lto-objects" + # + # -flto=auto and -ffat-lto-objects are currently not supported by clang. + $CC --version | grep -q clang + if test $? -ne 0; then + ODP_LTO_FLAGS="-flto=auto -ffat-lto-objects" + else + ODP_LTO_FLAGS="-flto" + fi fi]) ODP_CFLAGS="$ODP_CFLAGS $ODP_LTO_FLAGS" From 998592ba2c1f47ba5bdfaaf6161a9b70943256ed Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 28 Aug 2023 16:45:58 +0300 Subject: [PATCH 038/192] test: l2fwd: shorten tests run length Shorten test script run from 30 sec to 5 sec. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- test/performance/odp_l2fwd_run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/performance/odp_l2fwd_run.sh b/test/performance/odp_l2fwd_run.sh index 2d2321aa53..5a6a97483d 100755 --- a/test/performance/odp_l2fwd_run.sh +++ b/test/performance/odp_l2fwd_run.sh @@ -85,7 +85,7 @@ run_l2fwd() LOG=odp_l2fwd_tmp.log # Max 2 workers - $STDBUF odp_l2fwd${EXEEXT} -i $IF1,$IF2 -m 0 -t 30 -c 2 | tee $LOG + $STDBUF odp_l2fwd${EXEEXT} -i $IF1,$IF2 -m 0 -t 5 -c 2 | tee $LOG ret=${PIPESTATUS[0]} kill -2 ${GEN_PID} From 90f220ccfe6e5c4997d22c917673a0a25ea1b1b1 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 30 Aug 2023 10:39:03 +0300 Subject: [PATCH 039/192] api: update copyright format Update all API files to use the new shorter copyright format: /* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) */ Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- include/README | 8 +++----- include/odp/api/abi-default/align.h | 6 ++---- include/odp/api/abi-default/atomic.h | 8 +++----- include/odp/api/abi-default/barrier.h | 6 ++---- include/odp/api/abi-default/buffer.h | 6 ++---- include/odp/api/abi-default/buffer_types.h | 8 +++----- include/odp/api/abi-default/byteorder.h | 6 ++---- include/odp/api/abi-default/classification.h | 6 ++---- include/odp/api/abi-default/comp.h | 6 ++---- include/odp/api/abi-default/cpu.h | 6 ++---- include/odp/api/abi-default/cpumask.h | 6 ++---- include/odp/api/abi-default/crypto.h | 8 +++----- include/odp/api/abi-default/crypto_types.h | 8 +++----- include/odp/api/abi-default/debug.h | 6 ++---- include/odp/api/abi-default/dma.h | 6 ++---- include/odp/api/abi-default/dma_types.h | 6 ++---- include/odp/api/abi-default/errno.h | 6 ++---- include/odp/api/abi-default/event.h | 6 ++---- include/odp/api/abi-default/event_types.h | 8 +++----- include/odp/api/abi-default/hash.h | 6 ++---- include/odp/api/abi-default/init.h | 6 ++---- include/odp/api/abi-default/ipsec.h | 8 +++----- include/odp/api/abi-default/ipsec_types.h | 8 +++----- include/odp/api/abi-default/packet.h | 6 ++---- include/odp/api/abi-default/packet_flags.h | 6 ++---- include/odp/api/abi-default/packet_io.h | 6 ++---- include/odp/api/abi-default/packet_io_types.h | 8 +++----- include/odp/api/abi-default/packet_types.h | 8 +++----- include/odp/api/abi-default/pool.h | 6 ++---- include/odp/api/abi-default/pool_types.h | 8 +++----- include/odp/api/abi-default/proto_stats.h | 6 ++---- include/odp/api/abi-default/proto_stats_types.h | 8 +++----- include/odp/api/abi-default/queue.h | 6 ++---- include/odp/api/abi-default/queue_types.h | 8 +++----- include/odp/api/abi-default/random.h | 6 ++---- include/odp/api/abi-default/rwlock.h | 6 ++---- include/odp/api/abi-default/rwlock_recursive.h | 6 ++---- include/odp/api/abi-default/schedule.h | 6 ++---- include/odp/api/abi-default/schedule_types.h | 6 ++---- include/odp/api/abi-default/shared_memory.h | 6 ++---- include/odp/api/abi-default/spinlock.h | 6 ++---- include/odp/api/abi-default/spinlock_recursive.h | 6 ++---- include/odp/api/abi-default/stash.h | 6 ++---- include/odp/api/abi-default/stash_types.h | 6 ++---- include/odp/api/abi-default/std.h | 6 ++---- include/odp/api/abi-default/std_types.h | 6 ++---- include/odp/api/abi-default/sync.h | 6 ++---- include/odp/api/abi-default/thread.h | 6 ++---- include/odp/api/abi-default/thrmask.h | 6 ++---- include/odp/api/abi-default/ticketlock.h | 6 ++---- include/odp/api/abi-default/time.h | 6 ++---- include/odp/api/abi-default/time_types.h | 6 ++---- include/odp/api/abi-default/timer.h | 6 ++---- include/odp/api/abi-default/timer_types.h | 6 ++---- include/odp/api/abi-default/traffic_mngr.h | 8 +++----- include/odp/api/abi-default/version.h | 6 ++---- include/odp/api/align.h | 6 ++---- include/odp/api/atomic.h | 6 ++---- include/odp/api/barrier.h | 6 ++---- include/odp/api/buffer.h | 6 ++---- include/odp/api/buffer_types.h | 6 ++---- include/odp/api/byteorder.h | 6 ++---- include/odp/api/chksum.h | 6 ++---- include/odp/api/classification.h | 6 ++---- include/odp/api/comp.h | 6 ++---- include/odp/api/cpu.h | 6 ++---- include/odp/api/cpumask.h | 6 ++---- include/odp/api/crypto.h | 6 ++---- include/odp/api/crypto_types.h | 6 ++---- include/odp/api/debug.h | 6 ++---- include/odp/api/deprecated.h | 6 ++---- include/odp/api/dma.h | 6 ++---- include/odp/api/dma_types.h | 6 ++---- include/odp/api/errno.h | 6 ++---- include/odp/api/event.h | 6 ++---- include/odp/api/event_types.h | 6 ++---- include/odp/api/hash.h | 6 ++---- include/odp/api/hints.h | 6 ++---- include/odp/api/init.h | 6 ++---- include/odp/api/ipsec.h | 6 ++---- include/odp/api/ipsec_types.h | 6 ++---- include/odp/api/packet.h | 8 +++----- include/odp/api/packet_flags.h | 6 ++---- include/odp/api/packet_io.h | 6 ++---- include/odp/api/packet_io_stats.h | 6 ++---- include/odp/api/packet_io_types.h | 6 ++---- include/odp/api/packet_types.h | 6 ++---- include/odp/api/pool.h | 6 ++---- include/odp/api/pool_types.h | 6 ++---- include/odp/api/proto_stats.h | 6 ++---- include/odp/api/proto_stats_types.h | 6 ++---- include/odp/api/protocols.h | 6 ++---- include/odp/api/queue.h | 8 +++----- include/odp/api/queue_types.h | 6 ++---- include/odp/api/random.h | 6 ++---- include/odp/api/random_types.h | 6 ++---- include/odp/api/reassembly.h | 6 ++---- include/odp/api/rwlock.h | 6 ++---- include/odp/api/rwlock_recursive.h | 6 ++---- include/odp/api/schedule.h | 6 ++---- include/odp/api/schedule_types.h | 6 ++---- include/odp/api/shared_memory.h | 6 ++---- include/odp/api/spec/align.h | 6 ++---- include/odp/api/spec/atomic.h | 8 +++----- include/odp/api/spec/barrier.h | 6 ++---- include/odp/api/spec/buffer.h | 8 +++----- include/odp/api/spec/buffer_types.h | 8 +++----- include/odp/api/spec/byteorder.h | 6 ++---- include/odp/api/spec/chksum.h | 6 ++---- include/odp/api/spec/classification.h | 8 +++----- include/odp/api/spec/comp.h | 6 ++---- include/odp/api/spec/cpu.h | 6 ++---- include/odp/api/spec/cpumask.h | 8 +++----- include/odp/api/spec/crypto.h | 8 +++----- include/odp/api/spec/crypto_types.h | 8 +++----- include/odp/api/spec/debug.h | 6 ++---- include/odp/api/spec/deprecated.h.in | 6 ++---- include/odp/api/spec/dma.h | 6 ++---- include/odp/api/spec/dma_types.h | 6 ++---- include/odp/api/spec/errno.h | 6 ++---- include/odp/api/spec/event.h | 8 +++----- include/odp/api/spec/event_types.h | 8 +++----- include/odp/api/spec/hash.h | 6 ++---- include/odp/api/spec/hints.h | 6 ++---- include/odp/api/spec/init.h | 8 +++----- include/odp/api/spec/ipsec.h | 8 +++----- include/odp/api/spec/ipsec_types.h | 8 +++----- include/odp/api/spec/packet.h | 8 +++----- include/odp/api/spec/packet_flags.h | 8 +++----- include/odp/api/spec/packet_io.h | 8 +++----- include/odp/api/spec/packet_io_stats.h | 8 +++----- include/odp/api/spec/packet_io_types.h | 8 +++----- include/odp/api/spec/packet_types.h | 8 +++----- include/odp/api/spec/pool.h | 8 +++----- include/odp/api/spec/pool_types.h | 6 ++---- include/odp/api/spec/proto_stats.h | 6 ++---- include/odp/api/spec/proto_stats_types.h | 8 +++----- include/odp/api/spec/protocols.h | 6 ++---- include/odp/api/spec/queue.h | 6 ++---- include/odp/api/spec/queue_types.h | 6 ++---- include/odp/api/spec/random.h | 6 ++---- include/odp/api/spec/random_types.h | 8 +++----- include/odp/api/spec/reassembly.h | 6 ++---- include/odp/api/spec/rwlock.h | 6 ++---- include/odp/api/spec/rwlock_recursive.h | 6 ++---- include/odp/api/spec/schedule.h | 6 ++---- include/odp/api/spec/schedule_types.h | 6 ++---- include/odp/api/spec/shared_memory.h | 8 +++----- include/odp/api/spec/spinlock.h | 6 ++---- include/odp/api/spec/spinlock_recursive.h | 6 ++---- include/odp/api/spec/stash.h | 6 ++---- include/odp/api/spec/stash_types.h | 6 ++---- include/odp/api/spec/std.h | 8 +++----- include/odp/api/spec/std_types.h | 10 ++++------ include/odp/api/spec/system_info.h | 8 +++----- include/odp/api/spec/thread.h | 8 +++----- include/odp/api/spec/thread_types.h | 6 ++---- include/odp/api/spec/threshold.h | 6 ++---- include/odp/api/spec/thrmask.h | 6 ++---- include/odp/api/spec/ticketlock.h | 6 ++---- include/odp/api/spec/time.h | 8 +++----- include/odp/api/spec/time_types.h | 8 +++----- include/odp/api/spec/timer.h | 9 +++------ include/odp/api/spec/timer_types.h | 9 +++------ include/odp/api/spec/traffic_mngr.h | 10 ++++------ include/odp/api/spec/version.h.in | 8 +++----- include/odp/api/spinlock.h | 6 ++---- include/odp/api/spinlock_recursive.h | 6 ++---- include/odp/api/stash.h | 6 ++---- include/odp/api/stash_types.h | 6 ++---- include/odp/api/std.h | 6 ++---- include/odp/api/std_types.h | 6 ++---- include/odp/api/sync.h | 6 ++---- include/odp/api/system_info.h | 6 ++---- include/odp/api/thread.h | 6 ++---- include/odp/api/threshold.h | 6 ++---- include/odp/api/thrmask.h | 6 ++---- include/odp/api/ticketlock.h | 6 ++---- include/odp/api/time.h | 6 ++---- include/odp/api/time_types.h | 6 ++---- include/odp/api/timer.h | 6 ++---- include/odp/api/timer_types.h | 6 ++---- include/odp/api/traffic_mngr.h | 6 ++---- include/odp/api/version.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/align.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/atomic.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/barrier.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/buffer.h | 6 ++---- .../odp/arch/arm32-linux/odp/api/abi/buffer_types.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/byteorder.h | 6 ++---- .../odp/arch/arm32-linux/odp/api/abi/classification.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/comp.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/cpu.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/cpumask.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/crypto.h | 6 ++---- .../odp/arch/arm32-linux/odp/api/abi/crypto_types.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/debug.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/dma.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/dma_types.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/errno.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/event.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/event_types.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/hash.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/init.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/ipsec.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/ipsec_types.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/packet.h | 6 ++---- .../odp/arch/arm32-linux/odp/api/abi/packet_flags.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/packet_io.h | 6 ++---- .../odp/arch/arm32-linux/odp/api/abi/packet_io_types.h | 6 ++---- .../odp/arch/arm32-linux/odp/api/abi/packet_types.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/pool.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/pool_types.h | 6 ++---- .../arch/arm32-linux/odp/api/abi/proto_stats_types.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/queue.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/queue_types.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/random.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/rwlock.h | 6 ++---- .../arch/arm32-linux/odp/api/abi/rwlock_recursive.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/schedule.h | 6 ++---- .../odp/arch/arm32-linux/odp/api/abi/schedule_types.h | 6 ++---- .../odp/arch/arm32-linux/odp/api/abi/shared_memory.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/spinlock.h | 6 ++---- .../arch/arm32-linux/odp/api/abi/spinlock_recursive.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/stash.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/stash_types.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/std.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/std_types.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/sync.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/thread.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/thrmask.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/ticketlock.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/time.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/time_types.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/timer.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/timer_types.h | 6 ++---- .../odp/arch/arm32-linux/odp/api/abi/traffic_mngr.h | 6 ++---- include/odp/arch/arm32-linux/odp/api/abi/version.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/align.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/atomic.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/barrier.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/buffer.h | 6 ++---- .../odp/arch/arm64-linux/odp/api/abi/buffer_types.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/byteorder.h | 6 ++---- .../odp/arch/arm64-linux/odp/api/abi/classification.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/comp.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/cpu.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/cpumask.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/crypto.h | 6 ++---- .../odp/arch/arm64-linux/odp/api/abi/crypto_types.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/debug.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/dma.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/dma_types.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/errno.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/event.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/event_types.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/hash.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/init.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/ipsec.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/ipsec_types.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/packet.h | 6 ++---- .../odp/arch/arm64-linux/odp/api/abi/packet_flags.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/packet_io.h | 6 ++---- .../odp/arch/arm64-linux/odp/api/abi/packet_io_types.h | 6 ++---- .../odp/arch/arm64-linux/odp/api/abi/packet_types.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/pool.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/pool_types.h | 6 ++---- .../arch/arm64-linux/odp/api/abi/proto_stats_types.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/queue.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/queue_types.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/random.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/rwlock.h | 6 ++---- .../arch/arm64-linux/odp/api/abi/rwlock_recursive.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/schedule.h | 6 ++---- .../odp/arch/arm64-linux/odp/api/abi/schedule_types.h | 6 ++---- .../odp/arch/arm64-linux/odp/api/abi/shared_memory.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/spinlock.h | 6 ++---- .../arch/arm64-linux/odp/api/abi/spinlock_recursive.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/stash.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/stash_types.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/std.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/std_types.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/sync.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/thread.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/thrmask.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/ticketlock.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/time.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/time_types.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/timer.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/timer_types.h | 6 ++---- .../odp/arch/arm64-linux/odp/api/abi/traffic_mngr.h | 6 ++---- include/odp/arch/arm64-linux/odp/api/abi/version.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/align.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/atomic.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/barrier.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/buffer.h | 6 ++---- .../odp/arch/default-linux/odp/api/abi/buffer_types.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/byteorder.h | 6 ++---- .../arch/default-linux/odp/api/abi/classification.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/comp.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/cpu.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/cpumask.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/crypto.h | 6 ++---- .../odp/arch/default-linux/odp/api/abi/crypto_types.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/debug.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/dma.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/dma_types.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/errno.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/event.h | 6 ++---- .../odp/arch/default-linux/odp/api/abi/event_types.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/hash.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/init.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/ipsec.h | 6 ++---- .../odp/arch/default-linux/odp/api/abi/ipsec_types.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/packet.h | 6 ++---- .../odp/arch/default-linux/odp/api/abi/packet_flags.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/packet_io.h | 6 ++---- .../arch/default-linux/odp/api/abi/packet_io_types.h | 6 ++---- .../odp/arch/default-linux/odp/api/abi/packet_types.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/pool.h | 6 ++---- .../odp/arch/default-linux/odp/api/abi/pool_types.h | 6 ++---- .../arch/default-linux/odp/api/abi/proto_stats_types.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/queue.h | 6 ++---- .../odp/arch/default-linux/odp/api/abi/queue_types.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/random.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/rwlock.h | 6 ++---- .../arch/default-linux/odp/api/abi/rwlock_recursive.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/schedule.h | 6 ++---- .../arch/default-linux/odp/api/abi/schedule_types.h | 6 ++---- .../odp/arch/default-linux/odp/api/abi/shared_memory.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/spinlock.h | 6 ++---- .../default-linux/odp/api/abi/spinlock_recursive.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/stash.h | 6 ++---- .../odp/arch/default-linux/odp/api/abi/stash_types.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/std.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/std_types.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/sync.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/thread.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/thrmask.h | 6 ++---- .../odp/arch/default-linux/odp/api/abi/ticketlock.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/time.h | 6 ++---- .../odp/arch/default-linux/odp/api/abi/time_types.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/timer.h | 6 ++---- .../odp/arch/default-linux/odp/api/abi/timer_types.h | 6 ++---- .../odp/arch/default-linux/odp/api/abi/traffic_mngr.h | 6 ++---- include/odp/arch/default-linux/odp/api/abi/version.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/align.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/atomic.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/barrier.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/buffer.h | 6 ++---- .../odp/arch/power64-linux/odp/api/abi/buffer_types.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/byteorder.h | 6 ++---- .../arch/power64-linux/odp/api/abi/classification.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/comp.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/cpu.h | 8 +++----- include/odp/arch/power64-linux/odp/api/abi/cpumask.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/crypto.h | 6 ++---- .../odp/arch/power64-linux/odp/api/abi/crypto_types.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/debug.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/dma.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/dma_types.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/errno.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/event.h | 6 ++---- .../odp/arch/power64-linux/odp/api/abi/event_types.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/hash.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/init.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/ipsec.h | 6 ++---- .../odp/arch/power64-linux/odp/api/abi/ipsec_types.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/packet.h | 6 ++---- .../odp/arch/power64-linux/odp/api/abi/packet_flags.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/packet_io.h | 6 ++---- .../arch/power64-linux/odp/api/abi/packet_io_types.h | 6 ++---- .../odp/arch/power64-linux/odp/api/abi/packet_types.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/pool.h | 6 ++---- .../odp/arch/power64-linux/odp/api/abi/pool_types.h | 6 ++---- .../arch/power64-linux/odp/api/abi/proto_stats_types.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/queue.h | 6 ++---- .../odp/arch/power64-linux/odp/api/abi/queue_types.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/random.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/rwlock.h | 6 ++---- .../arch/power64-linux/odp/api/abi/rwlock_recursive.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/schedule.h | 6 ++---- .../arch/power64-linux/odp/api/abi/schedule_types.h | 6 ++---- .../odp/arch/power64-linux/odp/api/abi/shared_memory.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/spinlock.h | 6 ++---- .../power64-linux/odp/api/abi/spinlock_recursive.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/stash.h | 6 ++---- .../odp/arch/power64-linux/odp/api/abi/stash_types.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/std.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/std_types.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/sync.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/thread.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/thrmask.h | 6 ++---- .../odp/arch/power64-linux/odp/api/abi/ticketlock.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/time.h | 6 ++---- .../odp/arch/power64-linux/odp/api/abi/time_types.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/timer.h | 6 ++---- .../odp/arch/power64-linux/odp/api/abi/timer_types.h | 6 ++---- .../odp/arch/power64-linux/odp/api/abi/traffic_mngr.h | 6 ++---- include/odp/arch/power64-linux/odp/api/abi/version.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/align.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/atomic.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/barrier.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/buffer.h | 6 ++---- .../odp/arch/x86_32-linux/odp/api/abi/buffer_types.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/byteorder.h | 6 ++---- .../odp/arch/x86_32-linux/odp/api/abi/classification.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/comp.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/cpu.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/cpumask.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/crypto.h | 6 ++---- .../odp/arch/x86_32-linux/odp/api/abi/crypto_types.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/debug.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/dma.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/dma_types.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/errno.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/event.h | 6 ++---- .../odp/arch/x86_32-linux/odp/api/abi/event_types.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/hash.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/init.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/ipsec.h | 6 ++---- .../odp/arch/x86_32-linux/odp/api/abi/ipsec_types.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/packet.h | 6 ++---- .../odp/arch/x86_32-linux/odp/api/abi/packet_flags.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/packet_io.h | 6 ++---- .../arch/x86_32-linux/odp/api/abi/packet_io_types.h | 6 ++---- .../odp/arch/x86_32-linux/odp/api/abi/packet_types.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/pool.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/pool_types.h | 6 ++---- .../arch/x86_32-linux/odp/api/abi/proto_stats_types.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/queue.h | 6 ++---- .../odp/arch/x86_32-linux/odp/api/abi/queue_types.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/random.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/rwlock.h | 6 ++---- .../arch/x86_32-linux/odp/api/abi/rwlock_recursive.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/schedule.h | 6 ++---- .../odp/arch/x86_32-linux/odp/api/abi/schedule_types.h | 6 ++---- .../odp/arch/x86_32-linux/odp/api/abi/shared_memory.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/spinlock.h | 6 ++---- .../arch/x86_32-linux/odp/api/abi/spinlock_recursive.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/stash.h | 6 ++---- .../odp/arch/x86_32-linux/odp/api/abi/stash_types.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/std.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/std_types.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/sync.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/thread.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/thrmask.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/ticketlock.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/time.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/time_types.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/timer.h | 6 ++---- .../odp/arch/x86_32-linux/odp/api/abi/timer_types.h | 6 ++---- .../odp/arch/x86_32-linux/odp/api/abi/traffic_mngr.h | 6 ++---- include/odp/arch/x86_32-linux/odp/api/abi/version.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/align.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/atomic.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/barrier.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/buffer.h | 6 ++---- .../odp/arch/x86_64-linux/odp/api/abi/buffer_types.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/byteorder.h | 6 ++---- .../odp/arch/x86_64-linux/odp/api/abi/classification.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/comp.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/cpu.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/cpumask.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/crypto.h | 6 ++---- .../odp/arch/x86_64-linux/odp/api/abi/crypto_types.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/debug.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/dma.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/dma_types.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/errno.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/event.h | 6 ++---- .../odp/arch/x86_64-linux/odp/api/abi/event_types.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/hash.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/init.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/ipsec.h | 6 ++---- .../odp/arch/x86_64-linux/odp/api/abi/ipsec_types.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/packet.h | 6 ++---- .../odp/arch/x86_64-linux/odp/api/abi/packet_flags.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/packet_io.h | 6 ++---- .../arch/x86_64-linux/odp/api/abi/packet_io_types.h | 6 ++---- .../odp/arch/x86_64-linux/odp/api/abi/packet_types.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/pool.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/pool_types.h | 6 ++---- .../arch/x86_64-linux/odp/api/abi/proto_stats_types.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/queue.h | 6 ++---- .../odp/arch/x86_64-linux/odp/api/abi/queue_types.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/random.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/rwlock.h | 6 ++---- .../arch/x86_64-linux/odp/api/abi/rwlock_recursive.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/schedule.h | 6 ++---- .../odp/arch/x86_64-linux/odp/api/abi/schedule_types.h | 6 ++---- .../odp/arch/x86_64-linux/odp/api/abi/shared_memory.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/spinlock.h | 6 ++---- .../arch/x86_64-linux/odp/api/abi/spinlock_recursive.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/stash.h | 6 ++---- .../odp/arch/x86_64-linux/odp/api/abi/stash_types.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/std.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/std_types.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/sync.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/thread.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/thrmask.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/ticketlock.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/time.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/time_types.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/timer.h | 6 ++---- .../odp/arch/x86_64-linux/odp/api/abi/timer_types.h | 6 ++---- .../odp/arch/x86_64-linux/odp/api/abi/traffic_mngr.h | 6 ++---- include/odp/arch/x86_64-linux/odp/api/abi/version.h | 6 ++---- include/odp/visibility_begin.h | 6 ++---- include/odp/visibility_end.h | 6 ++---- include/odp_api.h | 6 ++---- 511 files changed, 1073 insertions(+), 2097 deletions(-) diff --git a/include/README b/include/README index 180ff62c7a..90498c7fa0 100644 --- a/include/README +++ b/include/README @@ -1,8 +1,6 @@ -Copyright (c) 2017, Linaro Limited -Copyright (c) 2023, Nokia -All rights reserved. - -SPDX-License-Identifier: BSD-3-Clause +SPDX-License-Identifier: BSD-3-Clause +Copyright (c) 2017 Linaro Limited +Copyright (c) 2023 Nokia # ODP specification diff --git a/include/odp/api/abi-default/align.h b/include/odp/api/abi-default/align.h index b3bbed1999..0fa058549d 100644 --- a/include/odp/api/abi-default/align.h +++ b/include/odp/api/abi-default/align.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/include/odp/api/abi-default/atomic.h b/include/odp/api/abi-default/atomic.h index ce454499c9..9999360fc4 100644 --- a/include/odp/api/abi-default/atomic.h +++ b/include/odp/api/abi-default/atomic.h @@ -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 */ /** diff --git a/include/odp/api/abi-default/barrier.h b/include/odp/api/abi-default/barrier.h index cff12c577d..ee0329a97a 100644 --- a/include/odp/api/abi-default/barrier.h +++ b/include/odp/api/abi-default/barrier.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/include/odp/api/abi-default/buffer.h b/include/odp/api/abi-default/buffer.h index 59b81186ba..dce3fcac3d 100644 --- a/include/odp/api/abi-default/buffer.h +++ b/include/odp/api/abi-default/buffer.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_ABI_BUFFER_H_ diff --git a/include/odp/api/abi-default/buffer_types.h b/include/odp/api/abi-default/buffer_types.h index f014661515..59588224f6 100644 --- a/include/odp/api/abi-default/buffer_types.h +++ b/include/odp/api/abi-default/buffer_types.h @@ -1,8 +1,6 @@ -/* 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 */ #ifndef ODP_ABI_BUFFER_TYPES_H_ diff --git a/include/odp/api/abi-default/byteorder.h b/include/odp/api/abi-default/byteorder.h index 66a721b932..a3a512598f 100644 --- a/include/odp/api/abi-default/byteorder.h +++ b/include/odp/api/abi-default/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/include/odp/api/abi-default/classification.h b/include/odp/api/abi-default/classification.h index 1e73f439ba..e7519329ae 100644 --- a/include/odp/api/abi-default/classification.h +++ b/include/odp/api/abi-default/classification.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_ABI_CLASSIFICATION_H_ diff --git a/include/odp/api/abi-default/comp.h b/include/odp/api/abi-default/comp.h index 8a1145af52..b5638eba8f 100644 --- a/include/odp/api/abi-default/comp.h +++ b/include/odp/api/abi-default/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/include/odp/api/abi-default/cpu.h b/include/odp/api/abi-default/cpu.h index 24e5351adc..7bc4442364 100644 --- a/include/odp/api/abi-default/cpu.h +++ b/include/odp/api/abi-default/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_ABI_CPU_H_ diff --git a/include/odp/api/abi-default/cpumask.h b/include/odp/api/abi-default/cpumask.h index 66445f7da6..bb7638f0c7 100644 --- a/include/odp/api/abi-default/cpumask.h +++ b/include/odp/api/abi-default/cpumask.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/include/odp/api/abi-default/crypto.h b/include/odp/api/abi-default/crypto.h index 0e9e8506a9..aa80587c49 100644 --- a/include/odp/api/abi-default/crypto.h +++ b/include/odp/api/abi-default/crypto.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 */ #ifndef ODP_ABI_CRYPTO_H_ diff --git a/include/odp/api/abi-default/crypto_types.h b/include/odp/api/abi-default/crypto_types.h index 4fa9a63a44..58898dfeaa 100644 --- a/include/odp/api/abi-default/crypto_types.h +++ b/include/odp/api/abi-default/crypto_types.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 */ #ifndef ODP_ABI_CRYPTO_TYPES_H_ diff --git a/include/odp/api/abi-default/debug.h b/include/odp/api/abi-default/debug.h index 2c498f71b3..5b196d5893 100644 --- a/include/odp/api/abi-default/debug.h +++ b/include/odp/api/abi-default/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/include/odp/api/abi-default/dma.h b/include/odp/api/abi-default/dma.h index e7e0ad9702..dcc67bc71c 100644 --- a/include/odp/api/abi-default/dma.h +++ b/include/odp/api/abi-default/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 */ #ifndef ODP_ABI_DMA_H_ diff --git a/include/odp/api/abi-default/dma_types.h b/include/odp/api/abi-default/dma_types.h index c2b0eca644..ce133661eb 100644 --- a/include/odp/api/abi-default/dma_types.h +++ b/include/odp/api/abi-default/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_ABI_DMA_TYPES_H_ diff --git a/include/odp/api/abi-default/errno.h b/include/odp/api/abi-default/errno.h index 6437930a0d..d8eee49fbd 100644 --- a/include/odp/api/abi-default/errno.h +++ b/include/odp/api/abi-default/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/include/odp/api/abi-default/event.h b/include/odp/api/abi-default/event.h index a1563ac9b0..295f8608d7 100644 --- a/include/odp/api/abi-default/event.h +++ b/include/odp/api/abi-default/event.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_ABI_EVENT_H_ diff --git a/include/odp/api/abi-default/event_types.h b/include/odp/api/abi-default/event_types.h index 0fa20e6920..7955e53b87 100644 --- a/include/odp/api/abi-default/event_types.h +++ b/include/odp/api/abi-default/event_types.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 */ #ifndef ODP_ABI_EVENT_TYPES_H_ diff --git a/include/odp/api/abi-default/hash.h b/include/odp/api/abi-default/hash.h index 06e9e06c44..9cd0fb03d3 100644 --- a/include/odp/api/abi-default/hash.h +++ b/include/odp/api/abi-default/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/include/odp/api/abi-default/init.h b/include/odp/api/abi-default/init.h index bab17f9ada..221567e247 100644 --- a/include/odp/api/abi-default/init.h +++ b/include/odp/api/abi-default/init.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/include/odp/api/abi-default/ipsec.h b/include/odp/api/abi-default/ipsec.h index 1cbc257a11..ab3d5b6431 100644 --- a/include/odp/api/abi-default/ipsec.h +++ b/include/odp/api/abi-default/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 */ #ifndef ODP_ABI_IPSEC_H_ diff --git a/include/odp/api/abi-default/ipsec_types.h b/include/odp/api/abi-default/ipsec_types.h index 94fac6a203..737f671538 100644 --- a/include/odp/api/abi-default/ipsec_types.h +++ b/include/odp/api/abi-default/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 */ #ifndef ODP_ABI_IPSEC_TYPES_H_ diff --git a/include/odp/api/abi-default/packet.h b/include/odp/api/abi-default/packet.h index 3f6e82c5c3..033f50ceab 100644 --- a/include/odp/api/abi-default/packet.h +++ b/include/odp/api/abi-default/packet.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_ABI_PACKET_H_ diff --git a/include/odp/api/abi-default/packet_flags.h b/include/odp/api/abi-default/packet_flags.h index 11001e9304..ee1e6ae11a 100644 --- a/include/odp/api/abi-default/packet_flags.h +++ b/include/odp/api/abi-default/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/include/odp/api/abi-default/packet_io.h b/include/odp/api/abi-default/packet_io.h index 3a2b53a9b5..f9b089778a 100644 --- a/include/odp/api/abi-default/packet_io.h +++ b/include/odp/api/abi-default/packet_io.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_ABI_PACKET_IO_H_ diff --git a/include/odp/api/abi-default/packet_io_types.h b/include/odp/api/abi-default/packet_io_types.h index 1c4785c461..c13dd97e51 100644 --- a/include/odp/api/abi-default/packet_io_types.h +++ b/include/odp/api/abi-default/packet_io_types.h @@ -1,8 +1,6 @@ -/* 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 */ /** diff --git a/include/odp/api/abi-default/packet_types.h b/include/odp/api/abi-default/packet_types.h index 73cfdcafaa..300eaf177e 100644 --- a/include/odp/api/abi-default/packet_types.h +++ b/include/odp/api/abi-default/packet_types.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_ABI_PACKET_TYPES_H_ diff --git a/include/odp/api/abi-default/pool.h b/include/odp/api/abi-default/pool.h index a61706e193..dd2f66ac5c 100644 --- a/include/odp/api/abi-default/pool.h +++ b/include/odp/api/abi-default/pool.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_ABI_POOL_H_ diff --git a/include/odp/api/abi-default/pool_types.h b/include/odp/api/abi-default/pool_types.h index dde7f723ba..e4ca404229 100644 --- a/include/odp/api/abi-default/pool_types.h +++ b/include/odp/api/abi-default/pool_types.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 */ #ifndef ODP_ABI_POOL_TYPES_H_ diff --git a/include/odp/api/abi-default/proto_stats.h b/include/odp/api/abi-default/proto_stats.h index dd7ff09b77..9b31477628 100644 --- a/include/odp/api/abi-default/proto_stats.h +++ b/include/odp/api/abi-default/proto_stats.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Marvell - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Marvell */ #ifndef ODP_ABI_PROTO_STATS_H_ diff --git a/include/odp/api/abi-default/proto_stats_types.h b/include/odp/api/abi-default/proto_stats_types.h index 2e8e4aeef3..0d87012f3d 100644 --- a/include/odp/api/abi-default/proto_stats_types.h +++ b/include/odp/api/abi-default/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 */ #ifndef ODP_ABI_PROTO_STATS_TYPES_H_ diff --git a/include/odp/api/abi-default/queue.h b/include/odp/api/abi-default/queue.h index f74080dbb7..5ad307801a 100644 --- a/include/odp/api/abi-default/queue.h +++ b/include/odp/api/abi-default/queue.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_ABI_QUEUE_H_ diff --git a/include/odp/api/abi-default/queue_types.h b/include/odp/api/abi-default/queue_types.h index bf98621495..5a1dc40d9f 100644 --- a/include/odp/api/abi-default/queue_types.h +++ b/include/odp/api/abi-default/queue_types.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_ABI_QUEUE_TYPES_H_ diff --git a/include/odp/api/abi-default/random.h b/include/odp/api/abi-default/random.h index b997240d11..b99419155f 100644 --- a/include/odp/api/abi-default/random.h +++ b/include/odp/api/abi-default/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 */ #ifndef ODP_ABI_RANDOM_H_ diff --git a/include/odp/api/abi-default/rwlock.h b/include/odp/api/abi-default/rwlock.h index 219e1c5831..300108e672 100644 --- a/include/odp/api/abi-default/rwlock.h +++ b/include/odp/api/abi-default/rwlock.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/include/odp/api/abi-default/rwlock_recursive.h b/include/odp/api/abi-default/rwlock_recursive.h index 66a52c1945..eb5c000c0f 100644 --- a/include/odp/api/abi-default/rwlock_recursive.h +++ b/include/odp/api/abi-default/rwlock_recursive.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/include/odp/api/abi-default/schedule.h b/include/odp/api/abi-default/schedule.h index 89b92297b4..73c51a7c6d 100644 --- a/include/odp/api/abi-default/schedule.h +++ b/include/odp/api/abi-default/schedule.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 */ #ifndef ODP_ABI_SCHEDULE_H_ diff --git a/include/odp/api/abi-default/schedule_types.h b/include/odp/api/abi-default/schedule_types.h index 5e91c6e617..45366ffa6f 100644 --- a/include/odp/api/abi-default/schedule_types.h +++ b/include/odp/api/abi-default/schedule_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/include/odp/api/abi-default/shared_memory.h b/include/odp/api/abi-default/shared_memory.h index 4668927cdb..f4930da274 100644 --- a/include/odp/api/abi-default/shared_memory.h +++ b/include/odp/api/abi-default/shared_memory.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_ABI_SHM_H_ diff --git a/include/odp/api/abi-default/spinlock.h b/include/odp/api/abi-default/spinlock.h index 52af523cee..68f8aa8aac 100644 --- a/include/odp/api/abi-default/spinlock.h +++ b/include/odp/api/abi-default/spinlock.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/include/odp/api/abi-default/spinlock_recursive.h b/include/odp/api/abi-default/spinlock_recursive.h index 38efd1b382..6f80680335 100644 --- a/include/odp/api/abi-default/spinlock_recursive.h +++ b/include/odp/api/abi-default/spinlock_recursive.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/include/odp/api/abi-default/stash.h b/include/odp/api/abi-default/stash.h index db4469124c..ec9316e683 100644 --- a/include/odp/api/abi-default/stash.h +++ b/include/odp/api/abi-default/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 */ #ifndef ODP_ABI_STASH_H_ diff --git a/include/odp/api/abi-default/stash_types.h b/include/odp/api/abi-default/stash_types.h index 30bc3ca5fd..10db242d3a 100644 --- a/include/odp/api/abi-default/stash_types.h +++ b/include/odp/api/abi-default/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 */ #ifndef ODP_ABI_STASH_TYPES_H_ diff --git a/include/odp/api/abi-default/std.h b/include/odp/api/abi-default/std.h index 2500af800e..7de653653f 100644 --- a/include/odp/api/abi-default/std.h +++ b/include/odp/api/abi-default/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 */ #ifndef ODP_ABI_STD_H_ diff --git a/include/odp/api/abi-default/std_types.h b/include/odp/api/abi-default/std_types.h index df7bd8db53..cb8c4230fe 100644 --- a/include/odp/api/abi-default/std_types.h +++ b/include/odp/api/abi-default/std_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 */ #ifndef ODP_ABI_STD_TYPES_H_ diff --git a/include/odp/api/abi-default/sync.h b/include/odp/api/abi-default/sync.h index 1609dbf78b..862081a508 100644 --- a/include/odp/api/abi-default/sync.h +++ b/include/odp/api/abi-default/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/include/odp/api/abi-default/thread.h b/include/odp/api/abi-default/thread.h index e31651a267..3113278d3f 100644 --- a/include/odp/api/abi-default/thread.h +++ b/include/odp/api/abi-default/thread.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/include/odp/api/abi-default/thrmask.h b/include/odp/api/abi-default/thrmask.h index 5aa9b55704..a5aff670ba 100644 --- a/include/odp/api/abi-default/thrmask.h +++ b/include/odp/api/abi-default/thrmask.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/include/odp/api/abi-default/ticketlock.h b/include/odp/api/abi-default/ticketlock.h index 77e11f7788..d8489ad9dc 100644 --- a/include/odp/api/abi-default/ticketlock.h +++ b/include/odp/api/abi-default/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/include/odp/api/abi-default/time.h b/include/odp/api/abi-default/time.h index e601e6fd2d..e8af62c0fb 100644 --- a/include/odp/api/abi-default/time.h +++ b/include/odp/api/abi-default/time.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_ABI_TIME_H_ diff --git a/include/odp/api/abi-default/time_types.h b/include/odp/api/abi-default/time_types.h index 4b7ec47eb0..32d9384ddc 100644 --- a/include/odp/api/abi-default/time_types.h +++ b/include/odp/api/abi-default/time_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 */ #ifndef ODP_ABI_TIME_TYPES_H_ diff --git a/include/odp/api/abi-default/timer.h b/include/odp/api/abi-default/timer.h index faf690ae34..39b71c6a36 100644 --- a/include/odp/api/abi-default/timer.h +++ b/include/odp/api/abi-default/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 */ #ifndef ODP_ABI_TIMER_H_ diff --git a/include/odp/api/abi-default/timer_types.h b/include/odp/api/abi-default/timer_types.h index a653dcbaa5..89b237fdb8 100644 --- a/include/odp/api/abi-default/timer_types.h +++ b/include/odp/api/abi-default/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/include/odp/api/abi-default/traffic_mngr.h b/include/odp/api/abi-default/traffic_mngr.h index 78985313df..32a0ab473d 100644 --- a/include/odp/api/abi-default/traffic_mngr.h +++ b/include/odp/api/abi-default/traffic_mngr.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2022, Marvell - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2015-2018 Linaro Limited + * Copyright (c) 2022 Marvell */ /** diff --git a/include/odp/api/abi-default/version.h b/include/odp/api/abi-default/version.h index 59cf324083..f150586235 100644 --- a/include/odp/api/abi-default/version.h +++ b/include/odp/api/abi-default/version.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 */ #ifndef ODP_ABI_VERSION_H_ diff --git a/include/odp/api/align.h b/include/odp/api/align.h index 4364d58392..c003b714de 100644 --- a/include/odp/api/align.h +++ b/include/odp/api/align.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/include/odp/api/atomic.h b/include/odp/api/atomic.h index a81b9abbfd..7f79256e80 100644 --- a/include/odp/api/atomic.h +++ b/include/odp/api/atomic.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/include/odp/api/barrier.h b/include/odp/api/barrier.h index 95dc808fbe..768b66c0df 100644 --- a/include/odp/api/barrier.h +++ b/include/odp/api/barrier.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/include/odp/api/buffer.h b/include/odp/api/buffer.h index a56cd06601..13a31d1694 100644 --- a/include/odp/api/buffer.h +++ b/include/odp/api/buffer.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/include/odp/api/buffer_types.h b/include/odp/api/buffer_types.h index 767aae5609..73d2294be8 100644 --- a/include/odp/api/buffer_types.h +++ b/include/odp/api/buffer_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 */ /** diff --git a/include/odp/api/byteorder.h b/include/odp/api/byteorder.h index 6f33a84e64..39857381f3 100644 --- a/include/odp/api/byteorder.h +++ b/include/odp/api/byteorder.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/include/odp/api/chksum.h b/include/odp/api/chksum.h index 591534e46e..39cb08f7c3 100644 --- a/include/odp/api/chksum.h +++ b/include/odp/api/chksum.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/include/odp/api/classification.h b/include/odp/api/classification.h index baa1886631..5a14a9e79e 100644 --- a/include/odp/api/classification.h +++ b/include/odp/api/classification.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/include/odp/api/comp.h b/include/odp/api/comp.h index 300d12a61c..fa14d4631c 100644 --- a/include/odp/api/comp.h +++ b/include/odp/api/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 */ /** diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h index 08a0536ec9..43729b5abe 100644 --- a/include/odp/api/cpu.h +++ b/include/odp/api/cpu.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/include/odp/api/cpumask.h b/include/odp/api/cpumask.h index f5649106f1..6628882886 100644 --- a/include/odp/api/cpumask.h +++ b/include/odp/api/cpumask.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/include/odp/api/crypto.h b/include/odp/api/crypto.h index 3363045531..ce9d0f26ac 100644 --- a/include/odp/api/crypto.h +++ b/include/odp/api/crypto.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/include/odp/api/crypto_types.h b/include/odp/api/crypto_types.h index 225ff7df0a..922410c11c 100644 --- a/include/odp/api/crypto_types.h +++ b/include/odp/api/crypto_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/include/odp/api/debug.h b/include/odp/api/debug.h index 8369148011..a9eccbc43c 100644 --- a/include/odp/api/debug.h +++ b/include/odp/api/debug.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/include/odp/api/deprecated.h b/include/odp/api/deprecated.h index 992330ee1c..afa2dd4e73 100644 --- a/include/odp/api/deprecated.h +++ b/include/odp/api/deprecated.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/include/odp/api/dma.h b/include/odp/api/dma.h index 10e00a5063..20f079859a 100644 --- a/include/odp/api/dma.h +++ b/include/odp/api/dma.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/include/odp/api/dma_types.h b/include/odp/api/dma_types.h index eeaa7bee83..c6aedcd499 100644 --- a/include/odp/api/dma_types.h +++ b/include/odp/api/dma_types.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/include/odp/api/errno.h b/include/odp/api/errno.h index 212e51244d..4b37dbf603 100644 --- a/include/odp/api/errno.h +++ b/include/odp/api/errno.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/include/odp/api/event.h b/include/odp/api/event.h index 73774a6037..26fb9b97dd 100644 --- a/include/odp/api/event.h +++ b/include/odp/api/event.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/include/odp/api/event_types.h b/include/odp/api/event_types.h index a4d20a3418..8254583d7e 100644 --- a/include/odp/api/event_types.h +++ b/include/odp/api/event_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/include/odp/api/hash.h b/include/odp/api/hash.h index f059d51ce9..135fd2aef1 100644 --- a/include/odp/api/hash.h +++ b/include/odp/api/hash.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/include/odp/api/hints.h b/include/odp/api/hints.h index 4b1c61ca9f..bcd2780d17 100644 --- a/include/odp/api/hints.h +++ b/include/odp/api/hints.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/include/odp/api/init.h b/include/odp/api/init.h index 50a880a897..259c6f765a 100644 --- a/include/odp/api/init.h +++ b/include/odp/api/init.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/include/odp/api/ipsec.h b/include/odp/api/ipsec.h index 8116610b46..b61edaa6a9 100644 --- a/include/odp/api/ipsec.h +++ b/include/odp/api/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/include/odp/api/ipsec_types.h b/include/odp/api/ipsec_types.h index 9954f72158..ddbf04ed12 100644 --- a/include/odp/api/ipsec_types.h +++ b/include/odp/api/ipsec_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/include/odp/api/packet.h b/include/odp/api/packet.h index 1f04c026de..e5733595f8 100644 --- a/include/odp/api/packet.h +++ b/include/odp/api/packet.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 */ /** diff --git a/include/odp/api/packet_flags.h b/include/odp/api/packet_flags.h index c106634793..15e0852703 100644 --- a/include/odp/api/packet_flags.h +++ b/include/odp/api/packet_flags.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/include/odp/api/packet_io.h b/include/odp/api/packet_io.h index 9959d96fc7..5f3e9d3e3c 100644 --- a/include/odp/api/packet_io.h +++ b/include/odp/api/packet_io.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/include/odp/api/packet_io_stats.h b/include/odp/api/packet_io_stats.h index 40d0ae58cf..fa16ae290f 100644 --- a/include/odp/api/packet_io_stats.h +++ b/include/odp/api/packet_io_stats.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/include/odp/api/packet_io_types.h b/include/odp/api/packet_io_types.h index 2f221b7b4b..c5fd72e96d 100644 --- a/include/odp/api/packet_io_types.h +++ b/include/odp/api/packet_io_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/include/odp/api/packet_types.h b/include/odp/api/packet_types.h index 678f3519cf..6478102591 100644 --- a/include/odp/api/packet_types.h +++ b/include/odp/api/packet_types.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/include/odp/api/pool.h b/include/odp/api/pool.h index 9e2fe2b05a..0f4dfab278 100644 --- a/include/odp/api/pool.h +++ b/include/odp/api/pool.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/include/odp/api/pool_types.h b/include/odp/api/pool_types.h index 18d5dd9d5b..d2b88c3329 100644 --- a/include/odp/api/pool_types.h +++ b/include/odp/api/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/include/odp/api/proto_stats.h b/include/odp/api/proto_stats.h index bceaeaac93..2f16dfbf03 100644 --- a/include/odp/api/proto_stats.h +++ b/include/odp/api/proto_stats.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Marvell - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Marvell */ /** diff --git a/include/odp/api/proto_stats_types.h b/include/odp/api/proto_stats_types.h index b12a0f34fd..c6bae08426 100644 --- a/include/odp/api/proto_stats_types.h +++ b/include/odp/api/proto_stats_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 */ /** diff --git a/include/odp/api/protocols.h b/include/odp/api/protocols.h index b5f3742a4b..232e96904c 100644 --- a/include/odp/api/protocols.h +++ b/include/odp/api/protocols.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/include/odp/api/queue.h b/include/odp/api/queue.h index 666d5eaf94..b3728f1aba 100644 --- a/include/odp/api/queue.h +++ b/include/odp/api/queue.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 */ /** diff --git a/include/odp/api/queue_types.h b/include/odp/api/queue_types.h index 7c9a83bfe0..3aefdb3d01 100644 --- a/include/odp/api/queue_types.h +++ b/include/odp/api/queue_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 */ /** diff --git a/include/odp/api/random.h b/include/odp/api/random.h index 2576949188..27cd593b0d 100644 --- a/include/odp/api/random.h +++ b/include/odp/api/random.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/include/odp/api/random_types.h b/include/odp/api/random_types.h index c9ed2cc041..2b90f61ee4 100644 --- a/include/odp/api/random_types.h +++ b/include/odp/api/random_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/include/odp/api/reassembly.h b/include/odp/api/reassembly.h index 153fd6a125..2d52f6e153 100644 --- a/include/odp/api/reassembly.h +++ b/include/odp/api/reassembly.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Marvell - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Marvell */ /** diff --git a/include/odp/api/rwlock.h b/include/odp/api/rwlock.h index 2240c187e9..ca852a5bea 100644 --- a/include/odp/api/rwlock.h +++ b/include/odp/api/rwlock.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/include/odp/api/rwlock_recursive.h b/include/odp/api/rwlock_recursive.h index 4be8a571f0..2889754765 100644 --- a/include/odp/api/rwlock_recursive.h +++ b/include/odp/api/rwlock_recursive.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/include/odp/api/schedule.h b/include/odp/api/schedule.h index 4d97634b83..1a0e312763 100644 --- a/include/odp/api/schedule.h +++ b/include/odp/api/schedule.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/include/odp/api/schedule_types.h b/include/odp/api/schedule_types.h index ced5752ba7..1b415b578b 100644 --- a/include/odp/api/schedule_types.h +++ b/include/odp/api/schedule_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/include/odp/api/shared_memory.h b/include/odp/api/shared_memory.h index 988c30f023..a08f84cc44 100644 --- a/include/odp/api/shared_memory.h +++ b/include/odp/api/shared_memory.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/include/odp/api/spec/align.h b/include/odp/api/spec/align.h index 99f8f1db04..d5e5910aad 100644 --- a/include/odp/api/spec/align.h +++ b/include/odp/api/spec/align.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/include/odp/api/spec/atomic.h b/include/odp/api/spec/atomic.h index a77527e850..3a098ead17 100644 --- a/include/odp/api/spec/atomic.h +++ b/include/odp/api/spec/atomic.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-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) 2013-2018 Linaro Limited + * Copyright (c) 2021 ARM Limited */ /** diff --git a/include/odp/api/spec/barrier.h b/include/odp/api/spec/barrier.h index 2f90fc2c5f..e83d46c350 100644 --- a/include/odp/api/spec/barrier.h +++ b/include/odp/api/spec/barrier.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/include/odp/api/spec/buffer.h b/include/odp/api/spec/buffer.h index dd3749afea..11750136d4 100644 --- a/include/odp/api/spec/buffer.h +++ b/include/odp/api/spec/buffer.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-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) 2013-2018 Linaro Limited + * Copyright (c) 2022-2023 Nokia */ /** diff --git a/include/odp/api/spec/buffer_types.h b/include/odp/api/spec/buffer_types.h index 7a7bc770f7..7b0e80584c 100644 --- a/include/odp/api/spec/buffer_types.h +++ b/include/odp/api/spec/buffer_types.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 */ /** diff --git a/include/odp/api/spec/byteorder.h b/include/odp/api/spec/byteorder.h index 29856b400f..65d2e722aa 100644 --- a/include/odp/api/spec/byteorder.h +++ b/include/odp/api/spec/byteorder.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/include/odp/api/spec/chksum.h b/include/odp/api/spec/chksum.h index 4e40bf55a6..800aab2c20 100644 --- a/include/odp/api/spec/chksum.h +++ b/include/odp/api/spec/chksum.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/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index 4d5bff3375..1504d1961f 100644 --- a/include/odp/api/spec/classification.h +++ b/include/odp/api/spec/classification.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/include/odp/api/spec/comp.h b/include/odp/api/spec/comp.h index 2a04927883..49ccf4509c 100644 --- a/include/odp/api/spec/comp.h +++ b/include/odp/api/spec/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 */ /** diff --git a/include/odp/api/spec/cpu.h b/include/odp/api/spec/cpu.h index bacd0fac55..9550354fae 100644 --- a/include/odp/api/spec/cpu.h +++ b/include/odp/api/spec/cpu.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/include/odp/api/spec/cpumask.h b/include/odp/api/spec/cpumask.h index 6b3185bad5..a6c08e6c02 100644 --- a/include/odp/api/spec/cpumask.h +++ b/include/odp/api/spec/cpumask.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 */ /** diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 453eb9eeba..1feb4dba6a 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.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/include/odp/api/spec/crypto_types.h b/include/odp/api/spec/crypto_types.h index 8b7c3b3823..565951221a 100644 --- a/include/odp/api/spec/crypto_types.h +++ b/include/odp/api/spec/crypto_types.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/include/odp/api/spec/debug.h b/include/odp/api/spec/debug.h index 1bc0caf566..0cf5179a81 100644 --- a/include/odp/api/spec/debug.h +++ b/include/odp/api/spec/debug.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 */ /** * @file diff --git a/include/odp/api/spec/deprecated.h.in b/include/odp/api/spec/deprecated.h.in index ae7ae53bee..d062842c1b 100644 --- a/include/odp/api/spec/deprecated.h.in +++ b/include/odp/api/spec/deprecated.h.in @@ -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/include/odp/api/spec/dma.h b/include/odp/api/spec/dma.h index 658b31058a..5303dc03fd 100644 --- a/include/odp/api/spec/dma.h +++ b/include/odp/api/spec/dma.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/include/odp/api/spec/dma_types.h b/include/odp/api/spec/dma_types.h index 5e18faab28..0a0e267df1 100644 --- a/include/odp/api/spec/dma_types.h +++ b/include/odp/api/spec/dma_types.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/include/odp/api/spec/errno.h b/include/odp/api/spec/errno.h index 98884da019..85c002e2bd 100644 --- a/include/odp/api/spec/errno.h +++ b/include/odp/api/spec/errno.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/include/odp/api/spec/event.h b/include/odp/api/spec/event.h index 65b5dd7ff4..a8737d3a58 100644 --- a/include/odp/api/spec/event.h +++ b/include/odp/api/spec/event.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/include/odp/api/spec/event_types.h b/include/odp/api/spec/event_types.h index 4891192473..9df5e03ef6 100644 --- a/include/odp/api/spec/event_types.h +++ b/include/odp/api/spec/event_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/include/odp/api/spec/hash.h b/include/odp/api/spec/hash.h index 560f515a98..cb4f3241ab 100644 --- a/include/odp/api/spec/hash.h +++ b/include/odp/api/spec/hash.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/include/odp/api/spec/hints.h b/include/odp/api/spec/hints.h index 55ddf84181..032b483df0 100644 --- a/include/odp/api/spec/hints.h +++ b/include/odp/api/spec/hints.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/include/odp/api/spec/init.h b/include/odp/api/spec/init.h index 3712222674..f0491ad5b6 100644 --- a/include/odp/api/spec/init.h +++ b/include/odp/api/spec/init.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/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 603bf3aef1..b66e9a1caa 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -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 */ /** diff --git a/include/odp/api/spec/ipsec_types.h b/include/odp/api/spec/ipsec_types.h index 4ee7b36490..00fd944f5f 100644 --- a/include/odp/api/spec/ipsec_types.h +++ b/include/odp/api/spec/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/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 267bf819c7..187aedbb94 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.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/include/odp/api/spec/packet_flags.h b/include/odp/api/spec/packet_flags.h index c62e50885b..3bbd8f3314 100644 --- a/include/odp/api/spec/packet_flags.h +++ b/include/odp/api/spec/packet_flags.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 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) 2023 Nokia */ /** diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index 54aa2214b5..d653ad72d8 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-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) 2013-2018 Linaro Limited + * Copyright (c) 2020-2022 Nokia */ /** diff --git a/include/odp/api/spec/packet_io_stats.h b/include/odp/api/spec/packet_io_stats.h index bd39088678..d711d75f70 100644 --- a/include/odp/api/spec/packet_io_stats.h +++ b/include/odp/api/spec/packet_io_stats.h @@ -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 */ /** diff --git a/include/odp/api/spec/packet_io_types.h b/include/odp/api/spec/packet_io_types.h index fcdf49eb4e..47b77b9383 100644 --- a/include/odp/api/spec/packet_io_types.h +++ b/include/odp/api/spec/packet_io_types.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 */ /** diff --git a/include/odp/api/spec/packet_types.h b/include/odp/api/spec/packet_types.h index 5114582ab0..ee62de4ff0 100644 --- a/include/odp/api/spec/packet_types.h +++ b/include/odp/api/spec/packet_types.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/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index e51ce0b0df..4fade6470a 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.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/include/odp/api/spec/pool_types.h b/include/odp/api/spec/pool_types.h index 81974abc62..7820349efd 100644 --- a/include/odp/api/spec/pool_types.h +++ b/include/odp/api/spec/pool_types.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/include/odp/api/spec/proto_stats.h b/include/odp/api/spec/proto_stats.h index 0957c9e0ec..1a1f678862 100644 --- a/include/odp/api/spec/proto_stats.h +++ b/include/odp/api/spec/proto_stats.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Marvell - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Marvell */ /** diff --git a/include/odp/api/spec/proto_stats_types.h b/include/odp/api/spec/proto_stats_types.h index ff5f352b9c..f3ca804262 100644 --- a/include/odp/api/spec/proto_stats_types.h +++ b/include/odp/api/spec/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/include/odp/api/spec/protocols.h b/include/odp/api/spec/protocols.h index 95c9bc0ed9..104002937b 100644 --- a/include/odp/api/spec/protocols.h +++ b/include/odp/api/spec/protocols.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/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h index 0315d13129..32d13b0bcc 100644 --- a/include/odp/api/spec/queue.h +++ b/include/odp/api/spec/queue.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/include/odp/api/spec/queue_types.h b/include/odp/api/spec/queue_types.h index 384761e874..6dd31e6813 100644 --- a/include/odp/api/spec/queue_types.h +++ b/include/odp/api/spec/queue_types.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/include/odp/api/spec/random.h b/include/odp/api/spec/random.h index e90a577374..dd30f9d48e 100644 --- a/include/odp/api/spec/random.h +++ b/include/odp/api/spec/random.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/include/odp/api/spec/random_types.h b/include/odp/api/spec/random_types.h index e098394be1..cb7dccc7c3 100644 --- a/include/odp/api/spec/random_types.h +++ b/include/odp/api/spec/random_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/include/odp/api/spec/reassembly.h b/include/odp/api/spec/reassembly.h index 7ec49d220b..6f1b223900 100644 --- a/include/odp/api/spec/reassembly.h +++ b/include/odp/api/spec/reassembly.h @@ -1,7 +1,5 @@ -/* Copyright (c) 2021, Marvell - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2021 Marvell */ /** diff --git a/include/odp/api/spec/rwlock.h b/include/odp/api/spec/rwlock.h index aa9a0e3ad4..de749add8a 100644 --- a/include/odp/api/spec/rwlock.h +++ b/include/odp/api/spec/rwlock.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 */ #ifndef ODP_API_SPEC_RWLOCK_H_ diff --git a/include/odp/api/spec/rwlock_recursive.h b/include/odp/api/spec/rwlock_recursive.h index bec4a350e8..6b4afcbbe8 100644 --- a/include/odp/api/spec/rwlock_recursive.h +++ b/include/odp/api/spec/rwlock_recursive.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/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h index 9aa898ccca..31da38e4dd 100644 --- a/include/odp/api/spec/schedule.h +++ b/include/odp/api/spec/schedule.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/include/odp/api/spec/schedule_types.h b/include/odp/api/spec/schedule_types.h index aafc525134..5e2f5a2dae 100644 --- a/include/odp/api/spec/schedule_types.h +++ b/include/odp/api/spec/schedule_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/include/odp/api/spec/shared_memory.h b/include/odp/api/spec/shared_memory.h index 52fbd7ae90..3845f6e4d4 100644 --- a/include/odp/api/spec/shared_memory.h +++ b/include/odp/api/spec/shared_memory.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/include/odp/api/spec/spinlock.h b/include/odp/api/spec/spinlock.h index b156bd91ba..a71c83c527 100644 --- a/include/odp/api/spec/spinlock.h +++ b/include/odp/api/spec/spinlock.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/include/odp/api/spec/spinlock_recursive.h b/include/odp/api/spec/spinlock_recursive.h index e5c9824884..bc42f1ce17 100644 --- a/include/odp/api/spec/spinlock_recursive.h +++ b/include/odp/api/spec/spinlock_recursive.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/include/odp/api/spec/stash.h b/include/odp/api/spec/stash.h index 2453ed6bbb..756214abe4 100644 --- a/include/odp/api/spec/stash.h +++ b/include/odp/api/spec/stash.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/include/odp/api/spec/stash_types.h b/include/odp/api/spec/stash_types.h index 3e6e966be7..96e136d788 100644 --- a/include/odp/api/spec/stash_types.h +++ b/include/odp/api/spec/stash_types.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/include/odp/api/spec/std.h b/include/odp/api/spec/std.h index 0341f734e3..fba1ee31dd 100644 --- a/include/odp/api/spec/std.h +++ b/include/odp/api/spec/std.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/include/odp/api/spec/std_types.h b/include/odp/api/spec/std_types.h index accbd81d8d..e2630e0442 100644 --- a/include/odp/api/spec/std_types.h +++ b/include/odp/api/spec/std_types.h @@ -1,9 +1,7 @@ -/* Copyright (c) 2013-2018, Linaro Limited - * 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) 2013-2018 Linaro Limited + * Copyright (c) 2021 ARM Limited + * Copyright (c) 2021 Nokia */ /** diff --git a/include/odp/api/spec/system_info.h b/include/odp/api/spec/system_info.h index 118d8f8952..e3420ea8e1 100644 --- a/include/odp/api/spec/system_info.h +++ b/include/odp/api/spec/system_info.h @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-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) 2013-2018 Linaro Limited + * Copyright (c) 2020-2021 Nokia */ /** diff --git a/include/odp/api/spec/thread.h b/include/odp/api/spec/thread.h index 0d85b34328..d595a95631 100644 --- a/include/odp/api/spec/thread.h +++ b/include/odp/api/spec/thread.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 */ /** diff --git a/include/odp/api/spec/thread_types.h b/include/odp/api/spec/thread_types.h index 5a59223edd..60cf4897b0 100644 --- a/include/odp/api/spec/thread_types.h +++ b/include/odp/api/spec/thread_types.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 */ /** diff --git a/include/odp/api/spec/threshold.h b/include/odp/api/spec/threshold.h index f9100cb99b..732da72744 100644 --- a/include/odp/api/spec/threshold.h +++ b/include/odp/api/spec/threshold.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/include/odp/api/spec/thrmask.h b/include/odp/api/spec/thrmask.h index 12d1d70a75..725690e9e4 100644 --- a/include/odp/api/spec/thrmask.h +++ b/include/odp/api/spec/thrmask.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/include/odp/api/spec/ticketlock.h b/include/odp/api/spec/ticketlock.h index 0d5d67a886..2a14273ee2 100644 --- a/include/odp/api/spec/ticketlock.h +++ b/include/odp/api/spec/ticketlock.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/include/odp/api/spec/time.h b/include/odp/api/spec/time.h index f4496c4c73..54ab5f19a8 100644 --- a/include/odp/api/spec/time.h +++ b/include/odp/api/spec/time.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 */ /** diff --git a/include/odp/api/spec/time_types.h b/include/odp/api/spec/time_types.h index 9065b80044..5f56857454 100644 --- a/include/odp/api/spec/time_types.h +++ b/include/odp/api/spec/time_types.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 */ /** diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h index a6ad6f2b36..203031c3cf 100644 --- a/include/odp/api/spec/timer.h +++ b/include/odp/api/spec/timer.h @@ -1,9 +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/include/odp/api/spec/timer_types.h b/include/odp/api/spec/timer_types.h index f1e1993523..2b088693c5 100644 --- a/include/odp/api/spec/timer_types.h +++ b/include/odp/api/spec/timer_types.h @@ -1,9 +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/include/odp/api/spec/traffic_mngr.h b/include/odp/api/spec/traffic_mngr.h index 2331cc1332..117ed22cd6 100644 --- a/include/odp/api/spec/traffic_mngr.h +++ b/include/odp/api/spec/traffic_mngr.h @@ -1,9 +1,7 @@ -/* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2021-2022, Nokia - * Copyright (c) 2022, Marvell - * 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 + * Copyright (c) 2022 Marvell */ #ifndef ODP_API_SPEC_TRAFFIC_MNGR_H_ diff --git a/include/odp/api/spec/version.h.in b/include/odp/api/spec/version.h.in index f07a9125ff..19c5f2ec16 100644 --- a/include/odp/api/spec/version.h.in +++ b/include/odp/api/spec/version.h.in @@ -1,8 +1,6 @@ -/* Copyright (c) 2013-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) 2013-2018 Linaro Limited + * Copyright (c) 2020-2021 Nokia */ /** diff --git a/include/odp/api/spinlock.h b/include/odp/api/spinlock.h index cc195d488e..de4a86bf75 100644 --- a/include/odp/api/spinlock.h +++ b/include/odp/api/spinlock.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/include/odp/api/spinlock_recursive.h b/include/odp/api/spinlock_recursive.h index 7af0b59e87..6717a39583 100644 --- a/include/odp/api/spinlock_recursive.h +++ b/include/odp/api/spinlock_recursive.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/include/odp/api/stash.h b/include/odp/api/stash.h index ce11d3c6d5..e3071ec4ed 100644 --- a/include/odp/api/stash.h +++ b/include/odp/api/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/include/odp/api/stash_types.h b/include/odp/api/stash_types.h index 3d227d9587..429a47b27d 100644 --- a/include/odp/api/stash_types.h +++ b/include/odp/api/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/include/odp/api/std.h b/include/odp/api/std.h index 6af95b55a8..7a057efc66 100644 --- a/include/odp/api/std.h +++ b/include/odp/api/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 */ #ifndef ODP_API_STD_H_ diff --git a/include/odp/api/std_types.h b/include/odp/api/std_types.h index a18835cbd0..b940073143 100644 --- a/include/odp/api/std_types.h +++ b/include/odp/api/std_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/include/odp/api/sync.h b/include/odp/api/sync.h index 183cdda06f..c936a1477b 100644 --- a/include/odp/api/sync.h +++ b/include/odp/api/sync.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/include/odp/api/system_info.h b/include/odp/api/system_info.h index a69e2a2c31..d830a4f9c6 100644 --- a/include/odp/api/system_info.h +++ b/include/odp/api/system_info.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/include/odp/api/thread.h b/include/odp/api/thread.h index acc65159b5..2e02888863 100644 --- a/include/odp/api/thread.h +++ b/include/odp/api/thread.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/include/odp/api/threshold.h b/include/odp/api/threshold.h index 021d1181ec..f8e85e206f 100644 --- a/include/odp/api/threshold.h +++ b/include/odp/api/threshold.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/include/odp/api/thrmask.h b/include/odp/api/thrmask.h index 0300622a64..04cdffb993 100644 --- a/include/odp/api/thrmask.h +++ b/include/odp/api/thrmask.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/include/odp/api/ticketlock.h b/include/odp/api/ticketlock.h index 90ac5ff8cf..6ca983b3b7 100644 --- a/include/odp/api/ticketlock.h +++ b/include/odp/api/ticketlock.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/include/odp/api/time.h b/include/odp/api/time.h index fb550724d5..24757bbc61 100644 --- a/include/odp/api/time.h +++ b/include/odp/api/time.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/include/odp/api/time_types.h b/include/odp/api/time_types.h index f7281d4567..6cb14ffc7f 100644 --- a/include/odp/api/time_types.h +++ b/include/odp/api/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 */ /** diff --git a/include/odp/api/timer.h b/include/odp/api/timer.h index 356f7e9513..512c9aec03 100644 --- a/include/odp/api/timer.h +++ b/include/odp/api/timer.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/include/odp/api/timer_types.h b/include/odp/api/timer_types.h index 8d33855946..0fb0c7e1e7 100644 --- a/include/odp/api/timer_types.h +++ b/include/odp/api/timer_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 */ /** diff --git a/include/odp/api/traffic_mngr.h b/include/odp/api/traffic_mngr.h index 7ae9b40b38..96ccff1700 100644 --- a/include/odp/api/traffic_mngr.h +++ b/include/odp/api/traffic_mngr.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/include/odp/api/version.h b/include/odp/api/version.h index 3e584e0fc5..4461ccc327 100644 --- a/include/odp/api/version.h +++ b/include/odp/api/version.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/include/odp/arch/arm32-linux/odp/api/abi/align.h b/include/odp/arch/arm32-linux/odp/api/abi/align.h index 7fa3430782..aa8f2eab71 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/align.h +++ b/include/odp/arch/arm32-linux/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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/atomic.h b/include/odp/arch/arm32-linux/odp/api/abi/atomic.h index da89426c7a..ab7c3f17b1 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/atomic.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/atomic.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/barrier.h b/include/odp/arch/arm32-linux/odp/api/abi/barrier.h index 56b64b81d9..c3388fd2a8 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/barrier.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/barrier.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/buffer.h b/include/odp/arch/arm32-linux/odp/api/abi/buffer.h index 217ed4a934..2ffa07d1f8 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/buffer.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/buffer.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/buffer_types.h b/include/odp/arch/arm32-linux/odp/api/abi/buffer_types.h index 8dd78321f4..331e123c73 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/buffer_types.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/buffer_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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/byteorder.h b/include/odp/arch/arm32-linux/odp/api/abi/byteorder.h index eb383cd339..9c9728840f 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/byteorder.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/byteorder.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/classification.h b/include/odp/arch/arm32-linux/odp/api/abi/classification.h index 732eb27e04..789f3a92a3 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/classification.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/classification.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/comp.h b/include/odp/arch/arm32-linux/odp/api/abi/comp.h index a8f6439f4f..7b4be9d3e0 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/comp.h +++ b/include/odp/arch/arm32-linux/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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/cpu.h b/include/odp/arch/arm32-linux/odp/api/abi/cpu.h index d7485c0909..575f4a5ec5 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/cpu.h +++ b/include/odp/arch/arm32-linux/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/include/odp/arch/arm32-linux/odp/api/abi/cpumask.h b/include/odp/arch/arm32-linux/odp/api/abi/cpumask.h index c64bf2a69b..696f8664f1 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/cpumask.h +++ b/include/odp/arch/arm32-linux/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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/crypto.h b/include/odp/arch/arm32-linux/odp/api/abi/crypto.h index 3863842851..9d39ba7bc5 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/crypto.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/crypto.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/crypto_types.h b/include/odp/arch/arm32-linux/odp/api/abi/crypto_types.h index ddadec1c14..7e1da759a3 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/crypto_types.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/crypto_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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/debug.h b/include/odp/arch/arm32-linux/odp/api/abi/debug.h index 97d028d517..8a2ef2ade3 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/debug.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/debug.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/dma.h b/include/odp/arch/arm32-linux/odp/api/abi/dma.h index f4656c4cfc..f5e42a0766 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/dma.h +++ b/include/odp/arch/arm32-linux/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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/dma_types.h b/include/odp/arch/arm32-linux/odp/api/abi/dma_types.h index 76ccd895d1..cd96b9933c 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/dma_types.h +++ b/include/odp/arch/arm32-linux/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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/errno.h b/include/odp/arch/arm32-linux/odp/api/abi/errno.h index 69de49a0b6..9d197a8d41 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/errno.h +++ b/include/odp/arch/arm32-linux/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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/event.h b/include/odp/arch/arm32-linux/odp/api/abi/event.h index 408433ad8f..6f7074bb1e 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/event.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/event.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/event_types.h b/include/odp/arch/arm32-linux/odp/api/abi/event_types.h index a8321920c3..ece9cbef0c 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/event_types.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/event_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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/hash.h b/include/odp/arch/arm32-linux/odp/api/abi/hash.h index c9fb1976c4..72431f7651 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/hash.h +++ b/include/odp/arch/arm32-linux/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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/init.h b/include/odp/arch/arm32-linux/odp/api/abi/init.h index 7ad523fde0..936644f467 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/init.h +++ b/include/odp/arch/arm32-linux/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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/ipsec.h b/include/odp/arch/arm32-linux/odp/api/abi/ipsec.h index 13151beeb3..33c03cbe20 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/ipsec.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/ipsec.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/ipsec_types.h b/include/odp/arch/arm32-linux/odp/api/abi/ipsec_types.h index 49d854444e..854e7aa01f 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/ipsec_types.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/ipsec_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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/packet.h b/include/odp/arch/arm32-linux/odp/api/abi/packet.h index be8809aedf..9d560e6c84 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/packet.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/packet.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/packet_flags.h b/include/odp/arch/arm32-linux/odp/api/abi/packet_flags.h index 2ff0e00163..598047d96b 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/packet_flags.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/packet_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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/packet_io.h b/include/odp/arch/arm32-linux/odp/api/abi/packet_io.h index ec02e3a2b1..4356eb007d 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/packet_io.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/packet_io.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/packet_io_types.h b/include/odp/arch/arm32-linux/odp/api/abi/packet_io_types.h index d4f26338f7..3e8962f6a2 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/packet_io_types.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/packet_io_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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/packet_types.h b/include/odp/arch/arm32-linux/odp/api/abi/packet_types.h index c92ffd6842..9af00c1585 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/packet_types.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/packet_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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/pool.h b/include/odp/arch/arm32-linux/odp/api/abi/pool.h index 3b1f21d972..2f2e9164f5 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/pool.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/pool.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/pool_types.h b/include/odp/arch/arm32-linux/odp/api/abi/pool_types.h index 2c5cb121a2..a8366b5d25 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/pool_types.h +++ b/include/odp/arch/arm32-linux/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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/proto_stats_types.h b/include/odp/arch/arm32-linux/odp/api/abi/proto_stats_types.h index 1cb6128b6c..f6884a40aa 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/proto_stats_types.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/proto_stats_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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/queue.h b/include/odp/arch/arm32-linux/odp/api/abi/queue.h index 53f046f80a..2ba9174d06 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/queue.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/queue.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/queue_types.h b/include/odp/arch/arm32-linux/odp/api/abi/queue_types.h index 51837734a8..f1a8e197d4 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/queue_types.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/queue_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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/random.h b/include/odp/arch/arm32-linux/odp/api/abi/random.h index 87aa943b8f..703dcf5a0b 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/random.h +++ b/include/odp/arch/arm32-linux/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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/rwlock.h b/include/odp/arch/arm32-linux/odp/api/abi/rwlock.h index 96dbc9b838..5f953d6f69 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/rwlock.h +++ b/include/odp/arch/arm32-linux/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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/rwlock_recursive.h b/include/odp/arch/arm32-linux/odp/api/abi/rwlock_recursive.h index 14c964c9d6..f10116aebd 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/rwlock_recursive.h +++ b/include/odp/arch/arm32-linux/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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/schedule.h b/include/odp/arch/arm32-linux/odp/api/abi/schedule.h index 748c6aa8a6..cd16a11617 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/schedule.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/schedule.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/schedule_types.h b/include/odp/arch/arm32-linux/odp/api/abi/schedule_types.h index d5164ff796..1b2990c2b4 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/schedule_types.h +++ b/include/odp/arch/arm32-linux/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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/shared_memory.h b/include/odp/arch/arm32-linux/odp/api/abi/shared_memory.h index 784170abec..7ba8a2248e 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/shared_memory.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/shared_memory.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/spinlock.h b/include/odp/arch/arm32-linux/odp/api/abi/spinlock.h index fbfbce5cc2..c626baae57 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/spinlock.h +++ b/include/odp/arch/arm32-linux/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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/spinlock_recursive.h b/include/odp/arch/arm32-linux/odp/api/abi/spinlock_recursive.h index cc93b6acbf..6794590ca6 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/spinlock_recursive.h +++ b/include/odp/arch/arm32-linux/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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/stash.h b/include/odp/arch/arm32-linux/odp/api/abi/stash.h index d98413dea9..ed2cbbc645 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/stash.h +++ b/include/odp/arch/arm32-linux/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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/stash_types.h b/include/odp/arch/arm32-linux/odp/api/abi/stash_types.h index 998f754328..0f27597269 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/stash_types.h +++ b/include/odp/arch/arm32-linux/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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/std.h b/include/odp/arch/arm32-linux/odp/api/abi/std.h index a7243c4d4a..936009922a 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/std.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/std.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/std_types.h b/include/odp/arch/arm32-linux/odp/api/abi/std_types.h index 594e6f9dd4..c0d930e1f5 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/std_types.h +++ b/include/odp/arch/arm32-linux/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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/sync.h b/include/odp/arch/arm32-linux/odp/api/abi/sync.h index 37b03bcd98..dbe3a95ab2 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/sync.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/sync.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/thread.h b/include/odp/arch/arm32-linux/odp/api/abi/thread.h index be44ad8aa3..b6a233c965 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/thread.h +++ b/include/odp/arch/arm32-linux/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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/thrmask.h b/include/odp/arch/arm32-linux/odp/api/abi/thrmask.h index ab05cd83f2..2bb61d233f 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/thrmask.h +++ b/include/odp/arch/arm32-linux/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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/ticketlock.h b/include/odp/arch/arm32-linux/odp/api/abi/ticketlock.h index 0750f7e72d..4317157b8e 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/ticketlock.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/ticketlock.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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/time.h b/include/odp/arch/arm32-linux/odp/api/abi/time.h index a86a526dc9..0f24256695 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/time.h +++ b/include/odp/arch/arm32-linux/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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/time_types.h b/include/odp/arch/arm32-linux/odp/api/abi/time_types.h index cba80f5081..a415200a08 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/time_types.h +++ b/include/odp/arch/arm32-linux/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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/timer.h b/include/odp/arch/arm32-linux/odp/api/abi/timer.h index 0351468d38..0d7965bf79 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/timer.h +++ b/include/odp/arch/arm32-linux/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 */ #include diff --git a/include/odp/arch/arm32-linux/odp/api/abi/timer_types.h b/include/odp/arch/arm32-linux/odp/api/abi/timer_types.h index cd384c2bc6..51b578aa78 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/timer_types.h +++ b/include/odp/arch/arm32-linux/odp/api/abi/timer_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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/traffic_mngr.h b/include/odp/arch/arm32-linux/odp/api/abi/traffic_mngr.h index 0e6bc7982b..9a457c3703 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/traffic_mngr.h +++ b/include/odp/arch/arm32-linux/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 diff --git a/include/odp/arch/arm32-linux/odp/api/abi/version.h b/include/odp/arch/arm32-linux/odp/api/abi/version.h index 429d4f3fae..cf4b9a1284 100644 --- a/include/odp/arch/arm32-linux/odp/api/abi/version.h +++ b/include/odp/arch/arm32-linux/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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/align.h b/include/odp/arch/arm64-linux/odp/api/abi/align.h index 7fa3430782..aa8f2eab71 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/align.h +++ b/include/odp/arch/arm64-linux/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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/atomic.h b/include/odp/arch/arm64-linux/odp/api/abi/atomic.h index da89426c7a..ab7c3f17b1 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/atomic.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/atomic.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/barrier.h b/include/odp/arch/arm64-linux/odp/api/abi/barrier.h index 56b64b81d9..c3388fd2a8 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/barrier.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/barrier.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/buffer.h b/include/odp/arch/arm64-linux/odp/api/abi/buffer.h index 217ed4a934..2ffa07d1f8 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/buffer.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/buffer.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/buffer_types.h b/include/odp/arch/arm64-linux/odp/api/abi/buffer_types.h index 8dd78321f4..331e123c73 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/buffer_types.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/buffer_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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/byteorder.h b/include/odp/arch/arm64-linux/odp/api/abi/byteorder.h index eb383cd339..9c9728840f 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/byteorder.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/byteorder.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/classification.h b/include/odp/arch/arm64-linux/odp/api/abi/classification.h index 732eb27e04..789f3a92a3 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/classification.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/classification.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/comp.h b/include/odp/arch/arm64-linux/odp/api/abi/comp.h index a8f6439f4f..7b4be9d3e0 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/comp.h +++ b/include/odp/arch/arm64-linux/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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/cpu.h b/include/odp/arch/arm64-linux/odp/api/abi/cpu.h index d7485c0909..575f4a5ec5 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/cpu.h +++ b/include/odp/arch/arm64-linux/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/include/odp/arch/arm64-linux/odp/api/abi/cpumask.h b/include/odp/arch/arm64-linux/odp/api/abi/cpumask.h index c64bf2a69b..696f8664f1 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/cpumask.h +++ b/include/odp/arch/arm64-linux/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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/crypto.h b/include/odp/arch/arm64-linux/odp/api/abi/crypto.h index 3863842851..9d39ba7bc5 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/crypto.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/crypto.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/crypto_types.h b/include/odp/arch/arm64-linux/odp/api/abi/crypto_types.h index ddadec1c14..7e1da759a3 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/crypto_types.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/crypto_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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/debug.h b/include/odp/arch/arm64-linux/odp/api/abi/debug.h index 97d028d517..8a2ef2ade3 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/debug.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/debug.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/dma.h b/include/odp/arch/arm64-linux/odp/api/abi/dma.h index f4656c4cfc..f5e42a0766 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/dma.h +++ b/include/odp/arch/arm64-linux/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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/dma_types.h b/include/odp/arch/arm64-linux/odp/api/abi/dma_types.h index 76ccd895d1..cd96b9933c 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/dma_types.h +++ b/include/odp/arch/arm64-linux/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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/errno.h b/include/odp/arch/arm64-linux/odp/api/abi/errno.h index 69de49a0b6..9d197a8d41 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/errno.h +++ b/include/odp/arch/arm64-linux/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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/event.h b/include/odp/arch/arm64-linux/odp/api/abi/event.h index 408433ad8f..6f7074bb1e 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/event.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/event.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/event_types.h b/include/odp/arch/arm64-linux/odp/api/abi/event_types.h index a8321920c3..ece9cbef0c 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/event_types.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/event_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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/hash.h b/include/odp/arch/arm64-linux/odp/api/abi/hash.h index c9fb1976c4..72431f7651 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/hash.h +++ b/include/odp/arch/arm64-linux/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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/init.h b/include/odp/arch/arm64-linux/odp/api/abi/init.h index 7ad523fde0..936644f467 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/init.h +++ b/include/odp/arch/arm64-linux/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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/ipsec.h b/include/odp/arch/arm64-linux/odp/api/abi/ipsec.h index 13151beeb3..33c03cbe20 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/ipsec.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/ipsec.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/ipsec_types.h b/include/odp/arch/arm64-linux/odp/api/abi/ipsec_types.h index 49d854444e..854e7aa01f 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/ipsec_types.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/ipsec_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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/packet.h b/include/odp/arch/arm64-linux/odp/api/abi/packet.h index be8809aedf..9d560e6c84 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/packet.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/packet.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/packet_flags.h b/include/odp/arch/arm64-linux/odp/api/abi/packet_flags.h index 2ff0e00163..598047d96b 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/packet_flags.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/packet_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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/packet_io.h b/include/odp/arch/arm64-linux/odp/api/abi/packet_io.h index ec02e3a2b1..4356eb007d 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/packet_io.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/packet_io.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/packet_io_types.h b/include/odp/arch/arm64-linux/odp/api/abi/packet_io_types.h index d4f26338f7..3e8962f6a2 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/packet_io_types.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/packet_io_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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/packet_types.h b/include/odp/arch/arm64-linux/odp/api/abi/packet_types.h index c92ffd6842..9af00c1585 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/packet_types.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/packet_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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/pool.h b/include/odp/arch/arm64-linux/odp/api/abi/pool.h index 3b1f21d972..2f2e9164f5 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/pool.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/pool.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/pool_types.h b/include/odp/arch/arm64-linux/odp/api/abi/pool_types.h index 2c5cb121a2..a8366b5d25 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/pool_types.h +++ b/include/odp/arch/arm64-linux/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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/proto_stats_types.h b/include/odp/arch/arm64-linux/odp/api/abi/proto_stats_types.h index 1cb6128b6c..f6884a40aa 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/proto_stats_types.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/proto_stats_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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/queue.h b/include/odp/arch/arm64-linux/odp/api/abi/queue.h index 53f046f80a..2ba9174d06 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/queue.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/queue.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/queue_types.h b/include/odp/arch/arm64-linux/odp/api/abi/queue_types.h index 51837734a8..f1a8e197d4 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/queue_types.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/queue_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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/random.h b/include/odp/arch/arm64-linux/odp/api/abi/random.h index 87aa943b8f..703dcf5a0b 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/random.h +++ b/include/odp/arch/arm64-linux/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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/rwlock.h b/include/odp/arch/arm64-linux/odp/api/abi/rwlock.h index 96dbc9b838..5f953d6f69 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/rwlock.h +++ b/include/odp/arch/arm64-linux/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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/rwlock_recursive.h b/include/odp/arch/arm64-linux/odp/api/abi/rwlock_recursive.h index 14c964c9d6..f10116aebd 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/rwlock_recursive.h +++ b/include/odp/arch/arm64-linux/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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/schedule.h b/include/odp/arch/arm64-linux/odp/api/abi/schedule.h index 748c6aa8a6..cd16a11617 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/schedule.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/schedule.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/schedule_types.h b/include/odp/arch/arm64-linux/odp/api/abi/schedule_types.h index d5164ff796..1b2990c2b4 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/schedule_types.h +++ b/include/odp/arch/arm64-linux/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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/shared_memory.h b/include/odp/arch/arm64-linux/odp/api/abi/shared_memory.h index 784170abec..7ba8a2248e 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/shared_memory.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/shared_memory.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/spinlock.h b/include/odp/arch/arm64-linux/odp/api/abi/spinlock.h index fbfbce5cc2..c626baae57 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/spinlock.h +++ b/include/odp/arch/arm64-linux/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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/spinlock_recursive.h b/include/odp/arch/arm64-linux/odp/api/abi/spinlock_recursive.h index cc93b6acbf..6794590ca6 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/spinlock_recursive.h +++ b/include/odp/arch/arm64-linux/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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/stash.h b/include/odp/arch/arm64-linux/odp/api/abi/stash.h index d98413dea9..ed2cbbc645 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/stash.h +++ b/include/odp/arch/arm64-linux/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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/stash_types.h b/include/odp/arch/arm64-linux/odp/api/abi/stash_types.h index 998f754328..0f27597269 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/stash_types.h +++ b/include/odp/arch/arm64-linux/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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/std.h b/include/odp/arch/arm64-linux/odp/api/abi/std.h index a7243c4d4a..936009922a 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/std.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/std.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/std_types.h b/include/odp/arch/arm64-linux/odp/api/abi/std_types.h index 594e6f9dd4..c0d930e1f5 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/std_types.h +++ b/include/odp/arch/arm64-linux/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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/sync.h b/include/odp/arch/arm64-linux/odp/api/abi/sync.h index 37b03bcd98..dbe3a95ab2 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/sync.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/sync.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/thread.h b/include/odp/arch/arm64-linux/odp/api/abi/thread.h index be44ad8aa3..b6a233c965 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/thread.h +++ b/include/odp/arch/arm64-linux/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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/thrmask.h b/include/odp/arch/arm64-linux/odp/api/abi/thrmask.h index ab05cd83f2..2bb61d233f 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/thrmask.h +++ b/include/odp/arch/arm64-linux/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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/ticketlock.h b/include/odp/arch/arm64-linux/odp/api/abi/ticketlock.h index 0750f7e72d..4317157b8e 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/ticketlock.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/ticketlock.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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/time.h b/include/odp/arch/arm64-linux/odp/api/abi/time.h index a86a526dc9..0f24256695 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/time.h +++ b/include/odp/arch/arm64-linux/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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/time_types.h b/include/odp/arch/arm64-linux/odp/api/abi/time_types.h index cba80f5081..a415200a08 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/time_types.h +++ b/include/odp/arch/arm64-linux/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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/timer.h b/include/odp/arch/arm64-linux/odp/api/abi/timer.h index 0351468d38..0d7965bf79 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/timer.h +++ b/include/odp/arch/arm64-linux/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 */ #include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/timer_types.h b/include/odp/arch/arm64-linux/odp/api/abi/timer_types.h index cd384c2bc6..51b578aa78 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/timer_types.h +++ b/include/odp/arch/arm64-linux/odp/api/abi/timer_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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/traffic_mngr.h b/include/odp/arch/arm64-linux/odp/api/abi/traffic_mngr.h index 0e6bc7982b..9a457c3703 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/traffic_mngr.h +++ b/include/odp/arch/arm64-linux/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 diff --git a/include/odp/arch/arm64-linux/odp/api/abi/version.h b/include/odp/arch/arm64-linux/odp/api/abi/version.h index 429d4f3fae..cf4b9a1284 100644 --- a/include/odp/arch/arm64-linux/odp/api/abi/version.h +++ b/include/odp/arch/arm64-linux/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 diff --git a/include/odp/arch/default-linux/odp/api/abi/align.h b/include/odp/arch/default-linux/odp/api/abi/align.h index 250338cf3c..d5b26ba720 100644 --- a/include/odp/arch/default-linux/odp/api/abi/align.h +++ b/include/odp/arch/default-linux/odp/api/abi/align.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/atomic.h b/include/odp/arch/default-linux/odp/api/abi/atomic.h index d224edfa99..6645faf142 100644 --- a/include/odp/arch/default-linux/odp/api/abi/atomic.h +++ b/include/odp/arch/default-linux/odp/api/abi/atomic.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/barrier.h b/include/odp/arch/default-linux/odp/api/abi/barrier.h index 156a6e209e..23537289c7 100644 --- a/include/odp/arch/default-linux/odp/api/abi/barrier.h +++ b/include/odp/arch/default-linux/odp/api/abi/barrier.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/buffer.h b/include/odp/arch/default-linux/odp/api/abi/buffer.h index 74e8aadcec..092054239b 100644 --- a/include/odp/arch/default-linux/odp/api/abi/buffer.h +++ b/include/odp/arch/default-linux/odp/api/abi/buffer.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/buffer_types.h b/include/odp/arch/default-linux/odp/api/abi/buffer_types.h index 8dd78321f4..331e123c73 100644 --- a/include/odp/arch/default-linux/odp/api/abi/buffer_types.h +++ b/include/odp/arch/default-linux/odp/api/abi/buffer_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 diff --git a/include/odp/arch/default-linux/odp/api/abi/byteorder.h b/include/odp/arch/default-linux/odp/api/abi/byteorder.h index b2d174ce11..479077adb6 100644 --- a/include/odp/arch/default-linux/odp/api/abi/byteorder.h +++ b/include/odp/arch/default-linux/odp/api/abi/byteorder.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/classification.h b/include/odp/arch/default-linux/odp/api/abi/classification.h index 0e1271889c..7eccb68195 100644 --- a/include/odp/arch/default-linux/odp/api/abi/classification.h +++ b/include/odp/arch/default-linux/odp/api/abi/classification.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/comp.h b/include/odp/arch/default-linux/odp/api/abi/comp.h index a8f6439f4f..7b4be9d3e0 100644 --- a/include/odp/arch/default-linux/odp/api/abi/comp.h +++ b/include/odp/arch/default-linux/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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/cpu.h b/include/odp/arch/default-linux/odp/api/abi/cpu.h index d7485c0909..575f4a5ec5 100644 --- a/include/odp/arch/default-linux/odp/api/abi/cpu.h +++ b/include/odp/arch/default-linux/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/include/odp/arch/default-linux/odp/api/abi/cpumask.h b/include/odp/arch/default-linux/odp/api/abi/cpumask.h index f99009497f..c14cd36ba6 100644 --- a/include/odp/arch/default-linux/odp/api/abi/cpumask.h +++ b/include/odp/arch/default-linux/odp/api/abi/cpumask.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/crypto.h b/include/odp/arch/default-linux/odp/api/abi/crypto.h index 69efdd766c..1fc496fddb 100644 --- a/include/odp/arch/default-linux/odp/api/abi/crypto.h +++ b/include/odp/arch/default-linux/odp/api/abi/crypto.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/crypto_types.h b/include/odp/arch/default-linux/odp/api/abi/crypto_types.h index ddadec1c14..7e1da759a3 100644 --- a/include/odp/arch/default-linux/odp/api/abi/crypto_types.h +++ b/include/odp/arch/default-linux/odp/api/abi/crypto_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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/debug.h b/include/odp/arch/default-linux/odp/api/abi/debug.h index 8bce796ab5..59d18a02dd 100644 --- a/include/odp/arch/default-linux/odp/api/abi/debug.h +++ b/include/odp/arch/default-linux/odp/api/abi/debug.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/dma.h b/include/odp/arch/default-linux/odp/api/abi/dma.h index f4656c4cfc..f5e42a0766 100644 --- a/include/odp/arch/default-linux/odp/api/abi/dma.h +++ b/include/odp/arch/default-linux/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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/dma_types.h b/include/odp/arch/default-linux/odp/api/abi/dma_types.h index 76ccd895d1..cd96b9933c 100644 --- a/include/odp/arch/default-linux/odp/api/abi/dma_types.h +++ b/include/odp/arch/default-linux/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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/errno.h b/include/odp/arch/default-linux/odp/api/abi/errno.h index 69de49a0b6..9d197a8d41 100644 --- a/include/odp/arch/default-linux/odp/api/abi/errno.h +++ b/include/odp/arch/default-linux/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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/event.h b/include/odp/arch/default-linux/odp/api/abi/event.h index 90b5eb284c..5e6286ebd3 100644 --- a/include/odp/arch/default-linux/odp/api/abi/event.h +++ b/include/odp/arch/default-linux/odp/api/abi/event.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/event_types.h b/include/odp/arch/default-linux/odp/api/abi/event_types.h index a8321920c3..ece9cbef0c 100644 --- a/include/odp/arch/default-linux/odp/api/abi/event_types.h +++ b/include/odp/arch/default-linux/odp/api/abi/event_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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/hash.h b/include/odp/arch/default-linux/odp/api/abi/hash.h index c9fb1976c4..72431f7651 100644 --- a/include/odp/arch/default-linux/odp/api/abi/hash.h +++ b/include/odp/arch/default-linux/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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/init.h b/include/odp/arch/default-linux/odp/api/abi/init.h index 9ab42ec88b..babb44badf 100644 --- a/include/odp/arch/default-linux/odp/api/abi/init.h +++ b/include/odp/arch/default-linux/odp/api/abi/init.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/ipsec.h b/include/odp/arch/default-linux/odp/api/abi/ipsec.h index 17fcc63489..877515adda 100644 --- a/include/odp/arch/default-linux/odp/api/abi/ipsec.h +++ b/include/odp/arch/default-linux/odp/api/abi/ipsec.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/ipsec_types.h b/include/odp/arch/default-linux/odp/api/abi/ipsec_types.h index 49d854444e..854e7aa01f 100644 --- a/include/odp/arch/default-linux/odp/api/abi/ipsec_types.h +++ b/include/odp/arch/default-linux/odp/api/abi/ipsec_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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/packet.h b/include/odp/arch/default-linux/odp/api/abi/packet.h index a6cbeed725..8cee034846 100644 --- a/include/odp/arch/default-linux/odp/api/abi/packet.h +++ b/include/odp/arch/default-linux/odp/api/abi/packet.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/packet_flags.h b/include/odp/arch/default-linux/odp/api/abi/packet_flags.h index 48bc878ff3..00afba64c4 100644 --- a/include/odp/arch/default-linux/odp/api/abi/packet_flags.h +++ b/include/odp/arch/default-linux/odp/api/abi/packet_flags.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/packet_io.h b/include/odp/arch/default-linux/odp/api/abi/packet_io.h index b322ba885e..107a480ddd 100644 --- a/include/odp/arch/default-linux/odp/api/abi/packet_io.h +++ b/include/odp/arch/default-linux/odp/api/abi/packet_io.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/packet_io_types.h b/include/odp/arch/default-linux/odp/api/abi/packet_io_types.h index d4f26338f7..3e8962f6a2 100644 --- a/include/odp/arch/default-linux/odp/api/abi/packet_io_types.h +++ b/include/odp/arch/default-linux/odp/api/abi/packet_io_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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/packet_types.h b/include/odp/arch/default-linux/odp/api/abi/packet_types.h index c92ffd6842..9af00c1585 100644 --- a/include/odp/arch/default-linux/odp/api/abi/packet_types.h +++ b/include/odp/arch/default-linux/odp/api/abi/packet_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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/pool.h b/include/odp/arch/default-linux/odp/api/abi/pool.h index 3e8ab7e422..9c5d5d4fe5 100644 --- a/include/odp/arch/default-linux/odp/api/abi/pool.h +++ b/include/odp/arch/default-linux/odp/api/abi/pool.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/pool_types.h b/include/odp/arch/default-linux/odp/api/abi/pool_types.h index 2c5cb121a2..a8366b5d25 100644 --- a/include/odp/arch/default-linux/odp/api/abi/pool_types.h +++ b/include/odp/arch/default-linux/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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/proto_stats_types.h b/include/odp/arch/default-linux/odp/api/abi/proto_stats_types.h index 1cb6128b6c..f6884a40aa 100644 --- a/include/odp/arch/default-linux/odp/api/abi/proto_stats_types.h +++ b/include/odp/arch/default-linux/odp/api/abi/proto_stats_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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/queue.h b/include/odp/arch/default-linux/odp/api/abi/queue.h index 7860f6face..3528853077 100644 --- a/include/odp/arch/default-linux/odp/api/abi/queue.h +++ b/include/odp/arch/default-linux/odp/api/abi/queue.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/queue_types.h b/include/odp/arch/default-linux/odp/api/abi/queue_types.h index 51837734a8..f1a8e197d4 100644 --- a/include/odp/arch/default-linux/odp/api/abi/queue_types.h +++ b/include/odp/arch/default-linux/odp/api/abi/queue_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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/random.h b/include/odp/arch/default-linux/odp/api/abi/random.h index 87aa943b8f..703dcf5a0b 100644 --- a/include/odp/arch/default-linux/odp/api/abi/random.h +++ b/include/odp/arch/default-linux/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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/rwlock.h b/include/odp/arch/default-linux/odp/api/abi/rwlock.h index 2e073cb294..e77c35549c 100644 --- a/include/odp/arch/default-linux/odp/api/abi/rwlock.h +++ b/include/odp/arch/default-linux/odp/api/abi/rwlock.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/rwlock_recursive.h b/include/odp/arch/default-linux/odp/api/abi/rwlock_recursive.h index c266ef1bdb..b347e9c870 100644 --- a/include/odp/arch/default-linux/odp/api/abi/rwlock_recursive.h +++ b/include/odp/arch/default-linux/odp/api/abi/rwlock_recursive.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/schedule.h b/include/odp/arch/default-linux/odp/api/abi/schedule.h index ca4cf77b23..3c00f79dae 100644 --- a/include/odp/arch/default-linux/odp/api/abi/schedule.h +++ b/include/odp/arch/default-linux/odp/api/abi/schedule.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/schedule_types.h b/include/odp/arch/default-linux/odp/api/abi/schedule_types.h index 93c4db55fd..2731cfbb7f 100644 --- a/include/odp/arch/default-linux/odp/api/abi/schedule_types.h +++ b/include/odp/arch/default-linux/odp/api/abi/schedule_types.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/shared_memory.h b/include/odp/arch/default-linux/odp/api/abi/shared_memory.h index 1184fb0d1d..ddf32054c2 100644 --- a/include/odp/arch/default-linux/odp/api/abi/shared_memory.h +++ b/include/odp/arch/default-linux/odp/api/abi/shared_memory.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/spinlock.h b/include/odp/arch/default-linux/odp/api/abi/spinlock.h index 7b162c013a..8fe21357d7 100644 --- a/include/odp/arch/default-linux/odp/api/abi/spinlock.h +++ b/include/odp/arch/default-linux/odp/api/abi/spinlock.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/spinlock_recursive.h b/include/odp/arch/default-linux/odp/api/abi/spinlock_recursive.h index 8666a2df05..366c181ec2 100644 --- a/include/odp/arch/default-linux/odp/api/abi/spinlock_recursive.h +++ b/include/odp/arch/default-linux/odp/api/abi/spinlock_recursive.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/stash.h b/include/odp/arch/default-linux/odp/api/abi/stash.h index d98413dea9..ed2cbbc645 100644 --- a/include/odp/arch/default-linux/odp/api/abi/stash.h +++ b/include/odp/arch/default-linux/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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/stash_types.h b/include/odp/arch/default-linux/odp/api/abi/stash_types.h index 998f754328..0f27597269 100644 --- a/include/odp/arch/default-linux/odp/api/abi/stash_types.h +++ b/include/odp/arch/default-linux/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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/std.h b/include/odp/arch/default-linux/odp/api/abi/std.h index bc1abf1a6d..ae8d69371b 100644 --- a/include/odp/arch/default-linux/odp/api/abi/std.h +++ b/include/odp/arch/default-linux/odp/api/abi/std.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/std_types.h b/include/odp/arch/default-linux/odp/api/abi/std_types.h index 8cd05f78a3..3d011d9801 100644 --- a/include/odp/arch/default-linux/odp/api/abi/std_types.h +++ b/include/odp/arch/default-linux/odp/api/abi/std_types.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/sync.h b/include/odp/arch/default-linux/odp/api/abi/sync.h index 809c31f250..e6d26db028 100644 --- a/include/odp/arch/default-linux/odp/api/abi/sync.h +++ b/include/odp/arch/default-linux/odp/api/abi/sync.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/thread.h b/include/odp/arch/default-linux/odp/api/abi/thread.h index e90128286d..26b2f6be09 100644 --- a/include/odp/arch/default-linux/odp/api/abi/thread.h +++ b/include/odp/arch/default-linux/odp/api/abi/thread.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/thrmask.h b/include/odp/arch/default-linux/odp/api/abi/thrmask.h index b7f6ff4cbe..305be2ca4c 100644 --- a/include/odp/arch/default-linux/odp/api/abi/thrmask.h +++ b/include/odp/arch/default-linux/odp/api/abi/thrmask.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/ticketlock.h b/include/odp/arch/default-linux/odp/api/abi/ticketlock.h index e3220d327a..53d4fa04ac 100644 --- a/include/odp/arch/default-linux/odp/api/abi/ticketlock.h +++ b/include/odp/arch/default-linux/odp/api/abi/ticketlock.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/time.h b/include/odp/arch/default-linux/odp/api/abi/time.h index ffa8cd9aa9..1b61b9e8dd 100644 --- a/include/odp/arch/default-linux/odp/api/abi/time.h +++ b/include/odp/arch/default-linux/odp/api/abi/time.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/time_types.h b/include/odp/arch/default-linux/odp/api/abi/time_types.h index cba80f5081..a415200a08 100644 --- a/include/odp/arch/default-linux/odp/api/abi/time_types.h +++ b/include/odp/arch/default-linux/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 diff --git a/include/odp/arch/default-linux/odp/api/abi/timer.h b/include/odp/arch/default-linux/odp/api/abi/timer.h index 0351468d38..0d7965bf79 100644 --- a/include/odp/arch/default-linux/odp/api/abi/timer.h +++ b/include/odp/arch/default-linux/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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/timer_types.h b/include/odp/arch/default-linux/odp/api/abi/timer_types.h index 3050e4a61d..40fd26343c 100644 --- a/include/odp/arch/default-linux/odp/api/abi/timer_types.h +++ b/include/odp/arch/default-linux/odp/api/abi/timer_types.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/traffic_mngr.h b/include/odp/arch/default-linux/odp/api/abi/traffic_mngr.h index 2c9b01251d..8904e42914 100644 --- a/include/odp/arch/default-linux/odp/api/abi/traffic_mngr.h +++ b/include/odp/arch/default-linux/odp/api/abi/traffic_mngr.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 */ #include diff --git a/include/odp/arch/default-linux/odp/api/abi/version.h b/include/odp/arch/default-linux/odp/api/abi/version.h index 89b7d36116..3249a2e268 100644 --- a/include/odp/arch/default-linux/odp/api/abi/version.h +++ b/include/odp/arch/default-linux/odp/api/abi/version.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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/align.h b/include/odp/arch/power64-linux/odp/api/abi/align.h index 7fa3430782..aa8f2eab71 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/align.h +++ b/include/odp/arch/power64-linux/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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/atomic.h b/include/odp/arch/power64-linux/odp/api/abi/atomic.h index da89426c7a..ab7c3f17b1 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/atomic.h +++ b/include/odp/arch/power64-linux/odp/api/abi/atomic.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/barrier.h b/include/odp/arch/power64-linux/odp/api/abi/barrier.h index 56b64b81d9..c3388fd2a8 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/barrier.h +++ b/include/odp/arch/power64-linux/odp/api/abi/barrier.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/buffer.h b/include/odp/arch/power64-linux/odp/api/abi/buffer.h index 217ed4a934..2ffa07d1f8 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/buffer.h +++ b/include/odp/arch/power64-linux/odp/api/abi/buffer.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/buffer_types.h b/include/odp/arch/power64-linux/odp/api/abi/buffer_types.h index 8dd78321f4..331e123c73 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/buffer_types.h +++ b/include/odp/arch/power64-linux/odp/api/abi/buffer_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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/byteorder.h b/include/odp/arch/power64-linux/odp/api/abi/byteorder.h index eb383cd339..9c9728840f 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/byteorder.h +++ b/include/odp/arch/power64-linux/odp/api/abi/byteorder.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/classification.h b/include/odp/arch/power64-linux/odp/api/abi/classification.h index 732eb27e04..789f3a92a3 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/classification.h +++ b/include/odp/arch/power64-linux/odp/api/abi/classification.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/comp.h b/include/odp/arch/power64-linux/odp/api/abi/comp.h index a8f6439f4f..7b4be9d3e0 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/comp.h +++ b/include/odp/arch/power64-linux/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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/cpu.h b/include/odp/arch/power64-linux/odp/api/abi/cpu.h index 42a5dd22c9..55b59b1ab3 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/cpu.h +++ b/include/odp/arch/power64-linux/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/include/odp/arch/power64-linux/odp/api/abi/cpumask.h b/include/odp/arch/power64-linux/odp/api/abi/cpumask.h index c64bf2a69b..696f8664f1 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/cpumask.h +++ b/include/odp/arch/power64-linux/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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/crypto.h b/include/odp/arch/power64-linux/odp/api/abi/crypto.h index 3863842851..9d39ba7bc5 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/crypto.h +++ b/include/odp/arch/power64-linux/odp/api/abi/crypto.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/crypto_types.h b/include/odp/arch/power64-linux/odp/api/abi/crypto_types.h index ddadec1c14..7e1da759a3 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/crypto_types.h +++ b/include/odp/arch/power64-linux/odp/api/abi/crypto_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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/debug.h b/include/odp/arch/power64-linux/odp/api/abi/debug.h index 97d028d517..8a2ef2ade3 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/debug.h +++ b/include/odp/arch/power64-linux/odp/api/abi/debug.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/dma.h b/include/odp/arch/power64-linux/odp/api/abi/dma.h index f4656c4cfc..f5e42a0766 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/dma.h +++ b/include/odp/arch/power64-linux/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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/dma_types.h b/include/odp/arch/power64-linux/odp/api/abi/dma_types.h index 76ccd895d1..cd96b9933c 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/dma_types.h +++ b/include/odp/arch/power64-linux/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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/errno.h b/include/odp/arch/power64-linux/odp/api/abi/errno.h index 69de49a0b6..9d197a8d41 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/errno.h +++ b/include/odp/arch/power64-linux/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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/event.h b/include/odp/arch/power64-linux/odp/api/abi/event.h index 408433ad8f..6f7074bb1e 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/event.h +++ b/include/odp/arch/power64-linux/odp/api/abi/event.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/event_types.h b/include/odp/arch/power64-linux/odp/api/abi/event_types.h index a8321920c3..ece9cbef0c 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/event_types.h +++ b/include/odp/arch/power64-linux/odp/api/abi/event_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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/hash.h b/include/odp/arch/power64-linux/odp/api/abi/hash.h index c9fb1976c4..72431f7651 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/hash.h +++ b/include/odp/arch/power64-linux/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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/init.h b/include/odp/arch/power64-linux/odp/api/abi/init.h index 7ad523fde0..936644f467 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/init.h +++ b/include/odp/arch/power64-linux/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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/ipsec.h b/include/odp/arch/power64-linux/odp/api/abi/ipsec.h index 13151beeb3..33c03cbe20 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/ipsec.h +++ b/include/odp/arch/power64-linux/odp/api/abi/ipsec.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/ipsec_types.h b/include/odp/arch/power64-linux/odp/api/abi/ipsec_types.h index 49d854444e..854e7aa01f 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/ipsec_types.h +++ b/include/odp/arch/power64-linux/odp/api/abi/ipsec_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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/packet.h b/include/odp/arch/power64-linux/odp/api/abi/packet.h index be8809aedf..9d560e6c84 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/packet.h +++ b/include/odp/arch/power64-linux/odp/api/abi/packet.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/packet_flags.h b/include/odp/arch/power64-linux/odp/api/abi/packet_flags.h index 2ff0e00163..598047d96b 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/packet_flags.h +++ b/include/odp/arch/power64-linux/odp/api/abi/packet_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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/packet_io.h b/include/odp/arch/power64-linux/odp/api/abi/packet_io.h index ec02e3a2b1..4356eb007d 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/packet_io.h +++ b/include/odp/arch/power64-linux/odp/api/abi/packet_io.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/packet_io_types.h b/include/odp/arch/power64-linux/odp/api/abi/packet_io_types.h index d4f26338f7..3e8962f6a2 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/packet_io_types.h +++ b/include/odp/arch/power64-linux/odp/api/abi/packet_io_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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/packet_types.h b/include/odp/arch/power64-linux/odp/api/abi/packet_types.h index c92ffd6842..9af00c1585 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/packet_types.h +++ b/include/odp/arch/power64-linux/odp/api/abi/packet_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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/pool.h b/include/odp/arch/power64-linux/odp/api/abi/pool.h index 3b1f21d972..2f2e9164f5 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/pool.h +++ b/include/odp/arch/power64-linux/odp/api/abi/pool.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/pool_types.h b/include/odp/arch/power64-linux/odp/api/abi/pool_types.h index 2c5cb121a2..a8366b5d25 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/pool_types.h +++ b/include/odp/arch/power64-linux/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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/proto_stats_types.h b/include/odp/arch/power64-linux/odp/api/abi/proto_stats_types.h index 1cb6128b6c..f6884a40aa 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/proto_stats_types.h +++ b/include/odp/arch/power64-linux/odp/api/abi/proto_stats_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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/queue.h b/include/odp/arch/power64-linux/odp/api/abi/queue.h index 53f046f80a..2ba9174d06 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/queue.h +++ b/include/odp/arch/power64-linux/odp/api/abi/queue.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/queue_types.h b/include/odp/arch/power64-linux/odp/api/abi/queue_types.h index 51837734a8..f1a8e197d4 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/queue_types.h +++ b/include/odp/arch/power64-linux/odp/api/abi/queue_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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/random.h b/include/odp/arch/power64-linux/odp/api/abi/random.h index 87aa943b8f..703dcf5a0b 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/random.h +++ b/include/odp/arch/power64-linux/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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/rwlock.h b/include/odp/arch/power64-linux/odp/api/abi/rwlock.h index 96dbc9b838..5f953d6f69 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/rwlock.h +++ b/include/odp/arch/power64-linux/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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/rwlock_recursive.h b/include/odp/arch/power64-linux/odp/api/abi/rwlock_recursive.h index 14c964c9d6..f10116aebd 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/rwlock_recursive.h +++ b/include/odp/arch/power64-linux/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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/schedule.h b/include/odp/arch/power64-linux/odp/api/abi/schedule.h index 748c6aa8a6..cd16a11617 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/schedule.h +++ b/include/odp/arch/power64-linux/odp/api/abi/schedule.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/schedule_types.h b/include/odp/arch/power64-linux/odp/api/abi/schedule_types.h index d5164ff796..1b2990c2b4 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/schedule_types.h +++ b/include/odp/arch/power64-linux/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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/shared_memory.h b/include/odp/arch/power64-linux/odp/api/abi/shared_memory.h index 784170abec..7ba8a2248e 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/shared_memory.h +++ b/include/odp/arch/power64-linux/odp/api/abi/shared_memory.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/spinlock.h b/include/odp/arch/power64-linux/odp/api/abi/spinlock.h index fbfbce5cc2..c626baae57 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/spinlock.h +++ b/include/odp/arch/power64-linux/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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/spinlock_recursive.h b/include/odp/arch/power64-linux/odp/api/abi/spinlock_recursive.h index cc93b6acbf..6794590ca6 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/spinlock_recursive.h +++ b/include/odp/arch/power64-linux/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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/stash.h b/include/odp/arch/power64-linux/odp/api/abi/stash.h index d98413dea9..ed2cbbc645 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/stash.h +++ b/include/odp/arch/power64-linux/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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/stash_types.h b/include/odp/arch/power64-linux/odp/api/abi/stash_types.h index 998f754328..0f27597269 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/stash_types.h +++ b/include/odp/arch/power64-linux/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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/std.h b/include/odp/arch/power64-linux/odp/api/abi/std.h index a7243c4d4a..936009922a 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/std.h +++ b/include/odp/arch/power64-linux/odp/api/abi/std.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/std_types.h b/include/odp/arch/power64-linux/odp/api/abi/std_types.h index 594e6f9dd4..c0d930e1f5 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/std_types.h +++ b/include/odp/arch/power64-linux/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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/sync.h b/include/odp/arch/power64-linux/odp/api/abi/sync.h index 37b03bcd98..dbe3a95ab2 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/sync.h +++ b/include/odp/arch/power64-linux/odp/api/abi/sync.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/thread.h b/include/odp/arch/power64-linux/odp/api/abi/thread.h index be44ad8aa3..b6a233c965 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/thread.h +++ b/include/odp/arch/power64-linux/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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/thrmask.h b/include/odp/arch/power64-linux/odp/api/abi/thrmask.h index ab05cd83f2..2bb61d233f 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/thrmask.h +++ b/include/odp/arch/power64-linux/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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/ticketlock.h b/include/odp/arch/power64-linux/odp/api/abi/ticketlock.h index 0750f7e72d..4317157b8e 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/ticketlock.h +++ b/include/odp/arch/power64-linux/odp/api/abi/ticketlock.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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/time.h b/include/odp/arch/power64-linux/odp/api/abi/time.h index a86a526dc9..0f24256695 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/time.h +++ b/include/odp/arch/power64-linux/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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/time_types.h b/include/odp/arch/power64-linux/odp/api/abi/time_types.h index cba80f5081..a415200a08 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/time_types.h +++ b/include/odp/arch/power64-linux/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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/timer.h b/include/odp/arch/power64-linux/odp/api/abi/timer.h index 0351468d38..0d7965bf79 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/timer.h +++ b/include/odp/arch/power64-linux/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 */ #include diff --git a/include/odp/arch/power64-linux/odp/api/abi/timer_types.h b/include/odp/arch/power64-linux/odp/api/abi/timer_types.h index cd384c2bc6..51b578aa78 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/timer_types.h +++ b/include/odp/arch/power64-linux/odp/api/abi/timer_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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/traffic_mngr.h b/include/odp/arch/power64-linux/odp/api/abi/traffic_mngr.h index 0e6bc7982b..9a457c3703 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/traffic_mngr.h +++ b/include/odp/arch/power64-linux/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 diff --git a/include/odp/arch/power64-linux/odp/api/abi/version.h b/include/odp/arch/power64-linux/odp/api/abi/version.h index 429d4f3fae..cf4b9a1284 100644 --- a/include/odp/arch/power64-linux/odp/api/abi/version.h +++ b/include/odp/arch/power64-linux/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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/align.h b/include/odp/arch/x86_32-linux/odp/api/abi/align.h index 7fa3430782..aa8f2eab71 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/align.h +++ b/include/odp/arch/x86_32-linux/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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/atomic.h b/include/odp/arch/x86_32-linux/odp/api/abi/atomic.h index da89426c7a..ab7c3f17b1 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/atomic.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/atomic.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/barrier.h b/include/odp/arch/x86_32-linux/odp/api/abi/barrier.h index 56b64b81d9..c3388fd2a8 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/barrier.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/barrier.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/buffer.h b/include/odp/arch/x86_32-linux/odp/api/abi/buffer.h index 217ed4a934..2ffa07d1f8 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/buffer.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/buffer.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/buffer_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/buffer_types.h index 8dd78321f4..331e123c73 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/buffer_types.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/buffer_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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/byteorder.h b/include/odp/arch/x86_32-linux/odp/api/abi/byteorder.h index eb383cd339..9c9728840f 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/byteorder.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/byteorder.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/classification.h b/include/odp/arch/x86_32-linux/odp/api/abi/classification.h index 732eb27e04..789f3a92a3 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/classification.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/classification.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/comp.h b/include/odp/arch/x86_32-linux/odp/api/abi/comp.h index a8f6439f4f..7b4be9d3e0 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/comp.h +++ b/include/odp/arch/x86_32-linux/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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/cpu.h b/include/odp/arch/x86_32-linux/odp/api/abi/cpu.h index d7485c0909..575f4a5ec5 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/cpu.h +++ b/include/odp/arch/x86_32-linux/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/include/odp/arch/x86_32-linux/odp/api/abi/cpumask.h b/include/odp/arch/x86_32-linux/odp/api/abi/cpumask.h index c64bf2a69b..696f8664f1 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/cpumask.h +++ b/include/odp/arch/x86_32-linux/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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/crypto.h b/include/odp/arch/x86_32-linux/odp/api/abi/crypto.h index 3863842851..9d39ba7bc5 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/crypto.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/crypto.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/crypto_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/crypto_types.h index ddadec1c14..7e1da759a3 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/crypto_types.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/crypto_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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/debug.h b/include/odp/arch/x86_32-linux/odp/api/abi/debug.h index 97d028d517..8a2ef2ade3 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/debug.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/debug.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/dma.h b/include/odp/arch/x86_32-linux/odp/api/abi/dma.h index f4656c4cfc..f5e42a0766 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/dma.h +++ b/include/odp/arch/x86_32-linux/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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/dma_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/dma_types.h index 76ccd895d1..cd96b9933c 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/dma_types.h +++ b/include/odp/arch/x86_32-linux/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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/errno.h b/include/odp/arch/x86_32-linux/odp/api/abi/errno.h index 69de49a0b6..9d197a8d41 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/errno.h +++ b/include/odp/arch/x86_32-linux/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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/event.h b/include/odp/arch/x86_32-linux/odp/api/abi/event.h index 408433ad8f..6f7074bb1e 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/event.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/event.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/event_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/event_types.h index a8321920c3..ece9cbef0c 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/event_types.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/event_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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/hash.h b/include/odp/arch/x86_32-linux/odp/api/abi/hash.h index c9fb1976c4..72431f7651 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/hash.h +++ b/include/odp/arch/x86_32-linux/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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/init.h b/include/odp/arch/x86_32-linux/odp/api/abi/init.h index 7ad523fde0..936644f467 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/init.h +++ b/include/odp/arch/x86_32-linux/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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/ipsec.h b/include/odp/arch/x86_32-linux/odp/api/abi/ipsec.h index 13151beeb3..33c03cbe20 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/ipsec.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/ipsec.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/ipsec_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/ipsec_types.h index 49d854444e..854e7aa01f 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/ipsec_types.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/ipsec_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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/packet.h b/include/odp/arch/x86_32-linux/odp/api/abi/packet.h index be8809aedf..9d560e6c84 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/packet.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/packet.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/packet_flags.h b/include/odp/arch/x86_32-linux/odp/api/abi/packet_flags.h index 2ff0e00163..598047d96b 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/packet_flags.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/packet_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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/packet_io.h b/include/odp/arch/x86_32-linux/odp/api/abi/packet_io.h index ec02e3a2b1..4356eb007d 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/packet_io.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/packet_io.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/packet_io_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/packet_io_types.h index d4f26338f7..3e8962f6a2 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/packet_io_types.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/packet_io_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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/packet_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/packet_types.h index c92ffd6842..9af00c1585 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/packet_types.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/packet_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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/pool.h b/include/odp/arch/x86_32-linux/odp/api/abi/pool.h index 3b1f21d972..2f2e9164f5 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/pool.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/pool.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/pool_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/pool_types.h index 2c5cb121a2..a8366b5d25 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/pool_types.h +++ b/include/odp/arch/x86_32-linux/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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/proto_stats_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/proto_stats_types.h index 1cb6128b6c..f6884a40aa 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/proto_stats_types.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/proto_stats_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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/queue.h b/include/odp/arch/x86_32-linux/odp/api/abi/queue.h index 53f046f80a..2ba9174d06 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/queue.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/queue.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/queue_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/queue_types.h index 51837734a8..f1a8e197d4 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/queue_types.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/queue_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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/random.h b/include/odp/arch/x86_32-linux/odp/api/abi/random.h index 87aa943b8f..703dcf5a0b 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/random.h +++ b/include/odp/arch/x86_32-linux/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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/rwlock.h b/include/odp/arch/x86_32-linux/odp/api/abi/rwlock.h index 96dbc9b838..5f953d6f69 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/rwlock.h +++ b/include/odp/arch/x86_32-linux/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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/rwlock_recursive.h b/include/odp/arch/x86_32-linux/odp/api/abi/rwlock_recursive.h index 14c964c9d6..f10116aebd 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/rwlock_recursive.h +++ b/include/odp/arch/x86_32-linux/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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/schedule.h b/include/odp/arch/x86_32-linux/odp/api/abi/schedule.h index 748c6aa8a6..cd16a11617 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/schedule.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/schedule.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/schedule_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/schedule_types.h index d5164ff796..1b2990c2b4 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/schedule_types.h +++ b/include/odp/arch/x86_32-linux/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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/shared_memory.h b/include/odp/arch/x86_32-linux/odp/api/abi/shared_memory.h index 784170abec..7ba8a2248e 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/shared_memory.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/shared_memory.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/spinlock.h b/include/odp/arch/x86_32-linux/odp/api/abi/spinlock.h index fbfbce5cc2..c626baae57 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/spinlock.h +++ b/include/odp/arch/x86_32-linux/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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/spinlock_recursive.h b/include/odp/arch/x86_32-linux/odp/api/abi/spinlock_recursive.h index cc93b6acbf..6794590ca6 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/spinlock_recursive.h +++ b/include/odp/arch/x86_32-linux/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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/stash.h b/include/odp/arch/x86_32-linux/odp/api/abi/stash.h index d98413dea9..ed2cbbc645 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/stash.h +++ b/include/odp/arch/x86_32-linux/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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/stash_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/stash_types.h index 998f754328..0f27597269 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/stash_types.h +++ b/include/odp/arch/x86_32-linux/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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/std.h b/include/odp/arch/x86_32-linux/odp/api/abi/std.h index a7243c4d4a..936009922a 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/std.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/std.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/std_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/std_types.h index 594e6f9dd4..c0d930e1f5 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/std_types.h +++ b/include/odp/arch/x86_32-linux/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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/sync.h b/include/odp/arch/x86_32-linux/odp/api/abi/sync.h index 37b03bcd98..dbe3a95ab2 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/sync.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/sync.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/thread.h b/include/odp/arch/x86_32-linux/odp/api/abi/thread.h index be44ad8aa3..b6a233c965 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/thread.h +++ b/include/odp/arch/x86_32-linux/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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/thrmask.h b/include/odp/arch/x86_32-linux/odp/api/abi/thrmask.h index ab05cd83f2..2bb61d233f 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/thrmask.h +++ b/include/odp/arch/x86_32-linux/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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/ticketlock.h b/include/odp/arch/x86_32-linux/odp/api/abi/ticketlock.h index 0750f7e72d..4317157b8e 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/ticketlock.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/ticketlock.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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/time.h b/include/odp/arch/x86_32-linux/odp/api/abi/time.h index a86a526dc9..0f24256695 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/time.h +++ b/include/odp/arch/x86_32-linux/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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/time_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/time_types.h index cba80f5081..a415200a08 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/time_types.h +++ b/include/odp/arch/x86_32-linux/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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/timer.h b/include/odp/arch/x86_32-linux/odp/api/abi/timer.h index 0351468d38..0d7965bf79 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/timer.h +++ b/include/odp/arch/x86_32-linux/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 */ #include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/timer_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/timer_types.h index cd384c2bc6..51b578aa78 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/timer_types.h +++ b/include/odp/arch/x86_32-linux/odp/api/abi/timer_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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/traffic_mngr.h b/include/odp/arch/x86_32-linux/odp/api/abi/traffic_mngr.h index 0e6bc7982b..9a457c3703 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/traffic_mngr.h +++ b/include/odp/arch/x86_32-linux/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 diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/version.h b/include/odp/arch/x86_32-linux/odp/api/abi/version.h index 429d4f3fae..cf4b9a1284 100644 --- a/include/odp/arch/x86_32-linux/odp/api/abi/version.h +++ b/include/odp/arch/x86_32-linux/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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/align.h b/include/odp/arch/x86_64-linux/odp/api/abi/align.h index 7fa3430782..aa8f2eab71 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/align.h +++ b/include/odp/arch/x86_64-linux/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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/atomic.h b/include/odp/arch/x86_64-linux/odp/api/abi/atomic.h index da89426c7a..ab7c3f17b1 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/atomic.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/atomic.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/barrier.h b/include/odp/arch/x86_64-linux/odp/api/abi/barrier.h index 56b64b81d9..c3388fd2a8 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/barrier.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/barrier.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/buffer.h b/include/odp/arch/x86_64-linux/odp/api/abi/buffer.h index 217ed4a934..2ffa07d1f8 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/buffer.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/buffer.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/buffer_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/buffer_types.h index 8dd78321f4..331e123c73 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/buffer_types.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/buffer_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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/byteorder.h b/include/odp/arch/x86_64-linux/odp/api/abi/byteorder.h index eb383cd339..9c9728840f 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/byteorder.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/byteorder.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/classification.h b/include/odp/arch/x86_64-linux/odp/api/abi/classification.h index 732eb27e04..789f3a92a3 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/classification.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/classification.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/comp.h b/include/odp/arch/x86_64-linux/odp/api/abi/comp.h index a8f6439f4f..7b4be9d3e0 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/comp.h +++ b/include/odp/arch/x86_64-linux/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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/cpu.h b/include/odp/arch/x86_64-linux/odp/api/abi/cpu.h index d7485c0909..575f4a5ec5 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/cpu.h +++ b/include/odp/arch/x86_64-linux/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/include/odp/arch/x86_64-linux/odp/api/abi/cpumask.h b/include/odp/arch/x86_64-linux/odp/api/abi/cpumask.h index c64bf2a69b..696f8664f1 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/cpumask.h +++ b/include/odp/arch/x86_64-linux/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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/crypto.h b/include/odp/arch/x86_64-linux/odp/api/abi/crypto.h index 3863842851..9d39ba7bc5 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/crypto.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/crypto.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/crypto_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/crypto_types.h index ddadec1c14..7e1da759a3 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/crypto_types.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/crypto_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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/debug.h b/include/odp/arch/x86_64-linux/odp/api/abi/debug.h index 97d028d517..8a2ef2ade3 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/debug.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/debug.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/dma.h b/include/odp/arch/x86_64-linux/odp/api/abi/dma.h index f4656c4cfc..f5e42a0766 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/dma.h +++ b/include/odp/arch/x86_64-linux/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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/dma_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/dma_types.h index 76ccd895d1..cd96b9933c 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/dma_types.h +++ b/include/odp/arch/x86_64-linux/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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/errno.h b/include/odp/arch/x86_64-linux/odp/api/abi/errno.h index 69de49a0b6..9d197a8d41 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/errno.h +++ b/include/odp/arch/x86_64-linux/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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/event.h b/include/odp/arch/x86_64-linux/odp/api/abi/event.h index 408433ad8f..6f7074bb1e 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/event.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/event.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/event_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/event_types.h index a8321920c3..ece9cbef0c 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/event_types.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/event_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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/hash.h b/include/odp/arch/x86_64-linux/odp/api/abi/hash.h index c9fb1976c4..72431f7651 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/hash.h +++ b/include/odp/arch/x86_64-linux/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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/init.h b/include/odp/arch/x86_64-linux/odp/api/abi/init.h index 7ad523fde0..936644f467 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/init.h +++ b/include/odp/arch/x86_64-linux/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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/ipsec.h b/include/odp/arch/x86_64-linux/odp/api/abi/ipsec.h index 13151beeb3..33c03cbe20 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/ipsec.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/ipsec.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/ipsec_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/ipsec_types.h index 49d854444e..854e7aa01f 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/ipsec_types.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/ipsec_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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/packet.h b/include/odp/arch/x86_64-linux/odp/api/abi/packet.h index be8809aedf..9d560e6c84 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/packet.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/packet.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/packet_flags.h b/include/odp/arch/x86_64-linux/odp/api/abi/packet_flags.h index 2ff0e00163..598047d96b 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/packet_flags.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/packet_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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/packet_io.h b/include/odp/arch/x86_64-linux/odp/api/abi/packet_io.h index ec02e3a2b1..4356eb007d 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/packet_io.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/packet_io.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/packet_io_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/packet_io_types.h index d4f26338f7..3e8962f6a2 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/packet_io_types.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/packet_io_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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/packet_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/packet_types.h index c92ffd6842..9af00c1585 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/packet_types.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/packet_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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/pool.h b/include/odp/arch/x86_64-linux/odp/api/abi/pool.h index 3b1f21d972..2f2e9164f5 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/pool.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/pool.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/pool_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/pool_types.h index 2c5cb121a2..a8366b5d25 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/pool_types.h +++ b/include/odp/arch/x86_64-linux/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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/proto_stats_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/proto_stats_types.h index 1cb6128b6c..f6884a40aa 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/proto_stats_types.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/proto_stats_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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/queue.h b/include/odp/arch/x86_64-linux/odp/api/abi/queue.h index 53f046f80a..2ba9174d06 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/queue.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/queue.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/queue_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/queue_types.h index 51837734a8..f1a8e197d4 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/queue_types.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/queue_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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/random.h b/include/odp/arch/x86_64-linux/odp/api/abi/random.h index 87aa943b8f..703dcf5a0b 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/random.h +++ b/include/odp/arch/x86_64-linux/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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/rwlock.h b/include/odp/arch/x86_64-linux/odp/api/abi/rwlock.h index 96dbc9b838..5f953d6f69 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/rwlock.h +++ b/include/odp/arch/x86_64-linux/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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/rwlock_recursive.h b/include/odp/arch/x86_64-linux/odp/api/abi/rwlock_recursive.h index 14c964c9d6..f10116aebd 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/rwlock_recursive.h +++ b/include/odp/arch/x86_64-linux/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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/schedule.h b/include/odp/arch/x86_64-linux/odp/api/abi/schedule.h index 748c6aa8a6..cd16a11617 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/schedule.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/schedule.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/schedule_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/schedule_types.h index d5164ff796..1b2990c2b4 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/schedule_types.h +++ b/include/odp/arch/x86_64-linux/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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/shared_memory.h b/include/odp/arch/x86_64-linux/odp/api/abi/shared_memory.h index 784170abec..7ba8a2248e 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/shared_memory.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/shared_memory.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/spinlock.h b/include/odp/arch/x86_64-linux/odp/api/abi/spinlock.h index fbfbce5cc2..c626baae57 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/spinlock.h +++ b/include/odp/arch/x86_64-linux/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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/spinlock_recursive.h b/include/odp/arch/x86_64-linux/odp/api/abi/spinlock_recursive.h index cc93b6acbf..6794590ca6 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/spinlock_recursive.h +++ b/include/odp/arch/x86_64-linux/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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/stash.h b/include/odp/arch/x86_64-linux/odp/api/abi/stash.h index d98413dea9..ed2cbbc645 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/stash.h +++ b/include/odp/arch/x86_64-linux/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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/stash_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/stash_types.h index 998f754328..0f27597269 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/stash_types.h +++ b/include/odp/arch/x86_64-linux/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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/std.h b/include/odp/arch/x86_64-linux/odp/api/abi/std.h index a7243c4d4a..936009922a 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/std.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/std.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/std_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/std_types.h index 594e6f9dd4..c0d930e1f5 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/std_types.h +++ b/include/odp/arch/x86_64-linux/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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/sync.h b/include/odp/arch/x86_64-linux/odp/api/abi/sync.h index 37b03bcd98..dbe3a95ab2 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/sync.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/sync.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/thread.h b/include/odp/arch/x86_64-linux/odp/api/abi/thread.h index be44ad8aa3..b6a233c965 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/thread.h +++ b/include/odp/arch/x86_64-linux/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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/thrmask.h b/include/odp/arch/x86_64-linux/odp/api/abi/thrmask.h index ab05cd83f2..2bb61d233f 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/thrmask.h +++ b/include/odp/arch/x86_64-linux/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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/ticketlock.h b/include/odp/arch/x86_64-linux/odp/api/abi/ticketlock.h index 0750f7e72d..4317157b8e 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/ticketlock.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/ticketlock.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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/time.h b/include/odp/arch/x86_64-linux/odp/api/abi/time.h index a86a526dc9..0f24256695 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/time.h +++ b/include/odp/arch/x86_64-linux/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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/time_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/time_types.h index cba80f5081..a415200a08 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/time_types.h +++ b/include/odp/arch/x86_64-linux/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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/timer.h b/include/odp/arch/x86_64-linux/odp/api/abi/timer.h index 0351468d38..0d7965bf79 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/timer.h +++ b/include/odp/arch/x86_64-linux/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 */ #include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/timer_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/timer_types.h index cd384c2bc6..51b578aa78 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/timer_types.h +++ b/include/odp/arch/x86_64-linux/odp/api/abi/timer_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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/traffic_mngr.h b/include/odp/arch/x86_64-linux/odp/api/abi/traffic_mngr.h index 0e6bc7982b..9a457c3703 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/traffic_mngr.h +++ b/include/odp/arch/x86_64-linux/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 diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/version.h b/include/odp/arch/x86_64-linux/odp/api/abi/version.h index 429d4f3fae..cf4b9a1284 100644 --- a/include/odp/arch/x86_64-linux/odp/api/abi/version.h +++ b/include/odp/arch/x86_64-linux/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 diff --git a/include/odp/visibility_begin.h b/include/odp/visibility_begin.h index e335dab34f..25ac005f5b 100644 --- a/include/odp/visibility_begin.h +++ b/include/odp/visibility_begin.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/include/odp/visibility_end.h b/include/odp/visibility_end.h index 48942467ec..4580ff03ee 100644 --- a/include/odp/visibility_end.h +++ b/include/odp/visibility_end.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/include/odp_api.h b/include/odp_api.h index 00d2c243a5..e7cad266f8 100644 --- a/include/odp_api.h +++ b/include/odp_api.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 */ /** From 67f75685e200c5125e9c66195ad9a5d45ce9a65a Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 30 Aug 2023 10:55:21 +0300 Subject: [PATCH 040/192] helper: update copyright format Update all helper files to use the new shorter copyright format: /* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) */ Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- helper/chksum.c | 6 ++---- helper/cli.c | 6 ++---- helper/cuckootable.c | 6 ++---- helper/eth.c | 6 ++---- helper/hashtable.c | 6 ++---- helper/include/odp/helper/chksum.h | 6 ++---- helper/include/odp/helper/cli.h | 6 ++---- helper/include/odp/helper/deprecated.h | 8 +++----- helper/include/odp/helper/eth.h | 6 ++---- helper/include/odp/helper/gtp.h | 3 ++- helper/include/odp/helper/icmp.h | 6 ++---- helper/include/odp/helper/igmp.h | 2 +- helper/include/odp/helper/ip.h | 6 ++---- helper/include/odp/helper/ipsec.h | 8 +++----- helper/include/odp/helper/linux.h | 6 ++---- helper/include/odp/helper/linux/process.h | 6 ++---- helper/include/odp/helper/linux/pthread.h | 6 ++---- helper/include/odp/helper/odph_api.h | 6 ++---- helper/include/odp/helper/odph_cuckootable.h | 6 ++---- helper/include/odp/helper/odph_debug.h | 9 +++------ helper/include/odp/helper/odph_hashtable.h | 6 ++---- helper/include/odp/helper/odph_iplookuptable.h | 6 ++---- helper/include/odp/helper/odph_lineartable.h | 6 ++---- helper/include/odp/helper/sctp.h | 6 ++---- helper/include/odp/helper/strong_types.h | 6 ++---- helper/include/odp/helper/table.h | 6 ++---- helper/include/odp/helper/tcp.h | 6 ++---- helper/include/odp/helper/threads.h | 8 +++----- helper/include/odp/helper/udp.h | 6 ++---- helper/include/odp/helper/version.h.in | 6 ++---- helper/include/odph_list_internal.h | 6 ++---- helper/ip.c | 6 ++---- helper/iplookuptable.c | 6 ++---- helper/ipsec.c | 6 ++---- helper/lineartable.c | 6 ++---- helper/linux/thread.c | 6 ++---- helper/test/chksum.c | 6 ++---- helper/test/cli.c | 6 ++---- helper/test/cuckootable.c | 6 ++---- helper/test/debug.c | 6 ++---- helper/test/iplookuptable.c | 6 ++---- helper/test/linux/process.c | 6 ++---- helper/test/linux/pthread.c | 6 ++---- helper/test/odpthreads.c | 8 +++----- helper/test/odpthreads_as_processes | 6 ++---- helper/test/odpthreads_as_pthreads | 6 ++---- helper/test/parse.c | 6 ++---- helper/test/table.c | 6 ++---- helper/test/version.c | 6 ++---- helper/threads.c | 8 +++----- helper/version.c | 6 ++---- 51 files changed, 107 insertions(+), 205 deletions(-) diff --git a/helper/chksum.c b/helper/chksum.c index 0ac07393bd..69781291c2 100644 --- a/helper/chksum.c +++ b/helper/chksum.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 diff --git a/helper/cli.c b/helper/cli.c index fef42ec61e..4ce4bf62ee 100644 --- a/helper/cli.c +++ b/helper/cli.c @@ -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 */ #include diff --git a/helper/cuckootable.c b/helper/cuckootable.c index 0a71ca3889..85f715b3c7 100644 --- a/helper/cuckootable.c +++ b/helper/cuckootable.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/helper/eth.c b/helper/eth.c index 12218442d3..171563ca88 100644 --- a/helper/eth.c +++ b/helper/eth.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 diff --git a/helper/hashtable.c b/helper/hashtable.c index fc1774bb08..28c23a58c8 100644 --- a/helper/hashtable.c +++ b/helper/hashtable.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 diff --git a/helper/include/odp/helper/chksum.h b/helper/include/odp/helper/chksum.h index b9d808bb29..f9b3f2dc2b 100644 --- a/helper/include/odp/helper/chksum.h +++ b/helper/include/odp/helper/chksum.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/helper/include/odp/helper/cli.h b/helper/include/odp/helper/cli.h index 57e958568a..8a77ab763f 100644 --- a/helper/include/odp/helper/cli.h +++ b/helper/include/odp/helper/cli.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/helper/include/odp/helper/deprecated.h b/helper/include/odp/helper/deprecated.h index 3415b2127d..9251f2ca81 100644 --- a/helper/include/odp/helper/deprecated.h +++ b/helper/include/odp/helper/deprecated.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 */ /** diff --git a/helper/include/odp/helper/eth.h b/helper/include/odp/helper/eth.h index 329a39af4f..2a1f3f159b 100644 --- a/helper/include/odp/helper/eth.h +++ b/helper/include/odp/helper/eth.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/helper/include/odp/helper/gtp.h b/helper/include/odp/helper/gtp.h index eddfac7541..e9f5a8c618 100644 --- a/helper/include/odp/helper/gtp.h +++ b/helper/include/odp/helper/gtp.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(C) 2020 Marvell. + * Copyright(c) 2020 Marvell */ + /** * @file * diff --git a/helper/include/odp/helper/icmp.h b/helper/include/odp/helper/icmp.h index c2b463a24f..8f3215428e 100644 --- a/helper/include/odp/helper/icmp.h +++ b/helper/include/odp/helper/icmp.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/helper/include/odp/helper/igmp.h b/helper/include/odp/helper/igmp.h index 082da52723..7ab0d20ad1 100644 --- a/helper/include/odp/helper/igmp.h +++ b/helper/include/odp/helper/igmp.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(C) 2020 Marvell. + * Copyright(c) 2020 Marvell */ /** diff --git a/helper/include/odp/helper/ip.h b/helper/include/odp/helper/ip.h index 5deb451502..733c145d83 100644 --- a/helper/include/odp/helper/ip.h +++ b/helper/include/odp/helper/ip.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/helper/include/odp/helper/ipsec.h b/helper/include/odp/helper/ipsec.h index 734c13b186..11b7a3829e 100644 --- a/helper/include/odp/helper/ipsec.h +++ b/helper/include/odp/helper/ipsec.h @@ -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 */ diff --git a/helper/include/odp/helper/linux.h b/helper/include/odp/helper/linux.h index f63385ec19..df852569fb 100644 --- a/helper/include/odp/helper/linux.h +++ b/helper/include/odp/helper/linux.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/helper/include/odp/helper/linux/process.h b/helper/include/odp/helper/linux/process.h index fd7faff6c5..0f34d604b8 100644 --- a/helper/include/odp/helper/linux/process.h +++ b/helper/include/odp/helper/linux/process.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/helper/include/odp/helper/linux/pthread.h b/helper/include/odp/helper/linux/pthread.h index ee7700ebdd..5a2f6fd53a 100644 --- a/helper/include/odp/helper/linux/pthread.h +++ b/helper/include/odp/helper/linux/pthread.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/helper/include/odp/helper/odph_api.h b/helper/include/odp/helper/odph_api.h index 3c321b9d47..b4e3985c86 100644 --- a/helper/include/odp/helper/odph_api.h +++ b/helper/include/odp/helper/odph_api.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/helper/include/odp/helper/odph_cuckootable.h b/helper/include/odp/helper/odph_cuckootable.h index 7056c51412..1c87a3d427 100644 --- a/helper/include/odp/helper/odph_cuckootable.h +++ b/helper/include/odp/helper/odph_cuckootable.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/helper/include/odp/helper/odph_debug.h b/helper/include/odp/helper/odph_debug.h index c78df2238b..41b425ab22 100644 --- a/helper/include/odp/helper/odph_debug.h +++ b/helper/include/odp/helper/odph_debug.h @@ -1,9 +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/helper/include/odp/helper/odph_hashtable.h b/helper/include/odp/helper/odph_hashtable.h index 3921e0a2b1..b2dd21920f 100644 --- a/helper/include/odp/helper/odph_hashtable.h +++ b/helper/include/odp/helper/odph_hashtable.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/helper/include/odp/helper/odph_iplookuptable.h b/helper/include/odp/helper/odph_iplookuptable.h index 017746d0dd..41235ecc69 100644 --- a/helper/include/odp/helper/odph_iplookuptable.h +++ b/helper/include/odp/helper/odph_iplookuptable.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/helper/include/odp/helper/odph_lineartable.h b/helper/include/odp/helper/odph_lineartable.h index 72b9472d06..dc61113a54 100644 --- a/helper/include/odp/helper/odph_lineartable.h +++ b/helper/include/odp/helper/odph_lineartable.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/helper/include/odp/helper/sctp.h b/helper/include/odp/helper/sctp.h index da9773de7c..f6661e390f 100644 --- a/helper/include/odp/helper/sctp.h +++ b/helper/include/odp/helper/sctp.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/helper/include/odp/helper/strong_types.h b/helper/include/odp/helper/strong_types.h index 72e3c3176a..b0f504c169 100644 --- a/helper/include/odp/helper/strong_types.h +++ b/helper/include/odp/helper/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/helper/include/odp/helper/table.h b/helper/include/odp/helper/table.h index 711f8a202a..6a24e742b5 100644 --- a/helper/include/odp/helper/table.h +++ b/helper/include/odp/helper/table.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/helper/include/odp/helper/tcp.h b/helper/include/odp/helper/tcp.h index 00dfe4e606..8a14efa154 100644 --- a/helper/include/odp/helper/tcp.h +++ b/helper/include/odp/helper/tcp.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/helper/include/odp/helper/threads.h b/helper/include/odp/helper/threads.h index 785437ed17..358543c854 100644 --- a/helper/include/odp/helper/threads.h +++ b/helper/include/odp/helper/threads.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/helper/include/odp/helper/udp.h b/helper/include/odp/helper/udp.h index 0fe14ac482..53ac7281a2 100644 --- a/helper/include/odp/helper/udp.h +++ b/helper/include/odp/helper/udp.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/helper/include/odp/helper/version.h.in b/helper/include/odp/helper/version.h.in index d08b413c9f..e576de561e 100644 --- a/helper/include/odp/helper/version.h.in +++ b/helper/include/odp/helper/version.h.in @@ -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/helper/include/odph_list_internal.h b/helper/include/odph_list_internal.h index fd889d9711..d90b07ebc2 100644 --- a/helper/include/odph_list_internal.h +++ b/helper/include/odph_list_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/helper/ip.c b/helper/ip.c index 9e02892aa0..964544ddb7 100644 --- a/helper/ip.c +++ b/helper/ip.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 diff --git a/helper/iplookuptable.c b/helper/iplookuptable.c index 22fd6e56c3..31273a0a5e 100644 --- a/helper/iplookuptable.c +++ b/helper/iplookuptable.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 diff --git a/helper/ipsec.c b/helper/ipsec.c index 05f8b841a2..bb7d5d0eb5 100644 --- a/helper/ipsec.c +++ b/helper/ipsec.c @@ -1,9 +1,7 @@ -/* Copyright (c) 2017-2018, Linaro Limited +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2017-2018 Linaro Limited * Copyright (c) 2020 Marvell * Copyright (c) 2021 Nokia - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause */ #include diff --git a/helper/lineartable.c b/helper/lineartable.c index a81e4301c8..290a90c027 100644 --- a/helper/lineartable.c +++ b/helper/lineartable.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 diff --git a/helper/linux/thread.c b/helper/linux/thread.c index 3d90d794c1..d5b0168331 100644 --- a/helper/linux/thread.c +++ b/helper/linux/thread.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 */ #ifndef _GNU_SOURCE diff --git a/helper/test/chksum.c b/helper/test/chksum.c index 3b1f8ed9f0..d7273284aa 100644 --- a/helper/test/chksum.c +++ b/helper/test/chksum.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 diff --git a/helper/test/cli.c b/helper/test/cli.c index 4fa403f5a0..08e7501530 100644 --- a/helper/test/cli.c +++ b/helper/test/cli.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 diff --git a/helper/test/cuckootable.c b/helper/test/cuckootable.c index 06d207f073..d17f795623 100644 --- a/helper/test/cuckootable.c +++ b/helper/test/cuckootable.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/helper/test/debug.c b/helper/test/debug.c index 3b8a69d8b0..78ffb6347a 100644 --- a/helper/test/debug.c +++ b/helper/test/debug.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 diff --git a/helper/test/iplookuptable.c b/helper/test/iplookuptable.c index bd724b1b7a..669d334dd3 100644 --- a/helper/test/iplookuptable.c +++ b/helper/test/iplookuptable.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 diff --git a/helper/test/linux/process.c b/helper/test/linux/process.c index 8d3f31af02..54614a6956 100644 --- a/helper/test/linux/process.c +++ b/helper/test/linux/process.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 diff --git a/helper/test/linux/pthread.c b/helper/test/linux/pthread.c index 770308faac..f6c624df7f 100644 --- a/helper/test/linux/pthread.c +++ b/helper/test/linux/pthread.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 diff --git a/helper/test/odpthreads.c b/helper/test/odpthreads.c index b7b4c21045..bf623569ba 100644 --- a/helper/test/odpthreads.c +++ b/helper/test/odpthreads.c @@ -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/helper/test/odpthreads_as_processes b/helper/test/odpthreads_as_processes index 88f7592725..f71717b6be 100755 --- a/helper/test/odpthreads_as_processes +++ b/helper/test/odpthreads_as_processes @@ -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 # PATH=$(dirname $0):$PATH diff --git a/helper/test/odpthreads_as_pthreads b/helper/test/odpthreads_as_pthreads index 92f43ef904..b666e1a4d4 100755 --- a/helper/test/odpthreads_as_pthreads +++ b/helper/test/odpthreads_as_pthreads @@ -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 # PATH=$(dirname $0):$PATH diff --git a/helper/test/parse.c b/helper/test/parse.c index 3097ae4767..6f4dcc16ce 100644 --- a/helper/test/parse.c +++ b/helper/test/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 diff --git a/helper/test/table.c b/helper/test/table.c index df7a23d6e8..fb17e8a370 100644 --- a/helper/test/table.c +++ b/helper/test/table.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 diff --git a/helper/test/version.c b/helper/test/version.c index 925d305daa..17c9718866 100644 --- a/helper/test/version.c +++ b/helper/test/version.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 diff --git a/helper/threads.c b/helper/threads.c index 74f64b138c..63b4cc0192 100644 --- a/helper/threads.c +++ b/helper/threads.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 */ #ifndef _GNU_SOURCE diff --git a/helper/version.c b/helper/version.c index 586abbe411..f2635a6c27 100644 --- a/helper/version.c +++ b/helper/version.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 From 93ddaf79d79c24e4222fc2c0cb8c56840147c696 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 30 Aug 2023 16:30:35 +0300 Subject: [PATCH 041/192] example: sysinfo: print external packet pool capabilities Print odp_pool_ext_capability() output in sysinfo example. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- example/sysinfo/odp_sysinfo.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/example/sysinfo/odp_sysinfo.c b/example/sysinfo/odp_sysinfo.c index 093b2f1bf1..bd33a4f662 100644 --- a/example/sysinfo/odp_sysinfo.c +++ b/example/sysinfo/odp_sysinfo.c @@ -1,5 +1,5 @@ /* Copyright (c) 2018, Linaro Limited - * Copyright (c) 2022, Nokia + * Copyright (c) 2022-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -370,6 +370,7 @@ int main(void) odp_system_info_t sysinfo; odp_shm_capability_t shm_capa; odp_pool_capability_t pool_capa; + odp_pool_ext_capability_t pool_ext_capa; odp_cls_capability_t cls_capa; odp_comp_capability_t comp_capa; odp_dma_capability_t dma_capa; @@ -444,6 +445,11 @@ int main(void) return -1; } + if (odp_pool_ext_capability(ODP_POOL_PACKET, &pool_ext_capa)) { + printf("external packet pool capability failed\n"); + return -1; + } + if (odp_cls_capability(&cls_capa)) { printf("classifier capability failed\n"); return -1; @@ -569,6 +575,28 @@ int main(void) printf(" vector.min_cache_size:%u\n", pool_capa.vector.min_cache_size); printf(" vector.max_cache_size:%u\n", pool_capa.vector.max_cache_size); + printf("\n"); + printf(" POOL EXT (pkt)\n"); + printf(" max_pools: %u\n", pool_ext_capa.max_pools); + if (pool_ext_capa.max_pools) { + printf(" min_cache_size: %u\n", pool_ext_capa.min_cache_size); + printf(" max_cache_size: %u\n", pool_ext_capa.max_cache_size); + printf(" stats: 0x%" PRIx64 "\n", pool_ext_capa.stats.all); + printf(" pkt.max_num_buf: %u\n", pool_ext_capa.pkt.max_num_buf); + printf(" pkt.max_buf_size: %u B\n", pool_ext_capa.pkt.max_buf_size); + printf(" pkt.odp_header_size: %u B\n", pool_ext_capa.pkt.odp_header_size); + printf(" pkt.odp_trailer_size: %u B\n", pool_ext_capa.pkt.odp_trailer_size); + printf(" pkt.min_mem_align: %u B\n", pool_ext_capa.pkt.min_mem_align); + printf(" pkt.min_buf_align: %u B\n", pool_ext_capa.pkt.min_buf_align); + printf(" pkt.min_head_align: %u B\n", pool_ext_capa.pkt.min_head_align); + printf(" pkt.buf_size_aligned: %u\n", pool_ext_capa.pkt.buf_size_aligned); + printf(" pkt.max_headroom: %u B\n", pool_ext_capa.pkt.max_headroom); + printf(" pkt.max_headroom_size: %u B\n", pool_ext_capa.pkt.max_headroom_size); + printf(" pkt.max_segs_per_pkt: %u\n", pool_ext_capa.pkt.max_segs_per_pkt); + printf(" pkt.max_uarea_size: %u B\n", pool_ext_capa.pkt.max_uarea_size); + printf(" pkt.uarea_persistence: %i\n", pool_ext_capa.pkt.uarea_persistence); + } + printf("\n"); printf(" CLASSIFIER\n"); printf(" supported_terms: 0x%" PRIx64 "\n", cls_capa.supported_terms.all_bits); From d8892f56645845d7c3ab280aace82df7fdc74b75 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 31 Aug 2023 13:50:47 +0300 Subject: [PATCH 042/192] example: sysinfo: print pktio capabilities Print odp_pktio_capability() output in sysinfo example. Also, help print has been added for the application. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- example/sysinfo/odp_sysinfo.c | 238 +++++++++++++++++++++++++++++++++- 1 file changed, 237 insertions(+), 1 deletion(-) diff --git a/example/sysinfo/odp_sysinfo.c b/example/sysinfo/odp_sysinfo.c index bd33a4f662..51fa4f0270 100644 --- a/example/sysinfo/odp_sysinfo.c +++ b/example/sysinfo/odp_sysinfo.c @@ -5,16 +5,36 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + +#include #include #include #include #include #include +#include #define KB 1024 #define MB (1024 * 1024) #define MAX_HUGE_PAGES 32 +#define MAX_IFACES 32 +#define MAX_NAME_LEN 128 + +#define PROG_NAME "odp_sysinfo" + +typedef struct { + char name[MAX_NAME_LEN]; + odp_pktio_capability_t capa; +} pktio_t; + +typedef struct { + int num_pktio; + pktio_t pktio[MAX_IFACES]; +} appl_args_t; /* Check that prints can use %u instead of %PRIu32 */ ODP_STATIC_ASSERT(sizeof(unsigned int) >= sizeof(uint32_t), "unsigned int smaller than uint32_t"); @@ -361,7 +381,211 @@ static void print_auth(odp_auth_alg_t alg) printf("%s ", auth_alg_name(alg)); } -int main(void) +static int pktio_capability(appl_args_t *appl_args) +{ + odp_pool_param_t pool_param; + odp_pool_t pool; + int ret = 0; + + odp_pool_param_init(&pool_param); + + pool_param.type = ODP_POOL_PACKET; + pool_param.pkt.num = 128; + + pool = odp_pool_create("pktio_pool", &pool_param); + if (pool == ODP_POOL_INVALID) { + ODPH_ERR("Creating packet pool failed\n"); + return -1; + } + + for (int i = 0; i < appl_args->num_pktio; i++) { + odp_pktio_param_t param; + odp_pktio_t pktio; + + odp_pktio_param_init(¶m); + + param.in_mode = ODP_PKTIN_MODE_SCHED; + param.out_mode = ODP_PKTOUT_MODE_DIRECT; + + pktio = odp_pktio_open(appl_args->pktio[i].name, pool, ¶m); + if (pktio == ODP_PKTIO_INVALID) { + ODPH_ERR("Opening pktio %s failed\n", appl_args->pktio[i].name); + ret = -1; + break; + } + + if (odp_pktio_capability(pktio, &appl_args->pktio[i].capa)) { + ODPH_ERR("Reading pktio %s capa failed\n", appl_args->pktio[i].name); + ret = -1; + } + + if (odp_pktio_close(pktio)) { + ODPH_ERR("Closing pktio %s failed\n", appl_args->pktio[i].name); + ret = -1; + } + + if (ret) + break; + } + + if (odp_pool_destroy(pool)) { + ODPH_ERR("Destroying pktio pool failed\n"); + return -1; + } + return ret; +} + +static void print_pktio_capa(appl_args_t *appl_args) +{ + for (int i = 0; i < appl_args->num_pktio; i++) { + odp_pktio_capability_t *capa = &appl_args->pktio[i].capa; + + printf("\n"); + printf(" PKTIO (%s)\n", appl_args->pktio[i].name); + printf(" (in_mode: ODP_PKTIN_MODE_SCHED)\n"); + printf(" (out_mode: ODP_PKTOUT_MODE_DIRECT)\n"); + printf(" max_input_queues: %u\n", capa->max_input_queues); + printf(" min_input_queue_size: %u\n", capa->min_input_queue_size); + printf(" max_input_queue_size: %u\n", capa->max_input_queue_size); + printf(" max_output_queues: %u\n", capa->max_output_queues); + printf(" min_output_queue_size: %u\n", capa->min_output_queue_size); + printf(" max_output_queue_size: %u\n", capa->max_output_queue_size); + printf(" config.pktin: 0x%" PRIx64 "\n", + capa->config.pktin.all_bits); + printf(" config.pktout: 0x%" PRIx64 "\n", + capa->config.pktout.all_bits); + printf(" set_op: 0x%" PRIx32 "\n", capa->set_op.all_bits); + printf(" vector.supported: %s\n", + support_level(capa->vector.supported)); + printf(" vector.max_size: %u\n", capa->vector.max_size); + printf(" vector.min_size: %u\n", capa->vector.min_size); + printf(" vector.max_tmo_ns: %" PRIu64 " ns\n", + capa->vector.max_tmo_ns); + printf(" vector.min_tmo_ns: %" PRIu64 " ns\n", + capa->vector.min_tmo_ns); + printf(" lso.max_profiles: %u\n", capa->lso.max_profiles); + printf(" lso.max_profiles_per_pktio: %u\n", capa->lso.max_profiles_per_pktio); + printf(" lso.max_packet_segments: %u\n", capa->lso.max_packet_segments); + printf(" lso.max_segments: %u\n", capa->lso.max_segments); + printf(" lso.max_payload_len: %u B\n", capa->lso.max_payload_len); + printf(" lso.max_payload_offset: %u B\n", capa->lso.max_payload_offset); + printf(" lso.mod_op.add_segment_num: %u\n", capa->lso.mod_op.add_segment_num); + printf(" lso.mod_op.add_payload_len: %u\n", capa->lso.mod_op.add_payload_len); + printf(" lso.mod_op.add_payload_offset: %u\n", + capa->lso.mod_op.add_payload_offset); + printf(" lso.max_num_custom: %u\n", capa->lso.max_num_custom); + printf(" lso.proto.custom: %u\n", capa->lso.proto.custom); + printf(" lso.proto.ipv4: %u\n", capa->lso.proto.ipv4); + printf(" lso.proto.ipv6: %u\n", capa->lso.proto.ipv6); + printf(" lso.proto.tcp_ipv4: %u\n", capa->lso.proto.tcp_ipv4); + printf(" lso.proto.tcp_ipv6: %u\n", capa->lso.proto.tcp_ipv6); + printf(" lso.proto.sctp_ipv4: %u\n", capa->lso.proto.sctp_ipv4); + printf(" lso.proto.sctp_ipv6: %u\n", capa->lso.proto.sctp_ipv6); + printf(" maxlen.equal: %i\n", capa->maxlen.equal); + printf(" maxlen.min_input: %u B\n", capa->maxlen.min_input); + printf(" maxlen.max_input: %u B\n", capa->maxlen.max_input); + printf(" maxlen.min_output: %u B\n", capa->maxlen.min_output); + printf(" maxlen.max_output: %u B\n", capa->maxlen.max_output); + printf(" max_tx_aging_tmo_ns: %" PRIu64 " ns\n", + capa->max_tx_aging_tmo_ns); + printf(" tx_compl.queue_type_sched: %i\n", capa->tx_compl.queue_type_sched); + printf(" tx_compl.queue_type_plain: %i\n", capa->tx_compl.queue_type_plain); + printf(" tx_compl.mode_event: %u\n", capa->tx_compl.mode_event); + printf(" tx_compl.mode_poll: %u\n", capa->tx_compl.mode_poll); + printf(" tx_compl.max_compl_id: %u\n", capa->tx_compl.max_compl_id); + printf(" free_ctrl.dont_free: %u\n", capa->free_ctrl.dont_free); + printf(" reassembly.ip: %i\n", capa->reassembly.ip); + printf(" reassembly.ipv4: %i\n", capa->reassembly.ipv4); + printf(" reassembly.ipv6: %i\n", capa->reassembly.ipv6); + printf(" reassembly.max_wait_time: %" PRIu64 " ns\n", + capa->reassembly.max_wait_time); + printf(" reassembly.max_num_frags: %u\n", capa->reassembly.max_num_frags); + printf(" stats.pktio: 0x%" PRIx64 "\n", + capa->stats.pktio.all_counters); + printf(" stats.pktin_queue: 0x%" PRIx64 "\n", + capa->stats.pktin_queue.all_counters); + printf(" stats.pktout_queue: 0x%" PRIx64 "\n", + capa->stats.pktout_queue.all_counters); + printf(" flow_control.pause_rx: %u\n", capa->flow_control.pause_rx); + printf(" flow_control.pfc_rx: %u\n", capa->flow_control.pfc_rx); + printf(" flow_control.pause_tx: %u\n", capa->flow_control.pause_tx); + printf(" flow_control.pfc_tx: %u\n", capa->flow_control.pfc_tx); + } +} + +static void usage(void) +{ + printf("\n" + "System Information\n" + "\n" + "Usage: %s OPTIONS\n" + " E.g. %s -i eth0\n" + "\n" + "Optional OPTIONS:\n" + " -i, --interfaces Ethernet interfaces for packet I/O, comma-separated, no\n" + " spaces.\n" + " -h, --help Display help and exit.\n" + "\n", PROG_NAME, PROG_NAME); +} + +static void parse_interfaces(appl_args_t *config, const char *optarg) +{ + char *tmp_str = strdup(optarg), *tmp; + + if (tmp_str == NULL) + return; + + tmp = strtok(tmp_str, ","); + + while (tmp && config->num_pktio < MAX_IFACES) { + if (strlen(tmp) + 1 > MAX_NAME_LEN) { + ODPH_ERR("Unable to store interface name (MAX_NAME_LEN=%d)\n", + MAX_NAME_LEN); + exit(EXIT_FAILURE); + } + strncpy(config->pktio[config->num_pktio].name, tmp, MAX_NAME_LEN); + + config->num_pktio++; + + tmp = strtok(NULL, ","); + } + + free(tmp_str); +} + +static void parse_args(int argc, char *argv[], appl_args_t *appl_args) +{ + int opt; + int long_index; + static const struct option longopts[] = { + {"interfaces", required_argument, NULL, 'i'}, + {"help", no_argument, NULL, 'h'}, + {NULL, 0, NULL, 0} + }; + static const char *shortopts = "i:h"; + + while (1) { + opt = getopt_long(argc, argv, shortopts, longopts, &long_index); + + if (opt == -1) + break; /* No more options */ + + switch (opt) { + case 'i': + parse_interfaces(appl_args, optarg); + break; + case 'h': + usage(); + exit(EXIT_SUCCESS); + case '?': + default: + usage(); + exit(EXIT_FAILURE); + } + } +} + +int main(int argc, char **argv) { odp_instance_t inst; int i, num_hp, num_hp_print; @@ -380,6 +604,7 @@ int main(void) odp_ipsec_capability_t ipsec_capa; odp_schedule_capability_t schedule_capa; odp_stash_capability_t stash_capa; + appl_args_t appl_args; uint64_t huge_page[MAX_HUGE_PAGES]; char ava_mask_str[ODP_CPUMASK_STR_SIZE]; char work_mask_str[ODP_CPUMASK_STR_SIZE]; @@ -387,11 +612,15 @@ int main(void) int crypto_ret; int ipsec_ret; + memset(&appl_args, 0, sizeof(appl_args_t)); + printf("\n"); printf("ODP system info example\n"); printf("***********************************************************\n"); printf("\n"); + parse_args(argc, argv, &appl_args); + if (odp_init_global(&inst, NULL, NULL)) { printf("Global init failed.\n"); return -1; @@ -450,6 +679,11 @@ int main(void) return -1; } + if (pktio_capability(&appl_args)) { + printf("pktio capability failed\n"); + return -1; + } + if (odp_cls_capability(&cls_capa)) { printf("classifier capability failed\n"); return -1; @@ -597,6 +831,8 @@ int main(void) printf(" pkt.uarea_persistence: %i\n", pool_ext_capa.pkt.uarea_persistence); } + print_pktio_capa(&appl_args); + printf("\n"); printf(" CLASSIFIER\n"); printf(" supported_terms: 0x%" PRIx64 "\n", cls_capa.supported_terms.all_bits); From 56a4a642c3e75bb5246d22cb0e35daf2dc79d0ae Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 31 Aug 2023 16:29:28 +0300 Subject: [PATCH 043/192] example: sysinfo: print proto stats capabilities Print odp_proto_stats_capability() output in sysinfo example. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- example/sysinfo/odp_sysinfo.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/example/sysinfo/odp_sysinfo.c b/example/sysinfo/odp_sysinfo.c index 51fa4f0270..af024ac8a5 100644 --- a/example/sysinfo/odp_sysinfo.c +++ b/example/sysinfo/odp_sysinfo.c @@ -29,6 +29,7 @@ typedef struct { char name[MAX_NAME_LEN]; odp_pktio_capability_t capa; + odp_proto_stats_capability_t proto_stats_capa; } pktio_t; typedef struct { @@ -419,6 +420,12 @@ static int pktio_capability(appl_args_t *appl_args) ret = -1; } + if (odp_proto_stats_capability(pktio, &appl_args->pktio[i].proto_stats_capa)) { + ODPH_ERR("Reading pktio %s proto stats capa failed\n", + appl_args->pktio[i].name); + ret = -1; + } + if (odp_pktio_close(pktio)) { ODPH_ERR("Closing pktio %s failed\n", appl_args->pktio[i].name); ret = -1; @@ -513,6 +520,19 @@ static void print_pktio_capa(appl_args_t *appl_args) } } +static void print_proto_stats_capa(appl_args_t *appl_args) +{ + for (int i = 0; i < appl_args->num_pktio; i++) { + odp_proto_stats_capability_t *capa = &appl_args->pktio[i].proto_stats_capa; + + printf("\n"); + printf(" PROTO STATS (%s)\n", appl_args->pktio[i].name); + printf(" tx.counters: 0x%" PRIx64 "\n", capa->tx.counters.all_bits); + printf(" tx.oct_count0_adj: %i\n", capa->tx.oct_count0_adj); + printf(" tx.oct_count1_adj: %i\n", capa->tx.oct_count1_adj); + } +} + static void usage(void) { printf("\n" @@ -833,6 +853,8 @@ int main(int argc, char **argv) print_pktio_capa(&appl_args); + print_proto_stats_capa(&appl_args); + printf("\n"); printf(" CLASSIFIER\n"); printf(" supported_terms: 0x%" PRIx64 "\n", cls_capa.supported_terms.all_bits); From 661d5d135ecbcc64e6a0e5744ebbcb0de4ef5584 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 30 Aug 2023 17:15:57 +0300 Subject: [PATCH 044/192] example: sysinfo: improve timer capability prints Print timer capabilities, including periodic, for all supported clock sources in sysinfo example. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- example/sysinfo/odp_sysinfo.c | 90 ++++++++++++++++++++++++++--------- 1 file changed, 67 insertions(+), 23 deletions(-) diff --git a/example/sysinfo/odp_sysinfo.c b/example/sysinfo/odp_sysinfo.c index af024ac8a5..75fbfa3137 100644 --- a/example/sysinfo/odp_sysinfo.c +++ b/example/sysinfo/odp_sysinfo.c @@ -35,6 +35,8 @@ typedef struct { typedef struct { int num_pktio; pktio_t pktio[MAX_IFACES]; + int num_timer; + odp_timer_capability_t timer[ODP_CLOCK_NUM_SRC]; } appl_args_t; /* Check that prints can use %u instead of %PRIu32 */ @@ -533,6 +535,65 @@ static void print_proto_stats_capa(appl_args_t *appl_args) } } +static int timer_capability(appl_args_t *appl_args) +{ + for (int i = 0; i < ODP_CLOCK_NUM_SRC; i++) { + int ret = odp_timer_capability(i, &appl_args->timer[appl_args->num_timer]); + + if (ret && i == ODP_CLOCK_DEFAULT) { + ODPH_ERR("odp_timer_capability() failed for default clock source: %d\n", + ret); + return -1; + } + if (ret == -1) + continue; + if (ret < -1) { + ODPH_ERR("odp_timer_capability() failed: %d\n", ret); + return -1; + } + appl_args->num_timer++; + } + return 0; +} + +static void print_timer_capa(appl_args_t *appl_args) +{ + for (int i = 0; i < appl_args->num_timer; i++) { + odp_timer_capability_t *capa = &appl_args->timer[i]; + + printf("\n"); + printf(" TIMER (SRC %d)\n", i); + + printf(" max_pools_combined: %u\n", capa->max_pools_combined); + printf(" max_pools: %u\n", capa->max_pools); + printf(" max_timers: %u\n", capa->max_timers); + printf(" queue_type_sched: %i\n", capa->queue_type_sched); + printf(" queue_type_plain: %i\n", capa->queue_type_plain); + printf(" highest_res_ns: %" PRIu64 " nsec\n", capa->highest_res_ns); + printf(" maximum resolution\n"); + printf(" res_ns: %" PRIu64 " nsec\n", capa->max_res.res_ns); + printf(" res_hz: %" PRIu64 " hz\n", capa->max_res.res_hz); + printf(" min_tmo: %" PRIu64 " nsec\n", capa->max_res.min_tmo); + printf(" max_tmo: %" PRIu64 " nsec\n", capa->max_res.max_tmo); + printf(" maximum timeout\n"); + printf(" res_ns: %" PRIu64 " nsec\n", capa->max_tmo.res_ns); + printf(" res_hz: %" PRIu64 " hz\n", capa->max_tmo.res_hz); + printf(" min_tmo: %" PRIu64 " nsec\n", capa->max_tmo.min_tmo); + printf(" max_tmo: %" PRIu64 " nsec\n", capa->max_tmo.max_tmo); + printf(" periodic\n"); + printf(" max_pools: %u\n", capa->periodic.max_pools); + printf(" max_timers: %u\n", capa->periodic.max_timers); + printf(" min_base_freq_hz: %" PRIu64 " %" PRIu64 "/%" PRIu64 " Hz\n", + capa->periodic.min_base_freq_hz.integer, + capa->periodic.min_base_freq_hz.numer, + capa->periodic.min_base_freq_hz.denom); + printf(" max_base_freq_hz: %" PRIu64 " %" PRIu64 "/%" PRIu64 " Hz\n", + capa->periodic.max_base_freq_hz.integer, + capa->periodic.max_base_freq_hz.numer, + capa->periodic.max_base_freq_hz.denom); + } +} + static void usage(void) { printf("\n" @@ -619,7 +680,6 @@ int main(int argc, char **argv) odp_comp_capability_t comp_capa; odp_dma_capability_t dma_capa; odp_queue_capability_t queue_capa; - odp_timer_capability_t timer_capa; odp_crypto_capability_t crypto_capa; odp_ipsec_capability_t ipsec_capa; odp_schedule_capability_t schedule_capa; @@ -734,7 +794,7 @@ int main(int argc, char **argv) return -1; } - if (odp_timer_capability(ODP_CLOCK_DEFAULT, &timer_capa)) { + if (timer_capability(&appl_args)) { printf("timer capability failed\n"); return -1; } @@ -922,27 +982,10 @@ int main(int argc, char **argv) printf(" max_obj_size: %u\n", stash_capa.max_obj_size); printf(" max_cache_size: %u\n", stash_capa.max_cache_size); - printf("\n"); - printf(" TIMER (ODP_CLOCK_DEFAULT)\n"); - printf(" max_pools_combined: %u\n", timer_capa.max_pools_combined); - printf(" max_pools: %u\n", timer_capa.max_pools); - printf(" max_timers: %u\n", timer_capa.max_timers); - printf(" queue_type_sched: %i\n", timer_capa.queue_type_sched); - printf(" queue_type_plain: %i\n", timer_capa.queue_type_plain); - printf(" highest_res_ns: %" PRIu64 " nsec\n", timer_capa.highest_res_ns); - printf(" maximum resolution\n"); - printf(" res_ns: %" PRIu64 " nsec\n", timer_capa.max_res.res_ns); - printf(" res_hz: %" PRIu64 " hz\n", timer_capa.max_res.res_hz); - printf(" min_tmo: %" PRIu64 " nsec\n", timer_capa.max_res.min_tmo); - printf(" max_tmo: %" PRIu64 " nsec\n", timer_capa.max_res.max_tmo); - printf(" maximum timeout\n"); - printf(" res_ns: %" PRIu64 " nsec\n", timer_capa.max_tmo.res_ns); - printf(" res_hz: %" PRIu64 " hz\n", timer_capa.max_tmo.res_hz); - printf(" min_tmo: %" PRIu64 " nsec\n", timer_capa.max_tmo.min_tmo); - printf(" max_tmo: %" PRIu64 " nsec\n", timer_capa.max_tmo.max_tmo); - printf("\n"); + print_timer_capa(&appl_args); if (crypto_ret == 0) { + printf("\n"); printf(" CRYPTO\n"); printf(" max sessions: %u\n", crypto_capa.max_sessions); printf(" sync mode support: %s\n", support_level(crypto_capa.sync_mode)); @@ -957,10 +1000,10 @@ int main(int argc, char **argv) foreach_auth(crypto_capa.auths, print_auth); printf("\n"); foreach_auth(crypto_capa.auths, print_auth_capa); - printf("\n"); } if (ipsec_ret == 0) { + printf("\n"); printf(" IPSEC\n"); printf(" max SAs: %u\n", ipsec_capa.max_num_sa); printf(" sync mode support: %s\n", @@ -1003,9 +1046,10 @@ int main(int argc, char **argv) printf("\n"); printf(" auth algorithms: "); foreach_auth(ipsec_capa.auths, print_auth); - printf("\n\n"); + printf("\n"); } + printf("\n"); printf(" SHM MEMORY BLOCKS:\n"); odp_shm_print_all(); From e90c16e3d439f941ea7a3ea66cc79d2ff9dbc82b Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 4 Sep 2023 14:52:41 +0300 Subject: [PATCH 045/192] example: sysinfo: use ODPH_ERR() for error prints Use ODPH_ERR() helper macro for all error prints. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- example/sysinfo/odp_sysinfo.c | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/example/sysinfo/odp_sysinfo.c b/example/sysinfo/odp_sysinfo.c index 75fbfa3137..607ef5d7f8 100644 --- a/example/sysinfo/odp_sysinfo.c +++ b/example/sysinfo/odp_sysinfo.c @@ -702,12 +702,12 @@ int main(int argc, char **argv) parse_args(argc, argv, &appl_args); if (odp_init_global(&inst, NULL, NULL)) { - printf("Global init failed.\n"); + ODPH_ERR("Global init failed.\n"); return -1; } if (odp_init_local(inst, ODP_THREAD_CONTROL)) { - printf("Local init failed.\n"); + ODPH_ERR("Local init failed.\n"); return -1; } @@ -722,7 +722,7 @@ int main(int argc, char **argv) odp_sys_config_print(); if (odp_system_info(&sysinfo)) { - printf("system info call failed\n"); + ODPH_ERR("system info call failed\n"); return -1; } @@ -745,67 +745,67 @@ int main(int argc, char **argv) num_hp_print = MAX_HUGE_PAGES; if (odp_shm_capability(&shm_capa)) { - printf("shm capability failed\n"); + ODPH_ERR("shm capability failed\n"); return -1; } if (odp_pool_capability(&pool_capa)) { - printf("pool capability failed\n"); + ODPH_ERR("pool capability failed\n"); return -1; } if (odp_pool_ext_capability(ODP_POOL_PACKET, &pool_ext_capa)) { - printf("external packet pool capability failed\n"); + ODPH_ERR("external packet pool capability failed\n"); return -1; } if (pktio_capability(&appl_args)) { - printf("pktio capability failed\n"); + ODPH_ERR("pktio capability failed\n"); return -1; } if (odp_cls_capability(&cls_capa)) { - printf("classifier capability failed\n"); + ODPH_ERR("classifier capability failed\n"); return -1; } if (odp_comp_capability(&comp_capa)) { - printf("compression capability failed\n"); + ODPH_ERR("compression capability failed\n"); return -1; } if (odp_dma_capability(&dma_capa)) { - printf("dma capability failed\n"); + ODPH_ERR("dma capability failed\n"); return -1; } if (odp_queue_capability(&queue_capa)) { - printf("queue capability failed\n"); + ODPH_ERR("queue capability failed\n"); return -1; } if (odp_schedule_capability(&schedule_capa)) { - printf("schedule capability failed\n"); + ODPH_ERR("schedule capability failed\n"); return -1; } if (odp_stash_capability(&stash_capa, ODP_STASH_TYPE_DEFAULT)) { - printf("stash capability failed\n"); + ODPH_ERR("stash capability failed\n"); return -1; } if (timer_capability(&appl_args)) { - printf("timer capability failed\n"); + ODPH_ERR("timer capability failed\n"); return -1; } crypto_ret = odp_crypto_capability(&crypto_capa); if (crypto_ret < 0) - printf("crypto capability failed\n"); + ODPH_ERR("crypto capability failed\n"); ipsec_ret = odp_ipsec_capability(&ipsec_capa); if (ipsec_ret < 0) - printf("IPsec capability failed\n"); + ODPH_ERR("IPsec capability failed\n"); printf("\n"); printf("S Y S T E M I N F O R M A T I O N\n"); @@ -1058,12 +1058,12 @@ int main(int argc, char **argv) printf("\n"); if (odp_term_local()) { - printf("Local term failed.\n"); + ODPH_ERR("Local term failed.\n"); return -1; } if (odp_term_global(inst)) { - printf("Global term failed.\n"); + ODPH_ERR("Global term failed.\n"); return -1; } From bd108dfaccd4f2aa69aaf7aa9a60f813682acf01 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 4 Sep 2023 15:02:52 +0300 Subject: [PATCH 046/192] example: sysinfo: make exit codes uniform Use EXIT_SUCCESS/EXIT_FAILURE always when exiting the application. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- example/sysinfo/odp_sysinfo.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/example/sysinfo/odp_sysinfo.c b/example/sysinfo/odp_sysinfo.c index 607ef5d7f8..9424f657a7 100644 --- a/example/sysinfo/odp_sysinfo.c +++ b/example/sysinfo/odp_sysinfo.c @@ -703,12 +703,12 @@ int main(int argc, char **argv) if (odp_init_global(&inst, NULL, NULL)) { ODPH_ERR("Global init failed.\n"); - return -1; + exit(EXIT_FAILURE); } if (odp_init_local(inst, ODP_THREAD_CONTROL)) { ODPH_ERR("Local init failed.\n"); - return -1; + exit(EXIT_FAILURE); } printf("\n"); @@ -723,7 +723,7 @@ int main(int argc, char **argv) if (odp_system_info(&sysinfo)) { ODPH_ERR("system info call failed\n"); - return -1; + exit(EXIT_FAILURE); } memset(ava_mask_str, 0, ODP_CPUMASK_STR_SIZE); @@ -746,57 +746,57 @@ int main(int argc, char **argv) if (odp_shm_capability(&shm_capa)) { ODPH_ERR("shm capability failed\n"); - return -1; + exit(EXIT_FAILURE); } if (odp_pool_capability(&pool_capa)) { ODPH_ERR("pool capability failed\n"); - return -1; + exit(EXIT_FAILURE); } if (odp_pool_ext_capability(ODP_POOL_PACKET, &pool_ext_capa)) { ODPH_ERR("external packet pool capability failed\n"); - return -1; + exit(EXIT_FAILURE); } if (pktio_capability(&appl_args)) { ODPH_ERR("pktio capability failed\n"); - return -1; + exit(EXIT_FAILURE); } if (odp_cls_capability(&cls_capa)) { ODPH_ERR("classifier capability failed\n"); - return -1; + exit(EXIT_FAILURE); } if (odp_comp_capability(&comp_capa)) { ODPH_ERR("compression capability failed\n"); - return -1; + exit(EXIT_FAILURE); } if (odp_dma_capability(&dma_capa)) { ODPH_ERR("dma capability failed\n"); - return -1; + exit(EXIT_FAILURE); } if (odp_queue_capability(&queue_capa)) { ODPH_ERR("queue capability failed\n"); - return -1; + exit(EXIT_FAILURE); } if (odp_schedule_capability(&schedule_capa)) { ODPH_ERR("schedule capability failed\n"); - return -1; + exit(EXIT_FAILURE); } if (odp_stash_capability(&stash_capa, ODP_STASH_TYPE_DEFAULT)) { ODPH_ERR("stash capability failed\n"); - return -1; + exit(EXIT_FAILURE); } if (timer_capability(&appl_args)) { ODPH_ERR("timer capability failed\n"); - return -1; + exit(EXIT_FAILURE); } crypto_ret = odp_crypto_capability(&crypto_capa); @@ -1059,13 +1059,13 @@ int main(int argc, char **argv) if (odp_term_local()) { ODPH_ERR("Local term failed.\n"); - return -1; + exit(EXIT_FAILURE); } if (odp_term_global(inst)) { ODPH_ERR("Global term failed.\n"); - return -1; + exit(EXIT_FAILURE); } - return 0; + return EXIT_SUCCESS; } From a2085dd3d15bca1ca8f0d3da69e89becce80103f Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 4 Sep 2023 16:13:40 +0300 Subject: [PATCH 047/192] example: sysinfo: print missing capabilities Print missing capabilities and units in sysinfo example. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- example/sysinfo/odp_sysinfo.c | 181 ++++++++++++++++++++++------------ 1 file changed, 120 insertions(+), 61 deletions(-) diff --git a/example/sysinfo/odp_sysinfo.c b/example/sysinfo/odp_sysinfo.c index 9424f657a7..21ad244611 100644 --- a/example/sysinfo/odp_sysinfo.c +++ b/example/sysinfo/odp_sysinfo.c @@ -861,33 +861,47 @@ int main(int argc, char **argv) printf("\n"); printf(" POOL\n"); - printf(" max_pools: %u\n", pool_capa.max_pools); - printf(" buf.max_pools: %u\n", pool_capa.buf.max_pools); - printf(" buf.max_align: %u B\n", pool_capa.buf.max_align); - printf(" buf.max_size: %u kB\n", pool_capa.buf.max_size / KB); - printf(" buf.max_num: %u\n", pool_capa.buf.max_num); - printf(" buf.min_cache_size: %u\n", pool_capa.buf.min_cache_size); - printf(" buf.max_cache_size: %u\n", pool_capa.buf.max_cache_size); - printf(" pkt.max_pools: %u\n", pool_capa.pkt.max_pools); - printf(" pkt.max_len: %u kB\n", pool_capa.pkt.max_len / KB); - printf(" pkt.max_num: %u\n", pool_capa.pkt.max_num); - printf(" pkt.max_align: %u\n", pool_capa.pkt.max_align); - printf(" pkt.max_headroom: %u\n", pool_capa.pkt.max_headroom); - printf(" pkt.max_segs_per_pkt: %u\n", pool_capa.pkt.max_segs_per_pkt); - printf(" pkt.max_seg_len: %u B\n", pool_capa.pkt.max_seg_len); - printf(" pkt.max_uarea_size: %u B\n", pool_capa.pkt.max_uarea_size); - printf(" pkt.max_num_subparam: %u\n", pool_capa.pkt.max_num_subparam); - printf(" pkt.min_cache_size: %u\n", pool_capa.pkt.min_cache_size); - printf(" pkt.max_cache_size: %u\n", pool_capa.pkt.max_cache_size); - printf(" tmo.max_pools: %u\n", pool_capa.tmo.max_pools); - printf(" tmo.max_num: %u\n", pool_capa.tmo.max_num); - printf(" tmo.min_cache_size: %u\n", pool_capa.tmo.min_cache_size); - printf(" tmo.max_cache_size: %u\n", pool_capa.tmo.max_cache_size); - printf(" vector.max_pools: %u\n", pool_capa.vector.max_pools); - printf(" vector.max_num: %u\n", pool_capa.vector.max_num); - printf(" vector.max_size: %u\n", pool_capa.vector.max_size); - printf(" vector.min_cache_size:%u\n", pool_capa.vector.min_cache_size); - printf(" vector.max_cache_size:%u\n", pool_capa.vector.max_cache_size); + printf(" max_pools: %u\n", pool_capa.max_pools); + printf(" buf.max_pools: %u\n", pool_capa.buf.max_pools); + printf(" buf.max_align: %u B\n", pool_capa.buf.max_align); + printf(" buf.max_size: %u kB\n", pool_capa.buf.max_size / KB); + printf(" buf.max_num: %u\n", pool_capa.buf.max_num); + printf(" buf.max_uarea_size: %u B\n", pool_capa.buf.max_uarea_size); + printf(" buf.uarea_persistence: %i\n", pool_capa.buf.uarea_persistence); + printf(" buf.min_cache_size: %u\n", pool_capa.buf.min_cache_size); + printf(" buf.max_cache_size: %u\n", pool_capa.buf.max_cache_size); + printf(" buf.stats: 0x%" PRIx64 "\n", pool_capa.buf.stats.all); + printf(" pkt.max_pools: %u\n", pool_capa.pkt.max_pools); + printf(" pkt.max_len: %u kB\n", pool_capa.pkt.max_len / KB); + printf(" pkt.max_num: %u\n", pool_capa.pkt.max_num); + printf(" pkt.max_align: %u B\n", pool_capa.pkt.max_align); + printf(" pkt.min_headroom: %u B\n", pool_capa.pkt.min_headroom); + printf(" pkt.max_headroom: %u B\n", pool_capa.pkt.max_headroom); + printf(" pkt.min_tailroom: %u B\n", pool_capa.pkt.min_tailroom); + printf(" pkt.max_segs_per_pkt: %u\n", pool_capa.pkt.max_segs_per_pkt); + printf(" pkt.min_seg_len: %u B\n", pool_capa.pkt.min_seg_len); + printf(" pkt.max_seg_len: %u B\n", pool_capa.pkt.max_seg_len); + printf(" pkt.max_uarea_size: %u B\n", pool_capa.pkt.max_uarea_size); + printf(" pkt.uarea_persistence: %i\n", pool_capa.pkt.uarea_persistence); + printf(" pkt.max_num_subparam: %u\n", pool_capa.pkt.max_num_subparam); + printf(" pkt.min_cache_size: %u\n", pool_capa.pkt.min_cache_size); + printf(" pkt.max_cache_size: %u\n", pool_capa.pkt.max_cache_size); + printf(" pkt.stats: 0x%" PRIx64 "\n", pool_capa.pkt.stats.all); + printf(" tmo.max_pools: %u\n", pool_capa.tmo.max_pools); + printf(" tmo.max_num: %u\n", pool_capa.tmo.max_num); + printf(" tmo.max_uarea_size: %u B\n", pool_capa.tmo.max_uarea_size); + printf(" tmo.uarea_persistence: %i\n", pool_capa.tmo.uarea_persistence); + printf(" tmo.min_cache_size: %u\n", pool_capa.tmo.min_cache_size); + printf(" tmo.max_cache_size: %u\n", pool_capa.tmo.max_cache_size); + printf(" tmo.stats: 0x%" PRIx64 "\n", pool_capa.tmo.stats.all); + printf(" vector.max_pools: %u\n", pool_capa.vector.max_pools); + printf(" vector.max_num: %u\n", pool_capa.vector.max_num); + printf(" vector.max_size: %u\n", pool_capa.vector.max_size); + printf(" vector.max_uarea_size: %u B\n", pool_capa.vector.max_uarea_size); + printf(" vector.uarea_persistence: %i\n", pool_capa.vector.uarea_persistence); + printf(" vector.min_cache_size: %u\n", pool_capa.vector.min_cache_size); + printf(" vector.max_cache_size: %u\n", pool_capa.vector.max_cache_size); + printf(" vector.stats: 0x%" PRIx64 "\n", pool_capa.vector.stats.all); printf("\n"); printf(" POOL EXT (pkt)\n"); @@ -917,15 +931,19 @@ int main(int argc, char **argv) printf("\n"); printf(" CLASSIFIER\n"); - printf(" supported_terms: 0x%" PRIx64 "\n", cls_capa.supported_terms.all_bits); - printf(" max_pmr_terms: %u\n", cls_capa.max_pmr_terms); - printf(" available_pmr_terms: %u\n", cls_capa.available_pmr_terms); - printf(" max_cos: %u\n", cls_capa.max_cos); - printf(" max_hash_queues: %u\n", cls_capa.max_hash_queues); - printf(" hash_protocols: 0x%x\n", cls_capa.hash_protocols.all_bits); - printf(" pmr_range_supported: %i\n", cls_capa.pmr_range_supported); - printf(" max_mark: %" PRIu64 "\n", cls_capa.max_mark); - printf(" stats.queue: 0x%" PRIx64 "\n", cls_capa.stats.queue.all_counters); + printf(" supported_terms: 0x%" PRIx64 "\n", cls_capa.supported_terms.all_bits); + printf(" max_pmr_terms: %u\n", cls_capa.max_pmr_terms); + printf(" available_pmr_terms: %u\n", cls_capa.available_pmr_terms); + printf(" max_cos: %u\n", cls_capa.max_cos); + printf(" max_hash_queues: %u\n", cls_capa.max_hash_queues); + printf(" hash_protocols: 0x%x\n", cls_capa.hash_protocols.all_bits); + printf(" pmr_range_supported: %i\n", cls_capa.pmr_range_supported); + printf(" random_early_detection: %s\n", support_level(cls_capa.random_early_detection)); + printf(" threshold_red: 0x%" PRIx8 "\n", cls_capa.threshold_red.all_bits); + printf(" back_pressure: %s\n", support_level(cls_capa.back_pressure)); + printf(" threshold_bp: 0x%" PRIx8 "\n", cls_capa.threshold_bp.all_bits); + printf(" max_mark: %" PRIu64 "\n", cls_capa.max_mark); + printf(" stats.queue: 0x%" PRIx64 "\n", cls_capa.stats.queue.all_counters); printf("\n"); printf(" COMPRESSION\n"); @@ -937,19 +955,21 @@ int main(int argc, char **argv) printf("\n"); printf(" DMA\n"); - printf(" max_sessions: %u\n", dma_capa.max_sessions); - printf(" max_transfers: %u\n", dma_capa.max_transfers); - printf(" max_src_segs: %u\n", dma_capa.max_src_segs); - printf(" max_dst_segs: %u\n", dma_capa.max_dst_segs); - printf(" max_segs: %u\n", dma_capa.max_segs); - printf(" max_seg_len: %u\n", dma_capa.max_seg_len); - printf(" compl_mode_mask: 0x%x\n", dma_capa.compl_mode_mask); - printf(" queue_type_sched: %i\n", dma_capa.queue_type_sched); - printf(" queue_type_plain: %i\n", dma_capa.queue_type_plain); - printf(" pool.max_pools: %u\n", dma_capa.pool.max_pools); - printf(" pool.max_num: %u\n", dma_capa.pool.max_num); - printf(" pool.min_cache_size: %u\n", dma_capa.pool.min_cache_size); - printf(" pool.max_cache_size: %u\n", dma_capa.pool.max_cache_size); + printf(" max_sessions: %u\n", dma_capa.max_sessions); + printf(" max_transfers: %u\n", dma_capa.max_transfers); + printf(" max_src_segs: %u\n", dma_capa.max_src_segs); + printf(" max_dst_segs: %u\n", dma_capa.max_dst_segs); + printf(" max_segs: %u\n", dma_capa.max_segs); + printf(" max_seg_len: %u B\n", dma_capa.max_seg_len); + printf(" compl_mode_mask: 0x%x\n", dma_capa.compl_mode_mask); + printf(" queue_type_sched: %i\n", dma_capa.queue_type_sched); + printf(" queue_type_plain: %i\n", dma_capa.queue_type_plain); + printf(" pool.max_pools: %u\n", dma_capa.pool.max_pools); + printf(" pool.max_num: %u\n", dma_capa.pool.max_num); + printf(" pool.max_uarea_size: %u B\n", dma_capa.pool.max_uarea_size); + printf(" pool.uarea_persistence: %u\n", dma_capa.pool.uarea_persistence); + printf(" pool.min_cache_size: %u\n", dma_capa.pool.min_cache_size); + printf(" pool.max_cache_size: %u\n", dma_capa.pool.max_cache_size); printf("\n"); printf(" QUEUE\n"); @@ -969,37 +989,53 @@ int main(int argc, char **argv) printf(" max_queues: %u\n", schedule_capa.max_queues); printf(" max_queue_size: %u\n", schedule_capa.max_queue_size); printf(" max_flow_id: %u\n", schedule_capa.max_flow_id); - printf(" lockfree_queues: %ssupported\n", - schedule_capa.lockfree_queues ? "" : "not "); - printf(" waitfree_queues: %ssupported\n", - schedule_capa.waitfree_queues ? "" : "not "); + printf(" lockfree_queues: %s\n", support_level(schedule_capa.lockfree_queues)); + printf(" waitfree_queues: %s\n", support_level(schedule_capa.waitfree_queues)); + printf(" order_wait: %s\n", support_level(schedule_capa.order_wait)); printf("\n"); printf(" STASH\n"); printf(" max_stashes_any_type: %u\n", stash_capa.max_stashes_any_type); printf(" max_stashes: %u\n", stash_capa.max_stashes); printf(" max_num_obj: %" PRIu64 "\n", stash_capa.max_num_obj); - printf(" max_obj_size: %u\n", stash_capa.max_obj_size); + printf(" max_num.u8: %" PRIu64 "\n", stash_capa.max_num.u8); + printf(" max_num.u16: %" PRIu64 "\n", stash_capa.max_num.u16); + printf(" max_num.u32: %" PRIu64 "\n", stash_capa.max_num.u32); + printf(" max_num.u64: %" PRIu64 "\n", stash_capa.max_num.u64); + printf(" max_num.u128: %" PRIu64 "\n", stash_capa.max_num.u128); + printf(" max_num.max_obj_size: %" PRIu64 "\n", stash_capa.max_num.max_obj_size); + printf(" max_obj_size: %u B\n", stash_capa.max_obj_size); printf(" max_cache_size: %u\n", stash_capa.max_cache_size); + printf(" max_get_batch: %u\n", stash_capa.max_get_batch); + printf(" max_put_batch: %u\n", stash_capa.max_put_batch); + printf(" stats: 0x%" PRIx64 "\n", stash_capa.stats.all); print_timer_capa(&appl_args); if (crypto_ret == 0) { printf("\n"); printf(" CRYPTO\n"); - printf(" max sessions: %u\n", crypto_capa.max_sessions); - printf(" sync mode support: %s\n", support_level(crypto_capa.sync_mode)); - printf(" async mode support: %s\n", support_level(crypto_capa.async_mode)); - printf(" queue_type_sched: %i\n", crypto_capa.queue_type_sched); - printf(" queue_type_plain: %i\n", crypto_capa.queue_type_plain); - printf(" cipher algorithms: "); + printf(" max sessions: %u\n", crypto_capa.max_sessions); + printf(" sync mode support: %s\n", support_level(crypto_capa.sync_mode)); + printf(" async mode support: %s\n", support_level(crypto_capa.async_mode)); + printf(" queue_type_sched: %i\n", crypto_capa.queue_type_sched); + printf(" queue_type_plain: %i\n", crypto_capa.queue_type_plain); + printf(" cipher algorithms: "); foreach_cipher(crypto_capa.ciphers, print_cipher); printf("\n"); foreach_cipher(crypto_capa.ciphers, print_cipher_capa); - printf(" auth algorithms: "); + printf(" cipher algorithms (HW): "); + foreach_cipher(crypto_capa.hw_ciphers, print_cipher); + printf("\n"); + foreach_cipher(crypto_capa.hw_ciphers, print_cipher_capa); + printf(" auth algorithms: "); foreach_auth(crypto_capa.auths, print_auth); printf("\n"); foreach_auth(crypto_capa.auths, print_auth_capa); + printf(" auth algorithms (HW): "); + foreach_auth(crypto_capa.hw_auths, print_auth); + printf("\n"); + foreach_auth(crypto_capa.hw_auths, print_auth_capa); } if (ipsec_ret == 0) { @@ -1037,10 +1073,33 @@ int main(int argc, char **argv) printf(" max destination queues: %u\n", ipsec_capa.max_queues); printf(" queue_type_sched: %i\n", ipsec_capa.queue_type_sched); printf(" queue_type_plain: %i\n", ipsec_capa.queue_type_plain); + printf(" vector support: %s\n", + support_level(ipsec_capa.vector.supported)); + printf(" min_size: %u\n", ipsec_capa.vector.min_size); + printf(" max_size: %u\n", ipsec_capa.vector.max_size); + printf(" min_tmo_ns: %" PRIu64 " ns\n", + ipsec_capa.vector.min_tmo_ns); + printf(" max_tmo_ns: %" PRIu64 " ns\n", + ipsec_capa.vector.max_tmo_ns); printf(" max anti-replay window size: %u\n", ipsec_capa.max_antireplay_ws); printf(" inline TM pipelining: %s\n", support_level(ipsec_capa.inline_ipsec_tm)); + printf(" testing capabilities:\n"); + printf(" sa_operations.seq_num: %i\n", + ipsec_capa.test.sa_operations.seq_num); + printf(" sa_operations.antireplay_window_top: %i\n", + ipsec_capa.test.sa_operations.antireplay_window_top); + printf(" post-IPsec reassembly support:\n"); + printf(" ip: %i\n", ipsec_capa.reassembly.ip); + printf(" ipv4: %i\n", ipsec_capa.reassembly.ipv4); + printf(" ipv6: %i\n", ipsec_capa.reassembly.ipv6); + printf(" max_wait_time: %" PRIu64 "\n", + ipsec_capa.reassembly.max_wait_time); + printf(" max_num_frags: %" PRIu16 "\n", + ipsec_capa.reassembly.max_num_frags); + printf(" reass_async: %i\n", ipsec_capa.reass_async); + printf(" reass_inline: %i\n", ipsec_capa.reass_inline); printf(" cipher algorithms: "); foreach_cipher(ipsec_capa.ciphers, print_cipher); printf("\n"); From 6b758861ba04f54b63a276069f417f5c44e53de9 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Fri, 25 Aug 2023 13:08:15 +0000 Subject: [PATCH 048/192] test: dmafwd: fix potential memory leak When tearing down resources, free interface string unconditionally as teardown logic could be reached before packet I/Os have been opened. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- test/performance/odp_dmafwd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c index 8375a434b7..45cedbfdff 100644 --- a/test/performance/odp_dmafwd.c +++ b/test/performance/odp_dmafwd.c @@ -947,11 +947,12 @@ static void teardown(prog_config_t *config) { thread_config_t *thr; - for (uint32_t i = 0U; i < config->num_ifs; ++i) - if (config->pktios[i].handle != ODP_PKTIO_INVALID) { + for (uint32_t i = 0U; i < config->num_ifs; ++i) { + free(config->pktios[i].name); + + if (config->pktios[i].handle != ODP_PKTIO_INVALID) (void)odp_pktio_close(config->pktios[i].handle); - free(config->pktios[i].name); - } + } if (config->pktio_pool != ODP_POOL_INVALID) (void)odp_pool_destroy(config->pktio_pool); From 73a9a2f6f11da157b13f250bd1bff48052535eb4 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Fri, 25 Aug 2023 11:36:23 +0000 Subject: [PATCH 049/192] test: dmafwd: add run time option Add option to configure tester run time. This is useful in finite test run contexts such as CI. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- test/performance/odp_dmafwd.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c index 45cedbfdff..4404b5f49b 100644 --- a/test/performance/odp_dmafwd.c +++ b/test/performance/odp_dmafwd.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -35,6 +36,7 @@ enum { #define DEF_CNT 32768U #define DEF_LEN 1024U #define DEF_WORKERS 1U +#define DEF_TIME 0U #define MAX_IFS 2U #define MAX_OUT_QS 32U @@ -118,6 +120,7 @@ typedef struct prog_config_s { uint32_t num_pkts; uint32_t pkt_len; uint32_t cache_size; + uint32_t time_sec; int num_thrs; uint8_t num_ifs; uint8_t copy_type; @@ -175,6 +178,7 @@ static void init_config(prog_config_t *config) config->num_pkts = config->dyn_defs.num_pkts; config->pkt_len = config->dyn_defs.pkt_len; config->cache_size = config->dyn_defs.cache_size; + config->time_sec = DEF_TIME; config->num_thrs = DEF_WORKERS; config->copy_type = DEF_CPY_TYPE; @@ -219,9 +223,10 @@ static void print_usage(dynamic_defs_t *dyn_defs) " default.\n" " -c, --worker_count Amount of workers. %u by default.\n" " -C, --cache_size Packet pool cache size. %u by default.\n" + " -T, --time_sec Time in seconds to run. 0 means infinite. %u by default.\n" " -h, --help This help.\n" "\n", DEF_CPY_TYPE, dyn_defs->burst_size, dyn_defs->num_pkts, dyn_defs->pkt_len, - DEF_WORKERS, dyn_defs->cache_size); + DEF_WORKERS, dyn_defs->cache_size, DEF_TIME); } static void parse_interfaces(prog_config_t *config, const char *optarg) @@ -353,11 +358,12 @@ static parse_result_t parse_options(int argc, char **argv, prog_config_t *config { "pkt_len", required_argument, NULL, 'l' }, { "worker_count", required_argument, NULL, 'c' }, { "cache_size", required_argument, NULL, 'C' }, + { "time_sec", required_argument, NULL, 'T' }, { "help", no_argument, NULL, 'h' }, { NULL, 0, NULL, 0 } }; - static const char *shortopts = "i:t:b:n:l:c:C:h"; + static const char *shortopts = "i:t:b:n:l:c:C:T:h"; init_config(config); @@ -389,6 +395,9 @@ static parse_result_t parse_options(int argc, char **argv, prog_config_t *config case 'C': config->cache_size = atoi(optarg); break; + case 'T': + config->time_sec = atoi(optarg); + break; case 'h': print_usage(&config->dyn_defs); return PRS_TERM; @@ -1095,8 +1104,13 @@ int main(int argc, char **argv) goto out_test; } - while (odp_atomic_load_u32(&prog_conf->is_running)) - odp_cpu_pause(); + if (prog_conf->time_sec) { + sleep(prog_conf->time_sec); + odp_atomic_store_u32(&prog_conf->is_running, 0U); + } else { + while (odp_atomic_load_u32(&prog_conf->is_running)) + sleep(1U); + } stop_test(prog_conf); print_stats(prog_conf); From beb41b9d0723c2497f40211bbc6d1e34d37584be Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Fri, 25 Aug 2023 11:53:14 +0000 Subject: [PATCH 050/192] test: dmafwd: add return value for unsupported features Add new return value for tester to indicate that program exit was due to implementation not supporting certain features. This is useful e.g. in CI context where test runs can be skipped in case of lacking feature set. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- test/performance/odp_dmafwd.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c index 4404b5f49b..20fac97900 100644 --- a/test/performance/odp_dmafwd.c +++ b/test/performance/odp_dmafwd.c @@ -24,6 +24,7 @@ #include #include +#define EXIT_NOT_SUP 2 #define PROG_NAME "odp_dmafwd" #define DELIMITER "," @@ -60,7 +61,8 @@ typedef struct { typedef enum { PRS_OK, PRS_NOK, - PRS_TERM + PRS_TERM, + PRS_NOT_SUP } parse_result_t; typedef struct prog_config_s prog_config_t; @@ -287,7 +289,7 @@ static parse_result_t check_options(prog_config_t *config) if ((uint32_t)config->num_thrs > dma_capa.max_sessions) { ODPH_ERR("Not enough DMA sessions supported: %d (max: %u)\n", config->num_thrs, dma_capa.max_sessions); - return PRS_NOK; + return PRS_NOT_SUP; } burst_size = MIN(dma_capa.max_src_segs, dma_capa.max_dst_segs); @@ -308,7 +310,7 @@ static parse_result_t check_options(prog_config_t *config) if ((dma_capa.compl_mode_mask & ODP_DMA_COMPL_EVENT) == 0U || !dma_capa.queue_type_sched) { ODPH_ERR("Unsupported completion mode (mode support: %x, scheduled queue " "support: %u\n", dma_capa.compl_mode_mask, dma_capa.queue_type_sched); - return PRS_NOK; + return PRS_NOT_SUP; } if ((uint32_t)config->num_thrs > dma_capa.pool.max_pools) { @@ -1090,6 +1092,11 @@ int main(int argc, char **argv) goto out_test; } + if (parse_res == PRS_NOT_SUP) { + ret = EXIT_NOT_SUP; + goto out_test; + } + if (odp_schedule_config(NULL) < 0) { ODPH_ERR("Error configuring scheduler\n"); ret = EXIT_FAILURE; From edc0084406f60b04bb73932058a0465e54265430 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Fri, 25 Aug 2023 12:46:59 +0000 Subject: [PATCH 051/192] test: dmafwd: add CI integration Add test script and build files to setup a test run of `odp_dmafwd` with a few different scenarios during `make check`. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- platform/linux-generic/m4/configure.m4 | 2 + platform/linux-generic/test/Makefile.am | 12 ++-- .../test/performance/Makefile.am | 1 + .../test/performance/dmafwd/Makefile.am | 18 +++++ .../test/performance/dmafwd/pktio_env | 57 ++++++++++++++++ test/performance/Makefile.am | 3 +- test/performance/odp_dmafwd_run.sh | 68 +++++++++++++++++++ 7 files changed, 155 insertions(+), 6 deletions(-) create mode 100644 platform/linux-generic/test/performance/Makefile.am create mode 100644 platform/linux-generic/test/performance/dmafwd/Makefile.am create mode 100644 platform/linux-generic/test/performance/dmafwd/pktio_env create mode 100755 test/performance/odp_dmafwd_run.sh diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4 index 00ee3683b5..556f01c19a 100644 --- a/platform/linux-generic/m4/configure.m4 +++ b/platform/linux-generic/m4/configure.m4 @@ -71,5 +71,7 @@ AC_CONFIG_FILES([platform/linux-generic/Makefile platform/linux-generic/test/example/switch/Makefile platform/linux-generic/test/validation/api/shmem/Makefile platform/linux-generic/test/validation/api/pktio/Makefile + platform/linux-generic/test/performance/Makefile + platform/linux-generic/test/performance/dmafwd/Makefile platform/linux-generic/test/pktio_ipc/Makefile]) ]) diff --git a/platform/linux-generic/test/Makefile.am b/platform/linux-generic/test/Makefile.am index 99d7199adc..30ef260783 100644 --- a/platform/linux-generic/test/Makefile.am +++ b/platform/linux-generic/test/Makefile.am @@ -15,10 +15,11 @@ TESTS += validation/api/pktio/pktio_run.sh \ validation/api/pktio/pktio_run_tap.sh \ validation/api/shmem/shmem_linux$(EXEEXT) -SUBDIRS += validation/api/pktio\ - validation/api/shmem\ - pktio_ipc \ - example +SUBDIRS += validation/api/pktio \ + validation/api/shmem \ + pktio_ipc \ + example \ + performance if ODP_PKTIO_PCAP TESTS += validation/api/pktio/pktio_run_pcap.sh @@ -31,7 +32,8 @@ SUBDIRS += pktio_ipc else #performance tests refer to pktio_env if test_perf -SUBDIRS += validation/api/pktio +SUBDIRS += validation/api/pktio \ + performance endif endif diff --git a/platform/linux-generic/test/performance/Makefile.am b/platform/linux-generic/test/performance/Makefile.am new file mode 100644 index 0000000000..4070f09f2e --- /dev/null +++ b/platform/linux-generic/test/performance/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = dmafwd diff --git a/platform/linux-generic/test/performance/dmafwd/Makefile.am b/platform/linux-generic/test/performance/dmafwd/Makefile.am new file mode 100644 index 0000000000..91d42cc745 --- /dev/null +++ b/platform/linux-generic/test/performance/dmafwd/Makefile.am @@ -0,0 +1,18 @@ +EXTRA_DIST = pktio_env + +all-local: + if [ "x$(srcdir)" != "x$(builddir)" ]; then \ + for f in $(EXTRA_DIST); do \ + if [ -e $(srcdir)/$$f ]; then \ + mkdir -p $(builddir)/$$(dirname $$f); \ + cp -f $(srcdir)/$$f $(builddir)/$$f; \ + fi \ + done \ + fi + +clean-local: + if [ "x$(srcdir)" != "x$(builddir)" ]; then \ + for f in $(EXTRA_DIST); do \ + rm -f $(builddir)/$$f; \ + done \ + fi diff --git a/platform/linux-generic/test/performance/dmafwd/pktio_env b/platform/linux-generic/test/performance/dmafwd/pktio_env new file mode 100644 index 0000000000..91075973ed --- /dev/null +++ b/platform/linux-generic/test/performance/dmafwd/pktio_env @@ -0,0 +1,57 @@ +#!/bin/sh +# +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2023 Nokia + +PCAP_IN=`find . ${TEST_DIR} $(dirname $0) -name udp64.pcap -print -quit` +PCAP_OUT=dmafwd_out.pcap +IF0=pcap:in=${PCAP_IN}:out=${PCAP_OUT} +DUMP=tcpdump + +if [ "$0" = "$BASH_SOURCE" ]; then + echo "ERROR: Platform specific env file has to be sourced." +fi + +validate_result() +{ + local RET=0 + + if command -v ${DUMP}; then + local VALIN=valin + local VALOUT=valout + + ${DUMP} -r ${PCAP_IN} -t -x > ${VALIN} + ${DUMP} -r ${PCAP_OUT} -t -x > ${VALOUT} + diff ${VALIN} ${VALOUT} + RET=$? + rm -f ${VALIN} + rm -f ${VALOUT} + else + echo "WARNING: No ${DUMP} available, using \"stat\" for diff" + local SZIN=$(stat -c %s ${PCAP_IN}) + local SZOUT=$(stat -c %s ${PCAP_OUT}) + + if [ ${SZIN} -ne ${SZOUT} ]; then + RET=1 + fi + fi + + rm -f ${PCAP_OUT} + + if [ $RET -ne 0 ]; then + echo "ERROR: Input and output captures do not match, exiting" + exit 1 + fi + + return 0 +} + +setup_interfaces() +{ + return 0 +} + +cleanup_interfaces() +{ + return 0 +} diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am index b995a9d6a7..68532ac6ab 100644 --- a/test/performance/Makefile.am +++ b/test/performance/Makefile.am @@ -47,7 +47,8 @@ TESTSCRIPTS = odp_cpu_bench_run.sh \ odp_timer_perf_run.sh if ODP_PKTIO_PCAP -TESTSCRIPTS += odp_pktio_ordered_run.sh +TESTSCRIPTS += odp_dmafwd_run.sh \ + odp_pktio_ordered_run.sh endif TEST_EXTENSIONS = .sh diff --git a/test/performance/odp_dmafwd_run.sh b/test/performance/odp_dmafwd_run.sh new file mode 100755 index 0000000000..85a2c20f1c --- /dev/null +++ b/test/performance/odp_dmafwd_run.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2023 Nokia + +TEST_DIR="${TEST_DIR:-$PWD}" +TEST_SRC_DIR=$(dirname $0) +PERF_TEST_DIR=platform/${ODP_PLATFORM}/test/performance +PERF_TEST_DIR=${TEST_SRC_DIR}/../../${PERF_TEST_DIR} + +BIN_NAME=odp_dmafwd +BATCH=10 +TIME=2 +TESTS_RUN=0 + +check_env() +{ + if [ -f "./pktio_env" ]; then + . ./pktio_env + elif [ "${ODP_PLATFORM}" = "" ]; then + echo "$0: ERROR: ODP_PLATFORM must be defined" + exit 1 + elif [ -f ${PERF_TEST_DIR}/dmafwd/pktio_env ]; then + . ${PERF_TEST_DIR}/dmafwd/pktio_env + else + echo "ERROR: unable to find pktio_env" + echo "pktio_env has to be in current directory or in platform/\$ODP_PLATFORM/test/" + echo "ODP_PLATFORM=\"${ODP_PLATFORM}\"" + exit 1 + fi +} + +check_result() +{ + if [ $1 -eq 0 ]; then + TESTS_RUN=`expr $TESTS_RUN + 1` + elif [ $1 -eq 1 ]; then + echo "Test FAILED, exiting" + exit 1 + else + echo "Test SKIPPED" + return 0 + fi + + validate_result +} + +check_exit() +{ + if [ $TESTS_RUN -eq 0 ]; then + exit 77 + fi + + exit 0 +} + +check_env +setup_interfaces +echo "${BIN_NAME}: SW copy" +echo "===================" +./${BIN_NAME}${EXEEXT} -i ${IF0} -b ${BATCH} -T ${TIME} -t 0 +check_result $? +echo "${BIN_NAME}: DMA copy" +echo "====================" +./${BIN_NAME}${EXEEXT} -i ${IF0} -b ${BATCH} -T ${TIME} -t 1 +check_result $? +cleanup_interfaces +check_exit From a18fd930fb1191f7c338890b145efdab443e7b38 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 30 Aug 2023 16:17:52 +0300 Subject: [PATCH 052/192] linux-gen: pool: fix odp_pool_ext_capability() return value According to the specification, odp_pool_ext_capability() should set 'max_pools' to zero and return success if a valid but unsupported pool type is used. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- platform/linux-generic/odp_pool.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index e7b2398de1..b3b6f9c407 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -1856,8 +1856,21 @@ int odp_pool_ext_capability(odp_pool_type_t type, odp_pool_ext_capability_t *cap { odp_pool_stats_opt_t supported_stats; - if (type != ODP_POOL_PACKET) + _ODP_ASSERT(capa != NULL); + + switch (type) { + case ODP_POOL_PACKET: + break; + case ODP_POOL_BUFFER: + case ODP_POOL_TIMEOUT: + case ODP_POOL_VECTOR: + case ODP_POOL_DMA_COMPL: + memset(capa, 0, sizeof(odp_pool_ext_capability_t)); + return 0; + default: + _ODP_ERR("Invalid pool type: %d\n", type); return -1; + } supported_stats.all = 0; From 6ab85aac737beb937ca5714f7cf98c21e20c1044 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 1 Sep 2023 15:09:50 +0300 Subject: [PATCH 053/192] validation: pool: improve odp_pool_ext_capability() tests Add tests to validate that odp_pool_ext_capability() works according to the specification when unsupported pool type is used. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale --- test/validation/api/pool/pool.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c index 5176bb96f2..af6392e45f 100644 --- a/test/validation/api/pool/pool.c +++ b/test/validation/api/pool/pool.c @@ -1698,7 +1698,19 @@ static void pool_ext_init_packet_pool_param(odp_pool_ext_param_t *param) static void test_packet_pool_ext_capa(void) { odp_pool_ext_capability_t capa; - odp_pool_type_t type = ODP_POOL_PACKET; + odp_pool_type_t type; + const odp_pool_type_t unsupported_types[] = {ODP_POOL_BUFFER, ODP_POOL_TIMEOUT, + ODP_POOL_VECTOR, ODP_POOL_DMA_COMPL}; + const int num_types = sizeof(unsupported_types) / sizeof(unsupported_types[0]); + + /* Verify operation for unsupported pool types */ + for (int i = 0; i < num_types; i++) { + type = unsupported_types[i]; + CU_ASSERT_FATAL(odp_pool_ext_capability(type, &capa) == 0); + CU_ASSERT(capa.max_pools == 0); + } + + type = ODP_POOL_PACKET; CU_ASSERT_FATAL(odp_pool_ext_capability(type, &capa) == 0); From d6ebc187fa2a65ed3ded2445a90e1b9ccf614d5e Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 6 Sep 2023 11:14:46 +0300 Subject: [PATCH 054/192] linux-gen: pktio: remove packet vector tx code Transmitting packet vectors is not supported by the current API, so remove the code from the implementation. This may improve performance when using packet output through event queues. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale --- platform/linux-generic/odp_packet_io.c | 77 ++++---------------------- 1 file changed, 10 insertions(+), 67 deletions(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 4c1178751d..5a08d65d73 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -825,56 +825,20 @@ static inline int pktin_recv_buf(pktio_entry_t *entry, int pktin_index, return 1; } -static inline int packet_vector_send(odp_pktout_queue_t pktout_queue, odp_event_t event) -{ - odp_packet_vector_t pktv = odp_packet_vector_from_event(event); - odp_packet_t *pkt_tbl; - int num, sent; - - num = odp_packet_vector_tbl(pktv, &pkt_tbl); - _ODP_ASSERT(num > 0); - sent = odp_pktout_send(pktout_queue, pkt_tbl, num); - - /* Return success if any packets were sent. Free the possible remaining - packets in the vector and increase out_discards count accordingly. */ - if (odp_unlikely(sent <= 0)) { - return -1; - } else if (odp_unlikely(sent != num)) { - pktio_entry_t *entry = get_pktio_entry(pktout_queue.pktio); - int discards = num - sent; - - _ODP_ASSERT(entry != NULL); - - odp_atomic_add_u64(&entry->stats_extra.out_discards, discards); - - if (odp_unlikely(_odp_pktio_tx_compl_enabled(entry))) - _odp_pktio_allocate_and_send_tx_compl_events(entry, &pkt_tbl[sent], - discards); - - odp_packet_free_multi(&pkt_tbl[sent], discards); - } - - odp_packet_vector_free(pktv); - - return 0; -} - static int pktout_enqueue(odp_queue_t queue, _odp_event_hdr_t *event_hdr) { - odp_event_t event = _odp_event_from_hdr(event_hdr); odp_packet_t pkt = packet_from_event_hdr(event_hdr); odp_pktout_queue_t pktout_queue; int len = 1; int nbr; + _ODP_ASSERT(odp_event_type(_odp_event_from_hdr(event_hdr)) == ODP_EVENT_PACKET); + if (_odp_sched_fn->ord_enq_multi(queue, (void **)event_hdr, len, &nbr)) return (nbr == len ? 0 : -1); pktout_queue = _odp_queue_fn->get_pktout(queue); - if (odp_event_type(event) == ODP_EVENT_PACKET_VECTOR) - return packet_vector_send(pktout_queue, event); - nbr = odp_pktout_send(pktout_queue, &pkt, len); return (nbr == len ? 0 : -1); } @@ -882,47 +846,26 @@ static int pktout_enqueue(odp_queue_t queue, _odp_event_hdr_t *event_hdr) static int pktout_enq_multi(odp_queue_t queue, _odp_event_hdr_t *event_hdr[], int num) { - odp_event_t event; odp_packet_t pkt_tbl[QUEUE_MULTI_MAX]; odp_pktout_queue_t pktout_queue; - int have_pktv = 0; int nbr; int i; + if (ODP_DEBUG) { + for (int i = 0; i < num; i++) + _ODP_ASSERT(odp_event_type(_odp_event_from_hdr(event_hdr[i])) == + ODP_EVENT_PACKET); + } + if (_odp_sched_fn->ord_enq_multi(queue, (void **)event_hdr, num, &nbr)) return nbr; - for (i = 0; i < num; ++i) { - event = _odp_event_from_hdr(event_hdr[i]); - - if (odp_event_type(event) == ODP_EVENT_PACKET_VECTOR) { - have_pktv = 1; - break; - } - + for (i = 0; i < num; ++i) pkt_tbl[i] = packet_from_event_hdr(event_hdr[i]); - } pktout_queue = _odp_queue_fn->get_pktout(queue); - if (!have_pktv) - return odp_pktout_send(pktout_queue, pkt_tbl, num); - - for (i = 0; i < num; ++i) { - event = _odp_event_from_hdr(event_hdr[i]); - - if (odp_event_type(event) == ODP_EVENT_PACKET_VECTOR) { - if (odp_unlikely(packet_vector_send(pktout_queue, event))) - break; - } else { - odp_packet_t pkt = packet_from_event_hdr(event_hdr[i]); - - nbr = odp_pktout_send(pktout_queue, &pkt, 1); - if (odp_unlikely(nbr != 1)) - break; - } - } - return i; + return odp_pktout_send(pktout_queue, pkt_tbl, num); } static _odp_event_hdr_t *pktin_dequeue(odp_queue_t queue) From 528a2dc5d11f613abcc83082b669a8f15ae7b40c Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 6 Sep 2023 13:06:52 +0300 Subject: [PATCH 055/192] linux-gen: pktio: simplify pktout enqueue functions After packet vector transmit code was removed in the previous commit, packet output through event queues can be simplified. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale --- platform/linux-generic/odp_packet_io.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 5a08d65d73..985de5f03d 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -828,28 +828,21 @@ static inline int pktin_recv_buf(pktio_entry_t *entry, int pktin_index, static int pktout_enqueue(odp_queue_t queue, _odp_event_hdr_t *event_hdr) { odp_packet_t pkt = packet_from_event_hdr(event_hdr); - odp_pktout_queue_t pktout_queue; - int len = 1; int nbr; _ODP_ASSERT(odp_event_type(_odp_event_from_hdr(event_hdr)) == ODP_EVENT_PACKET); - if (_odp_sched_fn->ord_enq_multi(queue, (void **)event_hdr, len, &nbr)) - return (nbr == len ? 0 : -1); - - pktout_queue = _odp_queue_fn->get_pktout(queue); + if (_odp_sched_fn->ord_enq_multi(queue, (void **)event_hdr, 1, &nbr)) + return (nbr == 1 ? 0 : -1); - nbr = odp_pktout_send(pktout_queue, &pkt, len); - return (nbr == len ? 0 : -1); + nbr = odp_pktout_send(_odp_queue_fn->get_pktout(queue), &pkt, 1); + return (nbr == 1 ? 0 : -1); } static int pktout_enq_multi(odp_queue_t queue, _odp_event_hdr_t *event_hdr[], int num) { - odp_packet_t pkt_tbl[QUEUE_MULTI_MAX]; - odp_pktout_queue_t pktout_queue; int nbr; - int i; if (ODP_DEBUG) { for (int i = 0; i < num; i++) @@ -860,12 +853,7 @@ static int pktout_enq_multi(odp_queue_t queue, _odp_event_hdr_t *event_hdr[], if (_odp_sched_fn->ord_enq_multi(queue, (void **)event_hdr, num, &nbr)) return nbr; - for (i = 0; i < num; ++i) - pkt_tbl[i] = packet_from_event_hdr(event_hdr[i]); - - pktout_queue = _odp_queue_fn->get_pktout(queue); - - return odp_pktout_send(pktout_queue, pkt_tbl, num); + return odp_pktout_send(_odp_queue_fn->get_pktout(queue), (odp_packet_t *)event_hdr, num); } static _odp_event_hdr_t *pktin_dequeue(odp_queue_t queue) From 73297c10e36ce1dff747b0d617d61616e27efd5e Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 7 Sep 2023 16:31:58 +0300 Subject: [PATCH 056/192] example: sysinfo: print timer pool tick information Print timer pool tick info from odp_timer_pool_info(). Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- example/sysinfo/odp_sysinfo.c | 56 +++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 6 deletions(-) diff --git a/example/sysinfo/odp_sysinfo.c b/example/sysinfo/odp_sysinfo.c index 21ad244611..4564067b86 100644 --- a/example/sysinfo/odp_sysinfo.c +++ b/example/sysinfo/odp_sysinfo.c @@ -35,8 +35,11 @@ typedef struct { typedef struct { int num_pktio; pktio_t pktio[MAX_IFACES]; - int num_timer; - odp_timer_capability_t timer[ODP_CLOCK_NUM_SRC]; + struct { + odp_timer_capability_t capa[ODP_CLOCK_NUM_SRC]; + odp_timer_pool_info_t pool_info[ODP_CLOCK_NUM_SRC]; + int num; + } timer; } appl_args_t; /* Check that prints can use %u instead of %PRIu32 */ @@ -538,8 +541,13 @@ static void print_proto_stats_capa(appl_args_t *appl_args) static int timer_capability(appl_args_t *appl_args) { for (int i = 0; i < ODP_CLOCK_NUM_SRC; i++) { - int ret = odp_timer_capability(i, &appl_args->timer[appl_args->num_timer]); + int ret; + odp_timer_pool_t pool; + odp_timer_pool_param_t params; + odp_timer_capability_t *capa = &appl_args->timer.capa[appl_args->timer.num]; + odp_timer_pool_info_t *info = &appl_args->timer.pool_info[appl_args->timer.num]; + ret = odp_timer_capability(i, capa); if (ret && i == ODP_CLOCK_DEFAULT) { ODPH_ERR("odp_timer_capability() failed for default clock source: %d\n", ret); @@ -551,15 +559,38 @@ static int timer_capability(appl_args_t *appl_args) ODPH_ERR("odp_timer_capability() failed: %d\n", ret); return -1; } - appl_args->num_timer++; + + odp_timer_pool_param_init(¶ms); + params.clk_src = i; + params.res_ns = capa->max_res.res_ns; + params.min_tmo = capa->max_res.min_tmo; + params.max_tmo = capa->max_res.max_tmo; + params.num_timers = 1; + + pool = odp_timer_pool_create("timer_pool", ¶ms); + if (pool == ODP_TIMER_POOL_INVALID) { + ODPH_ERR("odp_timer_pool_create() failed for clock source: %d\n", i); + return -1; + } + + ret = odp_timer_pool_info(pool, info); + if (ret) { + ODPH_ERR("odp_timer_pool_info() failed: %d\n", ret); + return -1; + } + + odp_timer_pool_destroy(pool); + + appl_args->timer.num++; } return 0; } static void print_timer_capa(appl_args_t *appl_args) { - for (int i = 0; i < appl_args->num_timer; i++) { - odp_timer_capability_t *capa = &appl_args->timer[i]; + for (int i = 0; i < appl_args->timer.num; i++) { + odp_timer_capability_t *capa = &appl_args->timer.capa[i]; + odp_timer_pool_info_t *info = &appl_args->timer.pool_info[i]; printf("\n"); printf(" TIMER (SRC %d)\n", i); @@ -591,6 +622,19 @@ static void print_timer_capa(appl_args_t *appl_args) capa->periodic.max_base_freq_hz.integer, capa->periodic.max_base_freq_hz.numer, capa->periodic.max_base_freq_hz.denom); + printf(" timer pool tick info (max_res)\n"); + printf(" freq: %" PRIu64 " %" PRIu64 "/%" PRIu64 " Hz\n", + info->tick_info.freq.integer, + info->tick_info.freq.numer, + info->tick_info.freq.denom); + printf(" nsec: %" PRIu64 " %" PRIu64 "/%" PRIu64 " ns\n", + info->tick_info.nsec.integer, + info->tick_info.nsec.numer, + info->tick_info.nsec.denom); + printf(" clk_cycle: %" PRIu64 " %" PRIu64 "/%" PRIu64 " cycles\n", + info->tick_info.clk_cycle.integer, + info->tick_info.clk_cycle.numer, + info->tick_info.clk_cycle.denom); } } From 926a4cbc03562a9806607b7bb0b7b4e2d9aae7db Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Wed, 26 Jul 2023 08:53:00 +0000 Subject: [PATCH 057/192] linux-gen: packet: add fields for TX completion poll mode In preparation for TX completion poll mode support, add new parser and header fields. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- .../include/odp/api/plat/packet_inline_types.h | 9 +++++---- platform/linux-generic/include/odp_packet_internal.h | 3 +++ platform/linux-generic/odp_packet.c | 4 ++-- platform/linux-generic/odp_packet_io.c | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-) 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 5186efed0e..eb20ca7d77 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 @@ -123,7 +123,7 @@ typedef union { uint32_t all_flags; struct { - uint32_t reserved1: 5; + uint32_t reserved1: 4; /* * Init flags @@ -141,7 +141,8 @@ typedef union { uint32_t l4_chksum_set: 1; /* L4 chksum bit is valid */ uint32_t l4_chksum: 1; /* L4 chksum override */ uint32_t ts_set: 1; /* Set Tx timestamp */ - uint32_t tx_compl: 1; /* Tx completion event requested */ + uint32_t tx_compl_ev: 1; /* Tx completion event requested */ + uint32_t tx_compl_poll: 1; /* Tx completion poll requested */ uint32_t free_ctrl: 1; /* Don't free option */ uint32_t tx_aging: 1; /* Packet aging at Tx requested */ uint32_t shaper_len_adj: 8; /* Adjustment for traffic mgr */ @@ -160,8 +161,8 @@ typedef union { /* Flag groups */ struct { - uint32_t reserved2: 5; - uint32_t other: 20; /* All other flags */ + uint32_t reserved2: 4; + uint32_t other: 21; /* All other flags */ uint32_t error: 7; /* All error flags */ } all; diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index a6a8c551cb..eef0239f2e 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -147,6 +147,9 @@ typedef struct ODP_ALIGNED_CACHE odp_packet_hdr_t { * request + requested drop timeout). */ uint64_t tx_aging_ns; + /* Tx completion poll completion identifier */ + uint32_t tx_compl_id; + /* LSO profile index */ uint8_t lso_profile_idx; diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index cabb9fed51..f6f936b29f 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2218,7 +2218,7 @@ int odp_packet_tx_compl_request(odp_packet_t pkt, const odp_packet_tx_compl_opt_ { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - pkt_hdr->p.flags.tx_compl = opt->mode == ODP_PACKET_TX_COMPL_EVENT ? 1 : 0; + pkt_hdr->p.flags.tx_compl_ev = opt->mode == ODP_PACKET_TX_COMPL_EVENT ? 1 : 0; pkt_hdr->dst_queue = opt->queue; return 0; @@ -2228,7 +2228,7 @@ int odp_packet_has_tx_compl_request(odp_packet_t pkt) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - return pkt_hdr->p.flags.tx_compl; + return pkt_hdr->p.flags.tx_compl_ev; } void odp_packet_tx_compl_free(odp_packet_tx_compl_t tx_compl) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 985de5f03d..28b321d58a 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -2632,7 +2632,7 @@ uint64_t odp_pktin_wait_time(uint64_t nsec) static void check_tx_compl_ev(const odp_packet_hdr_t *hdr, int pkt_idx, tx_compl_info_t *info, uint16_t *num) { - if (odp_unlikely(hdr->p.flags.tx_compl)) { + if (odp_unlikely(hdr->p.flags.tx_compl_ev)) { info[*num].user_ptr = hdr->user_ptr; info[*num].queue = hdr->dst_queue; info[*num].idx = pkt_idx; @@ -3233,7 +3233,7 @@ void _odp_pktio_allocate_and_send_tx_compl_events(const pktio_entry_t *entry, odp_packet_hdr_t *hdr; for (int i = 0; i < num; i++) - if (odp_unlikely(packet_hdr(packets[i])->p.flags.tx_compl)) + if (odp_unlikely(packet_hdr(packets[i])->p.flags.tx_compl_ev)) idx[num_tx_cevs++] = i; if (odp_unlikely(num_tx_cevs)) { From 4cf41a56e960fa1d81459f9f2520df02629a06fa Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Thu, 27 Jul 2023 08:40:23 +0000 Subject: [PATCH 058/192] linux-gen: pktio: implement TX completion poll mode Implement TX completion poll mode support. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- .../include/odp_config_internal.h | 7 +- .../include/odp_packet_io_internal.h | 8 +- platform/linux-generic/odp_packet_io.c | 200 +++++++++++++----- platform/linux-generic/odp_traffic_mngr.c | 3 +- 4 files changed, 155 insertions(+), 63 deletions(-) diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h index e4f8d6d6d7..f83a237e99 100644 --- a/platform/linux-generic/include/odp_config_internal.h +++ b/platform/linux-generic/include/odp_config_internal.h @@ -134,10 +134,11 @@ extern "C" { /* * Number of shared memory blocks reserved for implementation internal use. * - * Each pool requires three blocks (buffers, ring, user area), and 20 blocks - * are reserved for per ODP module global data. + * Each pool requires three blocks (buffers, ring, user area), 20 blocks + * are reserved for per ODP module global data and one block per packet I/O is + * reserved for TX completion usage. */ -#define CONFIG_INTERNAL_SHM_BLOCKS ((ODP_CONFIG_POOLS * 3) + 20) +#define CONFIG_INTERNAL_SHM_BLOCKS ((ODP_CONFIG_POOLS * 3) + 20 + ODP_CONFIG_PKTIO_ENTRIES) /* * Maximum number of shared memory blocks. diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 05dda98977..5490c3d018 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -142,6 +142,10 @@ typedef struct ODP_ALIGNED_CACHE { /* Pool for Tx completion events */ odp_pool_t tx_compl_pool; + /* Status map SHM handle */ + odp_shm_t tx_compl_status_shm; + /* Status map for Tx completion identifiers */ + odp_atomic_u32_t *tx_compl_status; /* Storage for queue handles * Multi-queue support is pktio driver specific */ @@ -338,8 +342,8 @@ int _odp_lso_create_packets(odp_packet_t packet, const odp_packet_lso_opt_t *lso uint32_t payload_len, uint32_t left_over_len, odp_packet_t pkt_out[], int num_pkt); -void _odp_pktio_allocate_and_send_tx_compl_events(const pktio_entry_t *entry, - const odp_packet_t packets[], int num); +void _odp_pktio_process_tx_compl(const pktio_entry_t *entry, const odp_packet_t packets[], + int num); static inline int _odp_pktio_packet_to_pool(odp_packet_t *pkt, odp_packet_hdr_t **pkt_hdr, diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 28b321d58a..bf77404a81 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -56,9 +56,17 @@ #define MAX_TX_AGING_TMO_NS 3600000000000ULL typedef struct { - const void *user_ptr; - odp_queue_t queue; + union { + struct { + odp_buffer_t buf; + const void *user_ptr; + odp_queue_t queue; + }; + + odp_atomic_u32_t *status; + }; uint16_t idx; + uint8_t mode; } tx_compl_info_t; /* Global variables */ @@ -266,6 +274,7 @@ static void init_pktio_entry(pktio_entry_t *entry) entry->enabled.all_flags = 0; entry->tx_compl_pool = ODP_POOL_INVALID; + entry->tx_compl_status_shm = ODP_SHM_INVALID; odp_atomic_init_u64(&entry->stats_extra.in_discards, 0); odp_atomic_init_u64(&entry->stats_extra.in_errors, 0); @@ -514,13 +523,21 @@ int odp_pktio_close(odp_pktio_t hdl) entry->num_out_queue = 0; if (entry->tx_compl_pool != ODP_POOL_INVALID) { - if (odp_pool_destroy(entry->tx_compl_pool)) { + if (odp_pool_destroy(entry->tx_compl_pool) == -1) { unlock_entry(entry); _ODP_ERR("Unable to destroy Tx event completion pool\n"); return -1; } } + if (entry->tx_compl_status_shm != ODP_SHM_INVALID) { + if (odp_shm_free(entry->tx_compl_status_shm) < 0) { + unlock_entry(entry); + _ODP_ERR("Unable to destroy Tx poll completion SHM\n"); + return -1; + } + } + odp_spinlock_lock(&pktio_global->lock); res = _pktio_close(entry); odp_spinlock_unlock(&pktio_global->lock); @@ -537,14 +554,13 @@ int odp_pktio_close(odp_pktio_t hdl) static int configure_tx_event_compl(pktio_entry_t *entry) { odp_pool_param_t params; - const char *name_base = "_odp_pktio_tx_compl_pool_"; + const char *name_base = "_odp_pktio_tx_compl_"; char pool_name[ODP_POOL_NAME_LEN]; if (entry->tx_compl_pool != ODP_POOL_INVALID) return 0; - snprintf(pool_name, sizeof(pool_name), "%s%d", name_base, - odp_pktio_index(entry->handle)); + snprintf(pool_name, sizeof(pool_name), "%s%d", name_base, odp_pktio_index(entry->handle)); odp_pool_param_init(¶ms); params.type = ODP_POOL_BUFFER; @@ -558,6 +574,33 @@ static int configure_tx_event_compl(pktio_entry_t *entry) return 0; } +static int configure_tx_poll_compl(pktio_entry_t *entry, uint32_t count) +{ + odp_shm_t shm; + const char *name_base = "_odp_pktio_tx_compl_"; + char shm_name[ODP_SHM_NAME_LEN]; + + if (entry->tx_compl_status_shm != ODP_SHM_INVALID) + return 0; + + snprintf(shm_name, sizeof(shm_name), "%s%d", name_base, odp_pktio_index(entry->handle)); + shm = odp_shm_reserve(shm_name, sizeof(odp_atomic_u32_t) * count, ODP_CACHE_LINE_SIZE, 0); + + if (shm == ODP_SHM_INVALID) + return -1; + + entry->tx_compl_status_shm = shm; + entry->tx_compl_status = odp_shm_addr(shm); + + if (entry->tx_compl_status == NULL) + return -1; + + for (uint32_t i = 0; i < count; i++) + odp_atomic_init_u32(&entry->tx_compl_status[i], 0); + + return 0; +} + int odp_pktio_config(odp_pktio_t hdl, const odp_pktio_config_t *config) { pktio_entry_t *entry; @@ -610,15 +653,26 @@ int odp_pktio_config(odp_pktio_t hdl, const odp_pktio_config_t *config) entry->config = *config; entry->enabled.tx_ts = config->pktout.bit.ts_ena; - entry->enabled.tx_compl = (config->pktout.bit.tx_compl_ena || config->tx_compl.mode_event); + entry->enabled.tx_compl = (config->pktout.bit.tx_compl_ena || + config->tx_compl.mode_event || + config->tx_compl.mode_poll); - if (entry->enabled.tx_compl) - if (configure_tx_event_compl(entry)) { + if (entry->enabled.tx_compl) { + if ((config->pktout.bit.tx_compl_ena || config->tx_compl.mode_event) && + configure_tx_event_compl(entry)) { unlock_entry(entry); _ODP_ERR("Unable to configure Tx event completion\n"); return -1; } + if (config->tx_compl.mode_poll && + configure_tx_poll_compl(entry, config->tx_compl.max_compl_id + 1)) { + unlock_entry(entry); + _ODP_ERR("Unable to configure Tx poll completion\n"); + return -1; + } + } + entry->enabled.tx_aging = config->pktout.bit.aging_ena; if (entry->ops->config) @@ -2629,18 +2683,54 @@ uint64_t odp_pktin_wait_time(uint64_t nsec) return (nsec / (1000)) + 1; } -static void check_tx_compl_ev(const odp_packet_hdr_t *hdr, int pkt_idx, tx_compl_info_t *info, - uint16_t *num) +static inline odp_bool_t check_tx_compl(const odp_packet_hdr_t *hdr, int pkt_idx, + tx_compl_info_t *info, odp_pool_t pool, + odp_atomic_u32_t *status_map, uint16_t *num) { - if (odp_unlikely(hdr->p.flags.tx_compl_ev)) { - info[*num].user_ptr = hdr->user_ptr; - info[*num].queue = hdr->dst_queue; - info[*num].idx = pkt_idx; - (*num)++; + tx_compl_info_t *i; + + if (odp_likely(hdr->p.flags.tx_compl_ev == 0 && hdr->p.flags.tx_compl_poll == 0)) + return true; + + i = &info[*num]; + i->idx = pkt_idx; + + if (hdr->p.flags.tx_compl_ev) { + i->buf = odp_buffer_alloc(pool); + + if (i->buf == ODP_BUFFER_INVALID) + return false; + + i->user_ptr = hdr->user_ptr; + i->queue = hdr->dst_queue; + i->mode = ODP_PACKET_TX_COMPL_EVENT; + } else { + i->status = &status_map[hdr->tx_compl_id]; + odp_atomic_store_rel_u32(i->status, 0); + i->mode = ODP_PACKET_TX_COMPL_POLL; } + + (*num)++; + + return true; +} + +static inline int prepare_tx_compl(const odp_packet_t packets[], int num, tx_compl_info_t *info, + odp_pool_t pool, odp_atomic_u32_t *status_map, + uint16_t *num_tx_c) +{ + int num_to_send = num; + + for (int i = 0; i < num; i++) + if (!check_tx_compl(packet_hdr(packets[i]), i, info, pool, status_map, num_tx_c)) { + num_to_send = info[*num_tx_c].idx; + break; + } + + return num_to_send; } -static void send_tx_compl_event(odp_buffer_t buf, const void *user_ptr, odp_queue_t queue) +static inline void send_tx_compl_event(odp_buffer_t buf, const void *user_ptr, odp_queue_t queue) { _odp_pktio_tx_compl_t *data; odp_event_t ev; @@ -2656,15 +2746,20 @@ static void send_tx_compl_event(odp_buffer_t buf, const void *user_ptr, odp_queu } } -static void send_tx_compl_events(tx_compl_info_t *info, uint16_t num, odp_buffer_t bufs[], - int num_sent) +static inline void finish_tx_compl(tx_compl_info_t *info, uint16_t num, int num_sent) { - for (int i = 0; i < num; i++) { - if (info[i].idx < num_sent) { - send_tx_compl_event(bufs[i], info[i].user_ptr, info[i].queue); - } else { - odp_buffer_free_multi(&bufs[i], num - i); - break; + tx_compl_info_t *i; + + for (int j = 0; j < num; j++) { + i = &info[j]; + + if (i->idx < num_sent) { + if (i->mode == ODP_PACKET_TX_COMPL_EVENT) + send_tx_compl_event(i->buf, i->user_ptr, i->queue); + else + odp_atomic_store_rel_u32(i->status, 1); + } else if (i->mode == ODP_PACKET_TX_COMPL_EVENT) { + odp_buffer_free(i->buf); } } } @@ -2674,9 +2769,8 @@ int odp_pktout_send(odp_pktout_queue_t queue, const odp_packet_t packets[], { pktio_entry_t *entry; odp_pktio_t pktio = queue.pktio; - uint16_t num_tx_cevs = 0; tx_compl_info_t tx_compl_info[num]; - odp_buffer_t bufs[num]; + uint16_t num_tx_c = 0; int num_to_send = num, num_sent; entry = get_pktio_entry(pktio); @@ -2692,27 +2786,17 @@ int odp_pktout_send(odp_pktout_queue_t queue, const odp_packet_t packets[], _odp_pcapng_dump_pkts(entry, queue.index, packets, num); if (odp_unlikely(_odp_pktio_tx_compl_enabled(entry))) { - for (int i = 0; i < num; i++) - check_tx_compl_ev(packet_hdr(packets[i]), i, tx_compl_info, &num_tx_cevs); - - if (odp_unlikely(num_tx_cevs)) { - int num_alloc = odp_buffer_alloc_multi(entry->tx_compl_pool, bufs, - num_tx_cevs); + odp_pool_t tx_compl_pool = entry->tx_compl_pool; + odp_atomic_u32_t *tx_compl_status = entry->tx_compl_status; - if (odp_unlikely(num_alloc < num_tx_cevs)) { - if (odp_unlikely(num_alloc < 0)) - num_alloc = 0; - - num_to_send = tx_compl_info[num_alloc].idx; - num_tx_cevs = num_alloc; - } - } + num_to_send = prepare_tx_compl(packets, num, tx_compl_info, tx_compl_pool, + tx_compl_status, &num_tx_c); } num_sent = entry->ops->send(entry, queue.index, packets, num_to_send); - if (odp_unlikely(num_tx_cevs)) - send_tx_compl_events(tx_compl_info, num_tx_cevs, bufs, num_sent); + if (odp_unlikely(num_tx_c)) + finish_tx_compl(tx_compl_info, num_tx_c, num_sent); return num_sent; } @@ -3224,24 +3308,28 @@ int odp_pktout_send_lso(odp_pktout_queue_t queue, const odp_packet_t packet[], i return i; } -void _odp_pktio_allocate_and_send_tx_compl_events(const pktio_entry_t *entry, - const odp_packet_t packets[], int num) +void _odp_pktio_process_tx_compl(const pktio_entry_t *entry, const odp_packet_t packets[], int num) { - uint16_t num_tx_cevs = 0, num_alloc; - int idx[num]; - odp_buffer_t bufs[num]; odp_packet_hdr_t *hdr; + odp_pool_t pool = entry->tx_compl_pool; + odp_buffer_t buf; + odp_atomic_u32_t *status_map = entry->tx_compl_status; - for (int i = 0; i < num; i++) - if (odp_unlikely(packet_hdr(packets[i])->p.flags.tx_compl_ev)) - idx[num_tx_cevs++] = i; + for (int i = 0; i < num; i++) { + hdr = packet_hdr(packets[i]); - if (odp_unlikely(num_tx_cevs)) { - num_alloc = odp_buffer_alloc_multi(entry->tx_compl_pool, bufs, num_tx_cevs); + if (odp_likely(hdr->p.flags.tx_compl_ev == 0 && hdr->p.flags.tx_compl_poll == 0)) + continue; - for (int i = 0; i < num_alloc; i++) { - hdr = packet_hdr(packets[idx[i]]); - send_tx_compl_event(bufs[i], hdr->user_ptr, hdr->dst_queue); + if (hdr->p.flags.tx_compl_ev) { + buf = odp_buffer_alloc(pool); + + if (odp_unlikely(buf == ODP_BUFFER_INVALID)) + continue; + + send_tx_compl_event(buf, hdr->user_ptr, hdr->dst_queue); + } else { + odp_atomic_store_rel_u32(&status_map[hdr->tx_compl_id], 1); } } } diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c index 82339361d6..f0327fad07 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -2283,8 +2283,7 @@ static void tm_send_pkt(tm_system_t *tm_system, uint32_t max_sends) ret = odp_pktout_send(tm_system->pktout, &odp_pkt, 1); if (odp_unlikely(ret != 1)) { if (odp_unlikely(_odp_pktio_tx_compl_enabled(pktio_entry))) - _odp_pktio_allocate_and_send_tx_compl_events(pktio_entry, - &odp_pkt, 1); + _odp_pktio_process_tx_compl(pktio_entry, &odp_pkt, 1); odp_packet_free(odp_pkt); if (odp_unlikely(ret < 0)) odp_atomic_inc_u64(&tm_queue_obj->stats.errors); From e2e487619cbd17a8587ed0da7b21316a1ef9242a Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Thu, 27 Jul 2023 09:18:16 +0000 Subject: [PATCH 059/192] linux-gen: packet: implement TX completion poll mode Modify existing TX completion request logic to support the new poll mode and implement `odp_packet_tx_compl_done()`. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- platform/linux-generic/odp_packet.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index f6f936b29f..96fcd928a8 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -2218,8 +2218,26 @@ int odp_packet_tx_compl_request(odp_packet_t pkt, const odp_packet_tx_compl_opt_ { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - pkt_hdr->p.flags.tx_compl_ev = opt->mode == ODP_PACKET_TX_COMPL_EVENT ? 1 : 0; - pkt_hdr->dst_queue = opt->queue; + switch (opt->mode) { + case ODP_PACKET_TX_COMPL_DISABLED: + pkt_hdr->p.flags.tx_compl_ev = 0; + pkt_hdr->p.flags.tx_compl_poll = 0; + break; + case ODP_PACKET_TX_COMPL_EVENT: + _ODP_ASSERT(opt->queue != ODP_QUEUE_INVALID); + pkt_hdr->p.flags.tx_compl_ev = 1; + pkt_hdr->p.flags.tx_compl_poll = 0; + pkt_hdr->dst_queue = opt->queue; + break; + case ODP_PACKET_TX_COMPL_POLL: + pkt_hdr->p.flags.tx_compl_ev = 0; + pkt_hdr->p.flags.tx_compl_poll = 1; + pkt_hdr->tx_compl_id = opt->compl_id; + break; + default: + _ODP_ERR("Bad TX completion mode: %i\n", opt->mode); + return -1; + } return 0; } @@ -2228,7 +2246,7 @@ int odp_packet_has_tx_compl_request(odp_packet_t pkt) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - return pkt_hdr->p.flags.tx_compl_ev; + return pkt_hdr->p.flags.tx_compl_ev || pkt_hdr->p.flags.tx_compl_poll; } void odp_packet_tx_compl_free(odp_packet_tx_compl_t tx_compl) @@ -2255,10 +2273,7 @@ void *odp_packet_tx_compl_user_ptr(odp_packet_tx_compl_t tx_compl) int odp_packet_tx_compl_done(odp_pktio_t pktio, uint32_t compl_id) { - (void)pktio; - (void)compl_id; - - return -1; + return odp_atomic_load_acq_u32(&get_pktio_entry(pktio)->tx_compl_status[compl_id]); } void odp_packet_free_ctrl_set(odp_packet_t pkt, odp_packet_free_ctrl_t ctrl) From b1cf0ed2f0537c39cf75f0ad2f434f0032a43aa6 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Thu, 27 Jul 2023 09:20:26 +0000 Subject: [PATCH 060/192] validation: pktio: fix TX completion poll mode test Use `ODP_PACKET_TX_COMPL_POLL` completion mode when testing TX completion poll mode. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- test/validation/api/pktio/pktio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c index fa752c0a27..0746fd0e08 100644 --- a/test/validation/api/pktio/pktio.c +++ b/test/validation/api/pktio/pktio.c @@ -3793,7 +3793,7 @@ static void pktio_test_pktout_compl_poll(void) for (i = 0; i < TX_BATCH_LEN; i++) { CU_ASSERT(odp_packet_has_tx_compl_request(pkt_tbl[i]) == 0); opt.compl_id = i; - opt.mode = ODP_PACKET_TX_COMPL_EVENT; + opt.mode = ODP_PACKET_TX_COMPL_POLL; odp_packet_tx_compl_request(pkt_tbl[i], &opt); CU_ASSERT(odp_packet_has_tx_compl_request(pkt_tbl[i]) != 0); /* Set pkt sequence number as its user ptr */ From 3be656404c5caf846d84c7f599daeaed85b9b659 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Thu, 27 Jul 2023 09:25:06 +0000 Subject: [PATCH 061/192] linux-gen: pktio: enable TX completion poll mode Enable TX completion poll mode packet I/O capabilities and set a maximum supported completion ID. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- platform/linux-generic/odp_packet_io.c | 2 +- platform/linux-generic/pktio/dpdk.c | 2 +- platform/linux-generic/pktio/ipc.c | 2 +- platform/linux-generic/pktio/loop.c | 2 +- platform/linux-generic/pktio/null.c | 2 +- platform/linux-generic/pktio/pcap.c | 2 +- platform/linux-generic/pktio/socket.c | 2 +- platform/linux-generic/pktio/socket_mmap.c | 2 +- platform/linux-generic/pktio/tap.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index bf77404a81..349df6d337 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -1599,7 +1599,7 @@ int odp_pktio_capability(odp_pktio_t pktio, odp_pktio_capability_t *capa) capa->tx_compl.queue_type_sched = 1; capa->tx_compl.queue_type_plain = 1; - capa->tx_compl.max_compl_id = 0; + capa->tx_compl.max_compl_id = UINT32_MAX - 1; capa->free_ctrl.dont_free = 0; capa->config.pktout.bit.aging_ena = 1; diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index cea2026cb3..89aa91af76 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -1820,7 +1820,7 @@ static int dpdk_init_capability(pktio_entry_t *pktio_entry, capa->config.pktout.bit.tx_compl_ena = 1; capa->tx_compl.mode_all = 1; capa->tx_compl.mode_event = 1; - capa->tx_compl.mode_poll = 0; + capa->tx_compl.mode_poll = 1; } /* Copy for fast path access */ diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c index 4222b383a5..dd286328a4 100644 --- a/platform/linux-generic/pktio/ipc.c +++ b/platform/linux-generic/pktio/ipc.c @@ -926,7 +926,7 @@ static int ipc_capability(pktio_entry_t *pktio_entry ODP_UNUSED, odp_pktio_capab capa->config.pktout.bit.tx_compl_ena = 1; capa->tx_compl.mode_all = 1; capa->tx_compl.mode_event = 1; - capa->tx_compl.mode_poll = 0; + capa->tx_compl.mode_poll = 1; return 0; } diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index ca6cc76561..ff48525a34 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -677,7 +677,7 @@ static int loopback_init_capability(pktio_entry_t *pktio_entry) capa->config.pktout.bit.tx_compl_ena = 1; capa->tx_compl.mode_all = 1; capa->tx_compl.mode_event = 1; - capa->tx_compl.mode_poll = 0; + capa->tx_compl.mode_poll = 1; if (odp_global_ro.disable.ipsec == 0) { capa->config.inbound_ipsec = 1; diff --git a/platform/linux-generic/pktio/null.c b/platform/linux-generic/pktio/null.c index b2e15f7bd7..00c45f84af 100644 --- a/platform/linux-generic/pktio/null.c +++ b/platform/linux-generic/pktio/null.c @@ -142,7 +142,7 @@ static int null_capability(pktio_entry_t *pktio_entry ODP_UNUSED, capa->config.pktout.bit.tx_compl_ena = 1; capa->tx_compl.mode_all = 1; capa->tx_compl.mode_event = 1; - capa->tx_compl.mode_poll = 0; + capa->tx_compl.mode_poll = 1; return 0; } diff --git a/platform/linux-generic/pktio/pcap.c b/platform/linux-generic/pktio/pcap.c index b764f9e664..78b9876d79 100644 --- a/platform/linux-generic/pktio/pcap.c +++ b/platform/linux-generic/pktio/pcap.c @@ -508,7 +508,7 @@ static int pcapif_capability(pktio_entry_t *pktio_entry ODP_UNUSED, capa->config.pktout.bit.tx_compl_ena = 1; capa->tx_compl.mode_all = 1; capa->tx_compl.mode_event = 1; - capa->tx_compl.mode_poll = 0; + capa->tx_compl.mode_poll = 1; capa->stats.pktio.counter.in_octets = 1; capa->stats.pktio.counter.in_packets = 1; diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index 8a7f859edf..2a037e51f7 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -590,7 +590,7 @@ static int sock_capability(pktio_entry_t *pktio_entry, capa->config.pktout.bit.tx_compl_ena = 1; capa->tx_compl.mode_all = 1; capa->tx_compl.mode_event = 1; - capa->tx_compl.mode_poll = 0; + capa->tx_compl.mode_poll = 1; /* Fill statistics capabilities */ _odp_sock_stats_capa(pktio_entry, capa); diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c index d4183f18dc..92bf8a4bf7 100644 --- a/platform/linux-generic/pktio/socket_mmap.c +++ b/platform/linux-generic/pktio/socket_mmap.c @@ -894,7 +894,7 @@ static int sock_mmap_capability(pktio_entry_t *pktio_entry, capa->config.pktout.bit.tx_compl_ena = 1; capa->tx_compl.mode_all = 1; capa->tx_compl.mode_event = 1; - capa->tx_compl.mode_poll = 0; + capa->tx_compl.mode_poll = 1; /* Fill statistics capabilities */ _odp_sock_stats_capa(pktio_entry, capa); diff --git a/platform/linux-generic/pktio/tap.c b/platform/linux-generic/pktio/tap.c index 30ac9cffdc..baac096462 100644 --- a/platform/linux-generic/pktio/tap.c +++ b/platform/linux-generic/pktio/tap.c @@ -539,7 +539,7 @@ static int tap_capability(pktio_entry_t *pktio_entry ODP_UNUSED, capa->config.pktout.bit.tx_compl_ena = 1; capa->tx_compl.mode_all = 1; capa->tx_compl.mode_event = 1; - capa->tx_compl.mode_poll = 0; + capa->tx_compl.mode_poll = 1; return 0; } From 6cd8dd64e37a3ae03dbe94e0047184873a5dcd14 Mon Sep 17 00:00:00 2001 From: Tianyu Li Date: Mon, 7 Aug 2023 10:17:58 +0000 Subject: [PATCH 062/192] test: performance: add stash perf test Add stash perf test case to benchmark stash performance. Signed-off-by: Tianyu Li Reviewed-by: Matias Elo --- test/performance/.gitignore | 1 + test/performance/Makefile.am | 1 + test/performance/odp_stash_perf.c | 515 ++++++++++++++++++++++++++++++ 3 files changed, 517 insertions(+) create mode 100644 test/performance/odp_stash_perf.c diff --git a/test/performance/.gitignore b/test/performance/.gitignore index dfaef699c7..18b7a4230a 100644 --- a/test/performance/.gitignore +++ b/test/performance/.gitignore @@ -26,5 +26,6 @@ odp_sched_latency odp_sched_perf odp_sched_pktio odp_scheduling +odp_stash_perf odp_stress odp_timer_perf diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am index 68532ac6ab..24c1767fe6 100644 --- a/test/performance/Makefile.am +++ b/test/performance/Makefile.am @@ -13,6 +13,7 @@ EXECUTABLES = odp_atomic_perf \ odp_pktio_perf \ odp_pool_perf \ odp_queue_perf \ + odp_stash_perf \ odp_random \ odp_stress diff --git a/test/performance/odp_stash_perf.c b/test/performance/odp_stash_perf.c new file mode 100644 index 0000000000..ffbc92b4b7 --- /dev/null +++ b/test/performance/odp_stash_perf.c @@ -0,0 +1,515 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018 Linaro Limited + * Copyright (c) 2021 Nokia + * Copyright (c) 2023 Arm + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#define MAX_STASHES (32) + +typedef struct test_options_t { + uint32_t num_stash; + uint32_t num_round; + uint32_t max_burst; + uint32_t stash_size; + int strict; + int num_cpu; + +} test_options_t; + +typedef struct test_stat_t { + uint64_t rounds; + uint64_t ops; + uint64_t nsec; + uint64_t cycles; + uint64_t num_retry; + +} test_stat_t; + +typedef struct test_global_t { + odp_barrier_t barrier; + test_options_t options; + odp_instance_t instance; + odp_shm_t shm; + odp_pool_t pool; + odp_stash_t stash[MAX_STASHES]; + odph_thread_t thread_tbl[ODP_THREAD_COUNT_MAX]; + test_stat_t stat[ODP_THREAD_COUNT_MAX]; + +} test_global_t; + +static void print_usage(void) +{ + printf("\n" + "Stash performance test\n" + "\n" + "Usage: odp_stash_perf [options]\n" + "\n" + " -c, --num_cpu Number of worker threads. Default: 1\n" + " -n, --num_stash Number of stashes. Default: 1\n" + " -b, --burst_size Max number of objects per stash call. Default: 1\n" + " -s, --stash_size Stash size. Default: 1000\n" + " -r, --num_round Number of rounds. Default: 1000\n" + " -m, --strict Strict size stash\n" + " -h, --help This help\n" + "\n"); +} + +static int parse_options(int argc, char *argv[], test_options_t *test_options) +{ + int opt; + int long_index; + int ret = 0; + + static const struct option longopts[] = { + { "num_cpu", required_argument, NULL, 'c' }, + { "num_stash", required_argument, NULL, 'n' }, + { "burst_size", required_argument, NULL, 'b' }, + { "stash_size", required_argument, NULL, 's' }, + { "num_round", required_argument, NULL, 'r' }, + { "strict", no_argument, NULL, 'm' }, + { "help", no_argument, NULL, 'h' }, + { NULL, 0, NULL, 0 } + }; + + static const char *shortopts = "+c:n:b:s:r:mh"; + + test_options->num_cpu = 1; + test_options->num_stash = 1; + test_options->max_burst = 1; + test_options->stash_size = 1000; + test_options->num_round = 1000; + test_options->strict = 0; + + while (1) { + opt = getopt_long(argc, argv, shortopts, longopts, &long_index); + + if (opt == -1) + break; + + switch (opt) { + case 'c': + test_options->num_cpu = atoi(optarg); + break; + case 'n': + test_options->num_stash = atoi(optarg); + break; + case 'b': + test_options->max_burst = atoi(optarg); + break; + case 's': + test_options->stash_size = atoi(optarg); + break; + case 'r': + test_options->num_round = atoi(optarg); + break; + case 'm': + test_options->strict = 1; + break; + case 'h': + /* fall through */ + default: + print_usage(); + ret = -1; + break; + } + } + + if (test_options->num_stash > MAX_STASHES) { + ODPH_ERR("Too many stashes %u. Test maximum %u.\n", + test_options->num_stash, MAX_STASHES); + return -1; + } + + return ret; +} + +static int create_stashes(test_global_t *global) +{ + uint32_t i; + uint32_t tmp = 0; + test_options_t *test_options = &global->options; + + uint32_t num_stash = test_options->num_stash; + uint32_t num_round = test_options->num_round; + int num_stored; + uint32_t num_remain; + odp_stash_t *stash = global->stash; + odp_stash_capability_t stash_capa; + + printf("\nTesting %s stashes\n", + test_options->strict == 0 ? "NORMAL" : "STRICT_SIZE"); + printf(" num rounds %u\n", num_round); + printf(" num stashes %u\n", num_stash); + printf(" stash size %u\n", test_options->stash_size); + printf(" max burst size %u\n", test_options->max_burst); + + if (odp_stash_capability(&stash_capa, ODP_STASH_TYPE_DEFAULT)) { + ODPH_ERR("Get stash capability failed\n"); + return -1; + } + + if (test_options->stash_size > stash_capa.max_num_obj) { + ODPH_ERR("Max stash size supported %" PRIu64 "\n", + stash_capa.max_num_obj); + return -1; + } + + if (test_options->num_stash > stash_capa.max_stashes) { + ODPH_ERR("Max stash supported %u\n", stash_capa.max_stashes); + return -1; + } + + for (i = 0; i < num_stash; i++) { + odp_stash_param_t stash_param; + + odp_stash_param_init(&stash_param); + stash_param.num_obj = test_options->stash_size; + stash_param.obj_size = sizeof(uint32_t); + stash_param.strict_size = test_options->strict; + + stash[i] = odp_stash_create("test_stash_u32", &stash_param); + if (stash[i] == ODP_STASH_INVALID) { + ODPH_ERR("Stash create failed\n"); + return -1; + } + + num_remain = test_options->stash_size; + do { + num_stored = odp_stash_put_u32(stash[i], &tmp, 1); + if (num_stored < 0) { + ODPH_ERR("Error: Stash put failed\n"); + return -1; + } + num_remain -= num_stored; + } while (num_remain); + } + + return 0; +} + +static int destroy_stashes(test_global_t *global) +{ + odp_stash_t *stash = global->stash; + test_options_t *test_options = &global->options; + uint32_t num_stash = test_options->num_stash; + uint32_t tmp; + int num; + + for (uint32_t i = 0; i < num_stash; i++) { + do { + num = odp_stash_get_u32(stash[i], &tmp, 1); + if (num < 0) { + ODPH_ERR("Error: Stash get failed %u\n", i); + return -1; + } + } while (num); + + if (odp_stash_destroy(stash[i])) { + ODPH_ERR("Stash destroy failed\n"); + return -1; + } + } + + return 0; +} + +static int run_test(void *arg) +{ + uint64_t c1, c2, cycles, nsec; + odp_time_t t1, t2; + uint32_t rounds; + int num_stored; + int num_remain; + int num_obj; + test_stat_t *stat; + test_global_t *global = arg; + test_options_t *test_options = &global->options; + odp_stash_t stash; + uint64_t num_retry = 0; + uint64_t ops = 0; + uint32_t num_stash = test_options->num_stash; + uint32_t num_round = test_options->num_round; + int thr = odp_thread_id(); + int ret = 0; + uint32_t i = 0; + uint32_t max_burst = test_options->max_burst; + uint32_t *tmp = malloc(sizeof(uint32_t) * max_burst); + + if (tmp == NULL) { + ODPH_ERR("Error: malloc failed\n"); + ret = -1; + goto error; + } + + stat = &global->stat[thr]; + + /* Start all workers at the same time */ + odp_barrier_wait(&global->barrier); + + t1 = odp_time_local(); + c1 = odp_cpu_cycles(); + + for (rounds = 0; rounds < num_round; rounds++) { + stash = global->stash[i++]; + + if (i == num_stash) + i = 0; + + num_obj = odp_stash_get_u32(stash, tmp, max_burst); + if (num_obj == 0) + continue; + + if (num_obj < 0) { + ODPH_ERR("Error: Stash get failed\n"); + ret = -1; + goto error; + } + num_remain = num_obj; + do { + num_stored = odp_stash_put_u32(stash, tmp, num_remain); + if (num_stored < 0) { + ODPH_ERR("Error: Stash put failed\n"); + ret = -1; + goto error; + } + + if (num_stored != num_remain) + num_retry++; + + num_remain -= num_stored; + } while (num_remain); + ops += num_obj; + } + + c2 = odp_cpu_cycles(); + t2 = odp_time_local(); + + nsec = odp_time_diff_ns(t2, t1); + cycles = odp_cpu_cycles_diff(c2, c1); + + stat->rounds = rounds; + stat->ops = ops; + stat->nsec = nsec; + stat->cycles = cycles; + stat->num_retry = num_retry; +error: + free(tmp); + return ret; +} + +static int start_workers(test_global_t *global) +{ + odph_thread_common_param_t thr_common; + odph_thread_param_t thr_param; + odp_cpumask_t cpumask; + int ret; + test_options_t *test_options = &global->options; + int num_cpu = test_options->num_cpu; + + ret = odp_cpumask_default_worker(&cpumask, num_cpu); + + if (num_cpu && ret != num_cpu) { + ODPH_ERR("Error: Too many workers. Max supported %i\n.", ret); + return -1; + } + + /* Zero: all available workers */ + if (num_cpu == 0) { + num_cpu = ret; + test_options->num_cpu = num_cpu; + } + + printf(" num workers %u\n\n", num_cpu); + + odp_barrier_init(&global->barrier, num_cpu); + + odph_thread_common_param_init(&thr_common); + thr_common.instance = global->instance; + thr_common.cpumask = &cpumask; + thr_common.share_param = 1; + + odph_thread_param_init(&thr_param); + thr_param.start = run_test; + thr_param.arg = global; + thr_param.thr_type = ODP_THREAD_WORKER; + + if (odph_thread_create(global->thread_tbl, &thr_common, &thr_param, + num_cpu) != num_cpu) + return -1; + + return 0; +} + +static void print_stat(test_global_t *global) +{ + int i, num; + double rounds_ave, ops_ave, nsec_ave, cycles_ave, retry_ave; + test_options_t *test_options = &global->options; + int num_cpu = test_options->num_cpu; + uint64_t rounds_sum = 0; + uint64_t ops_sum = 0; + uint64_t nsec_sum = 0; + uint64_t cycles_sum = 0; + uint64_t retry_sum = 0; + + /* Averages */ + for (i = 0; i < ODP_THREAD_COUNT_MAX; i++) { + rounds_sum += global->stat[i].rounds; + ops_sum += global->stat[i].ops; + nsec_sum += global->stat[i].nsec; + cycles_sum += global->stat[i].cycles; + retry_sum += global->stat[i].num_retry; + } + + if (rounds_sum == 0) { + printf("No results.\n"); + return; + } + + rounds_ave = rounds_sum / num_cpu; + ops_ave = ops_sum / num_cpu; + nsec_ave = nsec_sum / num_cpu; + cycles_ave = cycles_sum / num_cpu; + retry_ave = retry_sum / num_cpu; + num = 0; + + printf("RESULTS - per thread (Million ops per sec):\n"); + printf("----------------------------------------------\n"); + printf(" 1 2 3 4 5 6 7 8 9 10"); + + for (i = 0; i < ODP_THREAD_COUNT_MAX; i++) { + if (global->stat[i].rounds) { + if ((num % 10) == 0) + printf("\n "); + + printf("%6.1f ", (1000.0 * global->stat[i].ops) / + global->stat[i].nsec); + num++; + } + } + printf("\n\n"); + + printf("RESULTS - per thread average (%i threads):\n", num_cpu); + printf("------------------------------------------\n"); + printf(" duration: %.3f msec\n", nsec_ave / 1000000); + printf(" num cycles: %.3f M\n", cycles_ave / 1000000); + printf(" ops per get: %.3f\n", ops_ave / rounds_ave); + printf(" cycles per ops: %.3f\n", cycles_ave / ops_ave); + printf(" retries per sec: %.3f k\n", + (1000000.0 * retry_ave) / nsec_ave); + printf(" ops per sec: %.3f M\n\n", + (1000.0 * ops_ave) / nsec_ave); + + printf("TOTAL ops per sec: %.3f M\n\n", + (1000.0 * ops_sum) / nsec_ave); +} + +int main(int argc, char **argv) +{ + odph_helper_options_t helper_options; + odp_instance_t instance; + odp_init_t init; + odp_shm_t shm; + test_global_t *global; + + /* Let helper collect its own arguments (e.g. --odph_proc) */ + argc = odph_parse_options(argc, argv); + if (odph_options(&helper_options)) { + ODPH_ERR("Error: Reading ODP helper options failed.\n"); + exit(EXIT_FAILURE); + } + + /* List features not to be used */ + odp_init_param_init(&init); + init.not_used.feat.cls = 1; + init.not_used.feat.compress = 1; + init.not_used.feat.crypto = 1; + init.not_used.feat.ipsec = 1; + init.not_used.feat.schedule = 1; + init.not_used.feat.timer = 1; + init.not_used.feat.tm = 1; + + init.mem_model = helper_options.mem_model; + + /* Init ODP before calling anything else */ + if (odp_init_global(&instance, &init, NULL)) { + ODPH_ERR("Error: Global init failed.\n"); + exit(EXIT_FAILURE); + } + + /* Init this thread */ + if (odp_init_local(instance, ODP_THREAD_WORKER)) { + ODPH_ERR("Error: Local init failed.\n"); + exit(EXIT_FAILURE); + } + + shm = odp_shm_reserve("stash_perf_global", sizeof(test_global_t), + ODP_CACHE_LINE_SIZE, 0); + if (shm == ODP_SHM_INVALID) { + ODPH_ERR("Error: Shared mem reserve failed.\n"); + exit(EXIT_FAILURE); + } + + global = odp_shm_addr(shm); + if (global == NULL) { + ODPH_ERR("Error: Shared mem alloc failed\n"); + exit(EXIT_FAILURE); + } + + memset(global, 0, sizeof(test_global_t)); + + if (parse_options(argc, argv, &global->options)) + exit(EXIT_FAILURE); + + odp_sys_info_print(); + + global->instance = instance; + + if (create_stashes(global)) { + ODPH_ERR("Error: Create stashes failed.\n"); + goto destroy; + } + + if (start_workers(global)) { + ODPH_ERR("Error: Test start failed.\n"); + exit(EXIT_FAILURE); + } + + /* Wait workers to exit */ + odph_thread_join(global->thread_tbl, global->options.num_cpu); + + print_stat(global); + +destroy: + if (destroy_stashes(global)) { + ODPH_ERR("Error: Destroy stashes failed.\n"); + exit(EXIT_FAILURE); + } + + if (odp_shm_free(shm)) { + ODPH_ERR("Error: Shared mem free failed.\n"); + exit(EXIT_FAILURE); + } + + if (odp_term_local()) { + ODPH_ERR("Error: term local failed.\n"); + exit(EXIT_FAILURE); + } + + if (odp_term_global(instance)) { + ODPH_ERR("Error: term global failed.\n"); + exit(EXIT_FAILURE); + } + + return 0; +} From e0c4b4ae1f84c03d7745a97a5019c1b2aa907ace Mon Sep 17 00:00:00 2001 From: Ashwin Sekhar T K Date: Wed, 6 Sep 2023 16:55:53 +0530 Subject: [PATCH 063/192] validation: pool: fix uarea init test for external pools The max payload of single segmented packets in external pools depends on the odp_header_size, app_header_size, max_headroom_size and odp_trailer_size. Take all these into consideration when doing packet alloc from external pools so that allocations don't fail. Signed-off-by: Ashwin Sekhar T K Reviewed-by: Matias Elo --- test/validation/api/pool/pool.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c index af6392e45f..7074095548 100644 --- a/test/validation/api/pool/pool.c +++ b/test/validation/api/pool/pool.c @@ -2035,6 +2035,7 @@ static void test_packet_pool_ext_uarea_init(void) odp_pool_ext_capability_t capa; odp_pool_ext_param_t param; uint32_t num = ELEM_NUM, i; + uint32_t max_payload; odp_pool_t pool; uarea_init_t data; odp_shm_t shm; @@ -2061,10 +2062,14 @@ static void test_packet_pool_ext_uarea_init(void) CU_ASSERT_FATAL(shm != ODP_SHM_INVALID); CU_ASSERT(data.count == num); + max_payload = param.pkt.buf_size; + max_payload -= capa.pkt.odp_header_size + param.pkt.app_header_size; + max_payload -= capa.pkt.max_headroom_size; + max_payload -= capa.pkt.odp_trailer_size; for (i = 0; i < num; i++) { CU_ASSERT(data.mark[i] == 1); - pkts[i] = odp_packet_alloc(pool, (param.pkt.buf_size - param.pkt.headroom) / 2); + pkts[i] = odp_packet_alloc(pool, max_payload); CU_ASSERT(pkts[i] != ODP_PACKET_INVALID); From 9a9a7cb977d35ade394dd69a0dc927ddd56dbf1b Mon Sep 17 00:00:00 2001 From: Ashwin Sekhar T K Date: Wed, 6 Sep 2023 17:41:28 +0530 Subject: [PATCH 064/192] validation: fix compilation errors When compiling with specific flags, the compiler throws the -Wmaybe-uninitialized error even if the implementation initializes the flag in the odp_event_user_area_and_flag() function. Workaround these errors by initializing the flag variable before calling the odp_event_user_area_and_flag() function. Signed-off-by: Ashwin Sekhar T K Reviewed-by: Matias Elo --- test/validation/api/buffer/buffer.c | 2 +- test/validation/api/dma/dma.c | 2 +- test/validation/api/ipsec/ipsec.c | 2 +- test/validation/api/timer/timer.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/validation/api/buffer/buffer.c b/test/validation/api/buffer/buffer.c index 1d0cc9d01c..909608ed81 100644 --- a/test/validation/api/buffer/buffer.c +++ b/test/validation/api/buffer/buffer.c @@ -537,7 +537,7 @@ static void buffer_test_user_area(void) for (i = 0; i < num; i++) { odp_event_t ev; - int flag; + int flag = 0; buffer[i] = odp_buffer_alloc(pool); diff --git a/test/validation/api/dma/dma.c b/test/validation/api/dma/dma.c index 36a025b0dc..fc15be8f27 100644 --- a/test/validation/api/dma/dma.c +++ b/test/validation/api/dma/dma.c @@ -441,7 +441,7 @@ static void test_dma_compl_user_area(void) for (i = 0; i < num; i++) { odp_event_t ev; - int flag; + int flag = 0; compl_evs[i] = odp_dma_compl_alloc(pool); diff --git a/test/validation/api/ipsec/ipsec.c b/test/validation/api/ipsec/ipsec.c index 87688838b5..da60c77b31 100644 --- a/test/validation/api/ipsec/ipsec.c +++ b/test/validation/api/ipsec/ipsec.c @@ -447,7 +447,7 @@ static void ipsec_status_event_handle(odp_event_t ev_status, odp_ipsec_sa_t sa, enum ipsec_test_sa_expiry sa_expiry) { - int flag; + int flag = 0; odp_ipsec_status_t status = { .id = 0, .sa = ODP_IPSEC_SA_INVALID, diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index 1927156bad..9b08847f9f 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -562,7 +562,7 @@ static void timer_test_timeout_user_area(void) for (i = 0; i < num; i++) { odp_event_t ev; - int flag; + int flag = 0; tmo[i] = odp_timeout_alloc(pool); From 5e0b3e5fa8df5227eaaa12c70474512ee8df11ea Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Fri, 1 Sep 2023 16:24:43 +0300 Subject: [PATCH 065/192] test: packet_gen: limit number of packet length bins Limit the number of packet length bins in preparation to introduce a transmit round packet table. Pre-calculate bin sizes and use those in allocation (instead of re-calculating). Report a warning if there are not enough packets for random length testing (instead of modifying the number of packets per transmit round). Signed-off-by: Petri Savolainen Reviewed-by: Matias Elo --- test/performance/odp_packet_gen.c | 151 +++++++++++++++--------------- 1 file changed, 78 insertions(+), 73 deletions(-) diff --git a/test/performance/odp_packet_gen.c b/test/performance/odp_packet_gen.c index 85b0c740b1..e2e815b6b5 100644 --- a/test/performance/odp_packet_gen.c +++ b/test/performance/odp_packet_gen.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2020-2022, Nokia +/* Copyright (c) 2020-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -22,6 +22,8 @@ #include #define MAX_PKTIOS 32 +/* Maximum number of packet length bins */ +#define MAX_BINS 1024 #define MAX_PKTIO_NAME 255 #define RX_THREAD 1 #define TX_THREAD 2 @@ -150,6 +152,10 @@ typedef struct test_global_t { /* Interface lookup table. Table index is pktio_index of the API. */ uint8_t if_from_pktio_idx[MAX_PKTIO_INDEXES]; + uint32_t num_tx_pkt; + uint32_t num_bins; + uint32_t len_bin[MAX_BINS]; + } test_global_t; typedef struct ODP_PACKED { @@ -196,13 +202,13 @@ static void print_usage(void) " Random packet length. Specify the minimum and maximum\n" " packet lengths and the number of bins. To reduce pool size\n" " requirement the length range can be divided into even sized\n" - " bins. Min and max size packets are always used and included\n" + " bins (max %u). Min and max size packets are always used and included\n" " into the number of bins (bins >= 2). Bin value of 0 means\n" " that each packet length is used. Comma-separated (no spaces).\n" " Overrides standard packet length option.\n" " -D, --direct_rx Direct input mode (default: 0)\n" " 0: Use scheduler for packet input\n" - " 1: Poll packet input in direct mode\n"); + " 1: Poll packet input in direct mode\n", MAX_BINS); printf(" -R, --no_pkt_refs Do not use packet references. Always allocate a\n" " fresh set of packets for a transmit burst. Some\n" " features may be available only with references\n" @@ -280,6 +286,41 @@ static int parse_vlan(const char *str, test_global_t *global) return num_vlan; } +static int init_bins(test_global_t *global) +{ + uint32_t i, bin_size; + test_options_t *test_options = &global->test_options; + uint32_t num_bins = test_options->rand_pkt_len_bins; + uint32_t len_min = test_options->rand_pkt_len_min; + uint32_t len_max = test_options->rand_pkt_len_max; + uint32_t num_bytes = len_max - len_min + 1; + + if (len_max <= len_min) { + ODPH_ERR("Error: Bad max packet length\n"); + return -1; + } + + if (num_bins == 0) + num_bins = num_bytes; + + if (num_bins == 1 || num_bins > MAX_BINS || num_bins > num_bytes) { + ODPH_ERR("Error: Bad number of packet length bins: %u\n", num_bins); + return -1; + } + + bin_size = (len_max - len_min + 1) / (num_bins - 1); + + /* Min length is the first bin */ + for (i = 0; i < num_bins - 1; i++) + global->len_bin[i] = len_min + (i * bin_size); + + /* Max length is the last bin */ + global->len_bin[i] = len_max; + global->num_bins = num_bins; + + return 0; +} + static int parse_options(int argc, char *argv[], test_global_t *global) { int opt, i, len, str_len, long_index, udp_port; @@ -288,7 +329,6 @@ static int parse_options(int argc, char *argv[], test_global_t *global) char *name, *str, *end; test_options_t *test_options = &global->test_options; int ret = 0; - int help = 0; uint8_t default_eth_dst[6] = {0x02, 0x00, 0x00, 0xa0, 0xb0, 0xc0}; static const struct option longopts[] = { @@ -551,53 +591,39 @@ static int parse_options(int argc, char *argv[], test_global_t *global) case 'h': /* fall through */ default: - help = 1; print_usage(); ret = -1; break; } } - if (help == 0 && test_options->num_pktio == 0) { + if (ret) + return -1; + + if (test_options->num_pktio == 0) { ODPH_ERR("Error: At least one packet IO interface is needed.\n"); ODPH_ERR(" Use -i to specify interfaces.\n"); - ret = -1; + return -1; } if (test_options->num_rx < 1 || test_options->num_tx < 1) { ODPH_ERR("Error: At least one rx and tx thread needed.\n"); - ret = -1; + return -1; } test_options->num_cpu = test_options->num_rx + test_options->num_tx; - num_tx_pkt = test_options->burst_size * test_options->bursts; - if (test_options->use_rand_pkt_len) { - uint32_t pkt_sizes = test_options->rand_pkt_len_max - - test_options->rand_pkt_len_min + 1; - uint32_t pkt_bins = test_options->rand_pkt_len_bins; - uint32_t req_pkts; + num_tx_pkt = test_options->burst_size * test_options->bursts; + global->num_tx_pkt = num_tx_pkt; - if (test_options->rand_pkt_len_max <= test_options->rand_pkt_len_min) { - ODPH_ERR("Error: Bad max packet length\n"); - ret = -1; - } - if (pkt_bins == 1) { - ODPH_ERR("Error: Invalid bins value\n"); - ret = -1; - } - if (pkt_sizes < pkt_bins) { - ODPH_ERR("Error: Not enough packet sizes for %" PRIu32 " bins\n", pkt_bins); - ret = -1; - } - if (pkt_bins && num_tx_pkt > pkt_bins && num_tx_pkt % pkt_bins) - ODPH_ERR("\nWARNING: Transmit packet count is not evenly divisible into packet length bins.\n\n"); - else if (!pkt_bins && num_tx_pkt > pkt_sizes && num_tx_pkt % pkt_sizes) - ODPH_ERR("\nWARNING: Transmit packet count is not evenly divisible into packet lengths.\n\n"); + if (num_tx_pkt == 0) { + ODPH_ERR("Error: Bad number of tx packets: %u\n", num_tx_pkt); + return -1; + } - req_pkts = pkt_bins ? pkt_bins : pkt_sizes; - if (req_pkts > num_tx_pkt) - num_tx_pkt = req_pkts; + if (test_options->use_rand_pkt_len) { + if (init_bins(global)) + return -1; } /* Pool needs to have enough packets for all tx side bursts and @@ -609,7 +635,7 @@ static int parse_options(int argc, char *argv[], test_global_t *global) if (test_options->num_pkt < min_packets) { ODPH_ERR("Error: Pool needs to have at least %u packets\n", min_packets); - ret = -1; + return -1; } if (test_options->calc_latency) @@ -624,6 +650,14 @@ static int parse_options(int argc, char *argv[], test_global_t *global) } } + if (global->num_bins) { + if (num_tx_pkt > global->num_bins && num_tx_pkt % global->num_bins) + ODPH_ERR("\nWARNING: Transmit packet count is not evenly divisible into packet length bins.\n\n"); + + if (num_tx_pkt < global->num_bins) + ODPH_ERR("\nWARNING: Not enough packets for every packet length bin.\n\n"); + } + if (test_options->c_mode.udp_dst && num_tx_pkt % test_options->c_mode.udp_dst) ODPH_ERR("\nWARNING: Transmit packet count is not evenly divisible by UDP destination port count.\n\n"); @@ -640,10 +674,10 @@ static int parse_options(int argc, char *argv[], test_global_t *global) test_options->rand_pkt_len_min : test_options->pkt_len; if (test_options->hdr_len >= pkt_len) { ODPH_ERR("Error: Headers do not fit into packet length %" PRIu32 "\n", pkt_len); - ret = -1; + return -1; } - return ret; + return 0; } static int set_num_cpu(test_global_t *global) @@ -1538,35 +1572,21 @@ static inline int send_burst(odp_pktout_queue_t pktout, odp_packet_t pkt[], } static int alloc_test_packets(odp_pool_t pool, odp_packet_t *pkt_tbl, int num_pkt, - int pkts_per_pktio, test_options_t *test_options) + int pkts_per_pktio, test_global_t *global) { + test_options_t *test_options = &global->test_options; + uint32_t num_bins = global->num_bins; int num_alloc = 0; - if (test_options->use_rand_pkt_len) { + if (num_bins) { int i, j; int num_pktio = test_options->num_pktio; - uint32_t pkt_bins = test_options->rand_pkt_len_bins; - uint32_t pkt_len_min = test_options->rand_pkt_len_min; - uint32_t pkt_len_max = test_options->rand_pkt_len_max; - uint32_t bin_size = 1; - - if (pkt_bins) - bin_size = (pkt_len_max - pkt_len_min + 1) / (pkt_bins - 1); for (i = 0; i < num_pktio; i++) { - uint32_t cur_bin = 0; - uint32_t pkt_len = pkt_len_min; + uint32_t pkt_len; for (j = 0; j < pkts_per_pktio; j++) { - if (pkt_bins) { - if (cur_bin + 1 < pkt_bins) { - pkt_len = pkt_len_min + (cur_bin * bin_size); - cur_bin++; - } else { - cur_bin = 0; - pkt_len = pkt_len_max; - } - } + pkt_len = global->len_bin[j % num_bins]; pkt_tbl[num_alloc] = odp_packet_alloc(pool, pkt_len); if (pkt_tbl[num_alloc] == ODP_PACKET_INVALID) { @@ -1574,12 +1594,6 @@ static int alloc_test_packets(odp_pool_t pool, odp_packet_t *pkt_tbl, int num_pk break; } num_alloc++; - - if (!pkt_bins) { - pkt_len++; - if (pkt_len > pkt_len_max) - pkt_len = pkt_len_min; - } } } return num_alloc; @@ -1597,7 +1611,7 @@ static int allocate_and_init_packets(odp_pool_t pool, odp_packet_t *pkt_tbl, int { int num_alloc, num_pktio = test_options->num_pktio; - num_alloc = alloc_test_packets(pool, pkt_tbl, num_pkt, pkts_per_pktio, test_options); + num_alloc = alloc_test_packets(pool, pkt_tbl, num_pkt, pkts_per_pktio, global); if (num_alloc != num_pkt) goto err; @@ -1646,18 +1660,9 @@ static int tx_thread(void *arg) int num_pktio = test_options->num_pktio; int num_pkt; odp_pktout_queue_t pktout[num_pktio]; - uint32_t pkts_per_pktio = bursts * burst_size; + uint32_t pkts_per_pktio = global->num_tx_pkt; uint32_t ts_off = test_options->calc_latency ? test_options->hdr_len : 0; - if (use_rand_len) { - uint32_t pkt_sizes = test_options->rand_pkt_len_max - - test_options->rand_pkt_len_min + 1; - - if (test_options->rand_pkt_len_bins) - pkt_sizes = test_options->rand_pkt_len_bins; - if (pkt_sizes > pkts_per_pktio) - pkts_per_pktio = pkt_sizes; - } num_pkt = num_pktio * pkts_per_pktio; odp_packet_t pkt[num_pkt]; From ef553d9166fe68ced4382c998cb2cab37e532746 Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Wed, 6 Sep 2023 13:35:42 +0300 Subject: [PATCH 066/192] test: packet_gen: use pre-initialized packets Allocate and initialize packets for all configured packet sizes in TX thread start up. Use those packets when forming a burst for sending. Sent packets are either copies or references of the original packets. This modification fixes current problem of random length selection sending the same packet multiple times when references are not used. Limit maximum number of threads and packet IO interfaces to avoid excessive global memory usage. Signed-off-by: Petri Savolainen Reviewed-by: Matias Elo --- test/performance/odp_packet_gen.c | 347 ++++++++++++++++-------------- 1 file changed, 186 insertions(+), 161 deletions(-) diff --git a/test/performance/odp_packet_gen.c b/test/performance/odp_packet_gen.c index e2e815b6b5..06b603465d 100644 --- a/test/performance/odp_packet_gen.c +++ b/test/performance/odp_packet_gen.c @@ -21,7 +21,23 @@ #include #include -#define MAX_PKTIOS 32 +#if ODP_THREAD_COUNT_MAX > 33 +/* One control thread, even number of workers */ +#define MAX_THREADS 33 +#else +#define MAX_THREADS ODP_THREAD_COUNT_MAX +#endif + +#define MAX_WORKERS (MAX_THREADS - 1) + +/* At least one control and two worker threads */ +ODP_STATIC_ASSERT(MAX_WORKERS >= 2, "Too few threads"); + +/* Maximum number of packet IO interfaces */ +#define MAX_PKTIOS 16 +/* Maximum number of packets to be allocated for + * one transmit round: bursts * burst_size * bins */ +#define MAX_ALLOC_PACKETS (64 * 1024) /* Maximum number of packet length bins */ #define MAX_BINS 1024 #define MAX_PKTIO_NAME 255 @@ -35,6 +51,9 @@ /* Maximum pktio index table size */ #define MAX_PKTIO_INDEXES 1024 +/* Use static references */ +#define TX_MODE_REF 1 + /* Minimum number of packets to receive in CI test */ #define MIN_RX_PACKETS_CI 800 @@ -101,6 +120,9 @@ typedef struct thread_arg_t { /* In direct_rx mode, pktin queue per pktio interface (per thread) */ odp_pktin_queue_t pktin[MAX_PKTIOS]; + /* Pre-built packets for TX thread */ + odp_packet_t packet[MAX_PKTIOS][MAX_ALLOC_PACKETS]; + } thread_arg_t; typedef struct ODP_ALIGNED_CACHE thread_stat_t { @@ -135,16 +157,16 @@ typedef struct test_global_t { odp_cpumask_t cpumask; odp_pool_t pool; uint64_t drained; - odph_thread_t thread_tbl[ODP_THREAD_COUNT_MAX]; - thread_stat_t stat[ODP_THREAD_COUNT_MAX]; - thread_arg_t thread_arg[ODP_THREAD_COUNT_MAX]; + odph_thread_t thread_tbl[MAX_THREADS]; + thread_stat_t stat[MAX_THREADS]; + thread_arg_t thread_arg[MAX_THREADS]; struct { odph_ethaddr_t eth_src; odph_ethaddr_t eth_dst; odp_pktio_t pktio; - odp_pktout_queue_t pktout[ODP_THREAD_COUNT_MAX]; - odp_pktin_queue_t pktin[ODP_THREAD_COUNT_MAX]; + odp_pktout_queue_t pktout[MAX_THREADS]; + odp_pktin_queue_t pktin[MAX_THREADS]; int started; } pktio[MAX_PKTIOS]; @@ -325,7 +347,7 @@ static int parse_options(int argc, char *argv[], test_global_t *global) { int opt, i, len, str_len, long_index, udp_port; unsigned long int count; - uint32_t min_packets, num_tx_pkt, pkt_len, val; + uint32_t min_packets, num_tx_pkt, num_tx_alloc, pkt_len, val, bins; char *name, *str, *end; test_options_t *test_options = &global->test_options; int ret = 0; @@ -613,6 +635,11 @@ static int parse_options(int argc, char *argv[], test_global_t *global) test_options->num_cpu = test_options->num_rx + test_options->num_tx; + if (test_options->num_cpu > MAX_WORKERS) { + ODPH_ERR("Error: Too many worker threads\n"); + return -1; + } + num_tx_pkt = test_options->burst_size * test_options->bursts; global->num_tx_pkt = num_tx_pkt; @@ -626,12 +653,18 @@ static int parse_options(int argc, char *argv[], test_global_t *global) return -1; } - /* Pool needs to have enough packets for all tx side bursts and - * one rx side burst */ - min_packets = (test_options->num_pktio * test_options->num_tx * - num_tx_pkt) + - (test_options->num_pktio * test_options->num_rx * - test_options->burst_size); + bins = global->num_bins ? global->num_bins : 1; + num_tx_alloc = num_tx_pkt * bins; + if (num_tx_alloc > MAX_ALLOC_PACKETS) { + ODPH_ERR("Error: Too many tx packets: %u\n", num_tx_alloc); + return -1; + } + + /* Pool needs to have enough packets for all TX side pre-allocated packets and + * a burst per thread (for packet copies). RX side needs one burst per thread per pktio. */ + min_packets = test_options->num_pktio * test_options->num_tx * num_tx_alloc; + min_packets += test_options->num_tx * test_options->burst_size; + min_packets += test_options->num_pktio * test_options->num_rx * test_options->burst_size; if (test_options->num_pkt < min_packets) { ODPH_ERR("Error: Pool needs to have at least %u packets\n", min_packets); @@ -686,13 +719,6 @@ static int set_num_cpu(test_global_t *global) test_options_t *test_options = &global->test_options; int num_cpu = test_options->num_cpu; - /* One thread used for the main thread */ - if (num_cpu > ODP_THREAD_COUNT_MAX - 1) { - ODPH_ERR("Error: Too many threads. API supports max %i.\n", - ODP_THREAD_COUNT_MAX - 1); - return -1; - } - ret = odp_cpumask_default_worker(&global->cpumask, num_cpu); if (ret != num_cpu) { @@ -1498,146 +1524,129 @@ static inline void set_timestamp(odp_packet_t pkt, uint32_t ts_off, odp_bool_t c udp->chksum = calc_cs ? odph_ipv4_udp_chksum(pkt) : 0; } -static inline int send_burst(odp_pktout_queue_t pktout, odp_packet_t pkt[], - int burst_size, odp_bool_t use_rand_len, odp_bool_t use_refs, - odp_bool_t calc_cs, uint32_t ts_off, uint32_t pkts_per_pktio, - uint64_t *sent_bytes) { - int i; - int ret = 0; - int num = burst_size; - odp_packet_t out_pkt[burst_size]; +static int alloc_packets(odp_pool_t pool, odp_packet_t *pkt_tbl, uint32_t num, + test_global_t *global) +{ + uint32_t i, pkt_len; + test_options_t *test_options = &global->test_options; + uint32_t num_bins = global->num_bins; + + pkt_len = test_options->pkt_len; + + for (i = 0; i < num; i++) { + if (num_bins) + pkt_len = global->len_bin[i % num_bins]; + + pkt_tbl[i] = odp_packet_alloc(pool, pkt_len); + if (pkt_tbl[i] == ODP_PACKET_INVALID) { + ODPH_ERR("Error: Alloc of %uB packet failed\n", pkt_len); + break; + } + } + + if (i == 0) + return -1; + + if (i != num) { + odp_packet_free_multi(pkt_tbl, i); + return -1; + } + + return 0; +} + +static inline uint32_t form_burst(odp_packet_t out_pkt[], uint32_t burst_size, uint32_t num_bins, + uint32_t burst, odp_packet_t *pkt_tbl, odp_pool_t pool, + int tx_mode, uint32_t ts_off, odp_bool_t calc_cs, + uint64_t *total_bytes) +{ + uint32_t i, idx; + odp_packet_t pkt; static __thread int rand_idx = RAND_16BIT_WORDS; static __thread uint16_t rand_data[RAND_16BIT_WORDS]; - uint64_t bytes_total = 0; + uint64_t bytes = 0; + + idx = burst * burst_size; + if (num_bins) + idx = burst * burst_size * num_bins; for (i = 0; i < burst_size; i++) { - int idx = i; + if (num_bins) { + uint32_t bin; - if (use_rand_len) { if (rand_idx >= RAND_16BIT_WORDS) { if (odp_unlikely(update_rand_data((uint8_t *)rand_data, - RAND_16BIT_WORDS * 2))) { - num = i; - ret = -1; + RAND_16BIT_WORDS * 2))) break; - } rand_idx = 0; } - idx = rand_data[rand_idx++] % pkts_per_pktio; + /* Select random length bin */ + bin = rand_data[rand_idx++] % num_bins; + pkt = pkt_tbl[idx + bin]; + idx += num_bins; + } else { + pkt = pkt_tbl[idx]; + idx++; } - if (use_refs) { - out_pkt[i] = odp_packet_ref_static(pkt[idx]); - if (odp_unlikely(out_pkt[i] == ODP_PACKET_INVALID)) { - num = i; + if (tx_mode == TX_MODE_REF) { + out_pkt[i] = odp_packet_ref_static(pkt); + + if (odp_unlikely(out_pkt[i] == ODP_PACKET_INVALID)) break; - } } else { - out_pkt[i] = pkt[idx]; - pkt[idx] = ODP_PACKET_INVALID; + out_pkt[i] = odp_packet_copy(pkt, pool); + + if (odp_unlikely(out_pkt[i] == ODP_PACKET_INVALID)) + break; if (ts_off) set_timestamp(out_pkt[i], ts_off, calc_cs); } - bytes_total += odp_packet_len(out_pkt[i]); - } - - if (odp_unlikely(num < burst_size)) { - if (!use_refs) - for (int i = 0; i < burst_size; i++) - if (pkt[i] != ODP_PACKET_INVALID) - odp_packet_free(pkt[i]); - if (num == 0) { - *sent_bytes = 0; - return ret; - } + bytes += odp_packet_len(out_pkt[i]); } - ret = odp_pktout_send(pktout, out_pkt, num); - - if (odp_unlikely(ret < 0)) - ret = 0; - - if (odp_unlikely(ret != num)) { - uint32_t num_drop = num - ret; + *total_bytes = bytes; - for (i = ret; i < num; i++) - bytes_total -= odp_packet_len(out_pkt[i]); - odp_packet_free_multi(&out_pkt[ret], num_drop); - } - - *sent_bytes = bytes_total; - return ret; + return i; } -static int alloc_test_packets(odp_pool_t pool, odp_packet_t *pkt_tbl, int num_pkt, - int pkts_per_pktio, test_global_t *global) +static inline uint32_t send_burst(odp_pktout_queue_t pktout, odp_packet_t pkt[], + uint32_t num, uint64_t *drop_bytes) { - test_options_t *test_options = &global->test_options; - uint32_t num_bins = global->num_bins; - int num_alloc = 0; - - if (num_bins) { - int i, j; - int num_pktio = test_options->num_pktio; - - for (i = 0; i < num_pktio; i++) { - uint32_t pkt_len; - - for (j = 0; j < pkts_per_pktio; j++) { - pkt_len = global->len_bin[j % num_bins]; - - pkt_tbl[num_alloc] = odp_packet_alloc(pool, pkt_len); - if (pkt_tbl[num_alloc] == ODP_PACKET_INVALID) { - ODPH_ERR("Error: Alloc of %dB packet failed\n", pkt_len); - break; - } - num_alloc++; - } - } - return num_alloc; - } - num_alloc = odp_packet_alloc_multi(pool, test_options->pkt_len, pkt_tbl, num_pkt); - if (num_alloc != num_pkt) - ODPH_ERR("Error: Alloc of %u packets failed\n", num_pkt); - - return num_alloc; -} + int ret; + uint32_t sent; + uint64_t bytes = 0; -static int allocate_and_init_packets(odp_pool_t pool, odp_packet_t *pkt_tbl, int num_pkt, - int pkts_per_pktio, test_options_t *test_options, - test_global_t *global) -{ - int num_alloc, num_pktio = test_options->num_pktio; + ret = odp_pktout_send(pktout, pkt, num); - num_alloc = alloc_test_packets(pool, pkt_tbl, num_pkt, pkts_per_pktio, global); + sent = ret; + if (odp_unlikely(ret < 0)) + sent = 0; - if (num_alloc != num_pkt) - goto err; + if (odp_unlikely(sent != num)) { + uint32_t i; + uint32_t num_drop = num - sent; - for (int i = 0; i < num_pktio; i++) { - int f = i * pkts_per_pktio; + for (i = sent; i < num; i++) + bytes += odp_packet_len(pkt[i]); - if (init_packets(global, i, &pkt_tbl[f], pkts_per_pktio, f)) - goto err; + odp_packet_free_multi(&pkt[sent], num_drop); } - return 0; - -err: - if (num_alloc > 0) - odp_packet_free_multi(pkt_tbl, num_alloc); + *drop_bytes = bytes; - return -1; + return sent; } static int tx_thread(void *arg) { int i, thr, tx_thr; - uint32_t exit_test; + uint32_t exit_test, num_alloc; odp_time_t t1, t2, next_tmo; uint64_t diff_ns, t1_nsec; + odp_packet_t *pkt_tbl; thread_arg_t *thread_arg = arg; test_global_t *global = thread_arg->global; test_options_t *test_options = &global->test_options; @@ -1650,35 +1659,43 @@ static int tx_thread(void *arg) uint64_t tx_packets = 0; uint64_t tx_drops = 0; int ret = 0; - int burst_size = test_options->burst_size; - int bursts = test_options->bursts; - uint32_t num_tx = test_options->num_tx; - odp_bool_t use_rand_len = test_options->use_rand_pkt_len; - odp_bool_t use_refs = test_options->use_refs; - odp_bool_t is_allocd = false; + const uint32_t burst_size = test_options->burst_size; + const uint32_t bursts = test_options->bursts; + const uint32_t num_tx = test_options->num_tx; + const int tx_mode = test_options->use_refs ? TX_MODE_REF : 0; odp_bool_t calc_cs = test_options->calc_cs; int num_pktio = test_options->num_pktio; - int num_pkt; odp_pktout_queue_t pktout[num_pktio]; - uint32_t pkts_per_pktio = global->num_tx_pkt; uint32_t ts_off = test_options->calc_latency ? test_options->hdr_len : 0; - - num_pkt = num_pktio * pkts_per_pktio; - - odp_packet_t pkt[num_pkt]; - + uint32_t tot_packets = 0; + uint32_t num_bins = global->num_bins; thr = odp_thread_id(); tx_thr = thread_arg->tx_thr; global->stat[thr].thread_type = TX_THREAD; - for (i = 0; i < num_pktio; i++) + num_alloc = global->num_tx_pkt; + if (num_bins) + num_alloc = global->num_tx_pkt * num_bins; + + for (i = 0; i < num_pktio; i++) { + int seq = i * num_alloc; + pktout[i] = thread_arg->pktout[i]; + pkt_tbl = thread_arg->packet[i]; + + if (alloc_packets(pool, pkt_tbl, num_alloc, global)) { + ret = -1; + break; + } + + tot_packets += num_alloc; - if (use_refs) { - ret = allocate_and_init_packets(pool, pkt, num_pkt, pkts_per_pktio, test_options, - global); - is_allocd = !ret; + if (init_packets(global, i, pkt_tbl, num_alloc, seq)) { + ret = -1; + break; + } } + /* Start all workers at the same time */ odp_barrier_wait(&global->barrier); @@ -1705,32 +1722,33 @@ static int tx_thread(void *arg) } tx_timeouts++; - if (!use_refs) { - if (odp_unlikely(allocate_and_init_packets(pool, pkt, num_pkt, - pkts_per_pktio, test_options, - global) < 0)) { - ret = -1; - break; - } - } /* Send bursts to each pktio */ for (i = 0; i < num_pktio; i++) { - int sent, j; - int first = i * bursts * pkts_per_pktio; - uint64_t sent_bytes; + uint32_t num, sent, j; + uint64_t total_bytes, drop_bytes; + odp_packet_t pkt[burst_size]; + + pkt_tbl = thread_arg->packet[i]; for (j = 0; j < bursts; j++) { - sent = send_burst(pktout[i], &pkt[first + j * burst_size], - burst_size, use_rand_len, use_refs, calc_cs, - ts_off, pkts_per_pktio, &sent_bytes); + num = form_burst(pkt, burst_size, num_bins, j, pkt_tbl, pool, + tx_mode, ts_off, calc_cs, &total_bytes); + + if (odp_unlikely(num == 0)) { + ret = -1; + tx_drops += burst_size; + break; + } - if (odp_unlikely(sent < 0)) { + sent = send_burst(pktout[i], pkt, num, &drop_bytes); + + if (odp_unlikely(sent == 0)) { ret = -1; tx_drops += burst_size; break; } - tx_bytes += sent_bytes; + tx_bytes += total_bytes - drop_bytes; tx_packets += sent; if (odp_unlikely(sent < burst_size)) tx_drops += burst_size - sent; @@ -1745,8 +1763,15 @@ static int tx_thread(void *arg) t2 = odp_time_local(); diff_ns = odp_time_diff_ns(t2, t1); - if (is_allocd) - odp_packet_free_multi(pkt, num_pkt); + for (i = 0; i < num_pktio; i++) { + pkt_tbl = thread_arg->packet[i]; + + if (tot_packets == 0) + break; + + odp_packet_free_multi(pkt_tbl, num_alloc); + tot_packets -= num_alloc; + } /* Update stats */ global->stat[thr].time_nsec = diff_ns; @@ -1830,7 +1855,7 @@ static void print_periodic_stat(test_global_t *global, uint64_t nsec) num_tx[i] = 0; num_rx[i] = 0; - for (j = 0; j < ODP_THREAD_COUNT_MAX; j++) { + for (j = 0; j < MAX_THREADS; j++) { if (global->stat[j].thread_type == RX_THREAD) num_rx[i] += global->stat[j].pktio[i].rx_packets; else if (global->stat[j].thread_type == TX_THREAD) @@ -1934,7 +1959,7 @@ static int print_final_stat(test_global_t *global) printf(" "); num_thr = 0; - for (i = 0; i < ODP_THREAD_COUNT_MAX; i++) { + for (i = 0; i < MAX_THREADS; i++) { if (global->stat[i].thread_type != RX_THREAD) continue; @@ -1953,7 +1978,7 @@ static int print_final_stat(test_global_t *global) printf(" "); num_thr = 0; - for (i = 0; i < ODP_THREAD_COUNT_MAX; i++) { + for (i = 0; i < MAX_THREADS; i++) { if (global->stat[i].thread_type != TX_THREAD) continue; @@ -1966,7 +1991,7 @@ static int print_final_stat(test_global_t *global) printf("\n\n"); - for (i = 0; i < ODP_THREAD_COUNT_MAX; i++) { + for (i = 0; i < MAX_THREADS; i++) { if (global->stat[i].thread_type == RX_THREAD) { rx_tmo_sum += global->stat[i].rx_timeouts; rx_pkt_sum += global->stat[i].rx_packets; @@ -2118,7 +2143,7 @@ int main(int argc, char **argv) memset(global, 0, sizeof(test_global_t)); odp_atomic_init_u32(&global->exit_test, 0); - for (i = 0; i < ODP_THREAD_COUNT_MAX; i++) + for (i = 0; i < MAX_THREADS; i++) global->thread_arg[i].global = global; if (parse_options(argc, argv, global)) { From 2867a30b8466c8aa64cd8e0e20a4e804cd6774d2 Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Mon, 11 Sep 2023 12:06:48 +0300 Subject: [PATCH 067/192] test: packet_gen: change no refs option to TX mode option Change current --no_pkt_refs option to --tx_mode option. The option can be used to select how packet are transmitted: send copies of packets, static references to packets, or packets marked with the new "don't free" option. Signed-off-by: Petri Savolainen Reviewed-by: Matias Elo --- test/performance/odp_packet_gen.c | 63 ++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/test/performance/odp_packet_gen.c b/test/performance/odp_packet_gen.c index 06b603465d..5e68320733 100644 --- a/test/performance/odp_packet_gen.c +++ b/test/performance/odp_packet_gen.c @@ -51,6 +51,8 @@ ODP_STATIC_ASSERT(MAX_WORKERS >= 2, "Too few threads"); /* Maximum pktio index table size */ #define MAX_PKTIO_INDEXES 1024 +/* Used don't free */ +#define TX_MODE_DF 0 /* Use static references */ #define TX_MODE_REF 1 @@ -88,7 +90,7 @@ typedef struct test_options_t { uint32_t wait_sec; uint32_t wait_start_sec; uint32_t mtu; - odp_bool_t use_refs; + int tx_mode; odp_bool_t promisc_mode; odp_bool_t calc_latency; odp_bool_t calc_cs; @@ -231,10 +233,11 @@ static void print_usage(void) " -D, --direct_rx Direct input mode (default: 0)\n" " 0: Use scheduler for packet input\n" " 1: Poll packet input in direct mode\n", MAX_BINS); - printf(" -R, --no_pkt_refs Do not use packet references. Always allocate a\n" - " fresh set of packets for a transmit burst. Some\n" - " features may be available only with references\n" - " disabled.\n" + printf(" -m, --tx_mode Transmit mode (default 1):\n" + " 0: Re-send packets with don't free option\n" + " 1: Send static packet references. Some features may\n" + " not be available with references.\n" + " 2: Send copies of packets\n" " -M, --mtu Interface MTU in bytes.\n" " -b, --burst_size Transmit burst size. Default: 8\n" " -x, --bursts Number of bursts per one transmit round. Default: 1\n" @@ -246,8 +249,8 @@ static void print_usage(void) " -o, --udp_src UDP source port. Default: 10000\n" " -p, --udp_dst UDP destination port. Default: 20000\n" " -P, --promisc_mode Enable promiscuous mode.\n" - " -a, --latency Calculate latency. Disables packet references (see\n" - " \"--no_pkt_refs\").\n" + " -a, --latency Calculate latency. Cannot be used with packet\n" + " references (see \"--tx_mode\").\n" " -c, --c_mode Counter mode for incrementing UDP port numbers.\n" " Specify the number of port numbers used starting from\n" " udp_src/udp_dst. Comma-separated (no spaces) list of\n" @@ -362,7 +365,7 @@ static int parse_options(int argc, char *argv[], test_global_t *global) {"len", required_argument, NULL, 'l'}, {"len_range", required_argument, NULL, 'L'}, {"direct_rx", required_argument, NULL, 'D'}, - {"no_pkt_refs", no_argument, NULL, 'R'}, + {"tx_mode", required_argument, NULL, 'm'}, {"burst_size", required_argument, NULL, 'b'}, {"bursts", required_argument, NULL, 'x'}, {"gap", required_argument, NULL, 'g'}, @@ -385,7 +388,7 @@ static int parse_options(int argc, char *argv[], test_global_t *global) {NULL, 0, NULL, 0} }; - static const char *shortopts = "+i:e:r:t:n:l:L:D:RM:b:x:g:v:s:d:o:p:c:CAq:u:w:W:Pah"; + static const char *shortopts = "+i:e:r:t:n:l:L:D:m:M:b:x:g:v:s:d:o:p:c:CAq:u:w:W:Pah"; test_options->num_pktio = 0; test_options->num_rx = 1; @@ -394,7 +397,7 @@ static int parse_options(int argc, char *argv[], test_global_t *global) test_options->pkt_len = 512; test_options->use_rand_pkt_len = 0; test_options->direct_rx = 0; - test_options->use_refs = 1; + test_options->tx_mode = TX_MODE_REF; test_options->burst_size = 8; test_options->bursts = 1; test_options->gap_nsec = 1000000; @@ -544,8 +547,8 @@ static int parse_options(int argc, char *argv[], test_global_t *global) case 'D': test_options->direct_rx = atoi(optarg); break; - case 'R': - test_options->use_refs = 0; + case 'm': + test_options->tx_mode = atoi(optarg); break; case 'M': test_options->mtu = atoi(optarg); @@ -671,8 +674,10 @@ static int parse_options(int argc, char *argv[], test_global_t *global) return -1; } - if (test_options->calc_latency) - test_options->use_refs = 0; + if (test_options->calc_latency && test_options->tx_mode == TX_MODE_REF) { + ODPH_ERR("Error: Latency test is not supported with packet references (--tx_mode 1)\n"); + return -1; + } if (test_options->gap_nsec) { double gap_hz = 1000000000.0 / test_options->gap_nsec; @@ -796,7 +801,7 @@ static int open_pktios(test_global_t *global) printf("interface default\n"); printf(" packet input mode: %s\n", test_options->direct_rx ? "direct" : "scheduler"); printf(" promisc mode: %s\n", test_options->promisc_mode ? "enabled" : "disabled"); - printf(" packet references: %s\n", test_options->use_refs ? "enabled" : "disabled"); + printf(" transmit mode: %i\n", test_options->tx_mode); printf(" measure latency: %s\n", test_options->calc_latency ? "enabled" : "disabled"); printf(" UDP checksum: %s\n", test_options->calc_cs ? "enabled" : "disabled"); printf(" payload filling: %s\n", test_options->fill_pl ? "enabled" : "disabled"); @@ -973,6 +978,11 @@ static int open_pktios(test_global_t *global) } } + if (test_options->tx_mode == TX_MODE_DF && pktio_capa.free_ctrl.dont_free == 0) { + ODPH_ERR("Error (%s): Don't free mode not supported\n", name); + return -1; + } + odp_pktio_config_init(&pktio_config); pktio_config.parser.layer = ODP_PROTO_LAYER_ALL; @@ -1589,7 +1599,9 @@ static inline uint32_t form_burst(odp_packet_t out_pkt[], uint32_t burst_size, u idx++; } - if (tx_mode == TX_MODE_REF) { + if (tx_mode == TX_MODE_DF) { + out_pkt[i] = pkt; + } else if (tx_mode == TX_MODE_REF) { out_pkt[i] = odp_packet_ref_static(pkt); if (odp_unlikely(out_pkt[i] == ODP_PACKET_INVALID)) @@ -1613,7 +1625,7 @@ static inline uint32_t form_burst(odp_packet_t out_pkt[], uint32_t burst_size, u } static inline uint32_t send_burst(odp_pktout_queue_t pktout, odp_packet_t pkt[], - uint32_t num, uint64_t *drop_bytes) + uint32_t num, int tx_mode, uint64_t *drop_bytes) { int ret; uint32_t sent; @@ -1632,7 +1644,8 @@ static inline uint32_t send_burst(odp_pktout_queue_t pktout, odp_packet_t pkt[], for (i = sent; i < num; i++) bytes += odp_packet_len(pkt[i]); - odp_packet_free_multi(&pkt[sent], num_drop); + if (tx_mode != TX_MODE_DF) + odp_packet_free_multi(&pkt[sent], num_drop); } *drop_bytes = bytes; @@ -1643,7 +1656,7 @@ static inline uint32_t send_burst(odp_pktout_queue_t pktout, odp_packet_t pkt[], static int tx_thread(void *arg) { int i, thr, tx_thr; - uint32_t exit_test, num_alloc; + uint32_t exit_test, num_alloc, j; odp_time_t t1, t2, next_tmo; uint64_t diff_ns, t1_nsec; odp_packet_t *pkt_tbl; @@ -1662,7 +1675,7 @@ static int tx_thread(void *arg) const uint32_t burst_size = test_options->burst_size; const uint32_t bursts = test_options->bursts; const uint32_t num_tx = test_options->num_tx; - const int tx_mode = test_options->use_refs ? TX_MODE_REF : 0; + const int tx_mode = test_options->tx_mode; odp_bool_t calc_cs = test_options->calc_cs; int num_pktio = test_options->num_pktio; odp_pktout_queue_t pktout[num_pktio]; @@ -1694,6 +1707,12 @@ static int tx_thread(void *arg) ret = -1; break; } + + if (tx_mode == TX_MODE_DF) { + for (j = 0; j < num_alloc; j++) + odp_packet_free_ctrl_set(pkt_tbl[j], + ODP_PACKET_FREE_CTRL_DONT_FREE); + } } /* Start all workers at the same time */ @@ -1724,7 +1743,7 @@ static int tx_thread(void *arg) /* Send bursts to each pktio */ for (i = 0; i < num_pktio; i++) { - uint32_t num, sent, j; + uint32_t num, sent; uint64_t total_bytes, drop_bytes; odp_packet_t pkt[burst_size]; @@ -1740,7 +1759,7 @@ static int tx_thread(void *arg) break; } - sent = send_burst(pktout[i], pkt, num, &drop_bytes); + sent = send_burst(pktout[i], pkt, num, tx_mode, &drop_bytes); if (odp_unlikely(sent == 0)) { ret = -1; From 014e609ca6710bb88c326aefd9ed8632dd4eaf7a Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Mon, 11 Sep 2023 16:20:07 +0300 Subject: [PATCH 068/192] linux-gen: dpdk: implement don't free option Implemented packet output don't free option for DPDK packet IO. Option is available only when not using zero copy mode. Signed-off-by: Petri Savolainen Reviewed-by: Matias Elo --- platform/linux-generic/odp_packet_io.c | 1 - platform/linux-generic/pktio/dpdk.c | 30 +++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 349df6d337..406916de25 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -1600,7 +1600,6 @@ int odp_pktio_capability(odp_pktio_t pktio, odp_pktio_capability_t *capa) capa->tx_compl.queue_type_sched = 1; capa->tx_compl.queue_type_plain = 1; capa->tx_compl.max_compl_id = UINT32_MAX - 1; - capa->free_ctrl.dont_free = 0; capa->config.pktout.bit.aging_ena = 1; capa->max_tx_aging_tmo_ns = MAX_TX_AGING_TMO_NS; diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 89aa91af76..3fa7960078 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -1821,6 +1821,7 @@ static int dpdk_init_capability(pktio_entry_t *pktio_entry, capa->tx_compl.mode_all = 1; capa->tx_compl.mode_event = 1; capa->tx_compl.mode_poll = 1; + capa->free_ctrl.dont_free = 1; } /* Copy for fast path access */ @@ -2258,13 +2259,36 @@ static int dpdk_send(pktio_entry_t *pktio_entry, int index, } } } else { + int i; + int first = tx_pkts; + if (odp_unlikely(tx_pkts < mbufs)) { - for (uint16_t i = tx_pkts; i < mbufs; i++) + for (i = tx_pkts; i < mbufs; i++) rte_pktmbuf_free(tx_mbufs[i]); } - if (odp_likely(tx_pkts)) - odp_packet_free_multi(pkt_table, tx_pkts); + if (odp_unlikely(tx_pkts == 0)) + return 0; + + /* Find the first packet with (possible) don't free flag */ + for (i = 0; i < tx_pkts; i++) { + if (odp_packet_free_ctrl(pkt_table[i]) == ODP_PACKET_FREE_CTRL_DONT_FREE) { + first = i; + break; + } + } + + /* Free first N packets that don't have the flag */ + if (odp_likely(first > 0)) + odp_packet_free_multi(pkt_table, first); + + /* Free rest of the packets (according to the flag) */ + for (i = first; i < tx_pkts; i++) { + if (odp_packet_free_ctrl(pkt_table[i]) == ODP_PACKET_FREE_CTRL_DONT_FREE) + continue; + + odp_packet_free(pkt_table[i]); + } } return tx_pkts; From 1a2b3352790bec6e533e70bf2ee8bedf6d590ee0 Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Wed, 13 Sep 2023 14:27:53 +0300 Subject: [PATCH 069/192] validation: pktio: add don't free test case Test packet output don't free operation by sending the same packet five times through the interface. TX completion is not checked as reception of the packet verifies previous TX completion. Signed-off-by: Petri Savolainen Reviewed-by: Matias Elo --- test/validation/api/pktio/pktio.c | 99 ++++++++++++++++++++++++++++++- 1 file changed, 98 insertions(+), 1 deletion(-) diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c index 0746fd0e08..79d835f603 100644 --- a/test/validation/api/pktio/pktio.c +++ b/test/validation/api/pktio/pktio.c @@ -1,5 +1,5 @@ /* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2020-2022, Nokia + * Copyright (c) 2020-2023, Nokia * Copyright (c) 2020, Marvell * All rights reserved. * @@ -3891,6 +3891,102 @@ static void pktio_test_pktout_compl_event_sched_queue(void) pktio_test_pktout_compl_event(false); } +static void pktio_test_pktout_dont_free(void) +{ + odp_pktio_t pktio[MAX_NUM_IFACES] = {ODP_PKTIO_INVALID}; + odp_packet_t pkt, rx_pkt; + odp_pktio_capability_t pktio_capa; + odp_pktout_queue_t pktout_queue; + odp_pktio_t pktio_tx, pktio_rx; + pktio_info_t pktio_rx_info; + uint32_t pkt_seq; + int ret, i; + const int num_pkt = 1; + int transmits = 5; + int num_rx = 0; + + CU_ASSERT_FATAL(num_ifaces >= 1); + + /* Open and configure interfaces */ + for (i = 0; i < num_ifaces; ++i) { + pktio[i] = create_pktio(i, ODP_PKTIN_MODE_DIRECT, ODP_PKTOUT_MODE_DIRECT); + CU_ASSERT_FATAL(pktio[i] != ODP_PKTIO_INVALID); + + CU_ASSERT_FATAL(odp_pktio_start(pktio[i]) == 0); + } + + pktio_tx = pktio[0]; + pktio_rx = (num_ifaces > 1) ? pktio[1] : pktio_tx; + + /* Check TX interface capa */ + CU_ASSERT_FATAL(odp_pktio_capability(pktio_tx, &pktio_capa) == 0); + CU_ASSERT_FATAL(pktio_capa.free_ctrl.dont_free == 1); + + for (i = 0; i < num_ifaces; i++) + _pktio_wait_linkup(pktio[i]); + + pktio_rx_info.id = pktio_rx; + pktio_rx_info.inq = ODP_QUEUE_INVALID; + pktio_rx_info.in_mode = ODP_PKTIN_MODE_DIRECT; + + ret = create_packets(&pkt, &pkt_seq, num_pkt, pktio_tx, pktio_rx); + CU_ASSERT_FATAL(ret == num_pkt); + + ret = odp_pktout_queue(pktio_tx, &pktout_queue, 1); + CU_ASSERT_FATAL(ret > 0); + + /* Set don't free flag */ + CU_ASSERT(odp_packet_free_ctrl(pkt) == ODP_PACKET_FREE_CTRL_DISABLED); + odp_packet_free_ctrl_set(pkt, ODP_PACKET_FREE_CTRL_DONT_FREE); + CU_ASSERT_FATAL(odp_packet_free_ctrl(pkt) == ODP_PACKET_FREE_CTRL_DONT_FREE); + + while (transmits--) { + /* Retransmit the same packet after it has been received from the RX interface */ + CU_ASSERT_FATAL(odp_pktout_send(pktout_queue, &pkt, num_pkt) == num_pkt); + + num_rx = wait_for_packets(&pktio_rx_info, &rx_pkt, &pkt_seq, num_pkt, + TXRX_MODE_SINGLE, ODP_TIME_SEC_IN_NS, false); + CU_ASSERT(num_rx == num_pkt); + + if (num_rx != num_pkt) + break; + + CU_ASSERT(odp_packet_len(pkt) == odp_packet_len(rx_pkt)); + odp_packet_free(rx_pkt); + } + + odp_packet_free(pkt); + + for (i = 0; i < num_ifaces; i++) { + CU_ASSERT_FATAL(odp_pktio_stop(pktio[i]) == 0); + CU_ASSERT_FATAL(odp_pktio_close(pktio[i]) == 0); + } +} + +static int pktio_check_pktout_dont_free(void) +{ + odp_pktio_param_t pktio_param; + odp_pktio_capability_t capa; + odp_pktio_t pktio; + int ret; + + odp_pktio_param_init(&pktio_param); + pktio_param.in_mode = ODP_PKTIN_MODE_DIRECT; + pktio_param.out_mode = ODP_PKTOUT_MODE_DIRECT; + + pktio = odp_pktio_open(iface_name[0], pool[0], &pktio_param); + if (pktio == ODP_PKTIO_INVALID) + return ODP_TEST_INACTIVE; + + ret = odp_pktio_capability(pktio, &capa); + (void)odp_pktio_close(pktio); + + if (ret == 0 && capa.free_ctrl.dont_free == 1) + return ODP_TEST_ACTIVE; + + return ODP_TEST_INACTIVE; +} + static void pktio_test_chksum(void (*config_fn)(odp_pktio_t, odp_pktio_t), void (*prep_fn)(odp_packet_t pkt), void (*test_fn)(odp_packet_t pkt)) @@ -5332,6 +5428,7 @@ odp_testinfo_t pktio_suite_unsegmented[] = { ODP_TEST_INFO_CONDITIONAL(pktio_test_pktout_compl_event_sched_queue, pktio_check_pktout_compl_event_sched_queue), ODP_TEST_INFO_CONDITIONAL(pktio_test_pktout_compl_poll, pktio_check_pktout_compl_poll), + ODP_TEST_INFO_CONDITIONAL(pktio_test_pktout_dont_free, pktio_check_pktout_dont_free), ODP_TEST_INFO_CONDITIONAL(pktio_test_enable_pause_rx, pktio_check_pause_rx), ODP_TEST_INFO_CONDITIONAL(pktio_test_enable_pause_tx, pktio_check_pause_tx), ODP_TEST_INFO_CONDITIONAL(pktio_test_enable_pause_both, pktio_check_pause_both), From abcdc5e261254eddac149cd45aef2c2a45b59cfe Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Mon, 18 Sep 2023 12:48:50 +0000 Subject: [PATCH 070/192] test: ipsecfwd: fix potential memory leak When tearing down resources, free interface string unconditionally as teardown logic could be reached before packet I/Os have been opened. Signed-off-by: Tuomas Taipale Reviewed-by: Janne Peltonen --- test/performance/odp_ipsecfwd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/performance/odp_ipsecfwd.c b/test/performance/odp_ipsecfwd.c index ecc6010329..d2441a4167 100644 --- a/test/performance/odp_ipsecfwd.c +++ b/test/performance/odp_ipsecfwd.c @@ -1933,11 +1933,12 @@ static void teardown_test(const prog_config_t *config) { (void)odph_iplookup_table_destroy(config->fwd_tbl); - for (uint32_t i = 0U; i < config->num_ifs; ++i) - if (config->pktios[i].handle != ODP_PKTIO_INVALID) { + for (uint32_t i = 0U; i < config->num_ifs; ++i) { + free(config->pktios[i].name); + + if (config->pktios[i].handle != ODP_PKTIO_INVALID) (void)odp_pktio_close(config->pktios[i].handle); - free(config->pktios[i].name); - } + } if (config->pktio_pool != ODP_POOL_INVALID) (void)odp_pool_destroy(config->pktio_pool); From 73e5b8a24f3e6b421c6d4a421f039cc0897664e4 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 18 Sep 2023 16:30:18 +0300 Subject: [PATCH 071/192] example: sysinfo: add timer pool start call Call odp_timer_pool_start() before querying timer pool info. Depending on the implementation, some information may only be available after the timer pool has been started. Also, print clock source in case of timer API call failures. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- example/sysinfo/odp_sysinfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/example/sysinfo/odp_sysinfo.c b/example/sysinfo/odp_sysinfo.c index 4564067b86..05635eec29 100644 --- a/example/sysinfo/odp_sysinfo.c +++ b/example/sysinfo/odp_sysinfo.c @@ -556,7 +556,7 @@ static int timer_capability(appl_args_t *appl_args) if (ret == -1) continue; if (ret < -1) { - ODPH_ERR("odp_timer_capability() failed: %d\n", ret); + ODPH_ERR("odp_timer_capability() for clock source %d failed: %d\n", i, ret); return -1; } @@ -573,9 +573,11 @@ static int timer_capability(appl_args_t *appl_args) return -1; } + odp_timer_pool_start(); + ret = odp_timer_pool_info(pool, info); if (ret) { - ODPH_ERR("odp_timer_pool_info() failed: %d\n", ret); + ODPH_ERR("odp_timer_pool_info() for clock source %d failed: %d\n", i, ret); return -1; } From 59524e105b9b8696bda29c144086615149ea405b Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 18 Sep 2023 16:28:56 +0300 Subject: [PATCH 072/192] validation: timer: add check for odp_timer_capability() return value Test that -1 (and not failure) is returned for unsupported timer clock sources. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- test/validation/api/timer/timer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index 9b08847f9f..ac65aac2b2 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -366,9 +366,17 @@ static void timer_test_capa(void) #endif for (i = 0; i < ODP_CLOCK_NUM_SRC; i++) { + odp_timer_capability_t capa; + int ret; + clk_src = ODP_CLOCK_SRC_0 + i; + + ret = odp_timer_capability(clk_src, &capa); + CU_ASSERT(ret == 0 || ret == -1); + if (global_mem->clk_supported[i]) { ODPH_DBG("\nTesting clock source: %i\n", clk_src); + CU_ASSERT(ret == 0); timer_test_capa_run(clk_src); } } From 74de8cfd241107aa9c666506ecb7ac14a2978a3d Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 13 Sep 2023 16:11:14 +0300 Subject: [PATCH 073/192] test: performance: use common data types Utilize common data types among all odp_bench_* applications. Reduces the amount of duplicate code. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- test/performance/Makefile.am | 8 ++-- test/performance/bench_common.h | 70 +++++++++++++++++++++++++++++ test/performance/odp_bench_buffer.c | 47 +++---------------- test/performance/odp_bench_misc.c | 31 ++----------- test/performance/odp_bench_packet.c | 34 ++------------ test/performance/odp_bench_timer.c | 25 ++--------- 6 files changed, 93 insertions(+), 122 deletions(-) create mode 100644 test/performance/bench_common.h diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am index 24c1767fe6..b5a1f9eb2b 100644 --- a/test/performance/Makefile.am +++ b/test/performance/Makefile.am @@ -61,10 +61,10 @@ endif bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY) odp_atomic_perf_SOURCES = odp_atomic_perf.c -odp_bench_buffer_SOURCES = odp_bench_buffer.c -odp_bench_misc_SOURCES = odp_bench_misc.c -odp_bench_packet_SOURCES = odp_bench_packet.c -odp_bench_timer_SOURCES = odp_bench_timer.c +odp_bench_buffer_SOURCES = odp_bench_buffer.c bench_common.h +odp_bench_misc_SOURCES = odp_bench_misc.c bench_common.h +odp_bench_packet_SOURCES = odp_bench_packet.c bench_common.h +odp_bench_timer_SOURCES = odp_bench_timer.c bench_common.h odp_cpu_bench_SOURCES = odp_cpu_bench.c odp_crc_SOURCES = odp_crc.c odp_crypto_SOURCES = odp_crypto.c diff --git a/test/performance/bench_common.h b/test/performance/bench_common.h new file mode 100644 index 0000000000..40908771b9 --- /dev/null +++ b/test/performance/bench_common.h @@ -0,0 +1,70 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia + */ + +#ifndef BENCH_COMMON_H +#define BENCH_COMMON_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +#include + +/** + * Check benchmark preconditions + * + * @retval !0 test enabled + */ +typedef int (*bench_cond_fn_t)(void); + +/** + * Initialize benchmark resources + */ +typedef void (*bench_init_fn_t)(void); + +/** + * Run benchmark + * + * @retval >0 on success + */ +typedef int (*bench_run_fn_t)(void); + +/** + * Release benchmark resources + */ +typedef void (*bench_term_fn_t)(void); + +/* Benchmark test data */ +typedef struct { + /* Default test name */ + const char *name; + + /* Optional alternate test description */ + const char *desc; + + /* Optional precondition to run test */ + bench_cond_fn_t cond; + + /* Optional test initializer function */ + bench_init_fn_t init; + + /* Test function to run */ + bench_run_fn_t run; + + /* Optional test terminate function */ + bench_term_fn_t term; + + /* Optional test specific limit for rounds (tuning for slow implementations) */ + uint32_t max_rounds; + +} bench_info_t; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/test/performance/odp_bench_buffer.c b/test/performance/odp_bench_buffer.c index e0e7c85cdc..123e457a73 100644 --- a/test/performance/odp_bench_buffer.c +++ b/test/performance/odp_bench_buffer.c @@ -8,6 +8,8 @@ #include #include +#include "bench_common.h" + #include #include #include @@ -36,11 +38,12 @@ #define NO_PATH(file_name) (strrchr((file_name), '/') ? \ strrchr((file_name), '/') + 1 : (file_name)) -#define BENCH_INFO(run, init, term, name) \ - {#run, run, init, term, name, NULL} +#define BENCH_INFO(run_fn, init_fn, term_fn, alt_name) \ + {.name = #run_fn, .run = run_fn, .init = init_fn, .term = term_fn, .desc = alt_name} -#define BENCH_INFO_COND(run, init, term, name, cond) \ - {#run, run, init, term, name, cond} +#define BENCH_INFO_COND(run_fn, init_fn, term_fn, alt_name, cond_fn) \ + {.name = #run_fn, .run = run_fn, .init = init_fn, .term = term_fn, .desc = alt_name, \ + .cond = cond_fn} /** * Parsed command line arguments @@ -52,42 +55,6 @@ typedef struct { int test_cycles; /** Test cycles per tested function */ } appl_args_t; -/** - * Initialize benchmark resources - */ -typedef void (*bench_init_fn_t)(void); - -/** - * Run benchmark - * - * @retval >0 on success - * */ -typedef int (*bench_run_fn_t)(void); - -/** - * Release benchmark resources - */ -typedef void (*bench_term_fn_t)(void); - -/** - * Check benchmark preconditions - * - * @retval !0 test enabled - * */ -typedef int (*bench_cond_fn_t)(void); - -/** - * Benchmark data - */ -typedef struct { - const char *name; - bench_run_fn_t run; - bench_init_fn_t init; - bench_term_fn_t term; - const char *desc; - bench_cond_fn_t cond; -} bench_info_t; - /** * Grouping of all global data */ diff --git a/test/performance/odp_bench_misc.c b/test/performance/odp_bench_misc.c index 3da4a66161..b4f55486dc 100644 --- a/test/performance/odp_bench_misc.c +++ b/test/performance/odp_bench_misc.c @@ -11,6 +11,8 @@ #include #include +#include "bench_common.h" + #include #include #include @@ -23,8 +25,8 @@ /* Default number of rounds per test case */ #define ROUNDS 1000u -#define BENCH_INFO(run, init, max, name) \ - {#run, run, init, max, name} +#define BENCH_INFO(run_fn, init_fn, max, alt_name) \ + {.name = #run_fn, .run = run_fn, .init = init_fn, .max_rounds = max, .desc = alt_name} typedef struct { /* Measure time vs CPU cycles */ @@ -38,31 +40,6 @@ typedef struct { } appl_args_t; -/* Initialize benchmark resources */ -typedef void (*bench_init_fn_t)(void); - -/* Run benchmark, returns >0 on success */ -typedef int (*bench_run_fn_t)(void); - -/* Benchmark data */ -typedef struct { - /* Default test name */ - const char *name; - - /* Test function to run */ - bench_run_fn_t run; - - /* Test init function */ - bench_init_fn_t init; - - /* Test specific limit for rounds (tuning for slow implementation) */ - uint32_t max_rounds; - - /* Override default test name */ - const char *desc; - -} bench_info_t; - /* Global data */ typedef struct { appl_args_t appl; diff --git a/test/performance/odp_bench_packet.c b/test/performance/odp_bench_packet.c index 8da2d736a0..a8f4fb5673 100644 --- a/test/performance/odp_bench_packet.c +++ b/test/performance/odp_bench_packet.c @@ -24,6 +24,8 @@ #include #include +#include "bench_common.h" + /** Minimum number of packet data bytes in the first segment */ #define PKT_POOL_SEG_LEN 128 @@ -66,8 +68,8 @@ #define NO_PATH(file_name) (strrchr((file_name), '/') ? \ strrchr((file_name), '/') + 1 : (file_name)) -#define BENCH_INFO(run, init, term, name) \ - {#run, run, init, term, name} +#define BENCH_INFO(run_fn, init_fn, term_fn, alt_name) \ + {.name = #run_fn, .run = run_fn, .init = init_fn, .term = term_fn, .desc = alt_name} ODP_STATIC_ASSERT((TEST_ALIGN_OFFSET + TEST_ALIGN_LEN) <= TEST_MIN_PKT_SIZE, "Invalid_alignment"); @@ -88,34 +90,6 @@ typedef struct { int cache_size; /** Pool cache size */ } appl_args_t; -/** - * Initialize benchmark resources - */ -typedef void (*bench_init_fn_t)(void); - -/** - * Run benchmark - * - * @retval >0 on success - * */ -typedef int (*bench_run_fn_t)(void); - -/** - * Release benchmark resources - */ -typedef void (*bench_term_fn_t)(void); - -/** - * Benchmark data - */ -typedef struct { - const char *name; - bench_run_fn_t run; - bench_init_fn_t init; - bench_term_fn_t term; - const char *desc; -} bench_info_t; - /** * Grouping of all global data */ diff --git a/test/performance/odp_bench_timer.c b/test/performance/odp_bench_timer.c index 918d19e5d7..4bf0df3f86 100644 --- a/test/performance/odp_bench_timer.c +++ b/test/performance/odp_bench_timer.c @@ -11,6 +11,8 @@ #include #include +#include "bench_common.h" + #include #include #include @@ -29,27 +31,8 @@ /** Timer duration in nsec */ #define TIMER_NSEC 50000000 -#define BENCH_INFO(run, max, name) \ - {#run, run, max, name} - -/* Run benchmark, returns >0 on success */ -typedef int (*bench_run_fn_t)(void); - -/* Benchmark data */ -typedef struct { - /* Default test name */ - const char *name; - - /* Test function to run */ - bench_run_fn_t run; - - /* Test specific limit for rounds (tuning for slow implementation) */ - uint32_t max_rounds; - - /* Override default test name */ - const char *desc; - -} bench_info_t; +#define BENCH_INFO(run_fn, max, alt_name) \ + {.name = #run_fn, .run = run_fn, .max_rounds = max, .desc = alt_name} typedef struct { /* Command line options */ From 7674c0cf77b894fefe25683cf3bfca11c058ab31 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 13 Sep 2023 16:41:21 +0300 Subject: [PATCH 074/192] test: performance: use common indefinite test runner function Use common indefinite test runner function bench_run_indef() for all odp_bench_* applications. Reduces the amount of duplicate code. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- test/performance/Makefile.am | 8 +++---- test/performance/bench_common.c | 34 +++++++++++++++++++++++++++++ test/performance/bench_common.h | 5 +++++ test/performance/odp_bench_buffer.c | 30 +------------------------ test/performance/odp_bench_misc.c | 26 +--------------------- test/performance/odp_bench_packet.c | 30 +------------------------ test/performance/odp_bench_timer.c | 23 +------------------ 7 files changed, 47 insertions(+), 109 deletions(-) create mode 100644 test/performance/bench_common.c diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am index b5a1f9eb2b..ded16bce59 100644 --- a/test/performance/Makefile.am +++ b/test/performance/Makefile.am @@ -61,10 +61,10 @@ endif bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY) odp_atomic_perf_SOURCES = odp_atomic_perf.c -odp_bench_buffer_SOURCES = odp_bench_buffer.c bench_common.h -odp_bench_misc_SOURCES = odp_bench_misc.c bench_common.h -odp_bench_packet_SOURCES = odp_bench_packet.c bench_common.h -odp_bench_timer_SOURCES = odp_bench_timer.c bench_common.h +odp_bench_buffer_SOURCES = odp_bench_buffer.c bench_common.c bench_common.h +odp_bench_misc_SOURCES = odp_bench_misc.c bench_common.c bench_common.h +odp_bench_packet_SOURCES = odp_bench_packet.c bench_common.c bench_common.h +odp_bench_timer_SOURCES = odp_bench_timer.c bench_common.c bench_common.h odp_cpu_bench_SOURCES = odp_cpu_bench.c odp_crc_SOURCES = odp_crc.c odp_crypto_SOURCES = odp_crypto.c diff --git a/test/performance/bench_common.c b/test/performance/bench_common.c new file mode 100644 index 0000000000..ae834f6129 --- /dev/null +++ b/test/performance/bench_common.c @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia + */ + +#include +#include + +#include "bench_common.h" + +#include + +void bench_run_indef(bench_info_t *info, odp_atomic_u32_t *exit_thread) +{ + const char *desc; + + desc = info->desc != NULL ? info->desc : info->name; + + printf("Running odp_%s test indefinitely\n", desc); + + while (!odp_atomic_load_u32(exit_thread)) { + int ret; + + if (info->init != NULL) + info->init(); + + ret = info->run(); + + if (info->term != NULL) + info->term(); + + if (!ret) + ODPH_ABORT("Benchmark %s failed\n", desc); + } +} diff --git a/test/performance/bench_common.h b/test/performance/bench_common.h index 40908771b9..08f9ab1951 100644 --- a/test/performance/bench_common.h +++ b/test/performance/bench_common.h @@ -63,6 +63,11 @@ typedef struct { } bench_info_t; +/** + * Run selected test indefinitely + */ +void bench_run_indef(bench_info_t *info, odp_atomic_u32_t *exit_thread); + #ifdef __cplusplus } #endif diff --git a/test/performance/odp_bench_buffer.c b/test/performance/odp_bench_buffer.c index 123e457a73..d65fa71a26 100644 --- a/test/performance/odp_bench_buffer.c +++ b/test/performance/odp_bench_buffer.c @@ -103,34 +103,6 @@ static void sig_handler(int signo ODP_UNUSED) odp_atomic_store_u32(&gbl_args->exit_thread, 1); } -/** - * Run given benchmark indefinitely - */ -static void run_indef(args_t *args, int idx) -{ - const char *desc; - - desc = args->bench[idx].desc != NULL ? - args->bench[idx].desc : args->bench[idx].name; - - printf("Running odp_%s test indefinitely\n", desc); - - while (!odp_atomic_load_u32(&gbl_args->exit_thread)) { - int ret; - - if (args->bench[idx].init != NULL) - args->bench[idx].init(); - - ret = args->bench[idx].run(); - - if (args->bench[idx].term != NULL) - args->bench[idx].term(); - - if (!ret) - ODPH_ABORT("Benchmark %s failed\n", desc); - } -} - static int run_benchmarks(void *arg) { int i, j, k; @@ -155,7 +127,7 @@ static int run_benchmarks(void *arg) continue; } else if (args->appl.bench_idx && (j + 1) == args->appl.bench_idx) { - run_indef(args, j); + bench_run_indef(&args->bench[j], &gbl_args->exit_thread); return 0; } diff --git a/test/performance/odp_bench_misc.c b/test/performance/odp_bench_misc.c index b4f55486dc..dac36dd129 100644 --- a/test/performance/odp_bench_misc.c +++ b/test/performance/odp_bench_misc.c @@ -102,29 +102,6 @@ static int setup_sig_handler(void) return 0; } -/* Run given benchmark indefinitely */ -static void run_indef(gbl_args_t *args, int idx) -{ - const char *desc; - const bench_info_t *bench = &args->bench[idx]; - - desc = bench->desc != NULL ? bench->desc : bench->name; - - printf("Running odp_%s test indefinitely\n", desc); - - while (!odp_atomic_load_u32(&gbl_args->exit_thread)) { - int ret; - - if (bench->init != NULL) - bench->init(); - - ret = bench->run(); - - if (!ret) - ODPH_ABORT("Benchmark %s failed\n", desc); - } -} - static int run_benchmarks(void *arg) { int i, j; @@ -156,8 +133,7 @@ static int run_benchmarks(void *arg) j++; continue; } - - run_indef(args, j); + bench_run_indef(&args->bench[j], &gbl_args->exit_thread); return 0; } diff --git a/test/performance/odp_bench_packet.c b/test/performance/odp_bench_packet.c index a8f4fb5673..7151e0a4d7 100644 --- a/test/performance/odp_bench_packet.c +++ b/test/performance/odp_bench_packet.c @@ -148,34 +148,6 @@ static void sig_handler(int signo ODP_UNUSED) odp_atomic_store_u32(&gbl_args->exit_thread, 1); } -/** - * Run given benchmark indefinitely - */ -static void run_indef(args_t *args, int idx) -{ - const char *desc; - - desc = args->bench[idx].desc != NULL ? - args->bench[idx].desc : args->bench[idx].name; - - printf("Running odp_%s test indefinitely\n", desc); - - while (!odp_atomic_load_u32(&gbl_args->exit_thread)) { - int ret; - - if (args->bench[idx].init != NULL) - args->bench[idx].init(); - - ret = args->bench[idx].run(); - - if (args->bench[idx].term != NULL) - args->bench[idx].term(); - - if (!ret) - ODPH_ABORT("Benchmark %s failed\n", desc); - } -} - /** * Master function for running the microbenchmarks */ @@ -210,7 +182,7 @@ static int run_benchmarks(void *arg) continue; } else if (args->appl.bench_idx && (j + 1) == args->appl.bench_idx) { - run_indef(args, j); + bench_run_indef(&args->bench[j], &gbl_args->exit_thread); return 0; } diff --git a/test/performance/odp_bench_timer.c b/test/performance/odp_bench_timer.c index 4bf0df3f86..822c31560d 100644 --- a/test/performance/odp_bench_timer.c +++ b/test/performance/odp_bench_timer.c @@ -116,26 +116,6 @@ static int setup_sig_handler(void) return 0; } -/* Run given benchmark indefinitely */ -static void run_indef(gbl_args_t *args, int idx) -{ - const char *desc; - const bench_info_t *bench = &args->bench[idx]; - - desc = bench->desc != NULL ? bench->desc : bench->name; - - printf("Running odp_%s test indefinitely\n", desc); - - while (!odp_atomic_load_u32(&gbl_args->exit_thread)) { - int ret; - - ret = bench->run(); - - if (!ret) - ODPH_ABORT("Benchmark %s failed\n", desc); - } -} - static int run_benchmarks(void *arg) { int i, j; @@ -167,8 +147,7 @@ static int run_benchmarks(void *arg) j++; continue; } - - run_indef(args, j); + bench_run_indef(&args->bench[j], &gbl_args->exit_thread); return 0; } From 6d5c269dfaf099d1991b7cb851947a196c6dcdf0 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 13 Sep 2023 17:12:50 +0300 Subject: [PATCH 075/192] test: performance: use common test runner function Use common test runner function bench_run() for all odp_bench_* applications. Reduces the amount of duplicate code. A separate warm-up round has been removed from odp_bench_packet, as bench_run() already performs one. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- test/performance/bench_common.c | 104 +++++++++++++++++++++ test/performance/bench_common.h | 44 +++++++++ test/performance/odp_bench_buffer.c | 113 +++-------------------- test/performance/odp_bench_misc.c | 135 +++++----------------------- test/performance/odp_bench_packet.c | 124 +++++++------------------ test/performance/odp_bench_timer.c | 133 +++++---------------------- 6 files changed, 232 insertions(+), 421 deletions(-) diff --git a/test/performance/bench_common.c b/test/performance/bench_common.c index ae834f6129..acb70038c2 100644 --- a/test/performance/bench_common.c +++ b/test/performance/bench_common.c @@ -7,7 +7,18 @@ #include "bench_common.h" +#include #include +#include + +void bench_suite_init(bench_suite_t *suite) +{ + memset(suite, 0, sizeof(bench_suite_t)); + + suite->measure_time = true; + + odp_atomic_init_u32(&suite->exit_worker, 0); +} void bench_run_indef(bench_info_t *info, odp_atomic_u32_t *exit_thread) { @@ -32,3 +43,96 @@ void bench_run_indef(bench_info_t *info, odp_atomic_u32_t *exit_thread) ODPH_ABORT("Benchmark %s failed\n", desc); } } + +int bench_run(void *arg) +{ + uint64_t c1, c2; + odp_time_t t1, t2; + bench_suite_t *suite = arg; + const uint64_t repeat_count = suite->repeat_count; + const odp_bool_t meas_time = suite->measure_time; + + printf("\nAverage %s per function call\n", meas_time ? "time (nsec)" : "CPU cycles"); + printf("-------------------------------------------------\n"); + + /* Run each test twice. Results from the first warm-up round are ignored. */ + for (int i = 0; i < 2; i++) { + uint64_t total = 0; + uint64_t round = 1; + + for (int j = 0; j < suite->num_bench; round++) { + int ret; + const char *desc; + const bench_info_t *bench = &suite->bench[j]; + uint64_t max_rounds = suite->rounds; + + if (bench->max_rounds && bench->max_rounds < max_rounds) + max_rounds = bench->max_rounds; + + /* Run selected test indefinitely */ + if (suite->indef_idx) { + if ((j + 1) != suite->indef_idx) { + j++; + continue; + } + bench_run_indef(&suite->bench[j], &suite->exit_worker); + return 0; + } + + desc = bench->desc != NULL ? bench->desc : bench->name; + + if (bench->init != NULL) + bench->init(); + + if (meas_time) + t1 = odp_time_local_strict(); + else + c1 = odp_cpu_cycles(); + + ret = bench->run(); + + if (meas_time) + t2 = odp_time_local_strict(); + else + c2 = odp_cpu_cycles(); + + if (bench->term != NULL) + bench->term(); + + if (!ret) { + ODPH_ERR("Benchmark odp_%s failed\n", desc); + suite->retval = -1; + return -1; + } + + if (meas_time) + total += odp_time_diff_ns(t2, t1); + else + total += odp_cpu_cycles_diff(c2, c1); + + if (round >= max_rounds) { + double result; + + /* Each benchmark runs internally 'repeat_count' times. */ + result = ((double)total) / (max_rounds * repeat_count); + + /* No print or results from warm-up round */ + if (i > 0) { + printf("[%02d] odp_%-26s: %12.2f\n", j + 1, desc, result); + + if (suite->result) + suite->result[j] = result; + } + j++; + total = 0; + round = 1; + } + } + } + printf("\n"); + /* Print dummy result to prevent compiler to optimize it away*/ + if (suite->dummy) + printf("(dummy result: 0x%" PRIx64 ")\n\n", suite->dummy); + + return 0; +} diff --git a/test/performance/bench_common.h b/test/performance/bench_common.h index 08f9ab1951..d33bd3b346 100644 --- a/test/performance/bench_common.h +++ b/test/performance/bench_common.h @@ -63,11 +63,55 @@ typedef struct { } bench_info_t; +/* Benchmark suite data */ +typedef struct { + /* Array of benchmark functions */ + bench_info_t *bench; + + /* Number of benchmark functions */ + int num_bench; + + /* Optional benchmark index to run indefinitely (1...num_bench) */ + int indef_idx; + + /* Suite exit value output */ + int retval; + + /* Measure time vs. CPU cycles */ + odp_bool_t measure_time; + + /* Break worker loop if set to 1 */ + odp_atomic_u32_t exit_worker; + + /* Number of API function calls per test case */ + uint64_t repeat_count; + + /* Number of rounds per test case */ + uint64_t rounds; + + /* Dummy test result output */ + uint64_t dummy; + + /* Optional test result output array */ + double *result; + +} bench_suite_t; + +/** + * Initialize benchmark suite parameters + */ +void bench_suite_init(bench_suite_t *suite); + /** * Run selected test indefinitely */ void bench_run_indef(bench_info_t *info, odp_atomic_u32_t *exit_thread); +/** + * Run tests suite and print results + */ +int bench_run(void *arg); + #ifdef __cplusplus } #endif diff --git a/test/performance/odp_bench_buffer.c b/test/performance/odp_bench_buffer.c index d65fa71a26..d82c787515 100644 --- a/test/performance/odp_bench_buffer.c +++ b/test/performance/odp_bench_buffer.c @@ -1,5 +1,5 @@ /* Copyright (c) 2017-2018, Linaro Limited - * Copyright (c) 2022, Nokia + * Copyright (c) 2022-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -61,20 +61,16 @@ typedef struct { typedef struct { /** Application (parsed) arguments */ appl_args_t appl; + /** Common benchmark suite data */ + bench_suite_t suite; /** Buffer pool */ odp_pool_t pool; - /** Benchmark functions */ - bench_info_t *bench; - /** Number of benchmark functions */ - int num_bench; /** Buffer size */ uint32_t buf_size; /** Buffer user area size */ uint32_t uarea_size; /** Max flow id */ uint32_t max_flow_id; - /** Break worker loop if set to 1 */ - odp_atomic_u32_t exit_thread; /** Array for storing test buffers */ odp_buffer_t buf_tbl[TEST_REPEAT_COUNT * TEST_MAX_BURST]; /** Array for storing test event */ @@ -87,8 +83,6 @@ typedef struct { odp_event_type_t event_type_tbl[TEST_REPEAT_COUNT]; /** Array for storing test event subtypes */ odp_event_subtype_t event_subtype_tbl[TEST_REPEAT_COUNT]; - /** Benchmark run failed */ - uint8_t bench_failed; /** CPU mask as string */ char cpumask_str[ODP_CPUMASK_STR_SIZE]; } args_t; @@ -100,89 +94,7 @@ static void sig_handler(int signo ODP_UNUSED) { if (gbl_args == NULL) return; - odp_atomic_store_u32(&gbl_args->exit_thread, 1); -} - -static int run_benchmarks(void *arg) -{ - int i, j, k; - args_t *args = arg; - - printf("\nAverage CPU cycles per function call\n" - "---------------------------------------------\n"); - - /* Run each test twice. Results from the first warm-up round are ignored. */ - for (i = 0; i < 2; i++) { - uint64_t tot_cycles = 0; - - for (j = 0, k = 1; j < gbl_args->num_bench; k++) { - int ret; - uint64_t c1, c2; - const char *desc; - - /* Run selected test indefinitely */ - if (args->appl.bench_idx && - (j + 1) != args->appl.bench_idx) { - j++; - continue; - } else if (args->appl.bench_idx && - (j + 1) == args->appl.bench_idx) { - bench_run_indef(&args->bench[j], &gbl_args->exit_thread); - return 0; - } - - desc = args->bench[j].desc != NULL ? - args->bench[j].desc : - args->bench[j].name; - - /* Skip unsupported tests */ - if (args->bench[j].cond != NULL && !args->bench[j].cond()) { - j++; - k = 1; - if (i > 0) - printf("[%02d] odp_%-26s: n/a\n", j, desc); - continue; - } - - if (args->bench[j].init != NULL) - args->bench[j].init(); - - c1 = odp_cpu_cycles(); - ret = args->bench[j].run(); - c2 = odp_cpu_cycles(); - - if (args->bench[j].term != NULL) - args->bench[j].term(); - - if (!ret) { - ODPH_ERR("Benchmark odp_%s failed\n", desc); - args->bench_failed = 1; - return -1; - } - - tot_cycles += odp_cpu_cycles_diff(c2, c1); - - if (k >= args->appl.test_cycles) { - double cycles; - - /** Each benchmark runs internally TEST_REPEAT_COUNT times. */ - cycles = ((double)tot_cycles) / - (args->appl.test_cycles * - TEST_REPEAT_COUNT); - - /* No print from warm-up round */ - if (i > 0) - printf("[%02d] odp_%-26s: %8.1f\n", j + 1, desc, cycles); - - j++; - k = 1; - tot_cycles = 0; - } - } - } - printf("\n"); - - return 0; + odp_atomic_store_u32(&gbl_args->suite.exit_worker, 1); } static void allocate_test_buffers(odp_buffer_t buf[], int num) @@ -732,14 +644,17 @@ int main(int argc, char *argv[]) } memset(gbl_args, 0, sizeof(args_t)); - odp_atomic_init_u32(&gbl_args->exit_thread, 0); - - gbl_args->bench = test_suite; - gbl_args->num_bench = sizeof(test_suite) / sizeof(test_suite[0]); /* Parse and store the application arguments */ parse_args(argc, argv, &gbl_args->appl); + bench_suite_init(&gbl_args->suite); + gbl_args->suite.bench = test_suite; + gbl_args->suite.num_bench = sizeof(test_suite) / sizeof(test_suite[0]); + gbl_args->suite.indef_idx = gbl_args->appl.bench_idx; + gbl_args->suite.rounds = gbl_args->appl.test_cycles; + gbl_args->suite.repeat_count = TEST_REPEAT_COUNT; + /* Get default worker cpumask */ if (odp_cpumask_default_worker(&default_mask, 1) != 1) { ODPH_ERR("Error: unable to allocate worker thread\n"); @@ -825,15 +740,15 @@ int main(int argc, char *argv[]) thr_common.share_param = 1; odph_thread_param_init(&thr_param); - thr_param.start = run_benchmarks; - thr_param.arg = gbl_args; + thr_param.start = bench_run; + thr_param.arg = &gbl_args->suite; thr_param.thr_type = ODP_THREAD_WORKER; odph_thread_create(&worker_thread, &thr_common, &thr_param, 1); odph_thread_join(&worker_thread, 1); - ret = gbl_args->bench_failed; + ret = gbl_args->suite.retval; if (odp_pool_destroy(gbl_args->pool)) { ODPH_ERR("Error: pool destroy\n"); diff --git a/test/performance/odp_bench_misc.c b/test/performance/odp_bench_misc.c index dac36dd129..925bfc193d 100644 --- a/test/performance/odp_bench_misc.c +++ b/test/performance/odp_bench_misc.c @@ -44,14 +44,8 @@ typedef struct { typedef struct { appl_args_t appl; - /* Benchmark functions */ - bench_info_t *bench; - - /* Number of benchmark functions */ - int num_bench; - - /* Break worker loop if set to 1 */ - odp_atomic_u32_t exit_thread; + /* Common benchmark suite data */ + bench_suite_t suite; /* Test case input / output data */ odp_time_t t1[REPEAT_COUNT]; @@ -64,12 +58,6 @@ typedef struct { uint16_t c1[REPEAT_COUNT]; uint16_t c2[REPEAT_COUNT]; - /* Dummy result */ - uint64_t dummy; - - /* Benchmark run failed */ - int bench_failed; - /* CPU mask as string */ char cpumask_str[ODP_CPUMASK_STR_SIZE]; @@ -81,7 +69,7 @@ static void sig_handler(int signo ODP_UNUSED) { if (gbl_args == NULL) return; - odp_atomic_store_u32(&gbl_args->exit_thread, 1); + odp_atomic_store_u32(&gbl_args->suite.exit_worker, 1); } static int setup_sig_handler(void) @@ -102,94 +90,6 @@ static int setup_sig_handler(void) return 0; } -static int run_benchmarks(void *arg) -{ - int i, j; - uint64_t c1, c2; - odp_time_t t1, t2; - gbl_args_t *args = arg; - const int meas_time = args->appl.time; - - printf("\nAverage %s per function call\n", meas_time ? "time (nsec)" : "CPU cycles"); - printf("-------------------------------------------------\n"); - - /* Run each test twice. Results from the first warm-up round are ignored. */ - for (i = 0; i < 2; i++) { - uint64_t total = 0; - uint32_t round = 1; - - for (j = 0; j < gbl_args->num_bench; round++) { - int ret; - const char *desc; - const bench_info_t *bench = &args->bench[j]; - uint32_t max_rounds = args->appl.rounds; - - if (bench->max_rounds && max_rounds > bench->max_rounds) - max_rounds = bench->max_rounds; - - /* Run selected test indefinitely */ - if (args->appl.bench_idx) { - if ((j + 1) != args->appl.bench_idx) { - j++; - continue; - } - bench_run_indef(&args->bench[j], &gbl_args->exit_thread); - return 0; - } - - desc = bench->desc != NULL ? bench->desc : bench->name; - - if (bench->init != NULL) - bench->init(); - - if (meas_time) - t1 = odp_time_local(); - else - c1 = odp_cpu_cycles(); - - ret = bench->run(); - - if (meas_time) - t2 = odp_time_local(); - else - c2 = odp_cpu_cycles(); - - if (!ret) { - ODPH_ERR("Benchmark odp_%s failed\n", desc); - args->bench_failed = -1; - return -1; - } - - if (meas_time) - total += odp_time_diff_ns(t2, t1); - else - total += odp_cpu_cycles_diff(c2, c1); - - if (round >= max_rounds) { - double result; - - /* Each benchmark runs internally REPEAT_COUNT times. */ - result = ((double)total) / (max_rounds * REPEAT_COUNT); - - /* No print from warm-up round */ - if (i > 0) - printf("[%02d] odp_%-26s: %12.2f\n", j + 1, desc, result); - - j++; - total = 0; - round = 1; - } - } - } - - /* Print dummy result to prevent compiler to optimize it away*/ - printf("\n(dummy result: 0x%" PRIx64 ")\n", args->dummy); - - printf("\n"); - - return 0; -} - static void init_time_global(void) { int i; @@ -348,7 +248,7 @@ static int time_diff_ns(void) for (i = 0; i < REPEAT_COUNT; i++) res += odp_time_diff_ns(t2[i], t1[i]); - gbl_args->dummy += res; + gbl_args->suite.dummy += res; return i; } @@ -375,7 +275,7 @@ static int time_to_ns(void) for (i = 0; i < REPEAT_COUNT; i++) res += odp_time_to_ns(t1[i]); - gbl_args->dummy += res; + gbl_args->suite.dummy += res; return i; } @@ -414,7 +314,7 @@ static int time_cmp(void) for (i = 0; i < REPEAT_COUNT; i++) res += odp_time_cmp(t1[i], t2[i]); - gbl_args->dummy += res; + gbl_args->suite.dummy += res; return i; } @@ -530,7 +430,7 @@ static int cpu_cycles_diff(void) for (i = 0; i < REPEAT_COUNT; i++) res += odp_cpu_cycles_diff(a2[i], a1[i]); - gbl_args->dummy += res; + gbl_args->suite.dummy += res; return i; } @@ -900,7 +800,8 @@ static int parse_args(int argc, char *argv[]) return -1; } - if (appl_args->bench_idx < 0 || appl_args->bench_idx > gbl_args->num_bench) { + if (appl_args->bench_idx < 0 || + appl_args->bench_idx > (int)(sizeof(test_suite) / sizeof(test_suite[0]))) { ODPH_ERR("Bad bench index %i\n", appl_args->bench_idx); return -1; } @@ -979,10 +880,6 @@ int main(int argc, char *argv[]) } memset(gbl_args, 0, sizeof(gbl_args_t)); - odp_atomic_init_u32(&gbl_args->exit_thread, 0); - - gbl_args->bench = test_suite; - gbl_args->num_bench = sizeof(test_suite) / sizeof(test_suite[0]); for (i = 0; i < REPEAT_COUNT; i++) { gbl_args->t1[i] = ODP_TIME_NULL; @@ -1001,6 +898,14 @@ int main(int argc, char *argv[]) if (ret) goto exit; + bench_suite_init(&gbl_args->suite); + gbl_args->suite.bench = test_suite; + gbl_args->suite.num_bench = sizeof(test_suite) / sizeof(test_suite[0]); + gbl_args->suite.measure_time = !!gbl_args->appl.time; + gbl_args->suite.indef_idx = gbl_args->appl.bench_idx; + gbl_args->suite.rounds = gbl_args->appl.rounds; + gbl_args->suite.repeat_count = REPEAT_COUNT; + /* Get default worker cpumask */ if (odp_cpumask_default_worker(&default_mask, 1) != 1) { ODPH_ERR("Unable to allocate worker thread\n"); @@ -1027,15 +932,15 @@ int main(int argc, char *argv[]) thr_common.share_param = 1; odph_thread_param_init(&thr_param); - thr_param.start = run_benchmarks; - thr_param.arg = gbl_args; + thr_param.start = bench_run; + thr_param.arg = &gbl_args->suite; thr_param.thr_type = ODP_THREAD_WORKER; odph_thread_create(&worker_thread, &thr_common, &thr_param, 1); odph_thread_join(&worker_thread, 1); - ret = gbl_args->bench_failed; + ret = gbl_args->suite.retval; exit: if (odp_shm_free(shm)) { diff --git a/test/performance/odp_bench_packet.c b/test/performance/odp_bench_packet.c index 7151e0a4d7..9949a13bf7 100644 --- a/test/performance/odp_bench_packet.c +++ b/test/performance/odp_bench_packet.c @@ -1,5 +1,5 @@ /* Copyright (c) 2017-2018, Linaro Limited - * Copyright (c) 2022, Nokia + * Copyright (c) 2022-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -74,11 +74,8 @@ ODP_STATIC_ASSERT((TEST_ALIGN_OFFSET + TEST_ALIGN_LEN) <= TEST_MIN_PKT_SIZE, "Invalid_alignment"); -/** Warm up round packet size */ -#define WARM_UP TEST_MIN_PKT_SIZE - /** Test packet sizes */ -const uint32_t test_packet_len[] = {WARM_UP, TEST_MIN_PKT_SIZE, 128, 256, 512, +const uint32_t test_packet_len[] = {TEST_MIN_PKT_SIZE, 128, 256, 512, 1024, 1518, TEST_MAX_PKT_SIZE}; /** @@ -96,14 +93,10 @@ typedef struct { typedef struct { /** Application (parsed) arguments */ appl_args_t appl; + /** Common benchmark suite data */ + bench_suite_t suite; /** Packet pool */ odp_pool_t pool; - /** Benchmark functions */ - bench_info_t *bench; - /** Number of benchmark functions */ - int num_bench; - /** Break worker loop if set to 1 */ - odp_atomic_u32_t exit_thread; struct { /** Test packet length */ uint32_t len; @@ -134,8 +127,6 @@ typedef struct { odp_time_t ts_tbl[TEST_REPEAT_COUNT]; /** Array for storing test data */ uint8_t data_tbl[TEST_REPEAT_COUNT][TEST_MAX_PKT_SIZE]; - /** Benchmark run failed */ - uint8_t bench_failed; } args_t; /** Global pointer to args */ @@ -145,7 +136,7 @@ static void sig_handler(int signo ODP_UNUSED) { if (gbl_args == NULL) return; - odp_atomic_store_u32(&gbl_args->exit_thread, 1); + odp_atomic_store_u32(&gbl_args->suite.exit_worker, 1); } /** @@ -153,96 +144,38 @@ static void sig_handler(int signo ODP_UNUSED) */ static int run_benchmarks(void *arg) { - int i, j, k; + int i; args_t *args = arg; + bench_suite_t *suite = &args->suite; int num_sizes = sizeof(test_packet_len) / sizeof(test_packet_len[0]); - double results[gbl_args->num_bench][num_sizes]; + double results[num_sizes][suite->num_bench]; memset(results, 0, sizeof(results)); - printf("\nRunning benchmarks (cycles per call)\n" - "------------------------------------\n"); - for (i = 0; i < num_sizes; i++) { - uint64_t tot_cycles = 0; - - printf("\nPacket length: %6d bytes\n" - "---------------------------\n", test_packet_len[i]); + printf("Packet length: %6d bytes", test_packet_len[i]); gbl_args->pkt.len = test_packet_len[i]; - for (j = 0, k = 1; j < gbl_args->num_bench; k++) { - int ret; - uint64_t c1, c2; - const char *desc; - - if (args->appl.bench_idx && - (j + 1) != args->appl.bench_idx) { - j++; - continue; - } else if (args->appl.bench_idx && - (j + 1) == args->appl.bench_idx) { - bench_run_indef(&args->bench[j], &gbl_args->exit_thread); - return 0; - } - - desc = args->bench[j].desc != NULL ? - args->bench[j].desc : - args->bench[j].name; - - if (args->bench[j].init != NULL) - args->bench[j].init(); - - c1 = odp_cpu_cycles(); - ret = args->bench[j].run(); - c2 = odp_cpu_cycles(); - - if (args->bench[j].term != NULL) - args->bench[j].term(); - - if (!ret) { - ODPH_ERR("Benchmark %s failed\n", desc); - args->bench_failed = 1; - return -1; - } - - tot_cycles += odp_cpu_cycles_diff(c2, c1); - - if (k >= TEST_SIZE_RUN_COUNT) { - double cycles; - - /** Each benchmark runs internally - * TEST_REPEAT_COUNT times. */ - cycles = ((double)tot_cycles) / - (TEST_SIZE_RUN_COUNT * - TEST_REPEAT_COUNT); - results[j][i] = cycles; - - printf("odp_%-26s: %8.1f\n", desc, cycles); - - j++; - k = 1; - tot_cycles = 0; - } - } - } - printf("\n%-30s", "Benchmark / packet_size [B]"); - for (i = 0; i < num_sizes; i++) { - if (i == 0) - printf(" WARM UP "); - else - printf("%8.1d ", test_packet_len[i]); + suite->result = results[i]; + + bench_run(suite); } + + printf("\n%-35s", "Benchmark / packet_size [B]"); + for (i = 0; i < num_sizes; i++) + printf("%8.1d ", test_packet_len[i]); + printf("\n---------------------------------"); for (i = 0; i < num_sizes; i++) printf("----------"); - for (i = 0; i < gbl_args->num_bench; i++) { - printf("\n[%02d] odp_%-26s", i + 1, args->bench[i].desc != NULL ? - args->bench[i].desc : args->bench[i].name); + for (i = 0; i < suite->num_bench; i++) { + printf("\n[%02d] odp_%-26s", i + 1, suite->bench[i].desc != NULL ? + suite->bench[i].desc : suite->bench[i].name); - for (j = 0; j < num_sizes; j++) - printf("%8.1f ", results[i][j]); + for (int j = 0; j < num_sizes; j++) + printf("%8.1f ", results[j][i]); } printf("\n\n"); return 0; @@ -1657,14 +1590,17 @@ int main(int argc, char *argv[]) } memset(gbl_args, 0, sizeof(args_t)); - odp_atomic_init_u32(&gbl_args->exit_thread, 0); - - gbl_args->bench = test_suite; - gbl_args->num_bench = sizeof(test_suite) / sizeof(test_suite[0]); /* Parse and store the application arguments */ parse_args(argc, argv, &gbl_args->appl); + bench_suite_init(&gbl_args->suite); + gbl_args->suite.bench = test_suite; + gbl_args->suite.num_bench = sizeof(test_suite) / sizeof(test_suite[0]); + gbl_args->suite.indef_idx = gbl_args->appl.bench_idx; + gbl_args->suite.rounds = TEST_SIZE_RUN_COUNT; + gbl_args->suite.repeat_count = TEST_REPEAT_COUNT; + /* Print both system and application information */ print_info(NO_PATH(argv[0]), &gbl_args->appl); @@ -1767,7 +1703,7 @@ int main(int argc, char *argv[]) odph_thread_join(&worker_thread, 1); - ret = gbl_args->bench_failed; + ret = gbl_args->suite.retval; if (odp_pool_destroy(gbl_args->pool)) { ODPH_ERR("Error: pool destroy\n"); diff --git a/test/performance/odp_bench_timer.c b/test/performance/odp_bench_timer.c index 822c31560d..f6762175eb 100644 --- a/test/performance/odp_bench_timer.c +++ b/test/performance/odp_bench_timer.c @@ -51,6 +51,9 @@ typedef struct { } opt; + /* Common benchmark suite data */ + bench_suite_t suite; + odp_timer_pool_t timer_pool; odp_timer_t timer; odp_queue_t queue; @@ -63,27 +66,12 @@ typedef struct { double tick_hz; int plain_queue; - /* Benchmark functions */ - bench_info_t *bench; - - /* Number of benchmark functions */ - int num_bench; - - /* Break worker loop if set to 1 */ - odp_atomic_u32_t exit_thread; - /* Test case input / output data */ uint64_t a1[REPEAT_COUNT]; odp_event_t ev[REPEAT_COUNT]; odp_timeout_t tmo[REPEAT_COUNT]; odp_timer_t tim[REPEAT_COUNT]; - /* Dummy result */ - uint64_t dummy; - - /* Benchmark run failed */ - int bench_failed; - /* CPU mask as string */ char cpumask_str[ODP_CPUMASK_STR_SIZE]; @@ -95,7 +83,7 @@ static void sig_handler(int signo ODP_UNUSED) { if (gbl_args == NULL) return; - odp_atomic_store_u32(&gbl_args->exit_thread, 1); + odp_atomic_store_u32(&gbl_args->suite.exit_worker, 1); } static int setup_sig_handler(void) @@ -116,92 +104,6 @@ static int setup_sig_handler(void) return 0; } -static int run_benchmarks(void *arg) -{ - int i, j; - uint64_t c1, c2; - odp_time_t t1, t2; - gbl_args_t *args = arg; - const int meas_time = args->opt.time; - - printf("\nAverage %s per function call\n", meas_time ? "time (nsec)" : "CPU cycles"); - printf("-------------------------------------------------\n"); - - /* Run each test twice. Results from the first warm-up round are ignored. */ - for (i = 0; i < 2; i++) { - uint64_t total = 0; - uint32_t round = 1; - - for (j = 0; j < gbl_args->num_bench; round++) { - int ret; - const char *desc; - const bench_info_t *bench = &args->bench[j]; - uint32_t max_rounds = args->opt.rounds; - - if (bench->max_rounds && max_rounds > bench->max_rounds) - max_rounds = bench->max_rounds; - - /* Run selected test indefinitely */ - if (args->opt.bench_idx) { - if ((j + 1) != args->opt.bench_idx) { - j++; - continue; - } - bench_run_indef(&args->bench[j], &gbl_args->exit_thread); - return 0; - } - - desc = bench->desc != NULL ? bench->desc : bench->name; - - if (meas_time) - t1 = odp_time_local(); - else - c1 = odp_cpu_cycles(); - - ret = bench->run(); - - if (meas_time) - t2 = odp_time_local(); - else - c2 = odp_cpu_cycles(); - - if (!ret) { - ODPH_ERR("Benchmark odp_%s failed\n", desc); - args->bench_failed = -1; - return -1; - } - - if (meas_time) - total += odp_time_diff_ns(t2, t1); - else - total += odp_cpu_cycles_diff(c2, c1); - - for (i = 0; i < REPEAT_COUNT; i++) - args->dummy += args->a1[i]; - - if (round >= max_rounds) { - double result; - - /* Each benchmark runs internally REPEAT_COUNT times. */ - result = ((double)total) / (max_rounds * REPEAT_COUNT); - - /* No print from warm-up round */ - if (i > 0) - printf("[%02d] odp_%-26s: %12.2f\n", j + 1, desc, result); - - j++; - total = 0; - round = 1; - } - } - } - - /* Print dummy result to prevent compiler to optimize it away*/ - printf("\n(dummy result: 0x%" PRIx64 ")\n\n", args->dummy); - - return 0; -} - static int timer_current_tick(void) { int i; @@ -249,7 +151,7 @@ static int timeout_to_event(void) for (i = 0; i < REPEAT_COUNT; i++) ev[i] = odp_timeout_to_event(timeout); - gbl_args->dummy += odp_event_to_u64(ev[0]); + gbl_args->suite.dummy += odp_event_to_u64(ev[0]); return i; } @@ -263,7 +165,7 @@ static int timeout_from_event(void) for (i = 0; i < REPEAT_COUNT; i++) tmo[i] = odp_timeout_from_event(ev); - gbl_args->dummy += odp_timeout_to_u64(tmo[0]); + gbl_args->suite.dummy += odp_timeout_to_u64(tmo[0]); return i; } @@ -289,7 +191,7 @@ static int timeout_timer(void) for (i = 0; i < REPEAT_COUNT; i++) tim[i] = odp_timeout_timer(timeout); - gbl_args->dummy += odp_timer_to_u64(tim[0]); + gbl_args->suite.dummy += odp_timer_to_u64(tim[0]); return i; } @@ -453,7 +355,8 @@ static int parse_args(int argc, char *argv[]) return -1; } - if (gbl_args->opt.bench_idx < 0 || gbl_args->opt.bench_idx > gbl_args->num_bench) { + if (gbl_args->opt.bench_idx < 0 || + gbl_args->opt.bench_idx > (int)(sizeof(test_suite) / sizeof(test_suite[0]))) { ODPH_ERR("Bad bench index %i\n", gbl_args->opt.bench_idx); return -1; } @@ -722,16 +625,12 @@ int main(int argc, char *argv[]) } memset(gbl_args, 0, sizeof(gbl_args_t)); - odp_atomic_init_u32(&gbl_args->exit_thread, 0); gbl_args->timer_pool = ODP_TIMER_POOL_INVALID; gbl_args->timer = ODP_TIMER_INVALID; gbl_args->queue = ODP_QUEUE_INVALID; gbl_args->pool = ODP_POOL_INVALID; gbl_args->timeout = ODP_TIMEOUT_INVALID; - gbl_args->bench = test_suite; - gbl_args->num_bench = sizeof(test_suite) / sizeof(test_suite[0]); - for (i = 0; i < REPEAT_COUNT; i++) { gbl_args->a1[i] = i; gbl_args->ev[i] = ODP_EVENT_INVALID; @@ -744,6 +643,14 @@ int main(int argc, char *argv[]) if (ret) goto exit; + bench_suite_init(&gbl_args->suite); + gbl_args->suite.bench = test_suite; + gbl_args->suite.num_bench = sizeof(test_suite) / sizeof(test_suite[0]); + gbl_args->suite.measure_time = !!gbl_args->opt.time; + gbl_args->suite.indef_idx = gbl_args->opt.bench_idx; + gbl_args->suite.rounds = gbl_args->opt.rounds; + gbl_args->suite.repeat_count = REPEAT_COUNT; + /* Get default worker cpumask */ if (odp_cpumask_default_worker(&default_mask, 1) != 1) { ODPH_ERR("Unable to allocate worker thread\n"); @@ -781,15 +688,15 @@ int main(int argc, char *argv[]) thr_common.share_param = 1; odph_thread_param_init(&thr_param); - thr_param.start = run_benchmarks; - thr_param.arg = gbl_args; + thr_param.start = bench_run; + thr_param.arg = &gbl_args->suite; thr_param.thr_type = ODP_THREAD_WORKER; odph_thread_create(&worker_thread, &thr_common, &thr_param, 1); odph_thread_join(&worker_thread, 1); - ret = gbl_args->bench_failed; + ret = gbl_args->suite.retval; exit: if (gbl_args->timeout != ODP_TIMEOUT_INVALID) From c56cf83b93e13a2936b66fd7815de56420788a68 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 15 Sep 2023 17:20:03 +0300 Subject: [PATCH 076/192] test: performance: unify test rounds option for bench applications Use the same 'rounds' option with all odp_bench_* applications. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- test/performance/odp_bench_buffer.c | 30 ++++++++++++------------ test/performance/odp_bench_packet.c | 36 ++++++++++++++++++++--------- 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/test/performance/odp_bench_buffer.c b/test/performance/odp_bench_buffer.c index d82c787515..4e55d88791 100644 --- a/test/performance/odp_bench_buffer.c +++ b/test/performance/odp_bench_buffer.c @@ -22,11 +22,11 @@ /** Default pool user area size in bytes */ #define TEST_UAREA_SIZE 8 -/** Number of function calls per test cycle */ +/** Number of API function calls per test case */ #define TEST_REPEAT_COUNT 1000 -/** Default number of test cycles */ -#define TEST_CYCLES 1000 +/** Default number of rounds per test case */ +#define TEST_ROUNDS 1000u /** Maximum burst size for *_multi operations */ #define TEST_MAX_BURST 64 @@ -52,7 +52,7 @@ typedef struct { int bench_idx; /** Benchmark index to run indefinitely */ int burst_size; /** Burst size for *_multi operations */ int cache_size; /** Pool cache size */ - int test_cycles; /** Test cycles per tested function */ + uint32_t rounds; /** Rounds per test case */ } appl_args_t; /** @@ -463,9 +463,9 @@ static void usage(char *progname) " -b, --burst Test burst size.\n" " -c, --cache_size Pool cache size.\n" " -i, --index Benchmark index to run indefinitely.\n" - " -t, --test_cycles Run each test 'num' times (default %d).\n" + " -r, --rounds Run each test case 'num' times (default %u).\n" " -h, --help Display help and exit.\n\n" - "\n", NO_PATH(progname), NO_PATH(progname), TEST_CYCLES); + "\n", NO_PATH(progname), NO_PATH(progname), TEST_ROUNDS); } /** @@ -483,17 +483,17 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) {"burst", required_argument, NULL, 'b'}, {"cache_size", required_argument, NULL, 'c'}, {"index", required_argument, NULL, 'i'}, - {"test_cycles", required_argument, NULL, 't'}, + {"rounds", required_argument, NULL, 'r'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; - static const char *shortopts = "c:b:i:t:h"; + static const char *shortopts = "c:b:i:r:h"; appl_args->bench_idx = 0; /* Run all benchmarks */ appl_args->burst_size = TEST_DEF_BURST; appl_args->cache_size = -1; - appl_args->test_cycles = TEST_CYCLES; + appl_args->rounds = TEST_ROUNDS; while (1) { opt = getopt_long(argc, argv, shortopts, longopts, &long_index); @@ -515,8 +515,8 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) case 'i': appl_args->bench_idx = atoi(optarg); break; - case 't': - appl_args->test_cycles = atoi(optarg); + case 'r': + appl_args->rounds = atoi(optarg); break; default: break; @@ -529,8 +529,8 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) exit(EXIT_FAILURE); } - if (appl_args->test_cycles < 1) { - printf("Invalid test cycle repeat count: %d\n", appl_args->test_cycles); + if (appl_args->rounds < 1) { + printf("Invalid number test rounds: %d\n", appl_args->rounds); exit(EXIT_FAILURE); } @@ -555,7 +555,7 @@ static void print_info(void) printf("Pool cache size: default\n"); else printf("Pool cache size: %d\n", gbl_args->appl.cache_size); - printf("Test cycles: %d\n", gbl_args->appl.test_cycles); + printf("Test rounds: %u\n", gbl_args->appl.rounds); printf("\n"); } @@ -652,7 +652,7 @@ int main(int argc, char *argv[]) gbl_args->suite.bench = test_suite; gbl_args->suite.num_bench = sizeof(test_suite) / sizeof(test_suite[0]); gbl_args->suite.indef_idx = gbl_args->appl.bench_idx; - gbl_args->suite.rounds = gbl_args->appl.test_cycles; + gbl_args->suite.rounds = gbl_args->appl.rounds; gbl_args->suite.repeat_count = TEST_REPEAT_COUNT; /* Get default worker cpumask */ diff --git a/test/performance/odp_bench_packet.c b/test/performance/odp_bench_packet.c index 9949a13bf7..c36202d560 100644 --- a/test/performance/odp_bench_packet.c +++ b/test/performance/odp_bench_packet.c @@ -38,11 +38,11 @@ /** Maximum test packet size */ #define TEST_MAX_PKT_SIZE 2048 -/** Number of test runs per individual benchmark */ +/** Number of API function calls per test case */ #define TEST_REPEAT_COUNT 1000 -/** Number of times to run tests for each packet size */ -#define TEST_SIZE_RUN_COUNT 10 +/** Number of rounds per test case */ +#define TEST_ROUNDS 10u /** Maximum burst size for *_multi operations */ #define TEST_MAX_BURST 64 @@ -85,6 +85,7 @@ typedef struct { int bench_idx; /** Benchmark index to run indefinitely */ int burst_size; /** Burst size for *_multi operations */ int cache_size; /** Pool cache size */ + uint32_t rounds; /** Rounds per test case */ } appl_args_t; /** @@ -1359,8 +1360,9 @@ static void usage(char *progname) " -b, --burst Test packet burst size.\n" " -c, --cache_size Pool cache size.\n" " -i, --index Benchmark index to run indefinitely.\n" + " -r, --rounds Run each test case 'num' times (default %u).\n" " -h, --help Display help and exit.\n\n" - "\n", NO_PATH(progname), NO_PATH(progname)); + "\n", NO_PATH(progname), NO_PATH(progname), TEST_ROUNDS); } /** @@ -1377,16 +1379,18 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) static const struct option longopts[] = { {"burst", required_argument, NULL, 'b'}, {"cache_size", required_argument, NULL, 'c'}, - {"help", no_argument, NULL, 'h'}, {"index", required_argument, NULL, 'i'}, + {"rounds", required_argument, NULL, 'r'}, + {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; - static const char *shortopts = "c:b:i:h"; + static const char *shortopts = "c:b:i:r:h"; appl_args->bench_idx = 0; /* Run all benchmarks */ appl_args->burst_size = TEST_DEF_BURST; appl_args->cache_size = -1; + appl_args->rounds = TEST_ROUNDS; while (1) { opt = getopt_long(argc, argv, shortopts, longopts, &long_index); @@ -1401,15 +1405,19 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) case 'b': appl_args->burst_size = atoi(optarg); break; + case 'i': + appl_args->bench_idx = atoi(optarg); + break; + case 'r': + appl_args->rounds = atoi(optarg); + break; case 'h': usage(argv[0]); exit(EXIT_SUCCESS); break; - case 'i': - appl_args->bench_idx = atoi(optarg); - break; default: - break; + usage(argv[0]); + exit(EXIT_FAILURE); } } @@ -1419,6 +1427,11 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) exit(EXIT_FAILURE); } + if (appl_args->rounds < 1) { + printf("Invalid number test rounds: %d\n", appl_args->rounds); + exit(EXIT_FAILURE); + } + optind = 1; /* Reset 'extern optind' from the getopt lib */ } @@ -1598,7 +1611,7 @@ int main(int argc, char *argv[]) gbl_args->suite.bench = test_suite; gbl_args->suite.num_bench = sizeof(test_suite) / sizeof(test_suite[0]); gbl_args->suite.indef_idx = gbl_args->appl.bench_idx; - gbl_args->suite.rounds = TEST_SIZE_RUN_COUNT; + gbl_args->suite.rounds = gbl_args->appl.rounds; gbl_args->suite.repeat_count = TEST_REPEAT_COUNT; /* Print both system and application information */ @@ -1670,6 +1683,7 @@ int main(int argc, char *argv[]) printf("CPU mask: %s\n", cpumaskstr); printf("Burst size: %d\n", gbl_args->appl.burst_size); printf("Bench repeat: %d\n", TEST_REPEAT_COUNT); + printf("Test rounds: %u\n", gbl_args->appl.rounds); if (gbl_args->appl.cache_size < 0) printf("Pool cache size: default\n"); else From 2637bda13bd38d5324518a876136afd664f91e6e Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Fri, 22 Sep 2023 14:31:40 +0300 Subject: [PATCH 077/192] validation: cls: shorten function name prefix Make test case names more readable by shortening the prefix. Signed-off-by: Petri Savolainen Reviewed-by: Matias Elo --- .../classification/odp_classification_basic.c | 51 ++-- .../odp_classification_test_pmr.c | 219 ++++++++---------- .../classification/odp_classification_tests.c | 61 +++-- 3 files changed, 144 insertions(+), 187 deletions(-) diff --git a/test/validation/api/classification/odp_classification_basic.c b/test/validation/api/classification/odp_classification_basic.c index 2969dedab9..9a97e97dd6 100644 --- a/test/validation/api/classification/odp_classification_basic.c +++ b/test/validation/api/classification/odp_classification_basic.c @@ -31,13 +31,13 @@ static void test_defaults(uint8_t fill) CU_ASSERT_EQUAL(pmr_param.range_term, false); } -static void classification_test_default_values(void) +static void cls_default_values(void) { test_defaults(0); test_defaults(0xff); } -static void classification_test_create_cos(void) +static void cls_create_cos(void) { odp_cos_t cos; odp_cls_cos_param_t cls_param; @@ -64,7 +64,7 @@ static void classification_test_create_cos(void) odp_queue_destroy(queue); } -static void classification_test_create_cos_max_common(odp_bool_t stats) +static void cls_create_cos_max_common(odp_bool_t stats) { uint32_t i; odp_cls_cos_param_t cls_param; @@ -97,17 +97,17 @@ static void classification_test_create_cos_max_common(odp_bool_t stats) CU_ASSERT(!odp_cos_destroy(cos[j])); } -static void classification_test_create_cos_max(void) +static void cls_create_cos_max(void) { - classification_test_create_cos_max_common(false); + cls_create_cos_max_common(false); } -static void classification_test_create_cos_max_stats(void) +static void cls_create_cos_max_stats(void) { - classification_test_create_cos_max_common(true); + cls_create_cos_max_common(true); } -static void classification_test_destroy_cos(void) +static void cls_destroy_cos(void) { odp_cos_t cos; char name[ODP_COS_NAME_LEN]; @@ -141,7 +141,7 @@ static void classification_test_destroy_cos(void) odp_queue_destroy(queue); } -static void classification_test_create_pmr_match(void) +static void cls_create_pmr_match(void) { odp_pmr_t pmr; uint16_t val; @@ -214,7 +214,7 @@ static void classification_test_create_pmr_match(void) odp_pktio_close(pktio); } -static void classification_test_cos_set_queue(void) +static void cls_cos_set_queue(void) { int retval; char cosname[ODP_COS_NAME_LEN]; @@ -259,7 +259,7 @@ static void classification_test_cos_set_queue(void) odp_pool_destroy(pool); } -static void classification_test_cos_set_pool(void) +static void cls_cos_set_pool(void) { int retval; char cosname[ODP_COS_NAME_LEN]; @@ -302,7 +302,7 @@ static void classification_test_cos_set_pool(void) #if ODP_DEPRECATED_API -static void classification_test_cos_set_drop(void) +static void cls_cos_set_drop(void) { int retval; char cosname[ODP_COS_NAME_LEN]; @@ -339,7 +339,7 @@ static void classification_test_cos_set_drop(void) #endif -static void classification_test_pmr_composite_create(void) +static void cls_pmr_composite_create(void) { odp_pmr_t pmr_composite; int retval; @@ -413,7 +413,7 @@ static void classification_test_pmr_composite_create(void) odp_pktio_close(pktio); } -static void classification_test_create_cos_with_hash_queues(void) +static void cls_create_cos_with_hash_queues(void) { odp_pool_t pool; odp_cls_capability_t capa; @@ -457,19 +457,18 @@ static int check_capa_cos_hashing(void) } odp_testinfo_t classification_suite_basic[] = { - ODP_TEST_INFO(classification_test_default_values), - ODP_TEST_INFO(classification_test_create_cos), - ODP_TEST_INFO(classification_test_create_cos_max), - ODP_TEST_INFO(classification_test_create_cos_max_stats), - ODP_TEST_INFO(classification_test_destroy_cos), - ODP_TEST_INFO(classification_test_create_pmr_match), - ODP_TEST_INFO(classification_test_cos_set_queue), + ODP_TEST_INFO(cls_default_values), + ODP_TEST_INFO(cls_create_cos), + ODP_TEST_INFO(cls_create_cos_max), + ODP_TEST_INFO(cls_create_cos_max_stats), + ODP_TEST_INFO(cls_destroy_cos), + ODP_TEST_INFO(cls_create_pmr_match), + ODP_TEST_INFO(cls_cos_set_queue), #if ODP_DEPRECATED_API - ODP_TEST_INFO(classification_test_cos_set_drop), + ODP_TEST_INFO(cls_cos_set_drop), #endif - ODP_TEST_INFO(classification_test_cos_set_pool), - ODP_TEST_INFO(classification_test_pmr_composite_create), - ODP_TEST_INFO_CONDITIONAL(classification_test_create_cos_with_hash_queues, - check_capa_cos_hashing), + ODP_TEST_INFO(cls_cos_set_pool), + ODP_TEST_INFO(cls_pmr_composite_create), + ODP_TEST_INFO_CONDITIONAL(cls_create_cos_with_hash_queues, check_capa_cos_hashing), ODP_TEST_INFO_NULL, }; diff --git a/test/validation/api/classification/odp_classification_test_pmr.c b/test/validation/api/classification/odp_classification_test_pmr.c index bf067719b3..f8a1703dc7 100644 --- a/test/validation/api/classification/odp_classification_test_pmr.c +++ b/test/validation/api/classification/odp_classification_test_pmr.c @@ -1,5 +1,5 @@ /* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2019, Nokia + * Copyright (c) 2019-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -107,7 +107,7 @@ int classification_suite_pmr_term(void) return ret; } -static void classification_test_pktin_classifier_flag(void) +static void cls_pktin_classifier_flag(void) { odp_packet_t pkt; odph_tcphdr_t *tcp; @@ -206,7 +206,7 @@ static void classification_test_pktin_classifier_flag(void) odp_pktio_close(pktio); } -static void _classification_test_pmr_term_tcp_dport(int num_pkt) +static void cls_pmr_term_tcp_dport_n(int num_pkt) { odp_packet_t pkt; odph_tcphdr_t *tcp; @@ -471,7 +471,7 @@ static void test_pmr(const odp_pmr_param_t *pmr_param, odp_packet_t pkt, odp_pktio_close(pktio); } -static void classification_test_pmr_term_tcp_sport(void) +static void cls_pmr_term_tcp_sport(void) { odp_packet_t pkt; odph_tcphdr_t *tcp; @@ -503,7 +503,7 @@ static void classification_test_pmr_term_tcp_sport(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_udp_dport(void) +static void cls_pmr_term_udp_dport(void) { odp_packet_t pkt; odph_udphdr_t *udp; @@ -538,7 +538,7 @@ static void classification_test_pmr_term_udp_dport(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_udp_sport(void) +static void cls_pmr_term_udp_sport(void) { odp_packet_t pkt; odph_udphdr_t *udp; @@ -573,7 +573,7 @@ static void classification_test_pmr_term_udp_sport(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_proto(odp_bool_t ipv6) +static void cls_pmr_term_proto_ip(odp_bool_t ipv6) { odp_packet_t pkt; uint8_t val; @@ -605,17 +605,17 @@ static void classification_test_pmr_term_proto(odp_bool_t ipv6) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_ipv4_proto(void) +static void cls_pmr_term_ipv4_proto(void) { - classification_test_pmr_term_proto(TEST_IPV4); + cls_pmr_term_proto_ip(TEST_IPV4); } -static void classification_test_pmr_term_ipv6_proto(void) +static void cls_pmr_term_ipv6_proto(void) { - classification_test_pmr_term_proto(TEST_IPV6); + cls_pmr_term_proto_ip(TEST_IPV6); } -static void classification_test_pmr_term_dscp(odp_bool_t ipv6) +static void cls_pmr_term_dscp_ip(odp_bool_t ipv6) { odp_packet_t pkt; uint8_t val; @@ -648,17 +648,17 @@ static void classification_test_pmr_term_dscp(odp_bool_t ipv6) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_ipv4_dscp(void) +static void cls_pmr_term_ipv4_dscp(void) { - classification_test_pmr_term_dscp(TEST_IPV4); + cls_pmr_term_dscp_ip(TEST_IPV4); } -static void classification_test_pmr_term_ipv6_dscp(void) +static void cls_pmr_term_ipv6_dscp(void) { - classification_test_pmr_term_dscp(TEST_IPV6); + cls_pmr_term_dscp_ip(TEST_IPV6); } -static void classification_test_pmr_term_dmac(void) +static void cls_pmr_term_dmac(void) { odp_packet_t pkt; uint32_t seqno; @@ -763,7 +763,7 @@ static void classification_test_pmr_term_dmac(void) odp_pktio_close(pktio); } -static void classification_test_pmr_term_packet_len(void) +static void cls_pmr_term_packet_len(void) { odp_packet_t pkt; uint32_t val; @@ -796,7 +796,7 @@ static void classification_test_pmr_term_packet_len(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_vlan_id_0(void) +static void cls_pmr_term_vlan_id_0(void) { odp_packet_t pkt; uint16_t val; @@ -831,7 +831,7 @@ static void classification_test_pmr_term_vlan_id_0(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_vlan_id_x(void) +static void cls_pmr_term_vlan_id_x(void) { odp_packet_t pkt; uint16_t val; @@ -879,7 +879,7 @@ static void classification_test_pmr_term_vlan_id_x(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_vlan_pcp_0(void) +static void cls_pmr_term_vlan_pcp_0(void) { odp_packet_t pkt; uint8_t val; @@ -917,7 +917,7 @@ static void classification_test_pmr_term_vlan_pcp_0(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_eth_type_0(void) +static void cls_pmr_term_eth_type_0(void) { odp_packet_t pkt; uint16_t val; @@ -947,7 +947,7 @@ static void classification_test_pmr_term_eth_type_0(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_eth_type_x(void) +static void cls_pmr_term_eth_type_x(void) { odp_packet_t pkt; uint16_t val; @@ -995,7 +995,7 @@ static void classification_test_pmr_term_eth_type_x(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_pool_set(void) +static void cls_pmr_pool_set(void) { odp_packet_t pkt; uint32_t seqno; @@ -1097,7 +1097,7 @@ static void classification_test_pmr_pool_set(void) odp_pktio_close(pktio); } -static void classification_test_pmr_queue_set(void) +static void cls_pmr_queue_set(void) { odp_packet_t pkt; uint32_t seqno; @@ -1244,17 +1244,17 @@ static void test_pmr_term_ipv4_addr(int dst) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_ipv4_saddr(void) +static void cls_pmr_term_ipv4_saddr(void) { test_pmr_term_ipv4_addr(0); } -static void classification_test_pmr_term_ipv4_daddr(void) +static void cls_pmr_term_ipv4_daddr(void) { test_pmr_term_ipv4_addr(1); } -static void classification_test_pmr_term_ipv6daddr(void) +static void cls_pmr_term_ipv6daddr(void) { odp_packet_t pkt; odp_pmr_param_t pmr_param; @@ -1290,7 +1290,7 @@ static void classification_test_pmr_term_ipv6daddr(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_ipv6saddr(void) +static void cls_pmr_term_ipv6saddr(void) { odp_packet_t pkt; odp_pmr_param_t pmr_param; @@ -1325,14 +1325,14 @@ static void classification_test_pmr_term_ipv6saddr(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_tcp_dport(void) +static void cls_pmr_term_tcp_dport(void) { - _classification_test_pmr_term_tcp_dport(2); + cls_pmr_term_tcp_dport_n(2); } -static void classification_test_pmr_term_tcp_dport_multi(void) +static void cls_pmr_term_tcp_dport_multi(void) { - _classification_test_pmr_term_tcp_dport(SHM_PKT_NUM_BUFS / 4); + cls_pmr_term_tcp_dport_n(SHM_PKT_NUM_BUFS / 4); } static void test_pmr_term_custom(int custom_l3) @@ -1631,7 +1631,7 @@ static void test_pmr_series(const int num_udp, int marking) odp_pktio_close(pktio); } -static void classification_test_pmr_term_sctp(bool is_dport) +static void cls_pmr_term_sctp_port(bool is_dport) { odp_packet_t pkt; odph_sctphdr_t *sctp; @@ -1680,17 +1680,17 @@ static void classification_test_pmr_term_sctp(bool is_dport) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_sctp_sport(void) +static void cls_pmr_term_sctp_sport(void) { - classification_test_pmr_term_sctp(0); + cls_pmr_term_sctp_port(0); } -static void classification_test_pmr_term_sctp_dport(void) +static void cls_pmr_term_sctp_dport(void) { - classification_test_pmr_term_sctp(1); + cls_pmr_term_sctp_port(1); } -static void classification_test_pmr_term_icmp_type(void) +static void cls_pmr_term_icmp_type(void) { odp_packet_t pkt; odph_icmphdr_t *icmp; @@ -1725,7 +1725,7 @@ static void classification_test_pmr_term_icmp_type(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_icmp_code(void) +static void cls_pmr_term_icmp_code(void) { odp_packet_t pkt; odph_icmphdr_t *icmp; @@ -1760,7 +1760,7 @@ static void classification_test_pmr_term_icmp_code(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_icmp_id(void) +static void cls_pmr_term_icmp_id(void) { odp_packet_t pkt; odph_icmphdr_t *icmp; @@ -1795,7 +1795,7 @@ static void classification_test_pmr_term_icmp_id(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_gtpu_teid(void) +static void cls_pmr_term_gtpu_teid(void) { odp_packet_t pkt; odph_gtphdr_t *gtpu; @@ -1857,7 +1857,7 @@ static void classification_test_pmr_term_gtpu_teid(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_igmp_grpaddr(void) +static void cls_pmr_term_igmp_grpaddr(void) { odp_packet_t pkt; odph_igmphdr_t *igmp; @@ -1893,27 +1893,27 @@ static void classification_test_pmr_term_igmp_grpaddr(void) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_serial(void) +static void cls_pmr_serial(void) { test_pmr_series(1, 0); } -static void classification_test_pmr_parallel(void) +static void cls_pmr_parallel(void) { test_pmr_series(MAX_NUM_UDP, 0); } -static void classification_test_pmr_marking(void) +static void cls_pmr_marking(void) { test_pmr_series(MAX_NUM_UDP, 1); } -static void classification_test_pmr_term_custom_frame(void) +static void cls_pmr_term_custom_frame(void) { test_pmr_term_custom(0); } -static void classification_test_pmr_term_custom_l3(void) +static void cls_pmr_term_custom_l3(void) { test_pmr_term_custom(1); } @@ -1954,7 +1954,7 @@ static void test_pmr_term_ipsec_spi_ah(odp_bool_t is_ipv6) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_ipsec_spi_ah_ipv4(void) +static void cls_pmr_term_ipsec_spi_ah_ipv4(void) { test_pmr_term_ipsec_spi_ah(TEST_IPV4); } @@ -1995,17 +1995,17 @@ static void test_pmr_term_ipsec_spi_esp(odp_bool_t is_ipv6) test_pmr(&pmr_param, pkt, NO_MATCH); } -static void classification_test_pmr_term_ipsec_spi_esp_ipv4(void) +static void cls_pmr_term_ipsec_spi_esp_ipv4(void) { test_pmr_term_ipsec_spi_esp(TEST_IPV4); } -static void classification_test_pmr_term_ipsec_spi_ah_ipv6(void) +static void cls_pmr_term_ipsec_spi_ah_ipv6(void) { test_pmr_term_ipsec_spi_ah(TEST_IPV6); } -static void classification_test_pmr_term_ipsec_spi_esp_ipv6(void) +static void cls_pmr_term_ipsec_spi_esp_ipv6(void) { test_pmr_term_ipsec_spi_esp(TEST_IPV6); } @@ -2170,81 +2170,44 @@ static int check_capa_igmp_grpaddr(void) } odp_testinfo_t classification_suite_pmr[] = { - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_tcp_dport, - check_capa_tcp_dport), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_tcp_sport, - check_capa_tcp_sport), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_udp_dport, - check_capa_udp_dport), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_udp_sport, - check_capa_udp_sport), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_gtpu_teid, - check_capa_gtpu_teid), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_igmp_grpaddr, - check_capa_igmp_grpaddr), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_sctp_sport, - check_capa_sctp_sport), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_sctp_dport, - check_capa_sctp_dport), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_icmp_type, - check_capa_icmp_type), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_icmp_code, - check_capa_icmp_code), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_icmp_id, - check_capa_icmp_id), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv4_proto, - check_capa_ip_proto), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv6_proto, - check_capa_ip_proto), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv4_dscp, - check_capa_ip_dscp), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv6_dscp, - check_capa_ip_dscp), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_dmac, - check_capa_dmac), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_pool_set, - check_capa_ip_proto), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_queue_set, - check_capa_ip_proto), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv4_saddr, - check_capa_ipv4_saddr), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv4_daddr, - check_capa_ipv4_daddr), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv6saddr, - check_capa_ipv6_saddr), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipv6daddr, - check_capa_ipv6_daddr), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_packet_len, - check_capa_packet_len), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_vlan_id_0, - check_capa_vlan_id_0), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_vlan_id_x, - check_capa_vlan_id_x), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_vlan_pcp_0, - check_capa_vlan_pcp_0), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_eth_type_0, - check_capa_ethtype_0), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_eth_type_x, - check_capa_ethtype_x), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_custom_frame, - check_capa_custom_frame), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_custom_l3, - check_capa_custom_l3), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipsec_spi_ah_ipv4, - check_capa_ipsec_spi), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipsec_spi_esp_ipv4, - check_capa_ipsec_spi), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipsec_spi_ah_ipv6, - check_capa_ipsec_spi), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_term_ipsec_spi_esp_ipv6, - check_capa_ipsec_spi), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_serial, - check_capa_pmr_series), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_parallel, - check_capa_pmr_series), - ODP_TEST_INFO(classification_test_pktin_classifier_flag), - ODP_TEST_INFO(classification_test_pmr_term_tcp_dport_multi), - ODP_TEST_INFO_CONDITIONAL(classification_test_pmr_marking, - check_capa_pmr_marking), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_tcp_dport, check_capa_tcp_dport), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_tcp_sport, check_capa_tcp_sport), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_udp_dport, check_capa_udp_dport), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_udp_sport, check_capa_udp_sport), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_gtpu_teid, check_capa_gtpu_teid), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_igmp_grpaddr, check_capa_igmp_grpaddr), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_sctp_sport, check_capa_sctp_sport), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_sctp_dport, check_capa_sctp_dport), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_icmp_type, check_capa_icmp_type), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_icmp_code, check_capa_icmp_code), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_icmp_id, check_capa_icmp_id), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv4_proto, check_capa_ip_proto), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv6_proto, check_capa_ip_proto), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv4_dscp, check_capa_ip_dscp), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv6_dscp, check_capa_ip_dscp), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_dmac, check_capa_dmac), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_pool_set, check_capa_ip_proto), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_queue_set, check_capa_ip_proto), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv4_saddr, check_capa_ipv4_saddr), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv4_daddr, check_capa_ipv4_daddr), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv6saddr, check_capa_ipv6_saddr), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipv6daddr, check_capa_ipv6_daddr), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_packet_len, check_capa_packet_len), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_vlan_id_0, check_capa_vlan_id_0), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_vlan_id_x, check_capa_vlan_id_x), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_vlan_pcp_0, check_capa_vlan_pcp_0), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_eth_type_0, check_capa_ethtype_0), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_eth_type_x, check_capa_ethtype_x), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_custom_frame, check_capa_custom_frame), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_custom_l3, check_capa_custom_l3), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipsec_spi_ah_ipv4, check_capa_ipsec_spi), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipsec_spi_esp_ipv4, check_capa_ipsec_spi), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipsec_spi_ah_ipv6, check_capa_ipsec_spi), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_term_ipsec_spi_esp_ipv6, check_capa_ipsec_spi), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_serial, check_capa_pmr_series), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_parallel, check_capa_pmr_series), + ODP_TEST_INFO(cls_pktin_classifier_flag), + ODP_TEST_INFO(cls_pmr_term_tcp_dport_multi), + ODP_TEST_INFO_CONDITIONAL(cls_pmr_marking, check_capa_pmr_marking), ODP_TEST_INFO_NULL, }; diff --git a/test/validation/api/classification/odp_classification_tests.c b/test/validation/api/classification/odp_classification_tests.c index 84dfcf5624..008034d9a3 100644 --- a/test/validation/api/classification/odp_classification_tests.c +++ b/test/validation/api/classification/odp_classification_tests.c @@ -1,5 +1,5 @@ /* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2020-2021, Nokia + * Copyright (c) 2020-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -531,7 +531,7 @@ void test_pktio_drop_cos(odp_bool_t enable_pktv) CU_ASSERT((stop.errors - start.errors) == 0); } -static int classification_check_queue_stats(void) +static int check_queue_stats(void) { odp_cls_capability_t capa; @@ -544,7 +544,7 @@ static int classification_check_queue_stats(void) return ODP_TEST_INACTIVE; } -static void classification_test_queue_stats(odp_bool_t enable_pktv) +static void cls_queue_stats(odp_bool_t enable_pktv) { odp_cls_capability_t capa; odp_cls_queue_stats_t stats_start; @@ -595,14 +595,14 @@ static void classification_test_queue_stats(odp_bool_t enable_pktv) CU_ASSERT(stats_stop.packets == 0); } -static void classification_test_queue_stats_pkt(void) +static void cls_queue_stats_pkt(void) { - classification_test_queue_stats(false); + cls_queue_stats(false); } -static void classification_test_queue_stats_pktv(void) +static void cls_queue_stats_pktv(void) { - classification_test_queue_stats(true); + cls_queue_stats(true); } void configure_pktio_error_cos(odp_bool_t enable_pktv) @@ -678,7 +678,7 @@ void test_pktio_error_cos(odp_bool_t enable_pktv) odp_packet_free(pkt); } -static void classification_test_pktio_set_skip(void) +static void cls_pktio_set_skip(void) { int retval; size_t offset = 5; @@ -696,7 +696,7 @@ static void classification_test_pktio_set_skip(void) CU_ASSERT(retval == 0); } -static void classification_test_pktio_set_headroom(void) +static void cls_pktio_set_headroom(void) { size_t headroom; int retval; @@ -1000,7 +1000,7 @@ void test_pktio_pmr_composite_cos(odp_bool_t enable_pktv) odp_packet_free(pkt); } -static void classification_test_pktio_configure_common(odp_bool_t enable_pktv) +static void cls_pktio_configure_common(odp_bool_t enable_pktv) { odp_cls_capability_t capa; int num_cos; @@ -1049,17 +1049,17 @@ static void classification_test_pktio_configure_common(odp_bool_t enable_pktv) } -static void classification_test_pktio_configure(void) +static void cls_pktio_configure(void) { - classification_test_pktio_configure_common(false); + cls_pktio_configure_common(false); } -static void classification_test_pktio_configure_pktv(void) +static void cls_pktio_configure_pktv(void) { - classification_test_pktio_configure_common(true); + cls_pktio_configure_common(true); } -static void classification_test_pktio_test_common(odp_bool_t enable_pktv) +static void cls_pktio_test_common(odp_bool_t enable_pktv) { /* Test Different CoS on the pktio interface */ if (tc.default_cos && TEST_DEFAULT) @@ -1080,17 +1080,17 @@ static void classification_test_pktio_test_common(odp_bool_t enable_pktv) test_pktio_pmr_composite_cos(enable_pktv); } -static void classification_test_pktio_test(void) +static void cls_pktio_test(void) { - classification_test_pktio_test_common(false); + cls_pktio_test_common(false); } -static void classification_test_pktio_test_pktv(void) +static void cls_pktio_test_pktv(void) { - classification_test_pktio_test_common(true); + cls_pktio_test_common(true); } -static int classification_check_pktv(void) +static int check_pktv(void) { return pktv_config.enable ? ODP_TEST_ACTIVE : ODP_TEST_INACTIVE; } @@ -1101,22 +1101,17 @@ static int check_capa_skip_offset(void) } odp_testinfo_t classification_suite[] = { - ODP_TEST_INFO_CONDITIONAL(classification_test_pktio_set_skip, - check_capa_skip_offset), - ODP_TEST_INFO(classification_test_pktio_set_headroom), - ODP_TEST_INFO(classification_test_pktio_configure), - ODP_TEST_INFO(classification_test_pktio_test), - ODP_TEST_INFO_CONDITIONAL(classification_test_queue_stats_pkt, - classification_check_queue_stats), + ODP_TEST_INFO_CONDITIONAL(cls_pktio_set_skip, check_capa_skip_offset), + ODP_TEST_INFO(cls_pktio_set_headroom), + ODP_TEST_INFO(cls_pktio_configure), + ODP_TEST_INFO(cls_pktio_test), + ODP_TEST_INFO_CONDITIONAL(cls_queue_stats_pkt, check_queue_stats), ODP_TEST_INFO_NULL, }; odp_testinfo_t classification_suite_pktv[] = { - ODP_TEST_INFO_CONDITIONAL(classification_test_pktio_configure_pktv, - classification_check_pktv), - ODP_TEST_INFO_CONDITIONAL(classification_test_pktio_test_pktv, - classification_check_pktv), - ODP_TEST_INFO_CONDITIONAL(classification_test_queue_stats_pktv, - classification_check_queue_stats), + ODP_TEST_INFO_CONDITIONAL(cls_pktio_configure_pktv, check_pktv), + ODP_TEST_INFO_CONDITIONAL(cls_pktio_test_pktv, check_pktv), + ODP_TEST_INFO_CONDITIONAL(cls_queue_stats_pktv, check_queue_stats), ODP_TEST_INFO_NULL, }; From 2b182e1466901f5d817e977c345a1ac74b2b0020 Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Fri, 22 Sep 2023 13:00:12 +0300 Subject: [PATCH 078/192] validation: cls: create maximum number of PMRs Add test case that tries to create maximum number of PMRs into the default CoS. Signed-off-by: Petri Savolainen Reviewed-by: Matias Elo --- .../classification/odp_classification_basic.c | 147 +++++++++++++++++- 1 file changed, 144 insertions(+), 3 deletions(-) diff --git a/test/validation/api/classification/odp_classification_basic.c b/test/validation/api/classification/odp_classification_basic.c index 9a97e97dd6..1e0be14d21 100644 --- a/test/validation/api/classification/odp_classification_basic.c +++ b/test/validation/api/classification/odp_classification_basic.c @@ -1,5 +1,5 @@ /* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2021-2022, Nokia + * Copyright (c) 2021-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -11,6 +11,9 @@ #define PMR_SET_NUM 5 +/* Limit handle array allocation from stack to about 256kB */ +#define MAX_HANDLES (32 * 1024) + static void test_defaults(uint8_t fill) { odp_cls_cos_param_t cos_param; @@ -66,13 +69,15 @@ static void cls_create_cos(void) static void cls_create_cos_max_common(odp_bool_t stats) { - uint32_t i; + uint32_t i, num; odp_cls_cos_param_t cls_param; odp_cls_capability_t capa; CU_ASSERT_FATAL(odp_cls_capability(&capa) == 0); - uint32_t num = capa.max_cos; + num = capa.max_cos; + if (num > MAX_HANDLES) + num = MAX_HANDLES; if (stats && capa.max_cos_stats < num) num = capa.max_cos_stats; @@ -214,6 +219,140 @@ static void cls_create_pmr_match(void) odp_pktio_close(pktio); } +/* Create maximum number of PMRs into the default CoS */ +static void cls_max_pmr_from_default_action(int drop) +{ + odp_cls_cos_param_t cos_param; + odp_queue_param_t queue_param; + odp_cls_capability_t capa; + odp_schedule_capability_t sched_capa; + odp_pmr_param_t pmr_param; + odp_pool_t pool; + odp_pktio_t pktio; + odp_cos_t default_cos; + uint32_t i, num_cos, num_pmr; + int ret; + uint32_t cos_created = 0; + uint32_t queue_created = 0; + uint32_t pmr_created = 0; + uint16_t val = 1024; + uint16_t mask = 0xffff; + + CU_ASSERT_FATAL(odp_cls_capability(&capa) == 0); + + CU_ASSERT_FATAL(odp_schedule_capability(&sched_capa) == 0); + + pool = pool_create("pkt_pool"); + CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); + + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pool, true); + CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); + + num_cos = capa.max_cos; + + if (num_cos > sched_capa.max_queues) + num_cos = sched_capa.max_queues; + + if (num_cos > MAX_HANDLES) + num_cos = MAX_HANDLES; + + CU_ASSERT_FATAL(num_cos > 1); + + num_pmr = num_cos - 1; + + odp_cos_t cos[num_cos]; + odp_queue_t queue[num_cos]; + odp_pmr_t pmr[num_pmr]; + + odp_queue_param_init(&queue_param); + queue_param.type = ODP_QUEUE_TYPE_SCHED; + + odp_cls_cos_param_init(&cos_param); + if (drop) + cos_param.action = ODP_COS_ACTION_DROP; + + for (i = 0; i < num_cos; i++) { + if (!drop) { + queue[i] = odp_queue_create(NULL, &queue_param); + + if (queue[i] == ODP_QUEUE_INVALID) { + ODPH_ERR("odp_queue_create() failed %u / %u\n", i + 1, num_cos); + break; + } + + cos_param.queue = queue[i]; + queue_created++; + } + + cos[i] = odp_cls_cos_create(NULL, &cos_param); + + if (cos[i] == ODP_COS_INVALID) { + ODPH_ERR("odp_cls_cos_create() failed %u / %u\n", i + 1, num_cos); + break; + } + + cos_created++; + } + + if (!drop) + CU_ASSERT(queue_created == num_cos); + + CU_ASSERT(cos_created == num_cos); + + if (cos_created != num_cos) + goto destroy_cos; + + default_cos = cos[0]; + + ret = odp_pktio_default_cos_set(pktio, default_cos); + CU_ASSERT_FATAL(ret == 0); + + odp_cls_pmr_param_init(&pmr_param); + pmr_param.term = find_first_supported_l3_pmr(); + pmr_param.match.value = &val; + pmr_param.match.mask = &mask; + pmr_param.val_sz = sizeof(val); + + for (i = 0; i < num_pmr; i++) { + pmr[i] = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos[i + 1]); + + if (pmr[i] == ODP_PMR_INVALID) + break; + + val++; + pmr_created++; + } + + printf("\n Number of CoS created: %u\n Number of PMR created: %u\n", cos_created, + pmr_created); + + for (i = 0; i < pmr_created; i++) + CU_ASSERT(odp_cls_pmr_destroy(pmr[i]) == 0); + + ret = odp_pktio_default_cos_set(pktio, ODP_COS_INVALID); + CU_ASSERT_FATAL(ret == 0); + +destroy_cos: + for (i = 0; i < cos_created; i++) + CU_ASSERT(odp_cos_destroy(cos[i]) == 0); + + for (i = 0; i < queue_created; i++) + CU_ASSERT(odp_queue_destroy(queue[i]) == 0); + + CU_ASSERT(odp_pktio_close(pktio) == 0); + CU_ASSERT(odp_pool_destroy(pool) == 0); +} + +static void cls_max_pmr_from_default_drop(void) +{ + cls_max_pmr_from_default_action(1); +} + +static void cls_max_pmr_from_default_enqueue(void) +{ + cls_max_pmr_from_default_action(0); +} + static void cls_cos_set_queue(void) { int retval; @@ -463,6 +602,8 @@ odp_testinfo_t classification_suite_basic[] = { ODP_TEST_INFO(cls_create_cos_max_stats), ODP_TEST_INFO(cls_destroy_cos), ODP_TEST_INFO(cls_create_pmr_match), + ODP_TEST_INFO(cls_max_pmr_from_default_drop), + ODP_TEST_INFO(cls_max_pmr_from_default_enqueue), ODP_TEST_INFO(cls_cos_set_queue), #if ODP_DEPRECATED_API ODP_TEST_INFO(cls_cos_set_drop), From d55ab3a3e39d9f6d0db5497ae671c6c2f01077ca Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Tue, 12 Sep 2023 12:23:50 +0000 Subject: [PATCH 079/192] test: dmafwd: configure cache sizes for transfer and completion pools Configure cache sizes for transfer buffer and completion event pools based on the cache size command line option. These are utilized in fast path and caching may improve performance in DMA copy case. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- test/performance/odp_dmafwd.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c index 20fac97900..2890db260e 100644 --- a/test/performance/odp_dmafwd.c +++ b/test/performance/odp_dmafwd.c @@ -45,7 +45,8 @@ enum { #define MAX_WORKERS (ODP_THREAD_COUNT_MAX - 1) #define MAX_PKTIO_INDEXES 1024U -#define MIN(a, b) (((a) <= (b)) ? (a) : (b)) +#define MIN(a, b) (((a) <= (b)) ? (a) : (b)) +#define MAX(a, b) (((a) >= (b)) ? (a) : (b)) #define DIV_IF(a, b) ((b) > 0U ? ((a) / (b)) : 0U) ODP_STATIC_ASSERT(MAX_IFS < UINT8_MAX, "Too large maximum interface count"); @@ -122,6 +123,8 @@ typedef struct prog_config_s { uint32_t num_pkts; uint32_t pkt_len; uint32_t cache_size; + uint32_t trs_cache_size; + uint32_t compl_cache_size; uint32_t time_sec; int num_thrs; uint8_t num_ifs; @@ -224,7 +227,7 @@ static void print_usage(dynamic_defs_t *dyn_defs) " -l, --pkt_len Maximum size of packet buffers in packet I/O pool. %u by\n" " default.\n" " -c, --worker_count Amount of workers. %u by default.\n" - " -C, --cache_size Packet pool cache size. %u by default.\n" + " -C, --cache_size Maximum cache size for pools. %u by default.\n" " -T, --time_sec Time in seconds to run. 0 means infinite. %u by default.\n" " -h, --help This help.\n" "\n", DEF_CPY_TYPE, dyn_defs->burst_size, dyn_defs->num_pkts, dyn_defs->pkt_len, @@ -345,6 +348,11 @@ static parse_result_t check_options(prog_config_t *config) return PRS_NOK; } + config->trs_cache_size = MIN(MAX(config->cache_size, pool_capa.buf.min_cache_size), + pool_capa.buf.max_cache_size); + config->compl_cache_size = MIN(MAX(config->cache_size, dma_capa.pool.min_cache_size), + dma_capa.pool.max_cache_size); + return PRS_OK; } @@ -637,6 +645,7 @@ static odp_bool_t setup_copy(prog_config_t *config) pool_param.buf.num = config->num_pkts; pool_param.buf.size = sizeof(transfer_t); + pool_param.buf.cache_size = config->trs_cache_size; pool_param.type = ODP_POOL_BUFFER; config->trs_pool = odp_pool_create(PROG_NAME "_dma_trs", &pool_param); @@ -656,6 +665,7 @@ static odp_bool_t setup_copy(prog_config_t *config) odp_dma_pool_param_init(&compl_pool_param); compl_pool_param.num = config->num_pkts; + compl_pool_param.cache_size = config->compl_cache_size; thr->compl_pool = odp_dma_pool_create(PROG_NAME "_dma_compl", &compl_pool_param); if (thr->compl_pool == ODP_POOL_INVALID) { @@ -998,7 +1008,7 @@ static void print_stats(const prog_config_t *config) " copy mode: %s\n" " burst size: %u\n" " packet length: %u\n" - " pool cache size: %u\n", config->copy_type == SW_COPY ? "SW" : "DMA", + " max cache size: %u\n", config->copy_type == SW_COPY ? "SW" : "DMA", config->burst_size, config->pkt_len, config->cache_size); for (int i = 0; i < config->num_thrs; ++i) { From c17a05c9d65c20fb1bd8c2ddf2528f65b389d301 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Fri, 15 Sep 2023 08:33:50 +0000 Subject: [PATCH 080/192] test: dmafwd: unify ODP init/term error logs Remove trailing periods to match existing tester logging style. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- test/performance/odp_dmafwd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c index 2890db260e..c9718498da 100644 --- a/test/performance/odp_dmafwd.c +++ b/test/performance/odp_dmafwd.c @@ -1064,12 +1064,12 @@ int main(int argc, char **argv) init_param.mem_model = odph_opts.mem_model; if (odp_init_global(&odp_instance, NULL, NULL)) { - ODPH_ERR("ODP global init failed, exiting.\n"); + ODPH_ERR("ODP global init failed, exiting\n"); exit(EXIT_FAILURE); } if (odp_init_local(odp_instance, ODP_THREAD_CONTROL)) { - ODPH_ERR("ODP local init failed, exiting.\n"); + ODPH_ERR("ODP local init failed, exiting\n"); exit(EXIT_FAILURE); } @@ -1140,12 +1140,12 @@ int main(int argc, char **argv) (void)odp_shm_free(shm_cfg); if (odp_term_local()) { - ODPH_ERR("ODP local terminate failed, exiting.\n"); + ODPH_ERR("ODP local terminate failed, exiting\n"); exit(EXIT_FAILURE); } if (odp_term_global(odp_instance)) { - ODPH_ERR("ODP global terminate failed, exiting.\n"); + ODPH_ERR("ODP global terminate failed, exiting\n"); exit(EXIT_FAILURE); } From 4fcfb578dbf0e6536f499bb85844fc376cde0f5b Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Tue, 12 Sep 2023 12:44:02 +0000 Subject: [PATCH 081/192] test: dmafwd: unify capability check error logs Use suitable log wording in capability checks depending on the error condition (not supported vs. failure). Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- test/performance/odp_dmafwd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c index c9718498da..54494030f4 100644 --- a/test/performance/odp_dmafwd.c +++ b/test/performance/odp_dmafwd.c @@ -290,7 +290,7 @@ static parse_result_t check_options(prog_config_t *config) } if ((uint32_t)config->num_thrs > dma_capa.max_sessions) { - ODPH_ERR("Not enough DMA sessions supported: %d (max: %u)\n", config->num_thrs, + ODPH_ERR("Unsupported DMA session count: %d (max: %u)\n", config->num_thrs, dma_capa.max_sessions); return PRS_NOT_SUP; } @@ -299,13 +299,13 @@ static parse_result_t check_options(prog_config_t *config) burst_size = MIN(burst_size, MAX_BURST); if (config->burst_size == 0U || config->burst_size > burst_size) { - ODPH_ERR("Unsupported segment count for DMA: %u (min: 1, max: %u)\n", + ODPH_ERR("Invalid segment count for DMA: %u (min: 1, max: %u)\n", config->burst_size, burst_size); return PRS_NOK; } if (config->pkt_len > dma_capa.max_seg_len) { - ODPH_ERR("Unsupported packet length for DMA: %u (max: %u)\n", config->pkt_len, + ODPH_ERR("Invalid packet length for DMA: %u (max: %u)\n", config->pkt_len, dma_capa.max_seg_len); return PRS_NOK; } @@ -317,7 +317,7 @@ static parse_result_t check_options(prog_config_t *config) } if ((uint32_t)config->num_thrs > dma_capa.pool.max_pools) { - ODPH_ERR("Unsupported amount of completion pools: %d (max: %u)\n", + ODPH_ERR("Invalid amount of completion pools: %d (max: %u)\n", config->num_thrs, dma_capa.pool.max_pools); return PRS_NOK; } From 177cb381d0d2ec6cd51159e6fd88f01251991ec9 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Wed, 13 Sep 2023 07:40:20 +0000 Subject: [PATCH 082/192] test: dmafwd: add DMA poll mode parsing support In preparation for DMA poll mode support, add parsing skeleton for the new mode. The mode itself is not yet supported and will fail with "not yet implemented" error if chosen. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- test/performance/odp_dmafwd.c | 123 +++++++++++++++++++++------------- 1 file changed, 76 insertions(+), 47 deletions(-) diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c index 54494030f4..34e5e4016d 100644 --- a/test/performance/odp_dmafwd.c +++ b/test/performance/odp_dmafwd.c @@ -30,7 +30,8 @@ enum { SW_COPY = 0U, - DMA_COPY + DMA_COPY_EV, + DMA_COPY_POLL }; #define DEF_CPY_TYPE SW_COPY @@ -219,7 +220,8 @@ static void print_usage(dynamic_defs_t *dyn_defs) "\n" " -t, --copy_type Type of copy. %u by default.\n" " 0: SW\n" - " 1: DMA\n" + " 1: DMA with event completion\n" + " 2: DMA with poll completion\n" " -b, --burst_size Copy burst size. This many packets are accumulated before\n" " copy. %u by default.\n" " -n, --num_pkts Number of packet buffers allocated for packet I/O pool.\n" @@ -273,7 +275,8 @@ static parse_result_t check_options(prog_config_t *config) MAX_PKTIO_INDEXES); } - if (config->copy_type != SW_COPY && config->copy_type != DMA_COPY) { + if (config->copy_type != SW_COPY && config->copy_type != DMA_COPY_EV && + config->copy_type != DMA_COPY_POLL) { ODPH_ERR("Invalid copy type: %u\n", config->copy_type); return PRS_NOK; } @@ -310,16 +313,26 @@ static parse_result_t check_options(prog_config_t *config) return PRS_NOK; } - if ((dma_capa.compl_mode_mask & ODP_DMA_COMPL_EVENT) == 0U || !dma_capa.queue_type_sched) { - ODPH_ERR("Unsupported completion mode (mode support: %x, scheduled queue " - "support: %u\n", dma_capa.compl_mode_mask, dma_capa.queue_type_sched); - return PRS_NOT_SUP; - } + if (config->copy_type == DMA_COPY_EV) { + if ((dma_capa.compl_mode_mask & ODP_DMA_COMPL_EVENT) == 0U || + !dma_capa.queue_type_sched) { + ODPH_ERR("Unsupported DMA completion mode: event (mode support: %x, " + "scheduled queue support: %u)\n", dma_capa.compl_mode_mask, + dma_capa.queue_type_sched); + return PRS_NOT_SUP; + } - if ((uint32_t)config->num_thrs > dma_capa.pool.max_pools) { - ODPH_ERR("Invalid amount of completion pools: %d (max: %u)\n", - config->num_thrs, dma_capa.pool.max_pools); - return PRS_NOK; + if ((uint32_t)config->num_thrs > dma_capa.pool.max_pools) { + ODPH_ERR("Invalid amount of DMA completion pools: %d (max: %u)\n", + config->num_thrs, dma_capa.pool.max_pools); + return PRS_NOK; + } + } else if (config->copy_type == DMA_COPY_POLL) { + if ((dma_capa.compl_mode_mask & ODP_DMA_COMPL_POLL) == 0U) { + ODPH_ERR("Unsupported DMA completion mode: poll (mode support: %x)\n", + dma_capa.compl_mode_mask); + return PRS_NOT_SUP; + } } if (odp_pool_capability(&pool_capa) < 0) { @@ -655,34 +668,40 @@ static odp_bool_t setup_copy(prog_config_t *config) } for (int i = 0; i < config->num_thrs; ++i) { - thr = &config->thread_config[i]; - thr->dma_handle = odp_dma_create(PROG_NAME "_dma", &dma_params); - - if (thr->dma_handle == ODP_DMA_INVALID) { - ODPH_ERR("Error creating DMA session\n"); - return false; - } + if (config->copy_type == DMA_COPY_EV) { + thr = &config->thread_config[i]; + thr->dma_handle = odp_dma_create(PROG_NAME "_dma", &dma_params); - odp_dma_pool_param_init(&compl_pool_param); - compl_pool_param.num = config->num_pkts; - compl_pool_param.cache_size = config->compl_cache_size; - thr->compl_pool = odp_dma_pool_create(PROG_NAME "_dma_compl", &compl_pool_param); + if (thr->dma_handle == ODP_DMA_INVALID) { + ODPH_ERR("Error creating DMA session\n"); + return false; + } - if (thr->compl_pool == ODP_POOL_INVALID) { - ODPH_ERR("Error creating DMA event completion pool\n"); - return false; - } + odp_dma_pool_param_init(&compl_pool_param); + compl_pool_param.num = config->num_pkts; + compl_pool_param.cache_size = config->compl_cache_size; + thr->compl_pool = odp_dma_pool_create(PROG_NAME "_dma_compl", + &compl_pool_param); - thr->copy_pool = config->copy_pool; - thr->trs_pool = config->trs_pool; - odp_queue_param_init(&queue_param); - queue_param.type = ODP_QUEUE_TYPE_SCHED; - queue_param.sched.sync = ODP_SCHED_SYNC_PARALLEL; - queue_param.sched.prio = odp_schedule_max_prio(); - thr->compl_q = odp_queue_create(PROG_NAME "_dma_compl", &queue_param); + if (thr->compl_pool == ODP_POOL_INVALID) { + ODPH_ERR("Error creating DMA event completion pool\n"); + return false; + } - if (thr->compl_q == ODP_QUEUE_INVALID) { - ODPH_ERR("Error creating DMA completion queue\n"); + thr->copy_pool = config->copy_pool; + thr->trs_pool = config->trs_pool; + odp_queue_param_init(&queue_param); + queue_param.type = ODP_QUEUE_TYPE_SCHED; + queue_param.sched.sync = ODP_SCHED_SYNC_PARALLEL; + queue_param.sched.prio = odp_schedule_max_prio(); + thr->compl_q = odp_queue_create(PROG_NAME "_dma_compl", &queue_param); + + if (thr->compl_q == ODP_QUEUE_INVALID) { + ODPH_ERR("Error creating DMA completion queue\n"); + return false; + } + } else { + ODPH_ERR("DMA poll completion support not yet implemented\n"); return false; } } @@ -1001,14 +1020,18 @@ static void teardown(prog_config_t *config) static void print_stats(const prog_config_t *config) { const stats_t *stats; - const char *align = config->copy_type == SW_COPY ? " " : " "; + const char *align1 = config->copy_type == DMA_COPY_EV ? " " : ""; + const char *align2 = config->copy_type == SW_COPY ? " " : + config->copy_type == DMA_COPY_EV ? " " : + " "; printf("\n==================\n\n" "DMA forwarder done\n\n" " copy mode: %s\n" " burst size: %u\n" " packet length: %u\n" - " max cache size: %u\n", config->copy_type == SW_COPY ? "SW" : "DMA", + " max cache size: %u\n", config->copy_type == SW_COPY ? "SW" : + config->copy_type == DMA_COPY_EV ? "DMA-event" : "DMA-poll", config->burst_size, config->pkt_len, config->cache_size); for (int i = 0; i < config->num_thrs; ++i) { @@ -1020,15 +1043,21 @@ static void print_stats(const prog_config_t *config) printf(" packet copy errors: %" PRIu64 "\n", stats->copy_errs); } else { - printf(" successful DMA transfers: %" PRIu64 "\n" - " DMA transfer start errors: %" PRIu64 "\n" - " DMA transfer errors: %" PRIu64 "\n" - " transfer buffer allocation errors: %" PRIu64 "\n" - " completion event allocation errors: %" PRIu64 "\n" - " copy packet allocation errors: %" PRIu64 "\n", - stats->trs, stats->start_errs, stats->trs_errs, - stats->buf_alloc_errs, stats->compl_alloc_errs, + printf(" successful DMA transfers: %s%" PRIu64 "\n" + " DMA transfer start errors: %s%" PRIu64 "\n" + " DMA transfer errors: %s%" PRIu64 "\n" + " transfer buffer allocation errors: %s%" PRIu64 "\n" + " copy packet allocation errors: %s%" PRIu64 "\n", + align1, stats->trs, align1, stats->start_errs, align1, + stats->trs_errs, align1, stats->buf_alloc_errs, align1, stats->pkt_alloc_errs); + + if (config->copy_type == DMA_COPY_EV) + printf(" completion event allocation errors: %" PRIu64 "\n", + stats->compl_alloc_errs); + else + printf(" transfer ID allocation errors: %" PRIu64 "\n", + stats->compl_alloc_errs); } printf(" packets forwarded:%s%" PRIu64 "\n" @@ -1036,7 +1065,7 @@ static void print_stats(const prog_config_t *config) " call cycles per schedule round:\n" " total: %" PRIu64 "\n" " schedule: %" PRIu64 "\n" - " rounds: %" PRIu64 "\n", align, stats->fwd_pkts, align, + " rounds: %" PRIu64 "\n", align2, stats->fwd_pkts, align2, stats->discards, DIV_IF(stats->tot_cc, stats->sched_rounds), DIV_IF(stats->sched_cc, stats->sched_rounds), stats->sched_rounds); } From 463b1cfdee70dfbebcb08d2d7b939b3263667ef2 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Wed, 13 Sep 2023 11:06:38 +0000 Subject: [PATCH 083/192] test: dmafwd: refactor DMA copy In preparation for DMA poll mode support, restructure how transfers are initialized and sent in DMA copy case. This makes it easier to plug-in poll mode (and potentially others in the future) handling logic. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- test/performance/odp_dmafwd.c | 209 ++++++++++++++++++++-------------- 1 file changed, 122 insertions(+), 87 deletions(-) diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c index 34e5e4016d..7035266792 100644 --- a/test/performance/odp_dmafwd.c +++ b/test/performance/odp_dmafwd.c @@ -102,8 +102,25 @@ typedef struct pktio_s { uint8_t num_out_qs; } pktio_t; -typedef void (*ev_fn_t)(odp_dma_compl_t compl_ev, thread_config_t *config); -typedef void (*pkt_fn_t)(odp_packet_t pkts[], int num, pktio_t *pktio, thread_config_t *config); +typedef struct { + odp_packet_t src_pkts[MAX_BURST]; + odp_packet_t dst_pkts[MAX_BURST]; + pktio_t *pktio; + int num; +} transfer_t; + +/* Function for initializing transfer structures */ +typedef transfer_t *(*init_fn_t)(odp_dma_transfer_param_t *trs_param, + odp_dma_compl_param_t *compl_param, odp_dma_seg_t *src_segs, + odp_dma_seg_t *dst_segs, pktio_t *pktio, thread_config_t *config); +/* Function for starting transfers */ +typedef odp_bool_t (*start_fn_t)(odp_dma_transfer_param_t *trs_param, + odp_dma_compl_param_t *compl_param, thread_config_t *config); +/* Function for setting up packets for copy */ +typedef void (*pkt_fn_t)(odp_packet_t pkts[], int num, pktio_t *pktio, init_fn_t init_fn, + start_fn_t start_fn, thread_config_t *config); +/* Function for draining and tearing down inflight operations */ +typedef void (*drain_fn_t)(void); typedef struct prog_config_s { uint8_t pktio_idx_map[MAX_PKTIO_INDEXES]; @@ -118,8 +135,14 @@ typedef struct prog_config_s { odp_pool_t pktio_pool; odp_pool_t copy_pool; odp_pool_t trs_pool; - ev_fn_t ev_fn; - pkt_fn_t pkt_fn; + + struct { + init_fn_t init_fn; + start_fn_t start_fn; + pkt_fn_t pkt_fn; + drain_fn_t drain_fn; + }; + uint32_t burst_size; uint32_t num_pkts; uint32_t pkt_len; @@ -138,13 +161,6 @@ typedef struct { int num; } pkt_vec_t; -typedef struct { - odp_packet_t src_pkts[MAX_BURST]; - odp_packet_t dst_pkts[MAX_BURST]; - pktio_t *pktio; - int num; -} transfer_t; - static prog_config_t *prog_conf; static void terminate(int signal ODP_UNUSED) @@ -462,6 +478,7 @@ static inline int send_packets(odp_pktout_queue_t queue, odp_packet_t pkts[], in } static void sw_copy_and_send_packets(odp_packet_t pkts[], int num, pktio_t *pktio, + init_fn_t init_fn ODP_UNUSED, start_fn_t start_fn ODP_UNUSED, thread_config_t *config) { odp_packet_t old_pkt, new_pkt; @@ -490,41 +507,10 @@ static void sw_copy_and_send_packets(odp_packet_t pkts[], int num, pktio_t *pkti } } -static inline void send_dma_trs_packets(odp_dma_compl_t compl_ev, thread_config_t *config) -{ - odp_dma_result_t res; - odp_buffer_t buf; - transfer_t *trs; - pktio_t *pktio; - int num_sent; - stats_t *stats = &config->stats; - - memset(&res, 0, sizeof(res)); - odp_dma_compl_result(compl_ev, &res); - buf = (odp_buffer_t)res.user_ptr; - trs = (transfer_t *)odp_buffer_addr(buf); - pktio = trs->pktio; - - if (res.success) { - num_sent = send_packets(pktio->out_qs[config->thr_idx % pktio->num_out_qs], - trs->dst_pkts, trs->num); - ++stats->trs; - stats->fwd_pkts += num_sent; - stats->discards += trs->num - num_sent; - } else { - odp_packet_free_multi(trs->dst_pkts, trs->num); - ++stats->trs_errs; - } - - odp_packet_free_multi(trs->src_pkts, trs->num); - odp_buffer_free(buf); - odp_dma_compl_free(compl_ev); -} - -static inline transfer_t *init_dma_trs(odp_dma_transfer_param_t *trs_param, - odp_dma_compl_param_t *compl_param, odp_dma_seg_t *src_segs, - odp_dma_seg_t *dst_segs, pktio_t *pktio, - thread_config_t *config) +static transfer_t *init_dma_ev_trs(odp_dma_transfer_param_t *trs_param, + odp_dma_compl_param_t *compl_param, odp_dma_seg_t *src_segs, + odp_dma_seg_t *dst_segs, pktio_t *pktio, + thread_config_t *config) { odp_buffer_t buf; stats_t *stats = &config->stats; @@ -565,7 +551,22 @@ static inline transfer_t *init_dma_trs(odp_dma_transfer_param_t *trs_param, return trs; } -static void dma_copy(odp_packet_t pkts[], int num, pktio_t *pktio, thread_config_t *config) +static odp_bool_t start_dma_ev_trs(odp_dma_transfer_param_t *trs_param, + odp_dma_compl_param_t *compl_param, thread_config_t *config) +{ + const int ret = odp_dma_transfer_start(config->dma_handle, trs_param, compl_param); + + if (odp_unlikely(ret <= 0)) { + odp_buffer_free(compl_param->user_ptr); + odp_event_free(compl_param->event); + return false; + } + + return true; +} + +static void dma_copy(odp_packet_t pkts[], int num, pktio_t *pktio, init_fn_t init_fn, + start_fn_t start_fn, thread_config_t *config) { odp_dma_transfer_param_t trs_param; odp_dma_compl_param_t compl_param; @@ -583,8 +584,7 @@ static void dma_copy(odp_packet_t pkts[], int num, pktio_t *pktio, thread_config pkt = pkts[i]; if (odp_unlikely(trs == NULL)) { - trs = init_dma_trs(&trs_param, &compl_param, src_segs, dst_segs, pktio, - config); + trs = init_fn(&trs_param, &compl_param, src_segs, dst_segs, pktio, config); if (trs == NULL) { odp_packet_free(pkt); @@ -613,13 +613,43 @@ static void dma_copy(odp_packet_t pkts[], int num, pktio_t *pktio, thread_config } if (num_segs > 0U) - if (odp_dma_transfer_start(config->dma_handle, &trs_param, &compl_param) <= 0) { + if (odp_unlikely(!start_fn(&trs_param, &compl_param, config))) { odp_packet_free_multi(trs->src_pkts, trs->num); odp_packet_free_multi(trs->dst_pkts, trs->num); ++stats->start_errs; } } +static void drain_events(void) +{ + odp_event_t ev; + odp_event_type_t type; + odp_dma_result_t res; + odp_buffer_t buf; + transfer_t *trs; + + while (true) { + ev = odp_schedule(NULL, odp_schedule_wait_time(ODP_TIME_SEC_IN_NS * 2U)); + + if (ev == ODP_EVENT_INVALID) + break; + + type = odp_event_type(ev); + + if (type == ODP_EVENT_DMA_COMPL) { + memset(&res, 0, sizeof(res)); + odp_dma_compl_result(odp_dma_compl_from_event(ev), &res); + buf = (odp_buffer_t)res.user_ptr; + trs = (transfer_t *)odp_buffer_addr(buf); + odp_packet_free_multi(trs->src_pkts, trs->num); + odp_packet_free_multi(trs->dst_pkts, trs->num); + odp_buffer_free(buf); + } + + odp_event_free(ev); + } +} + static odp_bool_t setup_copy(prog_config_t *config) { odp_pool_param_t pool_param; @@ -647,7 +677,6 @@ static odp_bool_t setup_copy(prog_config_t *config) } if (config->copy_type == SW_COPY) { - config->ev_fn = NULL; config->pkt_fn = sw_copy_and_send_packets; for (int i = 0; i < config->num_thrs; ++i) @@ -706,8 +735,10 @@ static odp_bool_t setup_copy(prog_config_t *config) } } - config->ev_fn = send_dma_trs_packets; + config->init_fn = init_dma_ev_trs; + config->start_fn = start_dma_ev_trs; config->pkt_fn = dma_copy; + config->drain_fn = drain_events; return true; } @@ -800,6 +831,37 @@ static odp_bool_t setup_pktios(prog_config_t *config) return true; } +static inline void send_dma_trs_packets(odp_dma_compl_t compl_ev, thread_config_t *config) +{ + odp_dma_result_t res; + odp_buffer_t buf; + transfer_t *trs; + pktio_t *pktio; + int num_sent; + stats_t *stats = &config->stats; + + memset(&res, 0, sizeof(res)); + odp_dma_compl_result(compl_ev, &res); + buf = (odp_buffer_t)res.user_ptr; + trs = (transfer_t *)odp_buffer_addr(buf); + + if (res.success) { + pktio = trs->pktio; + num_sent = send_packets(pktio->out_qs[config->thr_idx % pktio->num_out_qs], + trs->dst_pkts, trs->num); + ++stats->trs; + stats->fwd_pkts += num_sent; + stats->discards += trs->num - num_sent; + } else { + odp_packet_free_multi(trs->dst_pkts, trs->num); + ++stats->trs_errs; + } + + odp_packet_free_multi(trs->src_pkts, trs->num); + odp_buffer_free(buf); + odp_dma_compl_free(compl_ev); +} + static inline void push_packet(odp_packet_t pkt, pkt_vec_t pkt_vecs[], uint8_t *pktio_idx_map) { uint8_t idx = pktio_idx_map[odp_packet_input_index(pkt)]; @@ -822,36 +884,6 @@ static void free_pending_packets(pkt_vec_t pkt_vecs[], uint32_t num_ifs) odp_packet_free_multi(pkt_vecs[i].pkts, pkt_vecs[i].num); } -static void drain(void) -{ - odp_event_t ev; - odp_event_type_t type; - odp_dma_result_t res; - odp_buffer_t buf; - transfer_t *trs; - - while (true) { - ev = odp_schedule(NULL, odp_schedule_wait_time(ODP_TIME_SEC_IN_NS * 2U)); - - if (ev == ODP_EVENT_INVALID) - break; - - type = odp_event_type(ev); - - if (type == ODP_EVENT_DMA_COMPL) { - memset(&res, 0, sizeof(res)); - odp_dma_compl_result(odp_dma_compl_from_event(ev), &res); - buf = (odp_buffer_t)res.user_ptr; - trs = (transfer_t *)odp_buffer_addr(buf); - odp_packet_free_multi(trs->src_pkts, trs->num); - odp_packet_free_multi(trs->dst_pkts, trs->num); - odp_buffer_free(buf); - } - - odp_event_free(ev); - } -} - static int process_packets(void *args) { thread_config_t *config = args; @@ -864,9 +896,10 @@ static int process_packets(void *args) int num_evs; odp_event_t ev; odp_event_type_t type; - ev_fn_t ev_fn = config->prog_config->ev_fn; uint8_t *pktio_map = config->prog_config->pktio_idx_map; stats_t *stats = &config->stats; + init_fn_t init_fn = config->prog_config->init_fn; + start_fn_t start_fn = config->prog_config->start_fn; pkt_fn_t pkt_fn = config->prog_config->pkt_fn; for (uint32_t i = 0U; i < num_ifs; ++i) { @@ -893,8 +926,7 @@ static int process_packets(void *args) type = odp_event_type(ev); if (type == ODP_EVENT_DMA_COMPL) { - if (ev_fn) - ev_fn(odp_dma_compl_from_event(ev), config); + send_dma_trs_packets(odp_dma_compl_from_event(ev), config); } else if (type == ODP_EVENT_PACKET) { push_packet(odp_packet_from_event(ev), pkt_vecs, pktio_map); } else { @@ -907,7 +939,8 @@ static int process_packets(void *args) pkt_vec = &pkt_vecs[i]; if (pkt_vec->num >= burst_size) { - pkt_fn(pkt_vec->pkts, burst_size, pkt_vec->pktio, config); + pkt_fn(pkt_vec->pkts, burst_size, pkt_vec->pktio, init_fn, + start_fn, config); pop_packets(pkt_vec, burst_size); } } @@ -919,7 +952,9 @@ static int process_packets(void *args) stats->sched_rounds = rounds; free_pending_packets(pkt_vecs, num_ifs); odp_barrier_wait(&config->prog_config->term_barrier); - drain(); + + if (config->prog_config->drain_fn) + config->prog_config->drain_fn(); return 0; } From 4be8e050c4152b0a707e6d1c7c33a608139b1e3b Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Fri, 15 Sep 2023 08:25:41 +0000 Subject: [PATCH 084/192] test: dmafwd: implement DMA poll mode In addition to event completion mode, DMA copy performance can now also be benchmarked with poll completion mode. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- test/performance/odp_dmafwd.c | 292 +++++++++++++++++++++++++++++++--- 1 file changed, 268 insertions(+), 24 deletions(-) diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c index 7035266792..987313f1f3 100644 --- a/test/performance/odp_dmafwd.c +++ b/test/performance/odp_dmafwd.c @@ -77,6 +77,8 @@ typedef struct { uint64_t buf_alloc_errs; uint64_t compl_alloc_errs; uint64_t pkt_alloc_errs; + uint64_t trs_poll_errs; + uint64_t trs_polled; uint64_t fwd_pkts; uint64_t discards; uint64_t sched_cc; @@ -91,6 +93,7 @@ typedef struct ODP_ALIGNED_CACHE { odp_pool_t copy_pool; odp_pool_t trs_pool; odp_queue_t compl_q; + odp_stash_t inflight_stash; stats_t stats; int thr_idx; } thread_config_t; @@ -120,7 +123,7 @@ typedef odp_bool_t (*start_fn_t)(odp_dma_transfer_param_t *trs_param, typedef void (*pkt_fn_t)(odp_packet_t pkts[], int num, pktio_t *pktio, init_fn_t init_fn, start_fn_t start_fn, thread_config_t *config); /* Function for draining and tearing down inflight operations */ -typedef void (*drain_fn_t)(void); +typedef void (*drain_fn_t)(thread_config_t *config); typedef struct prog_config_s { uint8_t pktio_idx_map[MAX_PKTIO_INDEXES]; @@ -143,13 +146,17 @@ typedef struct prog_config_s { drain_fn_t drain_fn; }; + uint64_t inflight_obj_size; uint32_t burst_size; uint32_t num_pkts; uint32_t pkt_len; uint32_t cache_size; + uint32_t num_inflight; uint32_t trs_cache_size; uint32_t compl_cache_size; + uint32_t stash_cache_size; uint32_t time_sec; + odp_stash_type_t stash_type; int num_thrs; uint8_t num_ifs; uint8_t copy_type; @@ -209,6 +216,7 @@ static void init_config(prog_config_t *config) thr->dma_handle = ODP_DMA_INVALID; thr->compl_pool = ODP_POOL_INVALID; thr->compl_q = ODP_QUEUE_INVALID; + thr->inflight_stash = ODP_STASH_INVALID; } for (uint32_t i = 0U; i < MAX_IFS; ++i) @@ -273,11 +281,29 @@ static void parse_interfaces(prog_config_t *config, const char *optarg) free(tmp_str); } +static odp_bool_t get_stash_capa(odp_stash_capability_t *stash_capa, odp_stash_type_t *stash_type) +{ + if (odp_stash_capability(stash_capa, ODP_STASH_TYPE_FIFO) == 0) { + *stash_type = ODP_STASH_TYPE_FIFO; + return true; + } + + if (odp_stash_capability(stash_capa, ODP_STASH_TYPE_DEFAULT) == 0) { + *stash_type = ODP_STASH_TYPE_DEFAULT; + return true; + } + + return false; +} + static parse_result_t check_options(prog_config_t *config) { - unsigned int idx = odp_pktio_max_index(); + const unsigned int idx = odp_pktio_max_index(); odp_dma_capability_t dma_capa; uint32_t burst_size; + odp_stash_capability_t stash_capa; + const uint64_t obj_size = sizeof(odp_dma_transfer_id_t); + uint64_t max_num; odp_pool_capability_t pool_capa; if (config->num_ifs == 0U) { @@ -329,6 +355,8 @@ static parse_result_t check_options(prog_config_t *config) return PRS_NOK; } + config->num_inflight = dma_capa.max_transfers; + if (config->copy_type == DMA_COPY_EV) { if ((dma_capa.compl_mode_mask & ODP_DMA_COMPL_EVENT) == 0U || !dma_capa.queue_type_sched) { @@ -349,6 +377,40 @@ static parse_result_t check_options(prog_config_t *config) dma_capa.compl_mode_mask); return PRS_NOT_SUP; } + + if (!get_stash_capa(&stash_capa, &config->stash_type)) { + ODPH_ERR("Error querying stash capabilities\n"); + return PRS_NOK; + } + + if ((uint32_t)config->num_thrs > stash_capa.max_stashes) { + ODPH_ERR("Invalid amount of stashes: %d (max: %u)\n", config->num_thrs, + stash_capa.max_stashes); + return PRS_NOK; + } + + if (obj_size == sizeof(uint8_t)) { + max_num = stash_capa.max_num.u8; + } else if (obj_size == sizeof(uint16_t)) { + max_num = stash_capa.max_num.u16; + } else if (obj_size <= sizeof(uint32_t)) { + max_num = stash_capa.max_num.u32; + } else if (obj_size <= sizeof(uint64_t)) { + max_num = stash_capa.max_num.u64; + } else if (obj_size <= sizeof(odp_u128_t)) { + max_num = stash_capa.max_num.u128; + } else { + ODPH_ERR("Invalid stash object size: %" PRIu64 "\n", obj_size); + return PRS_NOK; + } + + if (config->num_inflight > max_num) { + ODPH_ERR("Invalid stash size: %u (max: %" PRIu64 ")\n", + config->num_inflight, max_num); + return PRS_NOK; + } + + config->inflight_obj_size = obj_size; } if (odp_pool_capability(&pool_capa) < 0) { @@ -381,6 +443,7 @@ static parse_result_t check_options(prog_config_t *config) pool_capa.buf.max_cache_size); config->compl_cache_size = MIN(MAX(config->cache_size, dma_capa.pool.min_cache_size), dma_capa.pool.max_cache_size); + config->stash_cache_size = MIN(config->cache_size, stash_capa.max_cache_size); return PRS_OK; } @@ -551,6 +614,47 @@ static transfer_t *init_dma_ev_trs(odp_dma_transfer_param_t *trs_param, return trs; } +static transfer_t *init_dma_poll_trs(odp_dma_transfer_param_t *trs_param, + odp_dma_compl_param_t *compl_param, odp_dma_seg_t *src_segs, + odp_dma_seg_t *dst_segs, pktio_t *pktio, + thread_config_t *config) +{ + odp_buffer_t buf; + stats_t *stats = &config->stats; + transfer_t *trs; + + buf = odp_buffer_alloc(config->trs_pool); + + if (odp_unlikely(buf == ODP_BUFFER_INVALID)) { + ++stats->buf_alloc_errs; + return NULL; + } + + trs = (transfer_t *)odp_buffer_addr(buf); + trs->num = 0; + trs->pktio = pktio; + trs_param->src_format = ODP_DMA_FORMAT_PACKET; + trs_param->dst_format = ODP_DMA_FORMAT_PACKET; + trs_param->num_src = 0U; + trs_param->num_dst = 0U; + trs_param->src_seg = src_segs; + trs_param->dst_seg = dst_segs; + compl_param->compl_mode = ODP_DMA_COMPL_POLL; + compl_param->transfer_id = odp_dma_transfer_id_alloc(config->dma_handle); + + if (odp_unlikely(compl_param->transfer_id == ODP_DMA_TRANSFER_ID_INVALID)) { + odp_buffer_free(buf); + ++stats->compl_alloc_errs; + return NULL; + } + + compl_param->user_ptr = buf; + memset(src_segs, 0, sizeof(*src_segs) * MAX_BURST); + memset(dst_segs, 0, sizeof(*dst_segs) * MAX_BURST); + + return trs; +} + static odp_bool_t start_dma_ev_trs(odp_dma_transfer_param_t *trs_param, odp_dma_compl_param_t *compl_param, thread_config_t *config) { @@ -565,6 +669,24 @@ static odp_bool_t start_dma_ev_trs(odp_dma_transfer_param_t *trs_param, return true; } +static odp_bool_t start_dma_poll_trs(odp_dma_transfer_param_t *trs_param, + odp_dma_compl_param_t *compl_param, thread_config_t *config) +{ + const int ret = odp_dma_transfer_start(config->dma_handle, trs_param, compl_param); + + if (odp_unlikely(ret <= 0)) { + odp_buffer_free(compl_param->user_ptr); + odp_dma_transfer_id_free(config->dma_handle, compl_param->transfer_id); + return false; + } + + if (odp_unlikely(odp_stash_put(config->inflight_stash, &compl_param->transfer_id, 1) != 1)) + /* Should not happen, but make it visible if it somehow does */ + ODPH_ABORT("DMA inflight transfer stash overflow, aborting"); + + return true; +} + static void dma_copy(odp_packet_t pkts[], int num, pktio_t *pktio, init_fn_t init_fn, start_fn_t start_fn, thread_config_t *config) { @@ -620,7 +742,7 @@ static void dma_copy(odp_packet_t pkts[], int num, pktio_t *pktio, init_fn_t ini } } -static void drain_events(void) +static void drain_events(thread_config_t *config ODP_UNUSED) { odp_event_t ev; odp_event_type_t type; @@ -650,18 +772,50 @@ static void drain_events(void) } } +static void drain_polled(thread_config_t *config) +{ + odp_dma_transfer_id_t id; + odp_dma_result_t res; + int ret; + odp_buffer_t buf; + transfer_t *trs; + + while (true) { + if (odp_stash_get(config->inflight_stash, &id, 1) != 1) + break; + + memset(&res, 0, sizeof(res)); + + do { + ret = odp_dma_transfer_done(config->dma_handle, id, &res); + } while (ret == 0); + + odp_dma_transfer_id_free(config->dma_handle, id); + + if (ret < 0) + continue; + + buf = (odp_buffer_t)res.user_ptr; + trs = (transfer_t *)odp_buffer_addr(buf); + odp_packet_free_multi(trs->src_pkts, trs->num); + odp_packet_free_multi(trs->dst_pkts, trs->num); + odp_buffer_free(buf); + } +} + static odp_bool_t setup_copy(prog_config_t *config) { odp_pool_param_t pool_param; thread_config_t *thr; - const odp_dma_param_t dma_params = { + const odp_dma_param_t dma_param = { .direction = ODP_DMA_MAIN_TO_MAIN, .type = ODP_DMA_TYPE_COPY, - .compl_mode_mask = ODP_DMA_COMPL_EVENT, + .compl_mode_mask = ODP_DMA_COMPL_EVENT | ODP_DMA_COMPL_POLL, .mt_mode = ODP_DMA_MT_SERIAL, .order = ODP_DMA_ORDER_NONE }; odp_dma_pool_param_t compl_pool_param; odp_queue_param_t queue_param; + odp_stash_param_t stash_param; odp_pool_param_init(&pool_param); pool_param.pkt.seg_len = config->pkt_len; @@ -697,15 +851,17 @@ static odp_bool_t setup_copy(prog_config_t *config) } for (int i = 0; i < config->num_thrs; ++i) { - if (config->copy_type == DMA_COPY_EV) { - thr = &config->thread_config[i]; - thr->dma_handle = odp_dma_create(PROG_NAME "_dma", &dma_params); + thr = &config->thread_config[i]; + thr->copy_pool = config->copy_pool; + thr->trs_pool = config->trs_pool; + thr->dma_handle = odp_dma_create(PROG_NAME "_dma", &dma_param); - if (thr->dma_handle == ODP_DMA_INVALID) { - ODPH_ERR("Error creating DMA session\n"); - return false; - } + if (thr->dma_handle == ODP_DMA_INVALID) { + ODPH_ERR("Error creating DMA session\n"); + return false; + } + if (config->copy_type == DMA_COPY_EV) { odp_dma_pool_param_init(&compl_pool_param); compl_pool_param.num = config->num_pkts; compl_pool_param.cache_size = config->compl_cache_size; @@ -717,8 +873,6 @@ static odp_bool_t setup_copy(prog_config_t *config) return false; } - thr->copy_pool = config->copy_pool; - thr->trs_pool = config->trs_pool; odp_queue_param_init(&queue_param); queue_param.type = ODP_QUEUE_TYPE_SCHED; queue_param.sched.sync = ODP_SCHED_SYNC_PARALLEL; @@ -729,16 +883,32 @@ static odp_bool_t setup_copy(prog_config_t *config) ODPH_ERR("Error creating DMA completion queue\n"); return false; } + + config->init_fn = init_dma_ev_trs; + config->start_fn = start_dma_ev_trs; + config->drain_fn = drain_events; } else { - ODPH_ERR("DMA poll completion support not yet implemented\n"); - return false; + odp_stash_param_init(&stash_param); + stash_param.type = config->stash_type; + stash_param.put_mode = ODP_STASH_OP_LOCAL; + stash_param.get_mode = ODP_STASH_OP_LOCAL; + stash_param.num_obj = config->num_inflight; + stash_param.obj_size = config->inflight_obj_size; + stash_param.cache_size = config->stash_cache_size; + thr->inflight_stash = odp_stash_create("_dma_inflight", &stash_param); + + if (thr->inflight_stash == ODP_STASH_INVALID) { + ODPH_ERR("Error creating DMA inflight transfer stash\n"); + return false; + } + + config->init_fn = init_dma_poll_trs; + config->start_fn = start_dma_poll_trs; + config->drain_fn = drain_polled; } } - config->init_fn = init_dma_ev_trs; - config->start_fn = start_dma_ev_trs; config->pkt_fn = dma_copy; - config->drain_fn = drain_events; return true; } @@ -831,7 +1001,71 @@ static odp_bool_t setup_pktios(prog_config_t *config) return true; } -static inline void send_dma_trs_packets(odp_dma_compl_t compl_ev, thread_config_t *config) +static inline void send_dma_poll_trs_pkts(int burst_size, thread_config_t *config) +{ + odp_stash_t stash_handle = config->inflight_stash; + odp_dma_transfer_id_t ids[burst_size], id; + int32_t num; + odp_dma_t dma_handle = config->dma_handle; + odp_dma_result_t res; + int ret; + odp_buffer_t buf; + transfer_t *trs; + pktio_t *pktio; + int num_sent; + stats_t *stats = &config->stats; + + while (true) { + num = odp_stash_get(stash_handle, &ids, burst_size); + + if (num <= 0) + break; + + for (int32_t i = 0; i < num; ++i) { + id = ids[i]; + ret = odp_dma_transfer_done(dma_handle, id, &res); + + if (ret == 0) { + if (odp_unlikely(odp_stash_put(stash_handle, &id, 1) != 1)) + /* Should not happen, but make it visible if it somehow + * does */ + ODPH_ABORT("DMA inflight transfer stash overflow," + " aborting"); + + ++stats->trs_polled; + continue; + } + + odp_dma_transfer_id_free(dma_handle, id); + + if (ret < 0) { + ++stats->trs_poll_errs; + continue; + } + + buf = (odp_buffer_t)res.user_ptr; + trs = (transfer_t *)odp_buffer_addr(buf); + + if (res.success) { + pktio = trs->pktio; + num_sent = send_packets(pktio->out_qs[config->thr_idx % + pktio->num_out_qs], + trs->dst_pkts, trs->num); + ++stats->trs; + stats->fwd_pkts += num_sent; + stats->discards += trs->num - num_sent; + } else { + odp_packet_free_multi(trs->dst_pkts, trs->num); + ++stats->trs_errs; + } + + odp_packet_free_multi(trs->src_pkts, trs->num); + odp_buffer_free(buf); + } + } +} + +static inline void send_dma_ev_trs_pkts(odp_dma_compl_t compl_ev, thread_config_t *config) { odp_dma_result_t res; odp_buffer_t buf; @@ -891,6 +1125,7 @@ static int process_packets(void *args) pkt_vec_t pkt_vecs[num_ifs], *pkt_vec; odp_atomic_u32_t *is_running = &config->prog_config->is_running; uint64_t c1, c2, c3, c4, cdiff = 0U, rounds = 0U; + const uint8_t copy_type = config->prog_config->copy_type; const int burst_size = config->prog_config->burst_size; odp_event_t evs[burst_size]; int num_evs; @@ -918,6 +1153,9 @@ static int process_packets(void *args) cdiff += odp_cpu_cycles_diff(c4, c3); ++rounds; + if (copy_type == DMA_COPY_POLL) + send_dma_poll_trs_pkts(burst_size, config); + if (num_evs == 0) continue; @@ -926,7 +1164,7 @@ static int process_packets(void *args) type = odp_event_type(ev); if (type == ODP_EVENT_DMA_COMPL) { - send_dma_trs_packets(odp_dma_compl_from_event(ev), config); + send_dma_ev_trs_pkts(odp_dma_compl_from_event(ev), config); } else if (type == ODP_EVENT_PACKET) { push_packet(odp_packet_from_event(ev), pkt_vecs, pktio_map); } else { @@ -954,7 +1192,7 @@ static int process_packets(void *args) odp_barrier_wait(&config->prog_config->term_barrier); if (config->prog_config->drain_fn) - config->prog_config->drain_fn(); + config->prog_config->drain_fn(config); return 0; } @@ -1035,6 +1273,9 @@ static void teardown(prog_config_t *config) for (int i = 0; i < config->num_thrs; ++i) { thr = &config->thread_config[i]; + if (thr->inflight_stash != ODP_STASH_INVALID) + (void)odp_stash_destroy(thr->inflight_stash); + if (thr->compl_q != ODP_QUEUE_INVALID) (void)odp_queue_destroy(thr->compl_q); @@ -1091,8 +1332,11 @@ static void print_stats(const prog_config_t *config) printf(" completion event allocation errors: %" PRIu64 "\n", stats->compl_alloc_errs); else - printf(" transfer ID allocation errors: %" PRIu64 "\n", - stats->compl_alloc_errs); + printf(" transfer ID allocation errors: %" PRIu64 "\n" + " transfer poll errors: %" PRIu64 "\n" + " transfers polled: %" PRIu64 "\n", + stats->compl_alloc_errs, stats->trs_poll_errs, + stats->trs_polled); } printf(" packets forwarded:%s%" PRIu64 "\n" From df6b07e853430420e67b7f71c9b607393f0e9590 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Fri, 15 Sep 2023 08:51:12 +0000 Subject: [PATCH 085/192] test: dmafwd: tune DMA transfer buffer and completion event pool counts Transfer buffer and DMA completion event pools should be able to accommodate maximum inflight DMA transfer count of buffers/events. Change relevant pool creations accordingly. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- test/performance/odp_dmafwd.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c index 987313f1f3..b36b81b6ac 100644 --- a/test/performance/odp_dmafwd.c +++ b/test/performance/odp_dmafwd.c @@ -371,6 +371,12 @@ static parse_result_t check_options(prog_config_t *config) config->num_thrs, dma_capa.pool.max_pools); return PRS_NOK; } + + if (config->num_inflight > dma_capa.pool.max_num) { + ODPH_ERR("Invalid amount of DMA completion events: %u (max: %u)\n", + config->num_inflight, dma_capa.pool.max_num); + return PRS_NOK; + } } else if (config->copy_type == DMA_COPY_POLL) { if ((dma_capa.compl_mode_mask & ODP_DMA_COMPL_POLL) == 0U) { ODPH_ERR("Unsupported DMA completion mode: poll (mode support: %x)\n", @@ -439,6 +445,12 @@ static parse_result_t check_options(prog_config_t *config) return PRS_NOK; } + if (config->num_inflight > pool_capa.buf.max_num) { + ODPH_ERR("Invalid pool buffer count: %u (max: %u)\n", config->num_inflight, + pool_capa.buf.max_num); + return PRS_NOK; + } + config->trs_cache_size = MIN(MAX(config->cache_size, pool_capa.buf.min_cache_size), pool_capa.buf.max_cache_size); config->compl_cache_size = MIN(MAX(config->cache_size, dma_capa.pool.min_cache_size), @@ -839,7 +851,7 @@ static odp_bool_t setup_copy(prog_config_t *config) return true; } - pool_param.buf.num = config->num_pkts; + pool_param.buf.num = config->num_inflight; pool_param.buf.size = sizeof(transfer_t); pool_param.buf.cache_size = config->trs_cache_size; pool_param.type = ODP_POOL_BUFFER; @@ -863,7 +875,7 @@ static odp_bool_t setup_copy(prog_config_t *config) if (config->copy_type == DMA_COPY_EV) { odp_dma_pool_param_init(&compl_pool_param); - compl_pool_param.num = config->num_pkts; + compl_pool_param.num = config->num_inflight; compl_pool_param.cache_size = config->compl_cache_size; thr->compl_pool = odp_dma_pool_create(PROG_NAME "_dma_compl", &compl_pool_param); From 024880587cf1501d20e3f450ddda635ed82579cd Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Fri, 15 Sep 2023 09:22:08 +0000 Subject: [PATCH 086/192] test: dmafwd: update runner script Add test run for new DMA poll mode. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- test/performance/odp_dmafwd_run.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/performance/odp_dmafwd_run.sh b/test/performance/odp_dmafwd_run.sh index 85a2c20f1c..fa629bd0c0 100755 --- a/test/performance/odp_dmafwd_run.sh +++ b/test/performance/odp_dmafwd_run.sh @@ -60,9 +60,13 @@ echo "${BIN_NAME}: SW copy" echo "===================" ./${BIN_NAME}${EXEEXT} -i ${IF0} -b ${BATCH} -T ${TIME} -t 0 check_result $? -echo "${BIN_NAME}: DMA copy" +echo "${BIN_NAME}: DMA copy event" echo "====================" ./${BIN_NAME}${EXEEXT} -i ${IF0} -b ${BATCH} -T ${TIME} -t 1 check_result $? +echo "${BIN_NAME}: DMA copy poll" +echo "====================" +./${BIN_NAME}${EXEEXT} -i ${IF0} -b ${BATCH} -T ${TIME} -t 2 +check_result $? cleanup_interfaces check_exit From 09208042ef066e3e0a6949a67f63eb2640f0ae50 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Fri, 29 Sep 2023 08:07:01 +0000 Subject: [PATCH 087/192] linux-gen: dma: fix potential session leak In case of stash creation failure during DMA session creation, reset the session activity state to inactive to prevent a session leak. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- platform/linux-generic/odp_dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_dma.c b/platform/linux-generic/odp_dma.c index 8ac18260ce..82d7370736 100644 --- a/platform/linux-generic/odp_dma.c +++ b/platform/linux-generic/odp_dma.c @@ -252,8 +252,10 @@ odp_dma_t odp_dma_create(const char *name, const odp_dma_param_t *param) if (param->compl_mode_mask & ODP_DMA_COMPL_POLL) { session->stash = create_stash(); - if (session->stash == ODP_STASH_INVALID) + if (session->stash == ODP_STASH_INVALID) { + session->active = 0; return ODP_DMA_INVALID; + } } session->name[0] = 0; From ed7747383d6a0c5e06bbe6e18aa345b4ab9a75d2 Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Fri, 29 Sep 2023 07:06:23 +0000 Subject: [PATCH 088/192] test: dmafwd: reorder cache size calculations Move pool and stash cache calculations inside branches where related logic resides, preventing uninitialized value usage. The actual uninitialized usage is prevented later and does not cause any runtime issues. Nevertheless, this is now properly handled during startup. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- test/performance/odp_dmafwd.c | 39 +++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c index b36b81b6ac..5e0d4366db 100644 --- a/test/performance/odp_dmafwd.c +++ b/test/performance/odp_dmafwd.c @@ -357,6 +357,22 @@ static parse_result_t check_options(prog_config_t *config) config->num_inflight = dma_capa.max_transfers; + if (odp_pool_capability(&pool_capa) < 0) { + ODPH_ERR("Error querying pool capabilities\n"); + return PRS_NOK; + } + + if (config->cache_size < pool_capa.pkt.min_cache_size || + config->cache_size > pool_capa.pkt.max_cache_size) { + ODPH_ERR("Invalid pool cache size: %u (min: %u, max: %u)\n", config->cache_size, + pool_capa.pkt.min_cache_size, pool_capa.pkt.max_cache_size); + return PRS_NOK; + } + + if (config->copy_type != SW_COPY) + config->trs_cache_size = MIN(MAX(config->cache_size, pool_capa.buf.min_cache_size), + pool_capa.buf.max_cache_size); + if (config->copy_type == DMA_COPY_EV) { if ((dma_capa.compl_mode_mask & ODP_DMA_COMPL_EVENT) == 0U || !dma_capa.queue_type_sched) { @@ -377,6 +393,10 @@ static parse_result_t check_options(prog_config_t *config) config->num_inflight, dma_capa.pool.max_num); return PRS_NOK; } + + config->compl_cache_size = MIN(MAX(config->cache_size, + dma_capa.pool.min_cache_size), + dma_capa.pool.max_cache_size); } else if (config->copy_type == DMA_COPY_POLL) { if ((dma_capa.compl_mode_mask & ODP_DMA_COMPL_POLL) == 0U) { ODPH_ERR("Unsupported DMA completion mode: poll (mode support: %x)\n", @@ -417,11 +437,7 @@ static parse_result_t check_options(prog_config_t *config) } config->inflight_obj_size = obj_size; - } - - if (odp_pool_capability(&pool_capa) < 0) { - ODPH_ERR("Error querying pool capabilities\n"); - return PRS_NOK; + config->stash_cache_size = MIN(config->cache_size, stash_capa.max_cache_size); } if (config->num_pkts == 0U || @@ -438,25 +454,12 @@ static parse_result_t check_options(prog_config_t *config) return PRS_NOK; } - if (config->cache_size < pool_capa.pkt.min_cache_size || - config->cache_size > pool_capa.pkt.max_cache_size) { - ODPH_ERR("Invalid pool cache size: %u (min: %u, max: %u)\n", config->cache_size, - pool_capa.pkt.min_cache_size, pool_capa.pkt.max_cache_size); - return PRS_NOK; - } - if (config->num_inflight > pool_capa.buf.max_num) { ODPH_ERR("Invalid pool buffer count: %u (max: %u)\n", config->num_inflight, pool_capa.buf.max_num); return PRS_NOK; } - config->trs_cache_size = MIN(MAX(config->cache_size, pool_capa.buf.min_cache_size), - pool_capa.buf.max_cache_size); - config->compl_cache_size = MIN(MAX(config->cache_size, dma_capa.pool.min_cache_size), - dma_capa.pool.max_cache_size); - config->stash_cache_size = MIN(config->cache_size, stash_capa.max_cache_size); - return PRS_OK; } From 6f6488e251099af7bfd9f2aa32cd33e6c5b4b26e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= Date: Thu, 31 Aug 2023 14:48:19 +0300 Subject: [PATCH 089/192] validation: timer: test timeout event reuse with periodic timer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When starting again a canceled periodic timer, test also event reuse. Instead of freeing the last timeout event and allocating a new one, just reuse the event. Signed-off-by: Jere Leppänen Reviewed-by: Matias Elo --- test/validation/api/timer/timer.c | 34 +++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index ac65aac2b2..955e14cf8b 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -2775,7 +2775,8 @@ static void timer_test_periodic_capa(void) } } -static void timer_test_periodic(odp_queue_type_t queue_type, int use_first, int rounds) +static void timer_test_periodic(odp_queue_type_t queue_type, int use_first, int rounds, + int reuse_event) { odp_timer_capability_t timer_capa; odp_timer_periodic_capability_t periodic_capa; @@ -2787,7 +2788,7 @@ static void timer_test_periodic(odp_queue_type_t queue_type, int use_first, int odp_timer_periodic_start_t start_param; odp_queue_t queue; odp_timeout_t tmo; - odp_event_t ev; + odp_event_t ev = ODP_EVENT_INVALID; odp_timer_t timer; odp_time_t t1, t2; uint64_t tick, cur_tick, period_ns, duration_ns, diff_ns, offset_ns; @@ -2918,10 +2919,12 @@ static void timer_test_periodic(odp_queue_type_t queue_type, int use_first, int num_tmo = 0; done = 0; - tmo = odp_timeout_alloc(pool); - ev = odp_timeout_to_event(tmo); - CU_ASSERT_FATAL(ev != ODP_EVENT_INVALID); + if (!reuse_event || round == 0) { + tmo = odp_timeout_alloc(pool); + ev = odp_timeout_to_event(tmo); + } + CU_ASSERT_FATAL(ev != ODP_EVENT_INVALID); cur_tick = odp_timer_current_tick(timer_pool); tick = cur_tick + odp_timer_ns_to_tick(timer_pool, offset_ns); @@ -3023,8 +3026,10 @@ static void timer_test_periodic(odp_queue_type_t queue_type, int use_first, int CU_ASSERT(ret == 1 || ret == 2); if (ret == 2) { - odp_event_free(ev); done = 1; + if (reuse_event && round < rounds - 1) + break; + odp_event_free(ev); } } @@ -3041,27 +3046,32 @@ static void timer_test_periodic(odp_queue_type_t queue_type, int use_first, int static void timer_test_periodic_sched(void) { - timer_test_periodic(ODP_QUEUE_TYPE_SCHED, 0, 1); + timer_test_periodic(ODP_QUEUE_TYPE_SCHED, 0, 1, 0); } static void timer_test_periodic_plain(void) { - timer_test_periodic(ODP_QUEUE_TYPE_PLAIN, 0, 1); + timer_test_periodic(ODP_QUEUE_TYPE_PLAIN, 0, 1, 0); } static void timer_test_periodic_sched_first(void) { - timer_test_periodic(ODP_QUEUE_TYPE_SCHED, FIRST_TICK, 1); + timer_test_periodic(ODP_QUEUE_TYPE_SCHED, FIRST_TICK, 1, 0); } static void timer_test_periodic_plain_first(void) { - timer_test_periodic(ODP_QUEUE_TYPE_PLAIN, FIRST_TICK, 1); + timer_test_periodic(ODP_QUEUE_TYPE_PLAIN, FIRST_TICK, 1, 0); } static void timer_test_periodic_reuse(void) { - timer_test_periodic(ODP_QUEUE_TYPE_SCHED, 0, 2); + timer_test_periodic(ODP_QUEUE_TYPE_SCHED, 0, 2, 0); +} + +static void timer_test_periodic_event_reuse(void) +{ + timer_test_periodic(ODP_QUEUE_TYPE_SCHED, 0, 2, 1); } odp_testinfo_t timer_suite[] = { @@ -3158,6 +3168,8 @@ odp_testinfo_t timer_suite[] = { check_periodic_plain_support), ODP_TEST_INFO_CONDITIONAL(timer_test_periodic_reuse, check_periodic_sched_support), + ODP_TEST_INFO_CONDITIONAL(timer_test_periodic_event_reuse, + check_periodic_sched_support), ODP_TEST_INFO_NULL, }; From ca644509391e5c09483653fb5b0b954c3916895c Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Tue, 3 Oct 2023 10:26:59 +0300 Subject: [PATCH 090/192] test: performance: add timed benchmark framework variant Add new benchmark framework variant for measuring function call latencies. With the new framework latency measurements are performed within each test case and a single test case may include multiple measured functions. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- test/performance/bench_common.c | 107 +++++++++++++++++++++++++++++ test/performance/bench_common.h | 118 +++++++++++++++++++++++++++++++- 2 files changed, 222 insertions(+), 3 deletions(-) diff --git a/test/performance/bench_common.c b/test/performance/bench_common.c index acb70038c2..1d3567fd4a 100644 --- a/test/performance/bench_common.c +++ b/test/performance/bench_common.c @@ -136,3 +136,110 @@ int bench_run(void *arg) return 0; } + +void bench_tm_suite_init(bench_tm_suite_t *suite) +{ + memset(suite, 0, sizeof(bench_suite_t)); + + odp_atomic_init_u32(&suite->exit_worker, 0); +} + +uint8_t bench_tm_func_register(bench_tm_result_t *res, const char *func_name) +{ + uint8_t num_func = res->num; + + if (num_func >= BENCH_TM_MAX_FUNC) + ODPH_ABORT("Too many test functions (max %d)\n", BENCH_TM_MAX_FUNC); + + res->func[num_func].name = func_name; + res->num++; + + return num_func; +} + +void bench_tm_func_record(odp_time_t t2, odp_time_t t1, bench_tm_result_t *res, uint8_t id) +{ + odp_time_t diff = odp_time_diff(t2, t1); + + ODPH_ASSERT(id < BENCH_TM_MAX_FUNC); + + res->func[id].tot = odp_time_sum(res->func[id].tot, diff); + + if (odp_time_cmp(diff, res->func[id].min) < 0) + res->func[id].min = diff; + + if (odp_time_cmp(diff, res->func[id].max) > 0) + res->func[id].max = diff; +} + +static void init_result(bench_tm_result_t *res) +{ + memset(res, 0, sizeof(bench_tm_result_t)); + + for (int i = 0; i < BENCH_TM_MAX_FUNC; i++) { + res->func[i].tot = ODP_TIME_NULL; + res->func[i].min = odp_time_local_from_ns(ODP_TIME_HOUR_IN_NS); + res->func[i].max = ODP_TIME_NULL; + } +} + +static void print_results(bench_tm_result_t *res, uint64_t repeat_count) +{ + for (uint8_t i = 0; i < res->num; i++) { + printf(" %-38s %-12" PRIu64 " %-12" PRIu64 " %-12" PRIu64 "\n", + res->func[i].name, + odp_time_to_ns(res->func[i].min), + odp_time_to_ns(res->func[i].tot) / repeat_count, + odp_time_to_ns(res->func[i].max)); + } +} + +int bench_tm_run(void *arg) +{ + bench_tm_suite_t *suite = arg; + + printf("\nLatency (nsec) per function call min avg max\n"); + printf("------------------------------------------------------------------------------\n"); + + /* Run each test twice. Results from the first warm-up round are ignored. */ + for (uint32_t i = 0; i < 2; i++) { + for (uint32_t j = 0; j < suite->num_bench; j++) { + const bench_tm_info_t *bench = &suite->bench[j]; + uint64_t rounds = suite->rounds; + bench_tm_result_t res; + + if (odp_atomic_load_u32(&suite->exit_worker)) + return 0; + + /* Run only selected test case */ + if (suite->bench_idx && (j + 1) != suite->bench_idx) + continue; + + if (bench->max_rounds && bench->max_rounds < rounds) + rounds = bench->max_rounds; + + init_result(&res); + + if (bench->init != NULL) + bench->init(); + + if (bench->run(&res, rounds)) { + ODPH_ERR("Benchmark %s failed\n", bench->name); + suite->retval = -1; + return -1; + } + + if (bench->term != NULL) + bench->term(); + + /* No print or results from warm-up round */ + if (i > 0) { + printf("[%02d] %-26s\n", j + 1, bench->name); + print_results(&res, rounds); + } + } + } + printf("\n"); + + return 0; +} diff --git a/test/performance/bench_common.h b/test/performance/bench_common.h index d33bd3b346..1797266b54 100644 --- a/test/performance/bench_common.h +++ b/test/performance/bench_common.h @@ -17,7 +17,7 @@ extern "C" { /** * Check benchmark preconditions * - * @retval !0 test enabled + * Returns !0 if benchmark precondition is met. */ typedef int (*bench_cond_fn_t)(void); @@ -29,7 +29,7 @@ typedef void (*bench_init_fn_t)(void); /** * Run benchmark * - * @retval >0 on success + * Returns >0 on success. */ typedef int (*bench_run_fn_t)(void); @@ -108,10 +108,122 @@ void bench_suite_init(bench_suite_t *suite); void bench_run_indef(bench_info_t *info, odp_atomic_u32_t *exit_thread); /** - * Run tests suite and print results + * Run test suite and print results + * + * The argument is of type 'bench_suite_t *'. Returns 0 on success and <0 on failure. */ int bench_run(void *arg); +/* + * Timed benchmark framework + * + * The main difference compared to the standard benchmark suite is that all + * latency measurements are performed inside the test cases. + */ + +/* Maximum number of benchmarked functions per test case */ +#define BENCH_TM_MAX_FUNC 8 + +/* Timed benchmark results */ +typedef struct bench_tm_results_s { + /* Results per function */ + struct { + /* Name of function */ + const char *name; + + /* Total duration of all function calls */ + odp_time_t tot; + + /* Minimum duration */ + odp_time_t min; + + /* Maximum duration */ + odp_time_t max; + + } func[BENCH_TM_MAX_FUNC]; + + /* Number of registered test functions */ + uint8_t num; + +} bench_tm_result_t; + +/** + * Timed benchmark test case + * + * Returns 0 on success and <0 on failure. + */ +typedef int (*bench_tm_run_fn_t)(bench_tm_result_t *res, int repeat_count); + +/* Timed benchmark test case */ +typedef struct { + /* Test case name */ + const char *name; + + /* Optional test initializer function */ + bench_init_fn_t init; + + /* Test function to run */ + bench_tm_run_fn_t run; + + /* Optional test termination function */ + bench_term_fn_t term; + + /* Optional test specific limit for rounds (tuning for slow implementations) */ + uint32_t max_rounds; + +} bench_tm_info_t; + +/* Timed benchmark suite data */ +typedef struct { + /* Array of benchmark test cases */ + bench_tm_info_t *bench; + + /* Number of benchmark test cases */ + uint32_t num_bench; + + /* Optional benchmark index to run (1...num_bench) */ + uint32_t bench_idx; + + /* Suite exit value output */ + int retval; + + /* Number of rounds per test case */ + uint64_t rounds; + + /* Break worker loop if set to 1 */ + odp_atomic_u32_t exit_worker; + +} bench_tm_suite_t; + +/** + * Initialize benchmark suite data + */ +void bench_tm_suite_init(bench_tm_suite_t *suite); + +/** + * Register function for benchmarking + * + * Called by each test case to register benchmarked functions. Returns function + * ID for recording benchmark results. At most BENCH_TM_MAX_FUNC functions can + * be registered per test case. + */ +uint8_t bench_tm_func_register(bench_tm_result_t *res, const char *func_name); + +/** + * Record results for previously registered function + * + * Test case must call this function every test round for each registered + * function. + */ +void bench_tm_func_record(odp_time_t t2, odp_time_t t1, bench_tm_result_t *res, uint8_t id); + +/** + * Run timed test suite and print results + * + * The argument is of type 'bench_tm_suite_t *'. Returns 0 on success and <0 on failure. + */ +int bench_tm_run(void *arg); + #ifdef __cplusplus } #endif From 4492645b79aeed17ef7a83e4a064b5894a1853aa Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Tue, 3 Oct 2023 10:27:38 +0300 Subject: [PATCH 091/192] test: performance: add pktio slow path function benchmark application Add new odp_bench_pktio_sp application for measuring delays of ODP pktio slow path functions. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- test/performance/.gitignore | 1 + test/performance/Makefile.am | 2 + test/performance/odp_bench_pktio_sp.c | 963 ++++++++++++++++++++++++++ 3 files changed, 966 insertions(+) create mode 100644 test/performance/odp_bench_pktio_sp.c diff --git a/test/performance/.gitignore b/test/performance/.gitignore index 18b7a4230a..08a4d56097 100644 --- a/test/performance/.gitignore +++ b/test/performance/.gitignore @@ -5,6 +5,7 @@ odp_atomic_perf odp_bench_buffer odp_bench_misc odp_bench_packet +odp_bench_pktio_sp odp_bench_timer odp_cpu_bench odp_crc diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am index ded16bce59..7b0adbe090 100644 --- a/test/performance/Makefile.am +++ b/test/performance/Makefile.am @@ -6,6 +6,7 @@ EXECUTABLES = odp_atomic_perf \ odp_bench_buffer \ odp_bench_misc \ odp_bench_packet \ + odp_bench_pktio_sp \ odp_bench_timer \ odp_crc \ odp_lock_perf \ @@ -64,6 +65,7 @@ odp_atomic_perf_SOURCES = odp_atomic_perf.c odp_bench_buffer_SOURCES = odp_bench_buffer.c bench_common.c bench_common.h odp_bench_misc_SOURCES = odp_bench_misc.c bench_common.c bench_common.h odp_bench_packet_SOURCES = odp_bench_packet.c bench_common.c bench_common.h +odp_bench_pktio_sp_SOURCES = odp_bench_pktio_sp.c bench_common.c bench_common.h odp_bench_timer_SOURCES = odp_bench_timer.c bench_common.c bench_common.h odp_cpu_bench_SOURCES = odp_cpu_bench.c odp_crc_SOURCES = odp_crc.c diff --git a/test/performance/odp_bench_pktio_sp.c b/test/performance/odp_bench_pktio_sp.c new file mode 100644 index 0000000000..859abcd76f --- /dev/null +++ b/test/performance/odp_bench_pktio_sp.c @@ -0,0 +1,963 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia + */ + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE /* Needed for sigaction */ +#endif + +#include +#include + +#include "bench_common.h" + +#include +#include +#include +#include +#include + +/* Default number of rounds per test case */ +#define ROUNDS 100u + +/* Maximum interface name length */ +#define MAX_NAME_LEN 128 + +#define BENCH_INFO(run_fn, init_fn, term_fn, rounds) \ + {.name = #run_fn, .run = run_fn, .init = init_fn, .term = term_fn, \ + .max_rounds = rounds} + +typedef struct { + /* Command line options */ + struct { + /* Rounds per test case */ + uint32_t rounds; + + /* Test case index to run */ + uint32_t case_idx; + + /* Interface name */ + char name[MAX_NAME_LEN]; + + /* Packet input mode */ + odp_pktin_mode_t in_mode; + + /* Packet output mode */ + odp_pktout_mode_t out_mode; + + /* Number of packet input queues */ + uint32_t num_input_queues; + + /* Number of packet output queues */ + uint32_t num_output_queues; + } opt; + + /* Packet IO device */ + odp_pktio_t pktio; + + /* Packet IO capability*/ + odp_pktio_capability_t capa; + + /* Packet pool */ + odp_pool_t pool; + + /* Packet IO statistics */ + odp_pktio_stats_t stats; + + /* Input queue statistics */ + odp_pktin_queue_stats_t pktin_queue_stats; + + /* Output queue statistics */ + odp_pktout_queue_stats_t pktout_queue_stats; + + /* Common benchmark suite data */ + bench_tm_suite_t suite; + + /* CPU mask as string */ + char cpumask_str[ODP_CPUMASK_STR_SIZE]; + +} appl_args_t; + +static appl_args_t *gbl_args; + +static void sig_handler(int signo ODP_UNUSED) +{ + if (gbl_args == NULL) + return; + odp_atomic_store_u32(&gbl_args->suite.exit_worker, 1); +} + +static int setup_sig_handler(void) +{ + struct sigaction action; + + memset(&action, 0, sizeof(action)); + action.sa_handler = sig_handler; + + /* No additional signals blocked. By default, the signal which triggered + * the handler is blocked. */ + if (sigemptyset(&action.sa_mask)) + return -1; + + if (sigaction(SIGINT, &action, NULL)) + return -1; + + return 0; +} + +static void clean_pending_events(appl_args_t *appl_args) +{ + if (appl_args->opt.in_mode != ODP_PKTIN_MODE_SCHED) + return; + + while (1) { + odp_event_t event = odp_schedule(NULL, odp_schedule_wait_time(ODP_TIME_MSEC_IN_NS)); + + if (event != ODP_EVENT_INVALID) { + odp_event_free(event); + continue; + } + break; + }; +} + +static odp_pool_t create_packet_pool(void) +{ + odp_pool_capability_t capa; + odp_pool_param_t param; + odp_pool_t pool; + + if (odp_pool_capability(&capa)) + ODPH_ABORT("Reading pool capabilities failed\n"); + + odp_pool_param_init(¶m); + param.type = ODP_POOL_PACKET; + param.pkt.num = 512; + param.pkt.len = 2048; + + if (capa.pkt.max_num && capa.pkt.max_num < param.pkt.num) + param.pkt.num = capa.pkt.max_num; + + if (capa.pkt.max_len && capa.pkt.max_len < param.pkt.len) + param.pkt.len = capa.pkt.max_len; + + pool = odp_pool_create("pktio_pool", ¶m); + if (pool == ODP_POOL_INVALID) + ODPH_ABORT("Creating packet pool failed\n"); + + return pool; +} + +static void pktio_setup(void) +{ + appl_args_t *appl_args = gbl_args; + odp_pktio_param_t param; + odp_pktin_queue_param_t pktin_param; + odp_pktout_queue_param_t pktout_param; + odp_pktio_t pktio; + odp_pool_t pool; + int ret; + + pool = create_packet_pool(); + + odp_pktio_param_init(¶m); + param.in_mode = appl_args->opt.in_mode; + param.out_mode = appl_args->opt.out_mode; + + pktio = odp_pktio_open(appl_args->opt.name, pool, ¶m); + if (pktio == ODP_PKTIO_INVALID) + ODPH_ABORT("Opening pktio failed\n"); + + odp_pktin_queue_param_init(&pktin_param); + pktin_param.num_queues = appl_args->opt.num_input_queues; + if (pktin_param.num_queues > 1) { + pktin_param.hash_enable = true; + pktin_param.hash_proto.proto.ipv4_udp = 1; + } + + odp_pktout_queue_param_init(&pktout_param); + pktout_param.num_queues = appl_args->opt.num_output_queues; + + ret = odp_pktin_queue_config(pktio, &pktin_param); + if (ret) + ODPH_ABORT("Configuring packet input queues failed: %d\n", ret); + + ret = odp_pktout_queue_config(pktio, &pktout_param); + if (ret) + ODPH_ABORT("Configuring packet output queues failed: %d\n", ret); + + ret = odp_pktio_start(pktio); + if (ret) + ODPH_ABORT("Starting pktio failed: %d\n", ret); + + appl_args->pool = pool; + appl_args->pktio = pktio; +} + +static void pktio_setup_direct_rx(void) +{ + appl_args_t *appl_args = gbl_args; + odp_pktin_mode_t mode_orig = appl_args->opt.in_mode; + + appl_args->opt.in_mode = ODP_PKTIN_MODE_DIRECT; + pktio_setup(); + appl_args->opt.in_mode = mode_orig; +} + +static void pktio_setup_sched_rx(void) +{ + appl_args_t *appl_args = gbl_args; + odp_pktin_mode_t mode_orig = appl_args->opt.in_mode; + + appl_args->opt.in_mode = ODP_PKTIN_MODE_SCHED; + pktio_setup(); + appl_args->opt.in_mode = mode_orig; +} + +static void pktio_setup_direct_tx(void) +{ + appl_args_t *appl_args = gbl_args; + odp_pktout_mode_t mode_orig = appl_args->opt.out_mode; + + appl_args->opt.out_mode = ODP_PKTOUT_MODE_DIRECT; + pktio_setup(); + appl_args->opt.out_mode = mode_orig; +} + +static void pktio_setup_queue_tx(void) +{ + appl_args_t *appl_args = gbl_args; + odp_pktout_mode_t mode_orig = appl_args->opt.out_mode; + + appl_args->opt.out_mode = ODP_PKTOUT_MODE_QUEUE; + pktio_setup(); + appl_args->opt.out_mode = mode_orig; +} + +static void pktio_clean(void) +{ + appl_args_t *appl_args = gbl_args; + int ret; + + ret = odp_pktio_stop(appl_args->pktio); + if (ret) + ODPH_ABORT("Stopping pktio failed: %d\n", ret); + + /* Clean possible pre-scheduled packets */ + clean_pending_events(appl_args); + + ret = odp_pktio_close(appl_args->pktio); + if (ret) + ODPH_ABORT("Closing pktio failed: %d\n", ret); + + ret = odp_pool_destroy(appl_args->pool); + if (ret) + ODPH_ABORT("Destroying pktio pool failed: %d\n", ret); +} + +static void pktio_clean_direct_rx(void) +{ + appl_args_t *appl_args = gbl_args; + odp_pktin_mode_t mode_orig = appl_args->opt.in_mode; + + appl_args->opt.in_mode = ODP_PKTIN_MODE_DIRECT; + pktio_clean(); + appl_args->opt.in_mode = mode_orig; +} + +static void pktio_clean_sched_rx(void) +{ + appl_args_t *appl_args = gbl_args; + odp_pktin_mode_t mode_orig = appl_args->opt.in_mode; + + appl_args->opt.in_mode = ODP_PKTIN_MODE_SCHED; + pktio_clean(); + appl_args->opt.in_mode = mode_orig; +} + +static void pktio_clean_direct_tx(void) +{ + appl_args_t *appl_args = gbl_args; + odp_pktout_mode_t mode_orig = appl_args->opt.out_mode; + + appl_args->opt.out_mode = ODP_PKTOUT_MODE_DIRECT; + pktio_clean(); + appl_args->opt.out_mode = mode_orig; +} + +static void pktio_clean_queue_tx(void) +{ + appl_args_t *appl_args = gbl_args; + odp_pktout_mode_t mode_orig = appl_args->opt.out_mode; + + appl_args->opt.out_mode = ODP_PKTOUT_MODE_QUEUE; + pktio_clean(); + appl_args->opt.out_mode = mode_orig; +} + +static int pktio_capability(bench_tm_result_t *res, int repeat_count) +{ + appl_args_t *appl_args = gbl_args; + odp_pktio_capability_t *capa = &appl_args->capa; + odp_pktio_t pktio = appl_args->pktio; + odp_time_t t1, t2; + int ret; + uint8_t id1 = bench_tm_func_register(res, "odp_pktio_capability()"); + + for (int i = 0; i < repeat_count; i++) { + t1 = odp_time_local_strict(); + ret = odp_pktio_capability(pktio, capa); + t2 = odp_time_local_strict(); + + if (ret) { + ODPH_ERR("Reading pktio capa failed: %d\n", ret); + return -1; + } + + bench_tm_func_record(t2, t1, res, id1); + } + return 0; +} + +static int pktio_lookup(bench_tm_result_t *res, int repeat_count) +{ + appl_args_t *appl_args = gbl_args; + const char *name = appl_args->opt.name; + odp_pktio_t pktio; + odp_time_t t1, t2; + uint8_t id1 = bench_tm_func_register(res, "odp_pktio_lookup()"); + + for (int i = 0; i < repeat_count; i++) { + t1 = odp_time_local_strict(); + pktio = odp_pktio_lookup(name); + t2 = odp_time_local_strict(); + + if (pktio == ODP_PKTIO_INVALID) { + ODPH_ERR("Pktio lookup failed\n"); + return -1; + } + + bench_tm_func_record(t2, t1, res, id1); + } + return 0; +} + +static int pktio_open_start_stop_close(bench_tm_result_t *res, int repeat_count) +{ + appl_args_t *appl_args = gbl_args; + odp_pktio_param_t param; + odp_pktin_queue_param_t pktin_param; + odp_pktout_queue_param_t pktout_param; + odp_pktio_t pktio; + odp_pool_t pool; + odp_time_t t1, t2, t3, t4, t5, t6, t7, t8; + int ret; + uint8_t id1 = bench_tm_func_register(res, "odp_pktio_open()"); + uint8_t id2 = bench_tm_func_register(res, "odp_pktin_queue_config()"); + uint8_t id3 = bench_tm_func_register(res, "odp_pktout_queue_config()"); + uint8_t id4 = bench_tm_func_register(res, "odp_pktio_start()"); + uint8_t id5 = bench_tm_func_register(res, "odp_pktio_stop()"); + uint8_t id6 = bench_tm_func_register(res, "odp_pktio_close()"); + + pool = create_packet_pool(); + + odp_pktio_param_init(¶m); + param.in_mode = appl_args->opt.in_mode; + param.out_mode = appl_args->opt.out_mode; + + odp_pktin_queue_param_init(&pktin_param); + pktin_param.num_queues = appl_args->opt.num_input_queues; + if (pktin_param.num_queues > 1) { + pktin_param.hash_enable = true; + pktin_param.hash_proto.proto.ipv4_udp = 1; + } + + odp_pktout_queue_param_init(&pktout_param); + pktout_param.num_queues = appl_args->opt.num_output_queues; + + for (int i = 0; i < repeat_count; i++) { + t1 = odp_time_local_strict(); + pktio = odp_pktio_open(appl_args->opt.name, pool, ¶m); + t2 = odp_time_local_strict(); + + if (pktio == ODP_PKTIO_INVALID) { + ODPH_ERR("Opening pktio failed\n"); + return -1; + } + + ret = odp_pktin_queue_config(pktio, &pktin_param); + t3 = odp_time_local_strict(); + + if (ret) { + ODPH_ERR("Configuring packet input queues failed: %d\n", ret); + return -1; + } + + ret = odp_pktout_queue_config(pktio, &pktout_param); + t4 = odp_time_local_strict(); + + if (ret) { + ODPH_ERR("Configuring packet output queues failed: %d\n", ret); + return -1; + } + + ret = odp_pktio_start(pktio); + t5 = odp_time_local_strict(); + + if (ret) { + ODPH_ERR("Starting pktio failed: %d\n", ret); + return -1; + } + + ret = odp_pktio_stop(pktio); + t6 = odp_time_local_strict(); + + if (ret) { + ODPH_ERR("Stopping pktio failed: %d\n", ret); + return -1; + } + + /* Clean possible pre-scheduled packets */ + clean_pending_events(appl_args); + + t7 = odp_time_local_strict(); + ret = odp_pktio_close(pktio); + t8 = odp_time_local_strict(); + if (ret) { + ODPH_ERR("Closing pktio failed: %d\n", ret); + return -1; + } + + bench_tm_func_record(t2, t1, res, id1); + bench_tm_func_record(t3, t2, res, id2); + bench_tm_func_record(t4, t3, res, id3); + bench_tm_func_record(t5, t4, res, id4); + bench_tm_func_record(t6, t5, res, id5); + bench_tm_func_record(t8, t7, res, id6); + } + + ret = odp_pool_destroy(pool); + if (ret) { + ODPH_ERR("Destroying pktio pool failed: %d\n", ret); + return -1; + } + return 0; +} + +static int pktio_stats(bench_tm_result_t *res, int repeat_count) +{ + appl_args_t *appl_args = gbl_args; + odp_pktio_stats_t *stats = &appl_args->stats; + odp_pktio_t pktio = appl_args->pktio; + odp_time_t t1, t2; + int ret; + uint8_t id1 = bench_tm_func_register(res, "odp_pktio_stats()"); + + for (int i = 0; i < repeat_count; i++) { + t1 = odp_time_local_strict(); + ret = odp_pktio_stats(pktio, stats); + t2 = odp_time_local_strict(); + + if (ret) { + ODPH_ERR("Reading pktio stats failed\n"); + return -1; + } + + bench_tm_func_record(t2, t1, res, id1); + } + return 0; +} + +static int pktio_stats_reset(bench_tm_result_t *res, int repeat_count) +{ + appl_args_t *appl_args = gbl_args; + odp_pktio_t pktio = appl_args->pktio; + odp_time_t t1, t2; + int ret; + int id1 = bench_tm_func_register(res, "odp_pktio_stats_reset()"); + + for (int i = 0; i < repeat_count; i++) { + t1 = odp_time_local_strict(); + ret = odp_pktio_stats_reset(pktio); + t2 = odp_time_local_strict(); + + if (ret) { + ODPH_ERR("Resetting pktio stats failed\n"); + return -1; + } + + bench_tm_func_record(t2, t1, res, id1); + } + return 0; +} + +static int pktin_queue_stats(bench_tm_result_t *res, int repeat_count) +{ + appl_args_t *appl_args = gbl_args; + odp_pktin_queue_stats_t *stats = &appl_args->pktin_queue_stats; + odp_pktio_t pktio = appl_args->pktio; + odp_pktin_queue_t queue; + odp_time_t t1, t2; + int ret; + uint8_t id1 = bench_tm_func_register(res, "odp_pktin_queue_stats()"); + + ret = odp_pktin_queue(pktio, &queue, 1); + if (ret < 1) { + ODPH_ERR("Reading pktio input queue failed\n"); + return -1; + } + + for (int i = 0; i < repeat_count; i++) { + t1 = odp_time_local_strict(); + ret = odp_pktin_queue_stats(queue, stats); + t2 = odp_time_local_strict(); + + if (ret) { + ODPH_ERR("Reading pktio stats failed\n"); + return -1; + } + + bench_tm_func_record(t2, t1, res, id1); + } + return 0; +} + +static int pktin_event_queue_stats(bench_tm_result_t *res, int repeat_count) +{ + appl_args_t *appl_args = gbl_args; + odp_pktin_queue_stats_t *stats = &appl_args->pktin_queue_stats; + odp_pktio_t pktio = appl_args->pktio; + odp_queue_t queue; + odp_time_t t1, t2; + int ret; + uint8_t id1 = bench_tm_func_register(res, "odp_pktin_event_queue_stats()"); + + ret = odp_pktin_event_queue(pktio, &queue, 1); + if (ret < 1) { + ODPH_ERR("Reading pktio input queue failed\n"); + return -1; + } + + for (int i = 0; i < repeat_count; i++) { + t1 = odp_time_local_strict(); + ret = odp_pktin_event_queue_stats(pktio, queue, stats); + t2 = odp_time_local_strict(); + + if (ret) { + ODPH_ERR("Reading pktio stats failed\n"); + return -1; + } + + bench_tm_func_record(t2, t1, res, id1); + } + return 0; +} + +static int pktout_queue_stats(bench_tm_result_t *res, int repeat_count) +{ + appl_args_t *appl_args = gbl_args; + odp_pktout_queue_stats_t *stats = &appl_args->pktout_queue_stats; + odp_pktio_t pktio = appl_args->pktio; + odp_pktout_queue_t queue; + odp_time_t t1, t2; + int ret; + uint8_t id1 = bench_tm_func_register(res, "odp_pktout_queue_stats()"); + + ret = odp_pktout_queue(pktio, &queue, 1); + if (ret < 1) { + ODPH_ERR("Reading pktio input queue failed\n"); + return -1; + } + + for (int i = 0; i < repeat_count; i++) { + t1 = odp_time_local_strict(); + ret = odp_pktout_queue_stats(queue, stats); + t2 = odp_time_local_strict(); + + if (ret) { + ODPH_ERR("Reading pktio stats failed\n"); + return -1; + } + + bench_tm_func_record(t2, t1, res, id1); + } + return 0; +} + +static int pktout_event_queue_stats(bench_tm_result_t *res, int repeat_count) +{ + appl_args_t *appl_args = gbl_args; + odp_pktout_queue_stats_t *stats = &appl_args->pktout_queue_stats; + odp_pktio_t pktio = appl_args->pktio; + odp_queue_t queue; + odp_time_t t1, t2; + int ret; + uint8_t id1 = bench_tm_func_register(res, "odp_pktout_event_queue_stats()"); + + ret = odp_pktout_event_queue(pktio, &queue, 1); + if (ret < 1) { + ODPH_ERR("Reading pktio input queue failed\n"); + return -1; + } + + for (int i = 0; i < repeat_count; i++) { + t1 = odp_time_local_strict(); + ret = odp_pktout_event_queue_stats(pktio, queue, stats); + t2 = odp_time_local_strict(); + + if (ret) { + ODPH_ERR("Reading pktio stats failed\n"); + return -1; + } + + bench_tm_func_record(t2, t1, res, id1); + } + return 0; +} + +bench_tm_info_t test_suite[] = { + BENCH_INFO(pktio_capability, pktio_setup, pktio_clean, 0), + BENCH_INFO(pktio_lookup, pktio_setup, pktio_clean, 0), + BENCH_INFO(pktio_open_start_stop_close, NULL, NULL, 0), + BENCH_INFO(pktio_stats, pktio_setup, pktio_clean, 0), + BENCH_INFO(pktin_queue_stats, pktio_setup_direct_rx, pktio_clean_direct_rx, 0), + BENCH_INFO(pktin_event_queue_stats, pktio_setup_sched_rx, pktio_clean_sched_rx, 0), + BENCH_INFO(pktout_queue_stats, pktio_setup_direct_tx, pktio_clean_direct_tx, 0), + BENCH_INFO(pktout_event_queue_stats, pktio_setup_queue_tx, pktio_clean_queue_tx, 0), + BENCH_INFO(pktio_stats_reset, pktio_setup, pktio_clean, 0) +}; + +/* Print usage information */ +static void usage(void) +{ + printf("\n" + "ODP pktio API slow path micro benchmarks\n" + "\n" + "Options:\n" + " -i, --interface Ethernet interface name (default loop).\n" + " -m, --in_mode Packet input mode\n" + " 0: Direct mode: PKTIN_MODE_DIRECT (default)\n" + " 1: Scheduler mode with parallel queues:\n" + " PKTIN_MODE_SCHED + SCHED_SYNC_PARALLEL\n" + " -o, --out_mode Packet output mode\n" + " 0: Direct mode: PKTOUT_MODE_DIRECT (default)\n" + " 1: Queue mode: PKTOUT_MODE_QUEUE\n" + " -q, --rx_queues Number of packet input queues (default 1)\n" + " -t, --tx_queues Number of packet output queues (default 1)\n" + " -r, --rounds Run each test case 'num' times (default %u).\n" + " -s, --select Run only selected test case.\n" + " -h, --help Display help and exit.\n\n" + "\n", ROUNDS); +} + +static int parse_interface(appl_args_t *appl_args, const char *optarg) +{ + if (strlen(optarg) + 1 > MAX_NAME_LEN) { + ODPH_ERR("Unable to store interface name (MAX_NAME_LEN=%d)\n", MAX_NAME_LEN); + return -1; + } + strncpy(appl_args->opt.name, optarg, MAX_NAME_LEN); + return 0; +} + +/* Parse command line arguments */ +static int parse_args(int argc, char *argv[]) +{ + int i; + int opt; + int long_index; + static const struct option longopts[] = { + {"interface", required_argument, NULL, 'i'}, + {"in_mode", required_argument, NULL, 'm'}, + {"out_mode", required_argument, NULL, 'o'}, + {"rx_queues", required_argument, NULL, 'q'}, + {"tx_queues", required_argument, NULL, 't'}, + {"rounds", required_argument, NULL, 'r'}, + {"select", required_argument, NULL, 's'}, + {"help", no_argument, NULL, 'h'}, + {NULL, 0, NULL, 0} + }; + + static const char *shortopts = "i:m:o:q:r:s:t:h"; + + strncpy(gbl_args->opt.name, "loop", MAX_NAME_LEN); + gbl_args->opt.rounds = ROUNDS; + gbl_args->opt.in_mode = ODP_PKTIN_MODE_DIRECT; + gbl_args->opt.out_mode = ODP_PKTOUT_MODE_DIRECT; + gbl_args->opt.num_input_queues = 1; + gbl_args->opt.num_output_queues = 1; + + while (1) { + opt = getopt_long(argc, argv, shortopts, longopts, &long_index); + + if (opt == -1) + break; /* No more options */ + + switch (opt) { + case 'i': + if (parse_interface(gbl_args, optarg)) + return -1; + break; + case 'm': + i = atoi(optarg); + if (i == 1) + gbl_args->opt.in_mode = ODP_PKTIN_MODE_SCHED; + else + gbl_args->opt.in_mode = ODP_PKTIN_MODE_DIRECT; + break; + case 'o': + i = atoi(optarg); + if (i == 1) + gbl_args->opt.out_mode = ODP_PKTOUT_MODE_QUEUE; + else + gbl_args->opt.out_mode = ODP_PKTOUT_MODE_DIRECT; + break; + case 'q': + gbl_args->opt.num_input_queues = atoi(optarg); + break; + case 'r': + gbl_args->opt.rounds = atoi(optarg); + break; + case 's': + gbl_args->opt.case_idx = atoi(optarg); + break; + case 't': + gbl_args->opt.num_output_queues = atoi(optarg); + break; + case 'h': + usage(); + return 1; + default: + ODPH_ERR("Bad option. Use -h for help.\n"); + return -1; + } + } + + return 0; +} + +static int check_args(appl_args_t *appl_args) +{ + odp_pktio_param_t param; + odp_pktio_capability_t capa; + odp_pktio_t pktio; + odp_pool_t pool; + int ret; + + if (gbl_args->opt.rounds < 1) { + ODPH_ERR("Invalid test repeat count: %u\n", gbl_args->opt.rounds); + return -1; + } + + if (gbl_args->opt.case_idx > sizeof(test_suite) / sizeof(test_suite[0])) { + ODPH_ERR("Invalid test case index: %u\n", gbl_args->opt.case_idx); + return -1; + } + + pool = create_packet_pool(); + + odp_pktio_param_init(¶m); + param.in_mode = appl_args->opt.in_mode; + param.out_mode = appl_args->opt.out_mode; + + pktio = odp_pktio_open(appl_args->opt.name, pool, ¶m); + if (pktio == ODP_PKTIO_INVALID) { + ODPH_ERR("Opening pktio failed\n"); + return -1; + } + + ret = odp_pktio_capability(pktio, &capa); + if (ret) { + ODPH_ERR("Reading pktio capa failed\n"); + return -1; + } + + if (appl_args->opt.num_input_queues > capa.max_input_queues) { + ODPH_ERR("Too many input queues: %u/%u\n", appl_args->opt.num_input_queues, + capa.max_input_queues); + return -1; + } + + if (appl_args->opt.num_output_queues > capa.max_output_queues) { + ODPH_ERR("Too many output queues: %u/%u\n", appl_args->opt.num_output_queues, + capa.max_output_queues); + return -1; + } + + ret = odp_pktio_close(pktio); + if (ret) { + ODPH_ERR("Closing pktio failed: %d\n", ret); + return -1; + } + + ret = odp_pool_destroy(pool); + if (ret) { + ODPH_ERR("Destroying pktio pool failed: %d\n", ret); + return -1; + } + + return 0; +} + +/* Print application info */ +static void print_info(appl_args_t *appl_args) +{ + odp_sys_info_print(); + + printf("\n" + "odp_bench_pktio_sp options\n" + "--------------------------\n"); + + printf("CPU mask: %s\n", gbl_args->cpumask_str); + printf("Interface: %s\n", gbl_args->opt.name); + + printf("Input mode: "); + if (appl_args->opt.in_mode == ODP_PKTIN_MODE_SCHED) + printf("sched\n"); + else + printf("direct\n"); + + printf("Output mode: "); + if (appl_args->opt.out_mode == ODP_PKTOUT_MODE_QUEUE) + printf("plain\n"); + else + printf("direct\n"); + + printf("Input queues: %u\n", gbl_args->opt.num_input_queues); + printf("Output queues: %u\n", gbl_args->opt.num_output_queues); + printf("Test rounds: %d\n", gbl_args->opt.rounds); + printf("\n"); +} + +int main(int argc, char *argv[]) +{ + odph_helper_options_t helper_options; + odph_thread_t worker_thread; + odph_thread_common_param_t thr_common; + odph_thread_param_t thr_param; + odp_shm_t shm; + odp_cpumask_t cpumask, default_mask; + odp_instance_t instance; + odp_init_t init_param; + int cpu; + int ret; + + /* Let helper collect its own arguments (e.g. --odph_proc) */ + argc = odph_parse_options(argc, argv); + if (odph_options(&helper_options)) { + ODPH_ERR("Reading ODP helper options failed\n"); + exit(EXIT_FAILURE); + } + + odp_init_param_init(&init_param); + init_param.mem_model = helper_options.mem_model; + + /* Init ODP before calling anything else */ + if (odp_init_global(&instance, &init_param, NULL)) { + ODPH_ERR("Global init failed\n"); + exit(EXIT_FAILURE); + } + + /* Init this thread */ + if (odp_init_local(instance, ODP_THREAD_CONTROL)) { + ODPH_ERR("Local init failed\n"); + exit(EXIT_FAILURE); + } + + ret = odp_schedule_config(NULL); + if (ret) { + ODPH_ERR("Schedule config failed: %d\n", ret); + exit(EXIT_FAILURE); + } + + if (setup_sig_handler()) { + ODPH_ERR("Signal handler setup failed\n"); + exit(EXIT_FAILURE); + } + + /* Reserve memory for args from shared mem */ + shm = odp_shm_reserve("shm_args", sizeof(appl_args_t), ODP_CACHE_LINE_SIZE, 0); + if (shm == ODP_SHM_INVALID) { + ODPH_ERR("Shared mem reserve failed\n"); + exit(EXIT_FAILURE); + } + + gbl_args = odp_shm_addr(shm); + if (gbl_args == NULL) { + ODPH_ERR("Shared mem alloc failed\n"); + exit(EXIT_FAILURE); + } + + memset(gbl_args, 0, sizeof(appl_args_t)); + + /* Parse and store the application arguments */ + ret = parse_args(argc, argv); + if (ret) + goto exit; + + if (check_args(gbl_args)) + goto exit; + + bench_tm_suite_init(&gbl_args->suite); + gbl_args->suite.bench = test_suite; + gbl_args->suite.num_bench = sizeof(test_suite) / sizeof(test_suite[0]); + gbl_args->suite.rounds = gbl_args->opt.rounds; + gbl_args->suite.bench_idx = gbl_args->opt.case_idx; + + /* Get default worker cpumask */ + if (odp_cpumask_default_worker(&default_mask, 1) != 1) { + ODPH_ERR("Unable to allocate worker thread\n"); + ret = -1; + goto exit; + } + + (void)odp_cpumask_to_str(&default_mask, gbl_args->cpumask_str, + sizeof(gbl_args->cpumask_str)); + + print_info(gbl_args); + + memset(&worker_thread, 0, sizeof(odph_thread_t)); + + /* Create worker thread */ + cpu = odp_cpumask_first(&default_mask); + + odp_cpumask_zero(&cpumask); + odp_cpumask_set(&cpumask, cpu); + + odph_thread_common_param_init(&thr_common); + thr_common.instance = instance; + thr_common.cpumask = &cpumask; + thr_common.share_param = 1; + + odph_thread_param_init(&thr_param); + thr_param.start = bench_tm_run; + thr_param.arg = &gbl_args->suite; + thr_param.thr_type = ODP_THREAD_WORKER; + + odph_thread_create(&worker_thread, &thr_common, &thr_param, 1); + + odph_thread_join(&worker_thread, 1); + + ret = gbl_args->suite.retval; + +exit: + if (odp_shm_free(shm)) { + ODPH_ERR("Shared mem free failed\n"); + exit(EXIT_FAILURE); + } + + if (odp_term_local()) { + ODPH_ERR("Local term failed\n"); + exit(EXIT_FAILURE); + } + + if (odp_term_global(instance)) { + ODPH_ERR("Global term failed\n"); + exit(EXIT_FAILURE); + } + + if (ret < 0) + return EXIT_FAILURE; + + return EXIT_SUCCESS; +} From da8743f5ae9848401cf6d7b21a27e75ec94a3f41 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 9 Oct 2023 10:02:08 +0300 Subject: [PATCH 092/192] test: performance: fix wrong type in bench_tm_suite_init() Use correct type when zeroing timed benchmark suite data. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- test/performance/bench_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/performance/bench_common.c b/test/performance/bench_common.c index 1d3567fd4a..710b5a005b 100644 --- a/test/performance/bench_common.c +++ b/test/performance/bench_common.c @@ -139,7 +139,7 @@ int bench_run(void *arg) void bench_tm_suite_init(bench_tm_suite_t *suite) { - memset(suite, 0, sizeof(bench_suite_t)); + memset(suite, 0, sizeof(bench_tm_suite_t)); odp_atomic_init_u32(&suite->exit_worker, 0); } From 0db97834cb6efa0f91908bbc1af89c3427aed495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= Date: Mon, 4 Sep 2023 15:08:55 +0300 Subject: [PATCH 093/192] example: timer_accuracy: make first timeout diff and final timeout error timer specific MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make first timeout diff and final timeout error timer specific by storing them in the timer context. Signed-off-by: Jere Leppänen Reviewed-by: Petri Savolainen --- example/timer/odp_timer_accuracy.c | 71 +++++++++++++++++++----------- 1 file changed, 45 insertions(+), 26 deletions(-) diff --git a/example/timer/odp_timer_accuracy.c b/example/timer/odp_timer_accuracy.c index 2400a7bf88..e8e43c17b5 100644 --- a/example/timer/odp_timer_accuracy.c +++ b/example/timer/odp_timer_accuracy.c @@ -18,6 +18,8 @@ #define MAX_FILENAME 128 +#define ABS(v) ((v) < 0 ? -(v) : (v)) + enum mode_e { MODE_ONESHOT = 0, MODE_RESTART_ABS, @@ -31,6 +33,10 @@ typedef struct timer_ctx_t { uint64_t nsec; uint64_t count; uint64_t first_period; + int tmo_tick; + int64_t first_tmo_diff; + int64_t nsec_final; + } timer_ctx_t; typedef struct { @@ -46,10 +52,6 @@ typedef struct { uint64_t nsec_after_max; uint64_t nsec_after_max_idx; - int tmo_tick; - int64_t first_tmo_diff; - int64_t nsec_final; - uint64_t num_before; uint64_t num_exact; uint64_t num_after; @@ -747,10 +749,10 @@ static int destroy_timers(test_global_t *test_global) return ret; } -static void print_nsec_error(const char *str, uint64_t nsec, double res_ns, +static void print_nsec_error(const char *str, int64_t nsec, double res_ns, uint64_t idx) { - printf(" %s: %12" PRIu64 " / %.3fx resolution", + printf(" %s: %12" PRIi64 " / %.3fx resolution", str, nsec, (double)nsec / res_ns); if (idx != UINT64_MAX) printf(", event %" PRIu64, idx); @@ -763,17 +765,17 @@ static void print_stat(test_global_t *test_global) uint64_t tot_timers = test_global->tot_timers; test_stat_t *stat = &test_global->stat; test_log_t *log = test_global->log; - double ave_after = 0.0; - double ave_before = 0.0; double res_ns = test_global->res_ns; + uint64_t ave_after = 0; + uint64_t ave_before = 0; if (stat->num_after) - ave_after = (double)stat->nsec_after_sum / stat->num_after; + ave_after = stat->nsec_after_sum / stat->num_after; else stat->nsec_after_min = 0; if (stat->num_before) - ave_before = (double)stat->nsec_before_sum / stat->num_before; + ave_before = stat->nsec_before_sum / stat->num_before; else stat->nsec_before_min = 0; @@ -811,15 +813,37 @@ static void print_stat(test_global_t *test_global) print_nsec_error("ave", ave_before, res_ns, UINT64_MAX); if (test_global->opt.mode == MODE_PERIODIC && !test_global->opt.offset_ns) { - printf(" first timeout difference to one period (nsec):\n"); - printf(" %12" PRIi64 " / %.3fx resolution, based on %s\n", - stat->first_tmo_diff, (double)stat->first_tmo_diff / res_ns, - stat->tmo_tick ? "timeout tick" : "time"); + int idx = 0; + int64_t max = 0; + + for (int i = 0; i < (int)test_global->alloc_timers; i++) { + timer_ctx_t *t = &test_global->timer_ctx[i]; + int64_t v = t->first_tmo_diff; + + if (ABS(v) > ABS(max)) { + max = v; + idx = i; + } + } + + printf(" first timeout difference to one period, based on %s (nsec):\n", + test_global->timer_ctx[idx].tmo_tick ? "timeout tick" : "time"); + print_nsec_error("max", max, res_ns, UINT64_MAX); + } + + int64_t max = 0; + + for (int i = 0; i < (int)test_global->alloc_timers; i++) { + timer_ctx_t *t = &test_global->timer_ctx[i]; + int64_t v = t->nsec_final; + + if (ABS(v) > ABS(max)) + max = v; } printf(" final timeout error (nsec):\n"); - printf(" %12" PRIi64 " / %.3fx resolution\n", - stat->nsec_final, (double)stat->nsec_final / res_ns); + print_nsec_error("max", max, res_ns, UINT64_MAX); + printf("\n"); } @@ -904,17 +928,17 @@ static void run_test(test_global_t *test_global) * Adjust by the difference between one period after start * time and the timeout tick. */ - stat->tmo_tick = 1; - stat->first_tmo_diff = + ctx->tmo_tick = 1; + ctx->first_tmo_diff = (int64_t)odp_timer_tick_to_ns(tp, tmo_tick) - (int64_t)odp_timer_tick_to_ns(tp, ctx->first_period); - tmo_ns += stat->first_tmo_diff; + tmo_ns += ctx->first_tmo_diff; } else { /* * Timeout tick is not provided, so the best we can do is * to just take the current time as a baseline. */ - stat->first_tmo_diff = (int64_t)time_ns - (int64_t)tmo_ns; + ctx->first_tmo_diff = (int64_t)time_ns - (int64_t)tmo_ns; tmo_ns = ctx->nsec = time_ns; } @@ -927,17 +951,12 @@ static void run_test(test_global_t *test_global) } if (i == test_global->warmup_timers) { - int tmo_tick = stat->tmo_tick; - int64_t first_tmo_diff = stat->first_tmo_diff; - memset(stat, 0, sizeof(*stat)); stat->nsec_before_min = UINT64_MAX; stat->nsec_after_min = UINT64_MAX; - stat->tmo_tick = tmo_tick; - stat->first_tmo_diff = first_tmo_diff; } - stat->nsec_final = (int64_t)time_ns - (int64_t)tmo_ns; + ctx->nsec_final = (int64_t)time_ns - (int64_t)tmo_ns; if (log) log[i].tmo_ns = tmo_ns; From e37f14ed27c95cd1e9c9b1229a13249b2124a167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= Date: Mon, 25 Sep 2023 14:36:26 +0300 Subject: [PATCH 094/192] example: timer_accuracy: fix warmup with one-shot timers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test doesn't complete with one-shot timers and nonzero warmup periods (-w option), because we don't create timers for warmup in mode 0, and we stop re-starting timers too soon in modes 1 and 2. Fix it. Signed-off-by: Jere Leppänen Reviewed-by: Petri Savolainen --- example/timer/odp_timer_accuracy.c | 98 +++++++++++++++--------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/example/timer/odp_timer_accuracy.c b/example/timer/odp_timer_accuracy.c index e8e43c17b5..2135f57bd3 100644 --- a/example/timer/odp_timer_accuracy.c +++ b/example/timer/odp_timer_accuracy.c @@ -304,7 +304,7 @@ static int single_shot_params(test_global_t *test_global, odp_timer_pool_param_t uint64_t res_ns, res_hz; uint64_t max_res_ns, max_res_hz; uint64_t period_ns = test_global->opt.period_ns; - uint64_t num_tmo = test_global->opt.num; + uint64_t num_tmo = test_global->opt.num + test_global->opt.num_warmup; uint64_t offset_ns = test_global->opt.offset_ns; enum mode_e mode = test_global->opt.mode; @@ -482,8 +482,8 @@ static int start_timers(test_global_t *test_global) mode = test_global->opt.mode; alloc_timers = test_global->alloc_timers; tot_timers = test_global->tot_timers; - num_tmo = test_global->opt.num; num_warmup = test_global->opt.num_warmup; + num_tmo = num_warmup + test_global->opt.num; burst = test_global->opt.burst; burst_gap = test_global->opt.burst_gap; period_ns = test_global->opt.period_ns; @@ -762,7 +762,7 @@ static void print_nsec_error(const char *str, int64_t nsec, double res_ns, static void print_stat(test_global_t *test_global) { uint64_t i; - uint64_t tot_timers = test_global->tot_timers; + uint64_t tot_timers = test_global->tot_timers - test_global->warmup_timers; test_stat_t *stat = &test_global->stat; test_log_t *log = test_global->log; double res_ns = test_global->res_ns; @@ -784,7 +784,7 @@ static void print_stat(test_global_t *test_global) fprintf(file, " Timer tmo(ns) diff(ns)\n"); - for (i = test_global->warmup_timers; i < tot_timers; i++) { + for (i = 0; i < tot_timers; i++) { fprintf(file, "%8" PRIu64 " %12" PRIu64 " %10" PRIi64 "\n", i, log[i].tmo_ns, log[i].diff_ns); } @@ -792,8 +792,6 @@ static void print_stat(test_global_t *test_global) fprintf(file, "\n"); } - tot_timers -= test_global->warmup_timers; - printf("\nTest results:\n"); printf(" num after: %12" PRIu64 " / %.2f%%\n", stat->num_after, 100.0 * stat->num_after / tot_timers); @@ -898,9 +896,13 @@ static void run_test(test_global_t *test_global) double period_dbl = test_global->period_dbl; odp_timer_pool_t tp = test_global->timer_pool; + memset(stat, 0, sizeof(*stat)); + stat->nsec_before_min = UINT64_MAX; + stat->nsec_after_min = UINT64_MAX; + num = 0; next_tmo = 1; - num_tmo = test_global->opt.num; + num_tmo = test_global->opt.num_warmup + test_global->opt.num; burst = test_global->opt.burst; tot_timers = test_global->tot_timers; @@ -950,48 +952,44 @@ static void run_test(test_global_t *test_global) ctx->count++; } - if (i == test_global->warmup_timers) { - memset(stat, 0, sizeof(*stat)); - stat->nsec_before_min = UINT64_MAX; - stat->nsec_after_min = UINT64_MAX; - } - - ctx->nsec_final = (int64_t)time_ns - (int64_t)tmo_ns; - - if (log) - log[i].tmo_ns = tmo_ns; + if (i >= test_global->warmup_timers) { + ctx->nsec_final = (int64_t)time_ns - (int64_t)tmo_ns; - if (time_ns > tmo_ns) { - diff_ns = time_ns - tmo_ns; - stat->num_after++; - stat->nsec_after_sum += diff_ns; - if (diff_ns < stat->nsec_after_min) { - stat->nsec_after_min = diff_ns; - stat->nsec_after_min_idx = i; - } - if (diff_ns > stat->nsec_after_max) { - stat->nsec_after_max = diff_ns; - stat->nsec_after_max_idx = i; - } if (log) - log[i].diff_ns = diff_ns; - - } else if (time_ns < tmo_ns) { - diff_ns = tmo_ns - time_ns; - stat->num_before++; - stat->nsec_before_sum += diff_ns; - if (diff_ns < stat->nsec_before_min) { - stat->nsec_before_min = diff_ns; - stat->nsec_before_min_idx = i; - } - if (diff_ns > stat->nsec_before_max) { - stat->nsec_before_max = diff_ns; - stat->nsec_before_max_idx = i; + log[i].tmo_ns = tmo_ns; + + if (time_ns > tmo_ns) { + diff_ns = time_ns - tmo_ns; + stat->num_after++; + stat->nsec_after_sum += diff_ns; + if (diff_ns < stat->nsec_after_min) { + stat->nsec_after_min = diff_ns; + stat->nsec_after_min_idx = i; + } + if (diff_ns > stat->nsec_after_max) { + stat->nsec_after_max = diff_ns; + stat->nsec_after_max_idx = i; + } + if (log) + log[i].diff_ns = diff_ns; + + } else if (time_ns < tmo_ns) { + diff_ns = tmo_ns - time_ns; + stat->num_before++; + stat->nsec_before_sum += diff_ns; + if (diff_ns < stat->nsec_before_min) { + stat->nsec_before_min = diff_ns; + stat->nsec_before_min_idx = i; + } + if (diff_ns > stat->nsec_before_max) { + stat->nsec_before_max = diff_ns; + stat->nsec_before_max_idx = i; + } + if (log) + log[i].diff_ns = -diff_ns; + } else { + stat->num_exact++; } - if (log) - log[i].diff_ns = -diff_ns; - } else { - stat->num_exact++; } if ((mode == MODE_RESTART_ABS || mode == MODE_RESTART_REL) && @@ -1031,10 +1029,12 @@ static void run_test(test_global_t *test_global) start_param.tick = tick; ret = odp_timer_start(tim, &start_param); - if (ret == ODP_TIMER_TOO_NEAR) - stat->num_too_near++; - else + if (ret == ODP_TIMER_TOO_NEAR) { + if (i >= test_global->warmup_timers) + stat->num_too_near++; + } else { break; + } } if (ret != ODP_TIMER_SUCCESS) { From 4cc82ed070e1c12203bad0d1a03438bfa67be499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= Date: Mon, 2 Oct 2023 14:21:24 +0300 Subject: [PATCH 095/192] example: timer_accuracy: use shm for global data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To prepare for supporting multiple workers, use shm for test_global_t, timer context table and test log. Signed-off-by: Jere Leppänen Reviewed-by: Petri Savolainen --- example/timer/odp_timer_accuracy.c | 271 +++++++++++++++-------------- 1 file changed, 144 insertions(+), 127 deletions(-) diff --git a/example/timer/odp_timer_accuracy.c b/example/timer/odp_timer_accuracy.c index 2135f57bd3..fba1ef1695 100644 --- a/example/timer/odp_timer_accuracy.c +++ b/example/timer/odp_timer_accuracy.c @@ -27,6 +27,30 @@ enum mode_e { MODE_PERIODIC, }; +typedef struct test_opt_t { + unsigned long long period_ns; + long long res_ns; + unsigned long long res_hz; + unsigned long long offset_ns; + unsigned long long max_tmo_ns; + unsigned long long num; + unsigned long long num_warmup; + unsigned long long burst; + unsigned long long burst_gap; + odp_fract_u64_t freq; + unsigned long long max_multiplier; + unsigned long long multiplier; + enum mode_e mode; + int clk_src; + int init; + int output; + int early_retry; + uint64_t warmup_timers; + uint64_t tot_timers; + uint64_t alloc_timers; + char filename[MAX_FILENAME + 1]; +} test_opt_t; + typedef struct timer_ctx_t { odp_timer_t timer; odp_event_t event; @@ -67,25 +91,7 @@ typedef struct test_log_t { } test_log_t; typedef struct test_global_t { - struct { - unsigned long long period_ns; - long long res_ns; - unsigned long long res_hz; - unsigned long long offset_ns; - unsigned long long max_tmo_ns; - unsigned long long num; - unsigned long long num_warmup; - unsigned long long burst; - unsigned long long burst_gap; - odp_fract_u64_t freq; - unsigned long long max_multiplier; - unsigned long long multiplier; - enum mode_e mode; - int clk_src; - int init; - int output; - int early_retry; - } opt; + test_opt_t opt; test_stat_t stat; @@ -94,9 +100,6 @@ typedef struct test_global_t { odp_pool_t timeout_pool; timer_ctx_t *timer_ctx; double res_ns; - uint64_t warmup_timers; - uint64_t tot_timers; - uint64_t alloc_timers; uint64_t start_tick; uint64_t start_ns; uint64_t period_tick; @@ -105,7 +108,6 @@ typedef struct test_global_t { odp_shm_t log_shm; test_log_t *log; FILE *file; - char filename[MAX_FILENAME + 1]; } test_global_t; @@ -147,7 +149,7 @@ static void print_usage(void) " -h, --help Display help and exit.\n\n"); } -static int parse_options(int argc, char *argv[], test_global_t *test_global) +static int parse_options(int argc, char *argv[], test_opt_t *test_opt) { int opt, long_index; const struct option longopts[] = { @@ -173,25 +175,27 @@ static int parse_options(int argc, char *argv[], test_global_t *test_global) const char *shortopts = "+p:r:R:f:x:n:w:b:g:m:P:M:o:e:s:ih"; int ret = 0; - test_global->opt.period_ns = 200 * ODP_TIME_MSEC_IN_NS; - test_global->opt.res_ns = 0; - test_global->opt.res_hz = 0; - test_global->opt.offset_ns = UINT64_MAX; - test_global->opt.max_tmo_ns = 0; - test_global->opt.num = 50; - test_global->opt.num_warmup = 0; - test_global->opt.burst = 1; - test_global->opt.burst_gap = 0; - test_global->opt.mode = MODE_ONESHOT; - test_global->opt.freq.integer = ODP_TIME_SEC_IN_NS / test_global->opt.period_ns; - test_global->opt.freq.numer = 0; - test_global->opt.freq.denom = 0; - test_global->opt.max_multiplier = 1; - test_global->opt.multiplier = 1; - test_global->opt.clk_src = ODP_CLOCK_DEFAULT; - test_global->opt.init = 0; - test_global->opt.output = 0; - test_global->opt.early_retry = 0; + memset(test_opt, 0, sizeof(*test_opt)); + + test_opt->period_ns = 200 * ODP_TIME_MSEC_IN_NS; + test_opt->res_ns = 0; + test_opt->res_hz = 0; + test_opt->offset_ns = UINT64_MAX; + test_opt->max_tmo_ns = 0; + test_opt->num = 50; + test_opt->num_warmup = 0; + test_opt->burst = 1; + test_opt->burst_gap = 0; + test_opt->mode = MODE_ONESHOT; + test_opt->freq.integer = ODP_TIME_SEC_IN_NS / test_opt->period_ns; + test_opt->freq.numer = 0; + test_opt->freq.denom = 0; + test_opt->max_multiplier = 1; + test_opt->multiplier = 1; + test_opt->clk_src = ODP_CLOCK_DEFAULT; + test_opt->init = 0; + test_opt->output = 0; + test_opt->early_retry = 0; while (1) { opt = getopt_long(argc, argv, shortopts, longopts, &long_index); @@ -201,58 +205,56 @@ static int parse_options(int argc, char *argv[], test_global_t *test_global) switch (opt) { case 'p': - test_global->opt.period_ns = strtoull(optarg, NULL, 0); + test_opt->period_ns = strtoull(optarg, NULL, 0); break; case 'r': - test_global->opt.res_ns = strtoll(optarg, NULL, 0); + test_opt->res_ns = strtoll(optarg, NULL, 0); break; case 'R': - test_global->opt.res_hz = strtoull(optarg, NULL, 0); + test_opt->res_hz = strtoull(optarg, NULL, 0); break; case 'f': - test_global->opt.offset_ns = strtoull(optarg, NULL, 0); + test_opt->offset_ns = strtoull(optarg, NULL, 0); break; case 'x': - test_global->opt.max_tmo_ns = strtoull(optarg, NULL, 0); + test_opt->max_tmo_ns = strtoull(optarg, NULL, 0); break; case 'n': - test_global->opt.num = strtoull(optarg, NULL, 0); + test_opt->num = strtoull(optarg, NULL, 0); break; case 'w': - test_global->opt.num_warmup = strtoull(optarg, NULL, 0); + test_opt->num_warmup = strtoull(optarg, NULL, 0); break; case 'b': - test_global->opt.burst = strtoull(optarg, NULL, 0); + test_opt->burst = strtoull(optarg, NULL, 0); break; case 'g': - test_global->opt.burst_gap = strtoull(optarg, NULL, 0); + test_opt->burst_gap = strtoull(optarg, NULL, 0); break; case 'm': - test_global->opt.mode = atoi(optarg); + test_opt->mode = atoi(optarg); break; case 'P': sscanf(optarg, "%" SCNu64 ":%" SCNu64 ":%" SCNu64 ":%llu", - &test_global->opt.freq.integer, - &test_global->opt.freq.numer, - &test_global->opt.freq.denom, - &test_global->opt.max_multiplier); + &test_opt->freq.integer, &test_opt->freq.numer, + &test_opt->freq.denom, &test_opt->max_multiplier); break; case 'M': - test_global->opt.multiplier = strtoull(optarg, NULL, 0); + test_opt->multiplier = strtoull(optarg, NULL, 0); break; case 'o': - test_global->opt.output = 1; + test_opt->output = 1; /* filename is NULL terminated in anycase */ - strncpy(test_global->filename, optarg, MAX_FILENAME); + strncpy(test_opt->filename, optarg, MAX_FILENAME); break; case 'e': - test_global->opt.early_retry = atoi(optarg); + test_opt->early_retry = atoi(optarg); break; case 's': - test_global->opt.clk_src = atoi(optarg); + test_opt->clk_src = atoi(optarg); break; case 'i': - test_global->opt.init = 1; + test_opt->init = 1; break; case 'h': print_usage(); @@ -265,35 +267,35 @@ static int parse_options(int argc, char *argv[], test_global_t *test_global) } } - if (test_global->opt.mode == MODE_PERIODIC) { - if ((test_global->opt.freq.integer == 0 && test_global->opt.freq.numer == 0) || - (test_global->opt.freq.numer != 0 && test_global->opt.freq.denom == 0)) { + if (test_opt->mode == MODE_PERIODIC) { + if ((test_opt->freq.integer == 0 && test_opt->freq.numer == 0) || + (test_opt->freq.numer != 0 && test_opt->freq.denom == 0)) { printf("Bad frequency\n"); return -1; } - test_global->opt.period_ns = 0; + test_opt->period_ns = 0; - if (test_global->opt.offset_ns == UINT64_MAX) - test_global->opt.offset_ns = 0; + if (test_opt->offset_ns == UINT64_MAX) + test_opt->offset_ns = 0; } else { - if (test_global->opt.res_ns < 0) { + if (test_opt->res_ns < 0) { printf("Resolution (res_ns) must be >= 0 with single shot timer\n"); return -1; } - if (test_global->opt.offset_ns == UINT64_MAX) - test_global->opt.offset_ns = 300 * ODP_TIME_MSEC_IN_NS; + if (test_opt->offset_ns == UINT64_MAX) + test_opt->offset_ns = 300 * ODP_TIME_MSEC_IN_NS; } - test_global->warmup_timers = test_global->opt.num_warmup * test_global->opt.burst; - test_global->tot_timers = - test_global->warmup_timers + test_global->opt.num * test_global->opt.burst; + test_opt->warmup_timers = test_opt->num_warmup * test_opt->burst; + test_opt->tot_timers = + test_opt->warmup_timers + test_opt->num * test_opt->burst; - if (test_global->opt.mode == MODE_ONESHOT) - test_global->alloc_timers = test_global->tot_timers; + if (test_opt->mode == MODE_ONESHOT) + test_opt->alloc_timers = test_opt->tot_timers; else - test_global->alloc_timers = test_global->opt.burst; + test_opt->alloc_timers = test_opt->burst; return ret; } @@ -480,8 +482,8 @@ static int start_timers(test_global_t *test_global) int ret; mode = test_global->opt.mode; - alloc_timers = test_global->alloc_timers; - tot_timers = test_global->tot_timers; + alloc_timers = test_global->opt.alloc_timers; + tot_timers = test_global->opt.tot_timers; num_warmup = test_global->opt.num_warmup; num_tmo = num_warmup + test_global->opt.num; burst = test_global->opt.burst; @@ -542,10 +544,10 @@ static int start_timers(test_global_t *test_global) max_timers = timer_capa.periodic.max_timers; } - if (max_timers && test_global->alloc_timers > max_timers) { + if (max_timers && test_global->opt.alloc_timers > max_timers) { printf("Error: Too many timers: %" PRIu64 ".\n" " Max timers: %u\n", - test_global->alloc_timers, max_timers); + test_global->opt.alloc_timers, max_timers); return -1; } @@ -577,7 +579,7 @@ static int start_timers(test_global_t *test_global) printf(" restart retries: %i\n", test_global->opt.early_retry); if (test_global->opt.output) - printf(" log file: %s\n", test_global->filename); + printf(" log file: %s\n", test_global->opt.filename); printf(" start offset: %" PRIu64 " nsec\n", offset_ns); printf(" min timeout: %" PRIu64 " nsec\n", timer_param.min_tmo); printf(" max timeout: %" PRIu64 " nsec\n", timer_param.max_tmo); @@ -586,7 +588,7 @@ static int start_timers(test_global_t *test_global) printf(" burst size: %" PRIu64 "\n", burst); printf(" burst gap: %" PRIu64 "\n", burst_gap); printf(" total timers: %" PRIu64 "\n", tot_timers); - printf(" warmup timers: %" PRIu64 "\n", test_global->warmup_timers); + printf(" warmup timers: %" PRIu64 "\n", test_global->opt.warmup_timers); printf(" alloc timers: %" PRIu64 "\n", alloc_timers); printf(" warmup time: %.2f sec\n", (offset_ns + (num_warmup * test_global->period_dbl)) / 1000000000.0); @@ -715,7 +717,7 @@ static int destroy_timers(test_global_t *test_global) odp_event_t ev; int ret = 0; - alloc_timers = test_global->alloc_timers; + alloc_timers = test_global->opt.alloc_timers; for (i = 0; i < alloc_timers; i++) { timer = test_global->timer_ctx[i].timer; @@ -762,7 +764,7 @@ static void print_nsec_error(const char *str, int64_t nsec, double res_ns, static void print_stat(test_global_t *test_global) { uint64_t i; - uint64_t tot_timers = test_global->tot_timers - test_global->warmup_timers; + uint64_t tot_timers = test_global->opt.tot_timers - test_global->opt.warmup_timers; test_stat_t *stat = &test_global->stat; test_log_t *log = test_global->log; double res_ns = test_global->res_ns; @@ -814,7 +816,7 @@ static void print_stat(test_global_t *test_global) int idx = 0; int64_t max = 0; - for (int i = 0; i < (int)test_global->alloc_timers; i++) { + for (int i = 0; i < (int)test_global->opt.alloc_timers; i++) { timer_ctx_t *t = &test_global->timer_ctx[i]; int64_t v = t->first_tmo_diff; @@ -831,7 +833,7 @@ static void print_stat(test_global_t *test_global) int64_t max = 0; - for (int i = 0; i < (int)test_global->alloc_timers; i++) { + for (int i = 0; i < (int)test_global->opt.alloc_timers; i++) { timer_ctx_t *t = &test_global->timer_ctx[i]; int64_t v = t->nsec_final; @@ -854,7 +856,7 @@ static void cancel_periodic_timers(test_global_t *test_global) if (test_global->opt.mode != MODE_PERIODIC) return; - alloc_timers = test_global->alloc_timers; + alloc_timers = test_global->opt.alloc_timers; for (i = 0; i < alloc_timers; i++) { timer = test_global->timer_ctx[i].timer; @@ -904,7 +906,7 @@ static void run_test(test_global_t *test_global) next_tmo = 1; num_tmo = test_global->opt.num_warmup + test_global->opt.num; burst = test_global->opt.burst; - tot_timers = test_global->tot_timers; + tot_timers = test_global->opt.tot_timers; for (i = 0; i < tot_timers; i++) { ev = odp_schedule(NULL, ODP_SCHED_WAIT); @@ -952,7 +954,7 @@ static void run_test(test_global_t *test_global) ctx->count++; } - if (i >= test_global->warmup_timers) { + if (i >= test_global->opt.warmup_timers) { ctx->nsec_final = (int64_t)time_ns - (int64_t)tmo_ns; if (log) @@ -1030,7 +1032,7 @@ static void run_test(test_global_t *test_global) ret = odp_timer_start(tim, &start_param); if (ret == ODP_TIMER_TOO_NEAR) { - if (i >= test_global->warmup_timers) + if (i >= test_global->opt.warmup_timers) stat->num_too_near++; } else { break; @@ -1072,15 +1074,12 @@ int main(int argc, char *argv[]) { odp_instance_t instance; odp_init_t init; - test_global_t test_global; + test_opt_t test_opt; + test_global_t *test_global; odp_init_t *init_ptr = NULL; int ret = 0; - memset(&test_global, 0, sizeof(test_global_t)); - test_global.stat.nsec_before_min = UINT64_MAX; - test_global.stat.nsec_after_min = UINT64_MAX; - - if (parse_options(argc, argv, &test_global)) + if (parse_options(argc, argv, &test_opt)) return -1; /* List features not to be used (may optimize performance) */ @@ -1091,7 +1090,7 @@ int main(int argc, char *argv[]) init.not_used.feat.ipsec = 1; init.not_used.feat.tm = 1; - if (test_global.opt.init) + if (test_opt.init) init_ptr = &init; /* Init ODP before calling anything else */ @@ -1111,63 +1110,81 @@ int main(int argc, char *argv[]) /* Configure scheduler */ odp_schedule_config(NULL); - test_global.timer_ctx = calloc(test_global.alloc_timers, - sizeof(timer_ctx_t)); + odp_shm_t shm = ODP_SHM_INVALID, shm_ctx = ODP_SHM_INVALID, shm_log = ODP_SHM_INVALID; + uint64_t size = sizeof(test_global_t); + + shm = odp_shm_reserve("timer_accuracy", size, + ODP_CACHE_LINE_SIZE, ODP_SHM_SINGLE_VA); + + if (shm == ODP_SHM_INVALID) { + printf("Shm alloc failed.\n"); + return -1; + } - if (test_global.timer_ctx == NULL) { - printf("Timer context table calloc failed.\n"); + test_global = odp_shm_addr(shm); + memset(test_global, 0, size); + memcpy(&test_global->opt, &test_opt, sizeof(test_opt_t)); + + size = test_global->opt.alloc_timers * sizeof(timer_ctx_t); + shm_ctx = odp_shm_reserve("timer_accuracy_ctx", size, + ODP_CACHE_LINE_SIZE, ODP_SHM_SINGLE_VA); + + if (shm_ctx == ODP_SHM_INVALID) { + printf("Timer context alloc failed.\n"); ret = -1; goto quit; } - if (test_global.opt.output) { - odp_shm_t shm; - void *addr; - uint64_t size = test_global.tot_timers * sizeof(test_log_t); + test_global->timer_ctx = odp_shm_addr(shm_ctx); + memset(test_global->timer_ctx, 0, size); - test_global.file = fopen(test_global.filename, "w"); - if (test_global.file == NULL) { + if (test_global->opt.output) { + test_global->file = fopen(test_global->opt.filename, "w"); + if (test_global->file == NULL) { printf("Failed to open output file %s: %s\n", - test_global.filename, strerror(errno)); + test_global->opt.filename, strerror(errno)); ret = -1; goto quit; } - shm = odp_shm_reserve("timer_accuracy_log", size, - sizeof(test_log_t), 0); + size = (test_global->opt.tot_timers - test_global->opt.warmup_timers) * + sizeof(test_log_t); + shm_log = odp_shm_reserve("timer_accuracy_log", size, sizeof(test_log_t), + ODP_SHM_SINGLE_VA); - if (shm == ODP_SHM_INVALID) { + if (shm_log == ODP_SHM_INVALID) { printf("Test log alloc failed.\n"); ret = -1; goto quit; } - addr = odp_shm_addr(shm); - memset(addr, 0, size); - test_global.log = addr; - test_global.log_shm = shm; + test_global->log = odp_shm_addr(shm_log); + memset(test_global->log, 0, size); } - ret = start_timers(&test_global); + ret = start_timers(test_global); if (ret) goto quit; - run_test(&test_global); + run_test(test_global); - print_stat(&test_global); + print_stat(test_global); quit: - if (test_global.file) - fclose(test_global.file); + if (test_global->file) + fclose(test_global->file); + + if (destroy_timers(test_global)) + ret = -1; - if (test_global.timer_ctx && destroy_timers(&test_global)) + if (shm_log != ODP_SHM_INVALID && odp_shm_free(shm_log)) ret = -1; - if (test_global.timer_ctx) - free(test_global.timer_ctx); + if (shm_ctx != ODP_SHM_INVALID && odp_shm_free(shm_ctx)) + ret = -1; - if (test_global.log) - odp_shm_free(test_global.log_shm); + if (odp_shm_free(shm)) + ret = -1; if (odp_term_local()) { printf("Term local failed.\n"); From 21b9c3703f5d198c67d12648eca662042f49964a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= Date: Mon, 2 Oct 2023 17:38:05 +0300 Subject: [PATCH 096/192] example: timer_accuracy: add cpu count option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an option (-c, --count) to set the cpu count. Signed-off-by: Jere Leppänen Reviewed-by: Petri Savolainen --- example/timer/odp_timer_accuracy.c | 301 +++++++++++++++++++++-------- 1 file changed, 220 insertions(+), 81 deletions(-) diff --git a/example/timer/odp_timer_accuracy.c b/example/timer/odp_timer_accuracy.c index fba1ef1695..fd46d64b88 100644 --- a/example/timer/odp_timer_accuracy.c +++ b/example/timer/odp_timer_accuracy.c @@ -15,7 +15,9 @@ #include #include +#include +#define MAX_WORKERS (ODP_THREAD_COUNT_MAX - 1) #define MAX_FILENAME 128 #define ABS(v) ((v) < 0 ? -(v) : (v)) @@ -28,6 +30,7 @@ enum mode_e { }; typedef struct test_opt_t { + int cpu_count; unsigned long long period_ns; long long res_ns; unsigned long long res_hz; @@ -87,13 +90,14 @@ typedef struct { typedef struct test_log_t { uint64_t tmo_ns; int64_t diff_ns; + int tid; } test_log_t; typedef struct test_global_t { test_opt_t opt; - test_stat_t stat; + test_stat_t stat[MAX_WORKERS]; odp_queue_t queue; odp_timer_pool_t timer_pool; @@ -105,9 +109,11 @@ typedef struct test_global_t { uint64_t period_tick; double period_dbl; odp_fract_u64_t base_freq; - odp_shm_t log_shm; test_log_t *log; FILE *file; + odp_barrier_t barrier; + odp_atomic_u64_t events; + odp_atomic_u64_t last_events; } test_global_t; @@ -117,6 +123,7 @@ static void print_usage(void) "Timer accuracy test application.\n" "\n" "OPTIONS:\n" + " -c, --count CPU count, 0=all available, default=1\n" " -p, --period Timeout period in nsec. Not used in periodic mode. Default: 200 msec\n" " -r, --res_ns Timeout resolution in nsec. Default value is 0. Special values:\n" " 0: Use period / 10 as the resolution\n" @@ -153,6 +160,7 @@ static int parse_options(int argc, char *argv[], test_opt_t *test_opt) { int opt, long_index; const struct option longopts[] = { + {"count", required_argument, NULL, 'c'}, {"period", required_argument, NULL, 'p'}, {"res_ns", required_argument, NULL, 'r'}, {"res_hz", required_argument, NULL, 'R'}, @@ -172,7 +180,7 @@ static int parse_options(int argc, char *argv[], test_opt_t *test_opt) {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; - const char *shortopts = "+p:r:R:f:x:n:w:b:g:m:P:M:o:e:s:ih"; + const char *shortopts = "+c:p:r:R:f:x:n:w:b:g:m:P:M:o:e:s:ih"; int ret = 0; memset(test_opt, 0, sizeof(*test_opt)); @@ -204,6 +212,9 @@ static int parse_options(int argc, char *argv[], test_opt_t *test_opt) break; /* No more options */ switch (opt) { + case 'c': + test_opt->cpu_count = atoi(optarg); + break; case 'p': test_opt->period_ns = strtoull(optarg, NULL, 0); break; @@ -274,7 +285,8 @@ static int parse_options(int argc, char *argv[], test_opt_t *test_opt) return -1; } - test_opt->period_ns = 0; + test_opt->period_ns = + ODP_TIME_SEC_IN_NS / odp_fract_u64_to_dbl(&test_opt->freq); if (test_opt->offset_ns == UINT64_MAX) test_opt->offset_ns = 0; @@ -459,7 +471,7 @@ static int periodic_params(test_global_t *test_global, odp_timer_pool_param_t *t return 0; } -static int start_timers(test_global_t *test_global) +static int create_timers(test_global_t *test_global) { odp_pool_t pool; odp_pool_param_t pool_param; @@ -469,13 +481,11 @@ static int start_timers(test_global_t *test_global) odp_timer_t timer; odp_queue_t queue; odp_queue_param_t queue_param; - uint64_t start_tick; - uint64_t period_ns, start_ns, nsec, offset_ns; + uint64_t offset_ns; uint32_t max_timers; odp_event_t event; odp_timeout_t timeout; - odp_time_t time; - uint64_t i, j, idx, num_tmo, num_warmup, burst, burst_gap; + uint64_t i, num_tmo, num_warmup, burst, burst_gap; uint64_t tot_timers, alloc_timers; enum mode_e mode; odp_timer_clk_src_t clk_src; @@ -488,7 +498,6 @@ static int start_timers(test_global_t *test_global) num_tmo = num_warmup + test_global->opt.num; burst = test_global->opt.burst; burst_gap = test_global->opt.burst_gap; - period_ns = test_global->opt.period_ns; offset_ns = test_global->opt.offset_ns; /* Always init globals for destroy calls */ @@ -504,7 +513,7 @@ static int start_timers(test_global_t *test_global) odp_queue_param_init(&queue_param); queue_param.type = ODP_QUEUE_TYPE_SCHED; queue_param.sched.prio = odp_schedule_default_prio(); - queue_param.sched.sync = ODP_SCHED_SYNC_ATOMIC; + queue_param.sched.sync = ODP_SCHED_SYNC_PARALLEL; queue_param.sched.group = ODP_SCHED_GROUP_ALL; queue = odp_queue_create("timeout_queue", &queue_param); @@ -603,6 +612,7 @@ static int start_timers(test_global_t *test_global) } odp_timer_pool_start(); + odp_timer_pool_print(timer_pool); /* Spend some time so that current tick would not be zero */ odp_time_wait_ns(100 * ODP_TIME_MSEC_IN_NS); @@ -641,13 +651,33 @@ static int start_timers(test_global_t *test_global) } } + return 0; +} + +static int start_timers(test_global_t *test_global) +{ + odp_timer_pool_t timer_pool; + uint64_t start_tick; + uint64_t period_ns, start_ns, nsec, offset_ns; + odp_time_t time; + uint64_t i, j, idx, num_tmo, num_warmup, burst, burst_gap; + enum mode_e mode; + + mode = test_global->opt.mode; + num_warmup = test_global->opt.num_warmup; + num_tmo = num_warmup + test_global->opt.num; + burst = test_global->opt.burst; + burst_gap = test_global->opt.burst_gap; + period_ns = test_global->opt.period_ns; + offset_ns = test_global->opt.offset_ns; + timer_pool = test_global->timer_pool; idx = 0; /* Record test start time and tick. Memory barriers forbid compiler and out-of-order * CPU to move samples apart. */ odp_mb_full(); start_tick = odp_timer_current_tick(timer_pool); - time = odp_time_local(); + time = odp_time_global(); odp_mb_full(); start_ns = odp_time_to_ns(time); @@ -707,6 +737,8 @@ static int start_timers(test_global_t *test_global) } } + printf("\nStarting timers took %" PRIu64 " nsec\n", odp_time_global_ns() - start_ns); + return 0; } @@ -752,24 +784,69 @@ static int destroy_timers(test_global_t *test_global) } static void print_nsec_error(const char *str, int64_t nsec, double res_ns, - uint64_t idx) + int tid, int idx) { printf(" %s: %12" PRIi64 " / %.3fx resolution", str, nsec, (double)nsec / res_ns); - if (idx != UINT64_MAX) - printf(", event %" PRIu64, idx); + if (tid >= 0) + printf(", thread %d", tid); + if (idx >= 0) + printf(", event %d", idx); printf("\n"); } static void print_stat(test_global_t *test_global) { uint64_t i; - uint64_t tot_timers = test_global->opt.tot_timers - test_global->opt.warmup_timers; - test_stat_t *stat = &test_global->stat; + test_stat_t test_stat; + test_stat_t *stat = &test_stat; + uint64_t tot_timers; + test_stat_t *s = test_global->stat; test_log_t *log = test_global->log; double res_ns = test_global->res_ns; uint64_t ave_after = 0; uint64_t ave_before = 0; + uint64_t nsec_before_min_tid = 0; + uint64_t nsec_before_max_tid = 0; + uint64_t nsec_after_min_tid = 0; + uint64_t nsec_after_max_tid = 0; + + memset(stat, 0, sizeof(*stat)); + stat->nsec_before_min = UINT64_MAX; + stat->nsec_after_min = UINT64_MAX; + + for (int i = 1; i < test_global->opt.cpu_count + 1; i++) { + stat->nsec_before_sum += s[i].nsec_before_sum; + stat->nsec_after_sum += s[i].nsec_after_sum; + stat->num_before += s[i].num_before; + stat->num_exact += s[i].num_exact; + stat->num_after += s[i].num_after; + stat->num_too_near += s[i].num_too_near; + + if (s[i].nsec_before_min < stat->nsec_before_min) { + stat->nsec_before_min = s[i].nsec_before_min; + stat->nsec_before_min_idx = s[i].nsec_before_min_idx; + nsec_before_min_tid = i; + } + + if (s[i].nsec_after_min < stat->nsec_after_min) { + stat->nsec_after_min = s[i].nsec_after_min; + stat->nsec_after_min_idx = s[i].nsec_after_min_idx; + nsec_after_min_tid = i; + } + + if (s[i].nsec_before_max > stat->nsec_before_max) { + stat->nsec_before_max = s[i].nsec_before_max; + stat->nsec_before_max_idx = s[i].nsec_before_max_idx; + nsec_before_max_tid = i; + } + + if (s[i].nsec_after_max > stat->nsec_after_max) { + stat->nsec_after_max = s[i].nsec_after_max; + stat->nsec_after_max_idx = s[i].nsec_after_max_idx; + nsec_after_max_tid = i; + } + } if (stat->num_after) ave_after = stat->nsec_after_sum / stat->num_after; @@ -781,14 +858,16 @@ static void print_stat(test_global_t *test_global) else stat->nsec_before_min = 0; + tot_timers = stat->num_before + stat->num_after + stat->num_exact; + if (log) { FILE *file = test_global->file; - fprintf(file, " Timer tmo(ns) diff(ns)\n"); + fprintf(file, " Timer thread tmo(ns) diff(ns)\n"); for (i = 0; i < tot_timers; i++) { - fprintf(file, "%8" PRIu64 " %12" PRIu64 " %10" - PRIi64 "\n", i, log[i].tmo_ns, log[i].diff_ns); + fprintf(file, "%8" PRIu64 " %7u %12" PRIu64 " %10" + PRIi64 "\n", i, log[i].tid, log[i].tmo_ns, log[i].diff_ns); } fprintf(file, "\n"); @@ -804,13 +883,17 @@ static void print_stat(test_global_t *test_global) printf(" num retry: %12" PRIu64 " / %.2f%%\n", stat->num_too_near, 100.0 * stat->num_too_near / tot_timers); printf(" error after (nsec):\n"); - print_nsec_error("min", stat->nsec_after_min, res_ns, stat->nsec_after_min_idx); - print_nsec_error("max", stat->nsec_after_max, res_ns, stat->nsec_after_max_idx); - print_nsec_error("ave", ave_after, res_ns, UINT64_MAX); + print_nsec_error("min", stat->nsec_after_min, res_ns, nsec_after_min_tid, + stat->nsec_after_min_idx); + print_nsec_error("max", stat->nsec_after_max, res_ns, nsec_after_max_tid, + stat->nsec_after_max_idx); + print_nsec_error("ave", ave_after, res_ns, -1, -1); printf(" error before (nsec):\n"); - print_nsec_error("min", stat->nsec_before_min, res_ns, stat->nsec_before_min_idx); - print_nsec_error("max", stat->nsec_before_max, res_ns, stat->nsec_before_max_idx); - print_nsec_error("ave", ave_before, res_ns, UINT64_MAX); + print_nsec_error("min", stat->nsec_before_min, res_ns, nsec_before_min_tid, + stat->nsec_before_min_idx); + print_nsec_error("max", stat->nsec_before_max, res_ns, nsec_before_max_tid, + stat->nsec_before_max_idx); + print_nsec_error("ave", ave_before, res_ns, -1, -1); if (test_global->opt.mode == MODE_PERIODIC && !test_global->opt.offset_ns) { int idx = 0; @@ -828,7 +911,7 @@ static void print_stat(test_global_t *test_global) printf(" first timeout difference to one period, based on %s (nsec):\n", test_global->timer_ctx[idx].tmo_tick ? "timeout tick" : "time"); - print_nsec_error("max", max, res_ns, UINT64_MAX); + print_nsec_error("max", max, res_ns, -1, -1); } int64_t max = 0; @@ -842,7 +925,7 @@ static void print_stat(test_global_t *test_global) } printf(" final timeout error (nsec):\n"); - print_nsec_error("max", max, res_ns, UINT64_MAX); + print_nsec_error("max", max, res_ns, -1, -1); printf("\n"); } @@ -851,10 +934,6 @@ static void cancel_periodic_timers(test_global_t *test_global) { uint64_t i, alloc_timers; odp_timer_t timer; - odp_event_t ev; - - if (test_global->opt.mode != MODE_PERIODIC) - return; alloc_timers = test_global->opt.alloc_timers; @@ -867,51 +946,55 @@ static void cancel_periodic_timers(test_global_t *test_global) if (odp_timer_periodic_cancel(timer)) printf("Failed to cancel periodic timer.\n"); } - - while (alloc_timers) { - odp_timeout_t tmo; - timer_ctx_t *ctx; - - ev = odp_schedule(NULL, ODP_SCHED_WAIT); - tmo = odp_timeout_from_event(ev); - ctx = odp_timeout_user_ptr(tmo); - if (odp_timer_periodic_ack(ctx->timer, ev) != 2) - continue; - odp_event_free(ev); - alloc_timers--; - } } -static void run_test(test_global_t *test_global) +static int run_test(void *arg) { - uint64_t burst, num, num_tmo, next_tmo; - uint64_t i, tot_timers; + test_global_t *test_global = (test_global_t *)arg; odp_event_t ev; odp_time_t time; uint64_t time_ns, diff_ns; odp_timeout_t tmo; uint64_t tmo_ns; timer_ctx_t *ctx; - test_stat_t *stat = &test_global->stat; test_log_t *log = test_global->log; enum mode_e mode = test_global->opt.mode; + uint64_t tot_timers = test_global->opt.tot_timers; double period_dbl = test_global->period_dbl; odp_timer_pool_t tp = test_global->timer_pool; + int tid = odp_thread_id(); + + if (tid > test_global->opt.cpu_count) { + printf("Error: tid %d is larger than cpu_count %d.\n", tid, + test_global->opt.cpu_count); + return 0; + } + + test_stat_t *stat = &test_global->stat[tid]; memset(stat, 0, sizeof(*stat)); stat->nsec_before_min = UINT64_MAX; stat->nsec_after_min = UINT64_MAX; - num = 0; - next_tmo = 1; - num_tmo = test_global->opt.num_warmup + test_global->opt.num; - burst = test_global->opt.burst; - tot_timers = test_global->opt.tot_timers; + odp_barrier_wait(&test_global->barrier); + + while (1) { + ev = odp_schedule(NULL, 10 * ODP_TIME_MSEC_IN_NS); + time = odp_time_global_strict(); - for (i = 0; i < tot_timers; i++) { - ev = odp_schedule(NULL, ODP_SCHED_WAIT); + if (ev == ODP_EVENT_INVALID) { + if (mode == MODE_PERIODIC) { + if (odp_atomic_load_u64(&test_global->last_events) >= + test_global->opt.alloc_timers) + break; + + } else if (odp_atomic_load_u64(&test_global->events) >= tot_timers) { + break; + } + + continue; + } - time = odp_time_local(); time_ns = odp_time_to_ns(time); tmo = odp_timeout_from_event(ev); ctx = odp_timeout_user_ptr(tmo); @@ -954,11 +1037,17 @@ static void run_test(test_global_t *test_global) ctx->count++; } - if (i >= test_global->opt.warmup_timers) { + uint64_t events = odp_atomic_fetch_inc_u64(&test_global->events); + + if (events >= test_global->opt.warmup_timers && events < tot_timers) { + uint64_t i = events - test_global->opt.warmup_timers; + ctx->nsec_final = (int64_t)time_ns - (int64_t)tmo_ns; - if (log) + if (log) { log[i].tmo_ns = tmo_ns; + log[i].tid = tid; + } if (time_ns > tmo_ns) { diff_ns = time_ns - tmo_ns; @@ -995,7 +1084,7 @@ static void run_test(test_global_t *test_global) } if ((mode == MODE_RESTART_ABS || mode == MODE_RESTART_REL) && - next_tmo < num_tmo) { + events < tot_timers - 1) { /* Reset timer for next period */ odp_timer_t tim; uint64_t nsec, tick; @@ -1032,7 +1121,7 @@ static void run_test(test_global_t *test_global) ret = odp_timer_start(tim, &start_param); if (ret == ODP_TIMER_TOO_NEAR) { - if (i >= test_global->opt.warmup_timers) + if (events >= test_global->opt.warmup_timers) stat->num_too_near++; } else { break; @@ -1042,32 +1131,25 @@ static void run_test(test_global_t *test_global) if (ret != ODP_TIMER_SUCCESS) { printf("Timer set failed: %i. Timeout nsec " "%" PRIu64 "\n", ret, ctx->nsec); - return; + return 0; } } else if (mode == MODE_PERIODIC) { - if (odp_timer_periodic_ack(ctx->timer, ev)) + int ret = odp_timer_periodic_ack(ctx->timer, ev); + + if (ret < 0) printf("Failed to ack a periodic timer.\n"); - } else { - odp_event_free(ev); - } - num++; + if (ret == 2) + odp_atomic_inc_u64(&test_global->last_events); - if (num == burst) { - next_tmo++; - num = 0; + if (ret == 2 || ret < 0) + odp_event_free(ev); + } else { + odp_event_free(ev); } - } - cancel_periodic_timers(test_global); - - /* Free current scheduler context. There should be no more events. */ - while ((ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT)) - != ODP_EVENT_INVALID) { - printf("Dropping extra event\n"); - odp_event_free(ev); - } + return 0; } int main(int argc, char *argv[]) @@ -1076,9 +1158,17 @@ int main(int argc, char *argv[]) odp_init_t init; test_opt_t test_opt; test_global_t *test_global; + odph_helper_options_t helper_options; odp_init_t *init_ptr = NULL; int ret = 0; + /* Let helper collect its own arguments (e.g. --odph_proc) */ + argc = odph_parse_options(argc, argv); + if (odph_options(&helper_options)) { + ODPH_ERR("Reading ODP helper options failed.\n"); + exit(EXIT_FAILURE); + } + if (parse_options(argc, argv, &test_opt)) return -1; @@ -1090,6 +1180,8 @@ int main(int argc, char *argv[]) init.not_used.feat.ipsec = 1; init.not_used.feat.tm = 1; + init.mem_model = helper_options.mem_model; + if (test_opt.init) init_ptr = &init; @@ -1100,7 +1192,7 @@ int main(int argc, char *argv[]) } /* Init this thread */ - if (odp_init_local(instance, ODP_THREAD_WORKER)) { + if (odp_init_local(instance, ODP_THREAD_CONTROL)) { printf("Local init failed.\n"); return -1; } @@ -1162,12 +1254,59 @@ int main(int argc, char *argv[]) memset(test_global->log, 0, size); } + odph_thread_t thread_tbl[MAX_WORKERS]; + int num_workers; + odp_cpumask_t cpumask; + char cpumaskstr[ODP_CPUMASK_STR_SIZE]; + odph_thread_common_param_t thr_common; + odph_thread_param_t thr_param; + + memset(thread_tbl, 0, sizeof(thread_tbl)); + + num_workers = MAX_WORKERS; + if (test_global->opt.cpu_count && test_global->opt.cpu_count < MAX_WORKERS) + num_workers = test_global->opt.cpu_count; + num_workers = odp_cpumask_default_worker(&cpumask, num_workers); + test_global->opt.cpu_count = num_workers; + odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); + + printf("num worker threads: %i\n", num_workers); + printf("first CPU: %i\n", odp_cpumask_first(&cpumask)); + printf("cpu mask: %s\n", cpumaskstr); + + ret = create_timers(test_global); + if (ret) + goto quit; + + odp_barrier_init(&test_global->barrier, num_workers + 1); + odp_atomic_init_u64(&test_global->events, 0); + odp_atomic_init_u64(&test_global->last_events, 0); + + odph_thread_param_init(&thr_param); + thr_param.start = run_test; + thr_param.arg = (void *)test_global; + thr_param.thr_type = ODP_THREAD_WORKER; + + odph_thread_common_param_init(&thr_common); + thr_common.instance = instance; + thr_common.cpumask = &cpumask; + thr_common.share_param = 1; + + odph_thread_create(thread_tbl, &thr_common, &thr_param, num_workers); + odp_barrier_wait(&test_global->barrier); + ret = start_timers(test_global); if (ret) goto quit; - run_test(test_global); + if (test_global->opt.mode == MODE_PERIODIC) { + while (odp_atomic_load_u64(&test_global->events) < test_global->opt.tot_timers) + odp_time_wait_ns(10 * ODP_TIME_MSEC_IN_NS); + + cancel_periodic_timers(test_global); + } + odph_thread_join(thread_tbl, num_workers); print_stat(test_global); quit: From 56a348218f820a541f3a8a5f60c6b74ee4449355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= Date: Wed, 6 Sep 2023 13:56:04 +0300 Subject: [PATCH 097/192] example: timer_accuracy: add queue sync type option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an option (-t, --queue_type) to set the queue sync type. Signed-off-by: Jere Leppänen Reviewed-by: Petri Savolainen --- example/timer/odp_timer_accuracy.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/example/timer/odp_timer_accuracy.c b/example/timer/odp_timer_accuracy.c index fd46d64b88..a862aa320a 100644 --- a/example/timer/odp_timer_accuracy.c +++ b/example/timer/odp_timer_accuracy.c @@ -45,6 +45,7 @@ typedef struct test_opt_t { unsigned long long multiplier; enum mode_e mode; int clk_src; + odp_queue_type_t queue_type; int init; int output; int early_retry; @@ -152,6 +153,10 @@ static void print_usage(void) " -s, --clk_src Clock source select (default 0):\n" " 0: ODP_CLOCK_DEFAULT\n" " 1: ODP_CLOCK_SRC_1, ...\n" + " -t, --queue_type Queue sync type. Default is 0 (PARALLEL).\n" + " 0: PARALLEL\n" + " 1: ATOMIC\n" + " 2: ORDERED\n" " -i, --init Set global init parameters. Default: init params not set.\n" " -h, --help Display help and exit.\n\n"); } @@ -176,11 +181,12 @@ static int parse_options(int argc, char *argv[], test_opt_t *test_opt) {"output", required_argument, NULL, 'o'}, {"early_retry", required_argument, NULL, 'e'}, {"clk_src", required_argument, NULL, 's'}, + {"queue_type", required_argument, NULL, 't'}, {"init", no_argument, NULL, 'i'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; - const char *shortopts = "+c:p:r:R:f:x:n:w:b:g:m:P:M:o:e:s:ih"; + const char *shortopts = "+c:p:r:R:f:x:n:w:b:g:m:P:M:o:e:s:t:ih"; int ret = 0; memset(test_opt, 0, sizeof(*test_opt)); @@ -201,6 +207,7 @@ static int parse_options(int argc, char *argv[], test_opt_t *test_opt) test_opt->max_multiplier = 1; test_opt->multiplier = 1; test_opt->clk_src = ODP_CLOCK_DEFAULT; + test_opt->queue_type = ODP_SCHED_SYNC_PARALLEL; test_opt->init = 0; test_opt->output = 0; test_opt->early_retry = 0; @@ -264,6 +271,19 @@ static int parse_options(int argc, char *argv[], test_opt_t *test_opt) case 's': test_opt->clk_src = atoi(optarg); break; + case 't': + switch (atoi(optarg)) { + case 1: + test_opt->queue_type = ODP_SCHED_SYNC_ATOMIC; + break; + case 2: + test_opt->queue_type = ODP_SCHED_SYNC_ORDERED; + break; + default: + test_opt->queue_type = ODP_SCHED_SYNC_PARALLEL; + break; + } + break; case 'i': test_opt->init = 1; break; @@ -513,7 +533,7 @@ static int create_timers(test_global_t *test_global) odp_queue_param_init(&queue_param); queue_param.type = ODP_QUEUE_TYPE_SCHED; queue_param.sched.prio = odp_schedule_default_prio(); - queue_param.sched.sync = ODP_SCHED_SYNC_PARALLEL; + queue_param.sched.sync = test_global->opt.queue_type; queue_param.sched.group = ODP_SCHED_GROUP_ALL; queue = odp_queue_create("timeout_queue", &queue_param); @@ -564,6 +584,7 @@ static int create_timers(test_global_t *test_global) printf(" clock source: %i\n", clk_src); printf(" max timers capa: %" PRIu32 "\n", max_timers); printf(" mode: %i\n", mode); + printf(" queue type: %i\n", test_global->opt.queue_type); odp_timer_pool_param_init(&timer_param); From f7cff03f3f7135dc2494dcc1d09752cf03cbc5ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= Date: Wed, 6 Sep 2023 14:30:30 +0300 Subject: [PATCH 098/192] example: timer_accuracy: add number of queues option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an option (-q, --num_queue) to set the number of queues. Signed-off-by: Jere Leppänen Reviewed-by: Petri Savolainen --- example/timer/odp_timer_accuracy.c | 35 +++++++++++++++++++----------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/example/timer/odp_timer_accuracy.c b/example/timer/odp_timer_accuracy.c index a862aa320a..2ec44bb1e2 100644 --- a/example/timer/odp_timer_accuracy.c +++ b/example/timer/odp_timer_accuracy.c @@ -18,6 +18,7 @@ #include #define MAX_WORKERS (ODP_THREAD_COUNT_MAX - 1) +#define MAX_QUEUES 1024 #define MAX_FILENAME 128 #define ABS(v) ((v) < 0 ? -(v) : (v)) @@ -46,6 +47,7 @@ typedef struct test_opt_t { enum mode_e mode; int clk_src; odp_queue_type_t queue_type; + int num_queue; int init; int output; int early_retry; @@ -100,7 +102,7 @@ typedef struct test_global_t { test_stat_t stat[MAX_WORKERS]; - odp_queue_t queue; + odp_queue_t queue[MAX_QUEUES]; odp_timer_pool_t timer_pool; odp_pool_t timeout_pool; timer_ctx_t *timer_ctx; @@ -157,6 +159,7 @@ static void print_usage(void) " 0: PARALLEL\n" " 1: ATOMIC\n" " 2: ORDERED\n" + " -q, --num_queue Number of queues. Default is 1.\n" " -i, --init Set global init parameters. Default: init params not set.\n" " -h, --help Display help and exit.\n\n"); } @@ -182,11 +185,12 @@ static int parse_options(int argc, char *argv[], test_opt_t *test_opt) {"early_retry", required_argument, NULL, 'e'}, {"clk_src", required_argument, NULL, 's'}, {"queue_type", required_argument, NULL, 't'}, + {"num_queue", required_argument, NULL, 'q'}, {"init", no_argument, NULL, 'i'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; - const char *shortopts = "+c:p:r:R:f:x:n:w:b:g:m:P:M:o:e:s:t:ih"; + const char *shortopts = "+c:p:r:R:f:x:n:w:b:g:m:P:M:o:e:s:t:q:ih"; int ret = 0; memset(test_opt, 0, sizeof(*test_opt)); @@ -208,6 +212,7 @@ static int parse_options(int argc, char *argv[], test_opt_t *test_opt) test_opt->multiplier = 1; test_opt->clk_src = ODP_CLOCK_DEFAULT; test_opt->queue_type = ODP_SCHED_SYNC_PARALLEL; + test_opt->num_queue = 1; test_opt->init = 0; test_opt->output = 0; test_opt->early_retry = 0; @@ -284,6 +289,9 @@ static int parse_options(int argc, char *argv[], test_opt_t *test_opt) break; } break; + case 'q': + test_opt->num_queue = atoi(optarg); + break; case 'i': test_opt->init = 1; break; @@ -499,7 +507,7 @@ static int create_timers(test_global_t *test_global) odp_timer_pool_param_t timer_param; odp_timer_capability_t timer_capa; odp_timer_t timer; - odp_queue_t queue; + odp_queue_t *queue; odp_queue_param_t queue_param; uint64_t offset_ns; uint32_t max_timers; @@ -519,9 +527,9 @@ static int create_timers(test_global_t *test_global) burst = test_global->opt.burst; burst_gap = test_global->opt.burst_gap; offset_ns = test_global->opt.offset_ns; + queue = test_global->queue; /* Always init globals for destroy calls */ - test_global->queue = ODP_QUEUE_INVALID; test_global->timer_pool = ODP_TIMER_POOL_INVALID; test_global->timeout_pool = ODP_POOL_INVALID; @@ -536,14 +544,14 @@ static int create_timers(test_global_t *test_global) queue_param.sched.sync = test_global->opt.queue_type; queue_param.sched.group = ODP_SCHED_GROUP_ALL; - queue = odp_queue_create("timeout_queue", &queue_param); - if (queue == ODP_QUEUE_INVALID) { - printf("Queue create failed.\n"); - return -1; + for (i = 0; i < (uint64_t)test_global->opt.num_queue; i++) { + queue[i] = odp_queue_create(NULL, &queue_param); + if (queue[i] == ODP_QUEUE_INVALID) { + printf("Queue create failed.\n"); + return -1; + } } - test_global->queue = queue; - odp_pool_param_init(&pool_param); pool_param.type = ODP_POOL_TIMEOUT; pool_param.tmo.num = alloc_timers; @@ -585,6 +593,7 @@ static int create_timers(test_global_t *test_global) printf(" max timers capa: %" PRIu32 "\n", max_timers); printf(" mode: %i\n", mode); printf(" queue type: %i\n", test_global->opt.queue_type); + printf(" num queue: %i\n", test_global->opt.num_queue); odp_timer_pool_param_init(&timer_param); @@ -643,7 +652,7 @@ static int create_timers(test_global_t *test_global) for (i = 0; i < alloc_timers; i++) { timer_ctx_t *ctx = &test_global->timer_ctx[i]; - timer = odp_timer_alloc(timer_pool, queue, ctx); + timer = odp_timer_alloc(timer_pool, queue[i % test_global->opt.num_queue], ctx); if (timer == ODP_TIMER_INVALID) { printf("Timer alloc failed.\n"); @@ -794,8 +803,8 @@ static int destroy_timers(test_global_t *test_global) } } - if (test_global->queue != ODP_QUEUE_INVALID) { - if (odp_queue_destroy(test_global->queue)) { + for (i = 0; i < (uint64_t)test_global->opt.num_queue; i++) { + if (odp_queue_destroy(test_global->queue[i])) { printf("Queue destroy failed.\n"); ret = -1; } From e5542043d029835416808e904423ff4805845bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= Date: Wed, 6 Sep 2023 14:47:39 +0300 Subject: [PATCH 099/192] example: timer_accuracy: add schedule groups option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an option (-G, --sched_groups) to use a dedicated schedule group for each queue. Signed-off-by: Jere Leppänen Reviewed-by: Petri Savolainen --- example/timer/odp_timer_accuracy.c | 60 +++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/example/timer/odp_timer_accuracy.c b/example/timer/odp_timer_accuracy.c index 2ec44bb1e2..4bea7d680f 100644 --- a/example/timer/odp_timer_accuracy.c +++ b/example/timer/odp_timer_accuracy.c @@ -48,6 +48,7 @@ typedef struct test_opt_t { int clk_src; odp_queue_type_t queue_type; int num_queue; + int groups; int init; int output; int early_retry; @@ -103,6 +104,7 @@ typedef struct test_global_t { test_stat_t stat[MAX_WORKERS]; odp_queue_t queue[MAX_QUEUES]; + odp_schedule_group_t group[MAX_WORKERS]; odp_timer_pool_t timer_pool; odp_pool_t timeout_pool; timer_ctx_t *timer_ctx; @@ -160,6 +162,7 @@ static void print_usage(void) " 1: ATOMIC\n" " 2: ORDERED\n" " -q, --num_queue Number of queues. Default is 1.\n" + " -G, --sched_groups Use dedicated schedule group for each worker.\n" " -i, --init Set global init parameters. Default: init params not set.\n" " -h, --help Display help and exit.\n\n"); } @@ -186,11 +189,12 @@ static int parse_options(int argc, char *argv[], test_opt_t *test_opt) {"clk_src", required_argument, NULL, 's'}, {"queue_type", required_argument, NULL, 't'}, {"num_queue", required_argument, NULL, 'q'}, + {"sched_groups", no_argument, NULL, 'G'}, {"init", no_argument, NULL, 'i'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; - const char *shortopts = "+c:p:r:R:f:x:n:w:b:g:m:P:M:o:e:s:t:q:ih"; + const char *shortopts = "+c:p:r:R:f:x:n:w:b:g:m:P:M:o:e:s:t:q:Gih"; int ret = 0; memset(test_opt, 0, sizeof(*test_opt)); @@ -212,6 +216,7 @@ static int parse_options(int argc, char *argv[], test_opt_t *test_opt) test_opt->multiplier = 1; test_opt->clk_src = ODP_CLOCK_DEFAULT; test_opt->queue_type = ODP_SCHED_SYNC_PARALLEL; + test_opt->groups = 0; test_opt->num_queue = 1; test_opt->init = 0; test_opt->output = 0; @@ -292,6 +297,9 @@ static int parse_options(int argc, char *argv[], test_opt_t *test_opt) case 'q': test_opt->num_queue = atoi(optarg); break; + case 'G': + test_opt->groups = 1; + break; case 'i': test_opt->init = 1; break; @@ -508,6 +516,7 @@ static int create_timers(test_global_t *test_global) odp_timer_capability_t timer_capa; odp_timer_t timer; odp_queue_t *queue; + odp_schedule_group_t *group; odp_queue_param_t queue_param; uint64_t offset_ns; uint32_t max_timers; @@ -528,6 +537,7 @@ static int create_timers(test_global_t *test_global) burst_gap = test_global->opt.burst_gap; offset_ns = test_global->opt.offset_ns; queue = test_global->queue; + group = test_global->group; /* Always init globals for destroy calls */ test_global->timer_pool = ODP_TIMER_POOL_INVALID; @@ -538,6 +548,23 @@ static int create_timers(test_global_t *test_global) test_global->timer_ctx[i].event = ODP_EVENT_INVALID; } + if (test_global->opt.groups) { + /* Create groups */ + + odp_thrmask_t zero; + + odp_thrmask_zero(&zero); + + for (i = 0; i < (uint64_t)test_global->opt.cpu_count; i++) { + group[i] = odp_schedule_group_create(NULL, &zero); + + if (group[i] == ODP_SCHED_GROUP_INVALID) { + printf("Group create failed.\n"); + return -1; + } + } + } + odp_queue_param_init(&queue_param); queue_param.type = ODP_QUEUE_TYPE_SCHED; queue_param.sched.prio = odp_schedule_default_prio(); @@ -545,6 +572,9 @@ static int create_timers(test_global_t *test_global) queue_param.sched.group = ODP_SCHED_GROUP_ALL; for (i = 0; i < (uint64_t)test_global->opt.num_queue; i++) { + if (test_global->opt.groups) + queue_param.sched.group = group[i % test_global->opt.cpu_count]; + queue[i] = odp_queue_create(NULL, &queue_param); if (queue[i] == ODP_QUEUE_INVALID) { printf("Queue create failed.\n"); @@ -594,6 +624,7 @@ static int create_timers(test_global_t *test_global) printf(" mode: %i\n", mode); printf(" queue type: %i\n", test_global->opt.queue_type); printf(" num queue: %i\n", test_global->opt.num_queue); + printf(" sched groups: %s\n", test_global->opt.groups ? "yes" : "no"); odp_timer_pool_param_init(&timer_param); @@ -810,6 +841,15 @@ static int destroy_timers(test_global_t *test_global) } } + if (test_global->opt.groups) { + for (i = 0; i < (uint64_t)test_global->opt.cpu_count; i++) { + if (odp_schedule_group_destroy(test_global->group[i])) { + printf("Group destroy failed.\n"); + ret = -1; + } + } + } + return ret; } @@ -987,6 +1027,8 @@ static int run_test(void *arg) odp_timeout_t tmo; uint64_t tmo_ns; timer_ctx_t *ctx; + odp_thrmask_t mask; + odp_schedule_group_t group = ODP_SCHED_GROUP_INVALID; test_log_t *log = test_global->log; enum mode_e mode = test_global->opt.mode; uint64_t tot_timers = test_global->opt.tot_timers; @@ -1006,6 +1048,17 @@ static int run_test(void *arg) stat->nsec_before_min = UINT64_MAX; stat->nsec_after_min = UINT64_MAX; + if (test_global->opt.groups) { + odp_thrmask_zero(&mask); + odp_thrmask_set(&mask, tid); + group = test_global->group[tid - 1]; + + if (odp_schedule_group_join(group, &mask)) { + printf("odp_schedule_group_join() failed\n"); + return 0; + } + } + odp_barrier_wait(&test_global->barrier); while (1) { @@ -1179,6 +1232,11 @@ static int run_test(void *arg) } } + if (test_global->opt.groups) { + if (odp_schedule_group_leave(group, &mask)) + printf("odp_schedule_group_leave() failed\n"); + } + return 0; } From b087d636a4542d6dd87302ac9322091eba8836ce Mon Sep 17 00:00:00 2001 From: Fan Hong Date: Wed, 11 Oct 2023 02:59:45 +0000 Subject: [PATCH 100/192] test: cunit: fix typos Fix spelling error. Signed-off-by: Fan Hong Reviewed-by: Matias Elo --- test/common/odp_cunit_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/common/odp_cunit_common.c b/test/common/odp_cunit_common.c index 60746164c0..a5b9ff1ea4 100644 --- a/test/common/odp_cunit_common.c +++ b/test/common/odp_cunit_common.c @@ -639,7 +639,7 @@ int odp_cunit_run(void) CU_cleanup_registry(); - /* call test executable terminason hook, if any */ + /* call test executable termination hook, if any */ if (global_init_term.global_term_ptr && ((*global_init_term.global_term_ptr)(instance) != 0)) return -1; @@ -704,7 +704,7 @@ int odp_cunit_register(odp_suiteinfo_t testsuites[]) } /* - * Parse command line options to extract options affectiong cunit_common. + * Parse command line options to extract options affecting cunit_common. * (hence also helpers options as cunit_common uses the helpers) * Options private to the test calling cunit_common are not parsed here. */ From 600e1589968a4da5c0f16b0d805673f4a9b471f5 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Tue, 10 Oct 2023 14:29:10 +0300 Subject: [PATCH 101/192] test: bench_packet: avoid allocating segmented packets Try to set test pool's minimum segment size to maximum test packet size, so that allocated packets wouldn't be segmented. If this is not possible due to pool capabilities, a warning is printed. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale --- test/performance/odp_bench_packet.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/performance/odp_bench_packet.c b/test/performance/odp_bench_packet.c index c36202d560..9c2e83532d 100644 --- a/test/performance/odp_bench_packet.c +++ b/test/performance/odp_bench_packet.c @@ -26,9 +26,6 @@ #include "bench_common.h" -/** Minimum number of packet data bytes in the first segment */ -#define PKT_POOL_SEG_LEN 128 - /** Packet user area size in bytes */ #define PKT_POOL_UAREA_SIZE 8 @@ -1561,7 +1558,7 @@ int main(int argc, char *argv[]) odp_pool_param_t params; odp_instance_t instance; odp_init_t init_param; - uint32_t pkt_num; + uint32_t pkt_num, seg_len; uint8_t ret; /* Let helper collect its own arguments (e.g. --odph_proc) */ @@ -1644,10 +1641,6 @@ int main(int argc, char *argv[]) capa.pkt.max_len < 2 * TEST_MAX_PKT_SIZE) { ODPH_ERR("Error: packet length not supported.\n"); exit(EXIT_FAILURE); - } else if (capa.pkt.max_seg_len && - capa.pkt.max_seg_len < PKT_POOL_SEG_LEN) { - ODPH_ERR("Error: segment length not supported.\n"); - exit(EXIT_FAILURE); } else if (capa.pkt.max_uarea_size && capa.pkt.max_uarea_size < PKT_POOL_UAREA_SIZE) { ODPH_ERR("Error: user area size not supported.\n"); @@ -1658,9 +1651,16 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } + seg_len = TEST_MAX_PKT_SIZE; + if (capa.pkt.max_seg_len && capa.pkt.max_seg_len < seg_len) { + seg_len = capa.pkt.max_seg_len; + printf("\nWarn: allocated packets may be segmented (min seg_len=%" PRIu32 ")\n\n", + seg_len); + } + /* Create packet pool */ odp_pool_param_init(¶ms); - params.pkt.seg_len = PKT_POOL_SEG_LEN; + params.pkt.seg_len = seg_len; /* Using packet length as twice the TEST_MAX_PKT_SIZE as some * test cases (packet_ref_pkt) might allocate a bigger * packet than TEST_MAX_PKT_SIZE. From 35c01fe5dcdc4461a38b38b459e6d3b0d3f853fd Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Tue, 10 Oct 2023 15:02:12 +0300 Subject: [PATCH 102/192] test: bench: add options to select measurement unit Add option ('-t') to select between measuring CPU cycles or time to odp_bench_buffer and odp_bench_packet applications. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale --- test/performance/odp_bench_buffer.c | 23 ++++++++++++++++------- test/performance/odp_bench_packet.c | 25 +++++++++++++++++-------- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/test/performance/odp_bench_buffer.c b/test/performance/odp_bench_buffer.c index 4e55d88791..deed9aa92b 100644 --- a/test/performance/odp_bench_buffer.c +++ b/test/performance/odp_bench_buffer.c @@ -52,6 +52,7 @@ typedef struct { int bench_idx; /** Benchmark index to run indefinitely */ int burst_size; /** Burst size for *_multi operations */ int cache_size; /** Pool cache size */ + int time; /** Measure time vs. CPU cycles */ uint32_t rounds; /** Rounds per test case */ } appl_args_t; @@ -464,6 +465,7 @@ static void usage(char *progname) " -c, --cache_size Pool cache size.\n" " -i, --index Benchmark index to run indefinitely.\n" " -r, --rounds Run each test case 'num' times (default %u).\n" + " -t, --time Time measurement. 0: measure CPU cycles (default), 1: measure time\n" " -h, --help Display help and exit.\n\n" "\n", NO_PATH(progname), NO_PATH(progname), TEST_ROUNDS); } @@ -484,16 +486,18 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) {"cache_size", required_argument, NULL, 'c'}, {"index", required_argument, NULL, 'i'}, {"rounds", required_argument, NULL, 'r'}, + {"time", required_argument, NULL, 't'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; - static const char *shortopts = "c:b:i:r:h"; + static const char *shortopts = "c:b:i:r:t:h"; appl_args->bench_idx = 0; /* Run all benchmarks */ appl_args->burst_size = TEST_DEF_BURST; appl_args->cache_size = -1; appl_args->rounds = TEST_ROUNDS; + appl_args->time = 0; while (1) { opt = getopt_long(argc, argv, shortopts, longopts, &long_index); @@ -518,6 +522,9 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) case 'r': appl_args->rounds = atoi(optarg); break; + case 't': + appl_args->time = atoi(optarg); + break; default: break; } @@ -548,14 +555,15 @@ static void print_info(void) "odp_bench_buffer options\n" "------------------------\n"); - printf("Burst size: %d\n", gbl_args->appl.burst_size); - printf("Buffer size: %d\n", gbl_args->buf_size); - printf("CPU mask: %s\n", gbl_args->cpumask_str); + printf("Burst size: %d\n", gbl_args->appl.burst_size); + printf("Buffer size: %d\n", gbl_args->buf_size); + printf("CPU mask: %s\n", gbl_args->cpumask_str); if (gbl_args->appl.cache_size < 0) - printf("Pool cache size: default\n"); + printf("Pool cache size: default\n"); else - printf("Pool cache size: %d\n", gbl_args->appl.cache_size); - printf("Test rounds: %u\n", gbl_args->appl.rounds); + printf("Pool cache size: %d\n", gbl_args->appl.cache_size); + printf("Measurement unit: %s\n", gbl_args->appl.time ? "nsec" : "CPU cycles"); + printf("Test rounds: %u\n", gbl_args->appl.rounds); printf("\n"); } @@ -654,6 +662,7 @@ int main(int argc, char *argv[]) gbl_args->suite.indef_idx = gbl_args->appl.bench_idx; gbl_args->suite.rounds = gbl_args->appl.rounds; gbl_args->suite.repeat_count = TEST_REPEAT_COUNT; + gbl_args->suite.measure_time = !!gbl_args->appl.time; /* Get default worker cpumask */ if (odp_cpumask_default_worker(&default_mask, 1) != 1) { diff --git a/test/performance/odp_bench_packet.c b/test/performance/odp_bench_packet.c index 9c2e83532d..b8b08a4032 100644 --- a/test/performance/odp_bench_packet.c +++ b/test/performance/odp_bench_packet.c @@ -82,6 +82,7 @@ typedef struct { int bench_idx; /** Benchmark index to run indefinitely */ int burst_size; /** Burst size for *_multi operations */ int cache_size; /** Pool cache size */ + int time; /** Measure time vs. CPU cycles */ uint32_t rounds; /** Rounds per test case */ } appl_args_t; @@ -1358,6 +1359,7 @@ static void usage(char *progname) " -c, --cache_size Pool cache size.\n" " -i, --index Benchmark index to run indefinitely.\n" " -r, --rounds Run each test case 'num' times (default %u).\n" + " -t, --time Time measurement. 0: measure CPU cycles (default), 1: measure time\n" " -h, --help Display help and exit.\n\n" "\n", NO_PATH(progname), NO_PATH(progname), TEST_ROUNDS); } @@ -1378,16 +1380,18 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) {"cache_size", required_argument, NULL, 'c'}, {"index", required_argument, NULL, 'i'}, {"rounds", required_argument, NULL, 'r'}, + {"time", required_argument, NULL, 't'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; - static const char *shortopts = "c:b:i:r:h"; + static const char *shortopts = "c:b:i:r:t:h"; appl_args->bench_idx = 0; /* Run all benchmarks */ appl_args->burst_size = TEST_DEF_BURST; appl_args->cache_size = -1; appl_args->rounds = TEST_ROUNDS; + appl_args->time = 0; while (1) { opt = getopt_long(argc, argv, shortopts, longopts, &long_index); @@ -1408,6 +1412,9 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) case 'r': appl_args->rounds = atoi(optarg); break; + case 't': + appl_args->time = atoi(optarg); + break; case 'h': usage(argv[0]); exit(EXIT_SUCCESS); @@ -1610,6 +1617,7 @@ int main(int argc, char *argv[]) gbl_args->suite.indef_idx = gbl_args->appl.bench_idx; gbl_args->suite.rounds = gbl_args->appl.rounds; gbl_args->suite.repeat_count = TEST_REPEAT_COUNT; + gbl_args->suite.measure_time = !!gbl_args->appl.time; /* Print both system and application information */ print_info(NO_PATH(argv[0]), &gbl_args->appl); @@ -1679,15 +1687,16 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - printf("CPU: %i\n", odp_cpumask_first(&cpumask)); - printf("CPU mask: %s\n", cpumaskstr); - printf("Burst size: %d\n", gbl_args->appl.burst_size); - printf("Bench repeat: %d\n", TEST_REPEAT_COUNT); - printf("Test rounds: %u\n", gbl_args->appl.rounds); + printf("CPU: %i\n", odp_cpumask_first(&cpumask)); + printf("CPU mask: %s\n", cpumaskstr); + printf("Burst size: %d\n", gbl_args->appl.burst_size); + printf("Bench repeat: %d\n", TEST_REPEAT_COUNT); + printf("Measurement unit: %s\n", gbl_args->appl.time ? "nsec" : "CPU cycles"); + printf("Test rounds: %u\n", gbl_args->appl.rounds); if (gbl_args->appl.cache_size < 0) - printf("Pool cache size: default\n"); + printf("Pool cache size: default\n"); else - printf("Pool cache size: %d\n", gbl_args->appl.cache_size); + printf("Pool cache size: %d\n", gbl_args->appl.cache_size); odp_pool_print(gbl_args->pool); From fc21c9091cb06dea578c99a5ac8351afccb94511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= Date: Mon, 28 Aug 2023 13:26:09 +0300 Subject: [PATCH 103/192] validation: timer: test that odp_timer_alloc() returns TIMER_INVALID when pool is empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test that odp_timer_alloc() returns TIMER_INVALID when pool is empty, with both one-shot and periodic timer pools. Signed-off-by: Jere Leppänen Reviewed-by: Petri Savolainen --- test/validation/api/timer/timer.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index 955e14cf8b..3ed7d02385 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -741,6 +741,9 @@ static void timer_pool_create_max(void) ODPH_ERR("Timer alloc failed: %u / %u\n", i, num); CU_ASSERT_FATAL(timer[i] != ODP_TIMER_INVALID); + + /* Pool should have only one timer */ + CU_ASSERT_FATAL(odp_timer_alloc(tp[i], queue, USER_PTR) == ODP_TIMER_INVALID); } for (i = 0; i < num; i++) @@ -2907,6 +2910,9 @@ static void timer_test_periodic(odp_queue_type_t queue_type, int use_first, int timer = odp_timer_alloc(timer_pool, queue, user_ctx); CU_ASSERT_FATAL(timer != ODP_TIMER_INVALID); + /* Pool should have only one timer */ + CU_ASSERT_FATAL(odp_timer_alloc(timer_pool, queue, user_ctx) == ODP_TIMER_INVALID); + memset(&start_param, 0, sizeof(odp_timer_periodic_start_t)); offset_ns = period_ns / 2; From 9e0f294b019d048cdc635c4187e378d949a239ed Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 13 Oct 2023 14:01:49 +0300 Subject: [PATCH 104/192] linux-gen: sysinfo: add new arm core implementers Add new Arm core implementers from MIDR_EL1 documentation. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c b/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c index 352bee9e98..c5dd71bd61 100644 --- a/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c @@ -32,6 +32,9 @@ static void aarch64_impl_str(char *str, int maxlen, int implementer) case 0x44: snprintf(str, maxlen, "Digital Equipment Corporation"); return; + case 0x46: + snprintf(str, maxlen, "Fujitsu Ltd."); + return; case 0x49: snprintf(str, maxlen, "Infineon Technologies AG"); return; @@ -53,6 +56,9 @@ static void aarch64_impl_str(char *str, int maxlen, int implementer) case 0x69: snprintf(str, maxlen, "Intel Corporation"); return; + case 0xc0: + snprintf(str, maxlen, "Ampere Computing"); + return; default: break; } From afc87419297f41230fecdd8ac14a5928d6981c1c Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 13 Oct 2023 14:02:28 +0300 Subject: [PATCH 105/192] linux-gen: sysinfo: add new arm core part ids Recognize more Arm core part numbers. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- .../arch/aarch64/odp_sysinfo_parse.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c b/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c index c5dd71bd61..19c35f98ba 100644 --- a/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c @@ -138,6 +138,10 @@ static void aarch64_part_info(char *str, int maxlen, odp_cpu_arch_arm_t *cpu_isa snprintf(str, maxlen, "Cortex-A78AE"); *cpu_isa = ODP_CPU_ARCH_ARMV8_2; return; + case 0xd44: + snprintf(str, maxlen, "Cortex-X1"); + *cpu_isa = ODP_CPU_ARCH_ARMV8_2; + return; case 0xd46: snprintf(str, maxlen, "Cortex-A510"); *cpu_isa = ODP_CPU_ARCH_ARMV9_0; @@ -146,6 +150,10 @@ static void aarch64_part_info(char *str, int maxlen, odp_cpu_arch_arm_t *cpu_isa snprintf(str, maxlen, "Cortex-A710"); *cpu_isa = ODP_CPU_ARCH_ARMV9_0; return; + case 0xd48: + snprintf(str, maxlen, "Cortex-X2"); + *cpu_isa = ODP_CPU_ARCH_ARMV9_0; + return; case 0xd49: snprintf(str, maxlen, "Neoverse N2"); *cpu_isa = ODP_CPU_ARCH_ARMV9_0; @@ -158,6 +166,18 @@ static void aarch64_part_info(char *str, int maxlen, odp_cpu_arch_arm_t *cpu_isa snprintf(str, maxlen, "Cortex-A78C"); *cpu_isa = ODP_CPU_ARCH_ARMV8_2; return; + case 0xd4d: + snprintf(str, maxlen, "Cortex-A715"); + *cpu_isa = ODP_CPU_ARCH_ARMV9_0; + return; + case 0xd80: + snprintf(str, maxlen, "Cortex-A520"); + *cpu_isa = ODP_CPU_ARCH_ARMV9_2; + return; + case 0xd81: + snprintf(str, maxlen, "Cortex-A720"); + *cpu_isa = ODP_CPU_ARCH_ARMV9_2; + return; default: break; } From bcb1aa02b59dbbc36260e0da0e62f55d36ce8f0b Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 13 Oct 2023 15:04:43 +0300 Subject: [PATCH 106/192] linux-gen: sysinfo: recognize armv9 ISA Add support for recognizing Armv9 cores. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c b/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c index 19c35f98ba..890004afcd 100644 --- a/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c @@ -233,6 +233,11 @@ static odp_cpu_arch_arm_t arm_isa_version(void) #endif } + if (__ARM_ARCH == 9) { + /* v9.0 or higher */ + return ODP_CPU_ARCH_ARMV9_0; + } + if (__ARM_ARCH >= 800) { /* ACLE 2018 defines that from v8.1 onwards the value includes * the minor version number: __ARM_ARCH = X * 100 + Y From 1835c2612431e9a37c1f1b189810f20b9e4b7274 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 16 Oct 2023 16:47:23 +0300 Subject: [PATCH 107/192] github_ci: enable using github merge queue Enable usage of GitHub merge queue feature. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- .github/workflows/ci-pipeline-arm64.yml | 2 +- .github/workflows/ci-pipeline.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-pipeline-arm64.yml b/.github/workflows/ci-pipeline-arm64.yml index 668c841a01..84f52b75a8 100644 --- a/.github/workflows/ci-pipeline-arm64.yml +++ b/.github/workflows/ci-pipeline-arm64.yml @@ -3,7 +3,7 @@ name: CI arm64 # github.repository has been used to ensure CI is only run on the repo where # self-hosted runners are installed. This will prevent [self-hosted, ARM64] CI failing on forks -on: [push, pull_request] +on: [push, pull_request, merge_group] env: ARCH: arm64 CC: gcc diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 818a9772cb..8124e37530 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -1,6 +1,6 @@ name: CI x86_64 -on: [push, pull_request] +on: [push, pull_request, merge_group] env: ARCH: x86_64 CC: gcc From 1d5603ae9ce0e7a1fa86030b25da9e88713b807c Mon Sep 17 00:00:00 2001 From: Tuomas Taipale Date: Wed, 11 Oct 2023 09:17:44 +0000 Subject: [PATCH 108/192] validation: dma: fix early return with multiple async transfers When checking results for poll-mode asynchronous transfers, check the results of all expected transfers instead of already returning after a single check. Signed-off-by: Tuomas Taipale Reviewed-by: Matias Elo --- test/validation/api/dma/dma.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/validation/api/dma/dma.c b/test/validation/api/dma/dma.c index fc15be8f27..557e1ff0a5 100644 --- a/test/validation/api/dma/dma.c +++ b/test/validation/api/dma/dma.c @@ -663,9 +663,6 @@ static int do_transfer_async(odp_dma_t dma, odp_dma_transfer_param_t *trs_param, CU_ASSERT(user_data == USER_DATA); odp_dma_transfer_id_free(dma, compl_param[i].transfer_id); - - return done; - } else if (compl_mode == ODP_DMA_COMPL_EVENT) { odp_queue_t from = ODP_QUEUE_INVALID; From 3fc1ee279b56434ed2beedf645bccb6ca0708ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= Date: Tue, 17 Oct 2023 12:20:01 +0300 Subject: [PATCH 109/192] example: timer_accuracy: fix schedule wait time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Schedule wait time is not in nanoseconds. Convert by calling odp_schedule_wait_time(). Signed-off-by: Jere Leppänen Reviewed-by: Matias Elo --- example/timer/odp_timer_accuracy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example/timer/odp_timer_accuracy.c b/example/timer/odp_timer_accuracy.c index 4bea7d680f..ff6794166f 100644 --- a/example/timer/odp_timer_accuracy.c +++ b/example/timer/odp_timer_accuracy.c @@ -1028,6 +1028,7 @@ static int run_test(void *arg) uint64_t tmo_ns; timer_ctx_t *ctx; odp_thrmask_t mask; + uint64_t wait = odp_schedule_wait_time(10 * ODP_TIME_MSEC_IN_NS); odp_schedule_group_t group = ODP_SCHED_GROUP_INVALID; test_log_t *log = test_global->log; enum mode_e mode = test_global->opt.mode; @@ -1062,7 +1063,7 @@ static int run_test(void *arg) odp_barrier_wait(&test_global->barrier); while (1) { - ev = odp_schedule(NULL, 10 * ODP_TIME_MSEC_IN_NS); + ev = odp_schedule(NULL, wait); time = odp_time_global_strict(); if (ev == ODP_EVENT_INVALID) { From 15304570b73bc856c67bdc325a9f4725ceb4f89c Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Tue, 17 Oct 2023 16:08:22 +0300 Subject: [PATCH 110/192] validation: crypto: use basic op type when creating test data Use the basic crypto operation type instead of the legacy operation type when invoking crypto for the purpose of creating test data. The legacy operation type, which may get deprecated in the future, will now only be used when testing the legacy operation type itself. Signed-off-by: Janne Peltonen Reviewed-by: Petri Savolainen --- test/validation/api/crypto/odp_crypto_test_inp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index d49a8d002e..50f0281849 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -600,7 +600,7 @@ static int create_hash_test_reference(odp_auth_alg_t auth, CU_ASSERT(rc == 0); session.op = ODP_CRYPTO_OP_ENCODE; - session.op_type = ODP_CRYPTO_OP_TYPE_LEGACY; + session.op_type = ODP_CRYPTO_OP_TYPE_BASIC; session.cipher_range_in_bits = false; session.auth_range_in_bits = false; if (session_create(&session, AUTH_PLAINTEXT, ref, HASH_NO_OVERLAP, false)) @@ -616,7 +616,7 @@ static int create_hash_test_reference(odp_auth_alg_t auth, .auth_range = { .offset = 0, .length = auth_bytes }, .dst_offset_shift = 0, }; - rc = crypto_op(pkt, &pkt, &ok, &op_params, ODP_CRYPTO_OP_TYPE_LEGACY); + rc = crypto_op(pkt, &pkt, &ok, &op_params, ODP_CRYPTO_OP_TYPE_BASIC); CU_ASSERT(rc == 0); if (rc) { @@ -807,7 +807,7 @@ static int crypto_encode_ref(crypto_test_reference_t *ref, CU_ASSERT(rc == 0); session.op = ODP_CRYPTO_OP_ENCODE; - session.op_type = ODP_CRYPTO_OP_TYPE_LEGACY; + session.op_type = ODP_CRYPTO_OP_TYPE_BASIC; session.cipher_range_in_bits = false; session.auth_range_in_bits = false; if (session_create(&session, AUTH_PLAINTEXT, ref, HASH_OVERLAP, false)) { @@ -834,7 +834,7 @@ static int crypto_encode_ref(crypto_test_reference_t *ref, .auth_range = auth_range, .dst_offset_shift = 0, }; - rc = crypto_op(pkt, &pkt, &ok, &op_params, ODP_CRYPTO_OP_TYPE_LEGACY); + rc = crypto_op(pkt, &pkt, &ok, &op_params, ODP_CRYPTO_OP_TYPE_BASIC); CU_ASSERT(rc == 0); if (rc) { (void)odp_crypto_session_destroy(session.session); From 4858759a56d45d03a8c41488b7e55f3c0b3b6f77 Mon Sep 17 00:00:00 2001 From: Joyce Kong Date: Thu, 27 Jul 2023 12:05:28 +0000 Subject: [PATCH 111/192] linux-gen: timer: add possibility to profile inline timer performance Add the branch to profile inline timer scan performance. Enable inline timer scan performance test by setting CONFIG_TIMER_PROFILE_INLINE in odp_config_internal.h. Signed-off-by: Joyce Kong Reviewed-by: Petri Savolainen --- .../include/odp_config_internal.h | 3 ++ platform/linux-generic/odp_system_info.c | 1 + platform/linux-generic/odp_timer.c | 28 +++++++++++++++++-- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h index f83a237e99..279a43687d 100644 --- a/platform/linux-generic/include/odp_config_internal.h +++ b/platform/linux-generic/include/odp_config_internal.h @@ -190,6 +190,9 @@ extern "C" { */ #define CONFIG_TIMER_128BIT_ATOMICS 1 +/* Enable timer scan performance benchmark. This works with inline enabled. */ +#define CONFIG_TIMER_PROFILE_INLINE 0 + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c index 6281bee750..bb0eaa9b19 100644 --- a/platform/linux-generic/odp_system_info.c +++ b/platform/linux-generic/odp_system_info.c @@ -611,5 +611,6 @@ void odp_sys_config_print(void) _ODP_PRINT("CONFIG_POOL_MAX_NUM: %i\n", CONFIG_POOL_MAX_NUM); _ODP_PRINT("CONFIG_POOL_CACHE_MAX_SIZE: %i\n", CONFIG_POOL_CACHE_MAX_SIZE); _ODP_PRINT("CONFIG_TIMER_128BIT_ATOMICS: %i\n", CONFIG_TIMER_128BIT_ATOMICS); + _ODP_PRINT("CONFIG_TIMER_PROFILE_INLINE: %i\n", CONFIG_TIMER_PROFILE_INLINE); _ODP_PRINT("\n"); } diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index 8219c59a2f..c6d399d12f 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -235,7 +235,8 @@ typedef struct timer_local_t { odp_time_t last_run; int run_cnt; uint8_t poll_shared; - + uint64_t prof_nsec; + uint64_t prof_rounds; } timer_local_t; /* Points to timer global data */ @@ -872,7 +873,17 @@ void _odp_timer_run_inline(int dec) } /* Check the timer pools. */ - timer_pool_scan_inline(num, now); + if (CONFIG_TIMER_PROFILE_INLINE) { + odp_time_t t1 = odp_time_local_strict(); + + timer_pool_scan_inline(num, now); + odp_time_t t2 = odp_time_local_strict(); + + timer_local.prof_nsec += odp_time_diff_ns(t2, t1); + timer_local.prof_rounds++; + } else { + timer_pool_scan_inline(num, now); + } } /****************************************************************************** @@ -2119,6 +2130,8 @@ int _odp_timer_init_local(void) timer_local.last_run = odp_time_global_from_ns(0); timer_local.run_cnt = 1; timer_local.poll_shared = 0; + timer_local.prof_nsec = 0; + timer_local.prof_rounds = 0; /* Timer feature disabled */ if (timer_global == NULL) @@ -2140,5 +2153,16 @@ int _odp_timer_init_local(void) int _odp_timer_term_local(void) { + if (CONFIG_TIMER_PROFILE_INLINE) { + if (timer_local.prof_rounds) { + _ODP_PRINT("\n" + "Inline timer profiling for thread %i:\n" + "scan rounds: %" PRIu64 "\n" + "ave scan nsec: %.1f\n", + odp_thread_id(), timer_local.prof_rounds, + (double)timer_local.prof_nsec / timer_local.prof_rounds); + } + } + return 0; } From 6b7a3a55fd4b95ab6834f12c83e7bc16130cfd4e Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Fri, 13 Oct 2023 16:16:01 +0300 Subject: [PATCH 112/192] validation: crypto: reduce duplicate testing in different op modes Run time consuming algorithm combination tests only once, in async-sched, async-plain or sync mode (in that preference order) instead of in all the three modes, unless FULL_TEST is requested. We assume that the actual crypto implementation being tested is the same in all the three modes so test coverage should not suffer much. Signed-off-by: Janne Peltonen Reviewed-by: Tuomas Taipale --- .../api/crypto/odp_crypto_test_inp.c | 29 +++++++++++++++++++ test/validation/api/crypto/util.h | 1 + 2 files changed, 30 insertions(+) diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index 50f0281849..d4bceac81a 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -1303,6 +1303,11 @@ static void test_combo_variants(odp_cipher_alg_t cipher, odp_auth_alg_t auth) static void test_all_combinations(void) { + if (suite_context.partial_test) { + printf("skipped "); + return; + } + printf("\n"); for (size_t n = 0; n < ARRAY_SIZE(cipher_algs); n++) for (size_t i = 0; i < ARRAY_SIZE(auth_algs); i++) @@ -1987,6 +1992,24 @@ static odp_event_t plain_compl_queue_deq(void) return odp_queue_deq(suite_context.queue); } +static int partial_test_only(odp_crypto_op_mode_t op_mode, odp_queue_type_t q_type) +{ + odp_crypto_capability_t capa; + + if (full_test || odp_crypto_capability(&capa)) + return 0; + + if (!capa.async_mode) + return 0; + + if (op_mode == ODP_CRYPTO_SYNC) + return 1; + else if (q_type == ODP_QUEUE_TYPE_PLAIN && capa.queue_type_sched) + return 1; + + return 0; +} + static int crypto_suite_packet_sync_init(void) { suite_context.op_mode = ODP_CRYPTO_SYNC; @@ -1996,6 +2019,8 @@ static int crypto_suite_packet_sync_init(void) return -1; suite_context.queue = ODP_QUEUE_INVALID; + suite_context.partial_test = partial_test_only(suite_context.op_mode, + ODP_QUEUE_TYPE_PLAIN); return 0; } @@ -2017,6 +2042,8 @@ static int crypto_suite_packet_async_plain_init(void) suite_context.queue = out_queue; suite_context.q_type = ODP_QUEUE_TYPE_PLAIN; suite_context.compl_queue_deq = plain_compl_queue_deq; + suite_context.partial_test = partial_test_only(suite_context.op_mode, + suite_context.q_type); return 0; } @@ -2039,6 +2066,8 @@ static int crypto_suite_packet_async_sched_init(void) suite_context.queue = out_queue; suite_context.q_type = ODP_QUEUE_TYPE_SCHED; suite_context.compl_queue_deq = sched_compl_queue_deq; + suite_context.partial_test = partial_test_only(suite_context.op_mode, + suite_context.q_type); return 0; } diff --git a/test/validation/api/crypto/util.h b/test/validation/api/crypto/util.h index a81a568202..e0d8e15a3c 100644 --- a/test/validation/api/crypto/util.h +++ b/test/validation/api/crypto/util.h @@ -20,6 +20,7 @@ struct suite_context_s { odp_queue_t queue; odp_queue_type_t q_type; odp_event_t (*compl_queue_deq)(void); + int partial_test; }; extern struct suite_context_s suite_context; From adcc9eff31154e73e2c109a1b8f11a76431821f6 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 6 Oct 2023 12:33:48 +0300 Subject: [PATCH 113/192] test: bench_pktio_sp: add new test for creating pmr rules Add new test case 'cls_create_pmr', which creates a selected number ('-p') of PMRs. bench_tm_func_record() saves now also the number of measurements, which makes the usage more flexible. Optional precondition check function 'cond' was added to bench_tm_info_t to enable skipping unsupported tests. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- test/performance/bench_common.c | 17 +- test/performance/bench_common.h | 6 + test/performance/odp_bench_pktio_sp.c | 329 +++++++++++++++++++------- 3 files changed, 269 insertions(+), 83 deletions(-) diff --git a/test/performance/bench_common.c b/test/performance/bench_common.c index 710b5a005b..5a948c9c76 100644 --- a/test/performance/bench_common.c +++ b/test/performance/bench_common.c @@ -170,6 +170,8 @@ void bench_tm_func_record(odp_time_t t2, odp_time_t t1, bench_tm_result_t *res, if (odp_time_cmp(diff, res->func[id].max) > 0) res->func[id].max = diff; + + res->func[id].num++; } static void init_result(bench_tm_result_t *res) @@ -183,13 +185,15 @@ static void init_result(bench_tm_result_t *res) } } -static void print_results(bench_tm_result_t *res, uint64_t repeat_count) +static void print_results(bench_tm_result_t *res) { for (uint8_t i = 0; i < res->num; i++) { + uint64_t num = res->func[i].num ? res->func[i].num : 1; + printf(" %-38s %-12" PRIu64 " %-12" PRIu64 " %-12" PRIu64 "\n", res->func[i].name, odp_time_to_ns(res->func[i].min), - odp_time_to_ns(res->func[i].tot) / repeat_count, + odp_time_to_ns(res->func[i].tot) / num, odp_time_to_ns(res->func[i].max)); } } @@ -218,6 +222,13 @@ int bench_tm_run(void *arg) if (bench->max_rounds && bench->max_rounds < rounds) rounds = bench->max_rounds; + if (bench->cond != NULL && !bench->cond()) { + if (i > 0) + printf("[%02d] %-41s n/a n/a n/a\n", + j + 1, bench->name); + continue; + } + init_result(&res); if (bench->init != NULL) @@ -235,7 +246,7 @@ int bench_tm_run(void *arg) /* No print or results from warm-up round */ if (i > 0) { printf("[%02d] %-26s\n", j + 1, bench->name); - print_results(&res, rounds); + print_results(&res); } } } diff --git a/test/performance/bench_common.h b/test/performance/bench_common.h index 1797266b54..bd611878d8 100644 --- a/test/performance/bench_common.h +++ b/test/performance/bench_common.h @@ -140,6 +140,9 @@ typedef struct bench_tm_results_s { /* Maximum duration */ odp_time_t max; + /* Number of measurements */ + uint64_t num; + } func[BENCH_TM_MAX_FUNC]; /* Number of registered test functions */ @@ -159,6 +162,9 @@ typedef struct { /* Test case name */ const char *name; + /* Optional precondition to run test */ + bench_cond_fn_t cond; + /* Optional test initializer function */ bench_init_fn_t init; diff --git a/test/performance/odp_bench_pktio_sp.c b/test/performance/odp_bench_pktio_sp.c index 859abcd76f..e8708e6d6a 100644 --- a/test/performance/odp_bench_pktio_sp.c +++ b/test/performance/odp_bench_pktio_sp.c @@ -23,8 +23,8 @@ /* Maximum interface name length */ #define MAX_NAME_LEN 128 -#define BENCH_INFO(run_fn, init_fn, term_fn, rounds) \ - {.name = #run_fn, .run = run_fn, .init = init_fn, .term = term_fn, \ +#define BENCH_INFO(run_fn, init_fn, term_fn, cond_fn, rounds) \ + {.name = #run_fn, .run = run_fn, .init = init_fn, .term = term_fn, .cond = cond_fn,\ .max_rounds = rounds} typedef struct { @@ -50,6 +50,9 @@ typedef struct { /* Number of packet output queues */ uint32_t num_output_queues; + + /* Number of PMRs */ + uint32_t num_pmr; } opt; /* Packet IO device */ @@ -70,6 +73,16 @@ typedef struct { /* Output queue statistics */ odp_pktout_queue_stats_t pktout_queue_stats; + /* Data for cls_pmr_create() test */ + struct { + /* Term used to create PMRs */ + odp_cls_pmr_term_t term; + + /* Is test enabled */ + odp_bool_t enabled; + + } cls_pmr_create; + /* Common benchmark suite data */ bench_tm_suite_t suite; @@ -105,11 +118,8 @@ static int setup_sig_handler(void) return 0; } -static void clean_pending_events(appl_args_t *appl_args) +static void clean_pending_events(void) { - if (appl_args->opt.in_mode != ODP_PKTIN_MODE_SCHED) - return; - while (1) { odp_event_t event = odp_schedule(NULL, odp_schedule_wait_time(ODP_TIME_MSEC_IN_NS)); @@ -148,7 +158,7 @@ static odp_pool_t create_packet_pool(void) return pool; } -static void pktio_setup(void) +static void pktio_setup_param(odp_pktin_mode_t in_mode, odp_pktout_mode_t out_mode, odp_bool_t cls) { appl_args_t *appl_args = gbl_args; odp_pktio_param_t param; @@ -161,8 +171,8 @@ static void pktio_setup(void) pool = create_packet_pool(); odp_pktio_param_init(¶m); - param.in_mode = appl_args->opt.in_mode; - param.out_mode = appl_args->opt.out_mode; + param.in_mode = in_mode; + param.out_mode = out_mode; pktio = odp_pktio_open(appl_args->opt.name, pool, ¶m); if (pktio == ODP_PKTIO_INVALID) @@ -170,9 +180,14 @@ static void pktio_setup(void) odp_pktin_queue_param_init(&pktin_param); pktin_param.num_queues = appl_args->opt.num_input_queues; - if (pktin_param.num_queues > 1) { - pktin_param.hash_enable = true; - pktin_param.hash_proto.proto.ipv4_udp = 1; + + if (cls) { + pktin_param.classifier_enable = true; + } else { + if (pktin_param.num_queues > 1) { + pktin_param.hash_enable = true; + pktin_param.hash_proto.proto.ipv4_udp = 1; + } } odp_pktout_queue_param_init(&pktout_param); @@ -194,47 +209,37 @@ static void pktio_setup(void) appl_args->pktio = pktio; } -static void pktio_setup_direct_rx(void) +static void pktio_setup(void) { - appl_args_t *appl_args = gbl_args; - odp_pktin_mode_t mode_orig = appl_args->opt.in_mode; + pktio_setup_param(gbl_args->opt.in_mode, gbl_args->opt.out_mode, false); +} - appl_args->opt.in_mode = ODP_PKTIN_MODE_DIRECT; - pktio_setup(); - appl_args->opt.in_mode = mode_orig; +static void pktio_setup_direct_rx(void) +{ + pktio_setup_param(ODP_PKTIN_MODE_DIRECT, gbl_args->opt.out_mode, false); } static void pktio_setup_sched_rx(void) { - appl_args_t *appl_args = gbl_args; - odp_pktin_mode_t mode_orig = appl_args->opt.in_mode; + pktio_setup_param(ODP_PKTIN_MODE_SCHED, gbl_args->opt.out_mode, false); +} - appl_args->opt.in_mode = ODP_PKTIN_MODE_SCHED; - pktio_setup(); - appl_args->opt.in_mode = mode_orig; +static void pktio_setup_cls(void) +{ + pktio_setup_param(ODP_PKTIN_MODE_SCHED, gbl_args->opt.out_mode, true); } static void pktio_setup_direct_tx(void) { - appl_args_t *appl_args = gbl_args; - odp_pktout_mode_t mode_orig = appl_args->opt.out_mode; - - appl_args->opt.out_mode = ODP_PKTOUT_MODE_DIRECT; - pktio_setup(); - appl_args->opt.out_mode = mode_orig; + pktio_setup_param(gbl_args->opt.in_mode, ODP_PKTOUT_MODE_DIRECT, false); } static void pktio_setup_queue_tx(void) { - appl_args_t *appl_args = gbl_args; - odp_pktout_mode_t mode_orig = appl_args->opt.out_mode; - - appl_args->opt.out_mode = ODP_PKTOUT_MODE_QUEUE; - pktio_setup(); - appl_args->opt.out_mode = mode_orig; + pktio_setup_param(gbl_args->opt.in_mode, ODP_PKTOUT_MODE_QUEUE, false); } -static void pktio_clean(void) +static void pktio_clean_param(odp_pktin_mode_t in_mode) { appl_args_t *appl_args = gbl_args; int ret; @@ -244,7 +249,8 @@ static void pktio_clean(void) ODPH_ABORT("Stopping pktio failed: %d\n", ret); /* Clean possible pre-scheduled packets */ - clean_pending_events(appl_args); + if (in_mode == ODP_PKTIN_MODE_SCHED) + clean_pending_events(); ret = odp_pktio_close(appl_args->pktio); if (ret) @@ -255,44 +261,19 @@ static void pktio_clean(void) ODPH_ABORT("Destroying pktio pool failed: %d\n", ret); } -static void pktio_clean_direct_rx(void) +static void pktio_clean(void) { - appl_args_t *appl_args = gbl_args; - odp_pktin_mode_t mode_orig = appl_args->opt.in_mode; - - appl_args->opt.in_mode = ODP_PKTIN_MODE_DIRECT; - pktio_clean(); - appl_args->opt.in_mode = mode_orig; + pktio_clean_param(gbl_args->opt.in_mode); } -static void pktio_clean_sched_rx(void) +static void pktio_clean_direct_rx(void) { - appl_args_t *appl_args = gbl_args; - odp_pktin_mode_t mode_orig = appl_args->opt.in_mode; - - appl_args->opt.in_mode = ODP_PKTIN_MODE_SCHED; - pktio_clean(); - appl_args->opt.in_mode = mode_orig; + pktio_clean_param(ODP_PKTIN_MODE_DIRECT); } -static void pktio_clean_direct_tx(void) +static void pktio_clean_sched_rx(void) { - appl_args_t *appl_args = gbl_args; - odp_pktout_mode_t mode_orig = appl_args->opt.out_mode; - - appl_args->opt.out_mode = ODP_PKTOUT_MODE_DIRECT; - pktio_clean(); - appl_args->opt.out_mode = mode_orig; -} - -static void pktio_clean_queue_tx(void) -{ - appl_args_t *appl_args = gbl_args; - odp_pktout_mode_t mode_orig = appl_args->opt.out_mode; - - appl_args->opt.out_mode = ODP_PKTOUT_MODE_QUEUE; - pktio_clean(); - appl_args->opt.out_mode = mode_orig; + pktio_clean_param(ODP_PKTIN_MODE_SCHED); } static int pktio_capability(bench_tm_result_t *res, int repeat_count) @@ -418,7 +399,8 @@ static int pktio_open_start_stop_close(bench_tm_result_t *res, int repeat_count) } /* Clean possible pre-scheduled packets */ - clean_pending_events(appl_args); + if (appl_args->opt.in_mode == ODP_PKTIN_MODE_SCHED) + clean_pending_events(); t7 = odp_time_local_strict(); ret = odp_pktio_close(pktio); @@ -615,16 +597,193 @@ static int pktout_event_queue_stats(bench_tm_result_t *res, int repeat_count) return 0; } +static int find_first_supported_l3_pmr(const odp_cls_capability_t *capa, odp_cls_pmr_term_t *term) +{ + *term = ODP_PMR_TCP_DPORT; + + if (capa->supported_terms.bit.udp_sport) + *term = ODP_PMR_UDP_SPORT; + else if (capa->supported_terms.bit.udp_dport) + *term = ODP_PMR_UDP_DPORT; + else if (capa->supported_terms.bit.tcp_sport) + *term = ODP_PMR_TCP_SPORT; + else if (capa->supported_terms.bit.tcp_dport) + *term = ODP_PMR_TCP_DPORT; + else + return 0; + + return 1; +} + +/* Capabilities required for cls_pmr_create() test */ +static int check_cls_capa(void) +{ + appl_args_t *appl_args = gbl_args; + odp_cls_capability_t cls_capa; + odp_schedule_capability_t sched_capa; + int ret; + + ret = odp_cls_capability(&cls_capa); + if (ret) { + ODPH_ERR("Reading classifier capa failed: %d\n", ret); + return -1; + } + + ret = odp_schedule_capability(&sched_capa); + if (ret) { + ODPH_ERR("Reading scheduler capa failed: %d\n", ret); + return -1; + } + + if (!find_first_supported_l3_pmr(&cls_capa, &appl_args->cls_pmr_create.term)) { + ODPH_ERR("Implementations doesn't support any TCP/UDP PMRs\n"); + return 0; + } + + /* One extra CoS and queue required for the default CoS */ + if (appl_args->opt.num_pmr + 1 > cls_capa.max_cos) { + ODPH_ERR("Not enough CoSes supported for PMR test: %u/%u\n", + appl_args->opt.num_pmr + 1, cls_capa.max_cos); + return 0; + } + + if (appl_args->opt.num_pmr + 1 > sched_capa.max_queues) { + ODPH_ERR("Not enough queues supported for PMR test: %u/%u\n", + appl_args->opt.num_pmr + 1, sched_capa.max_queues); + return 0; + } + + appl_args->cls_pmr_create.enabled = true; + + return 1; +} + +static int check_cls_cond(void) +{ + return gbl_args->cls_pmr_create.enabled; +} + +static int cls_pmr_create(bench_tm_result_t *res, int repeat_count) +{ + appl_args_t *appl_args = gbl_args; + odp_pktio_t pktio = appl_args->pktio; + odp_cls_cos_param_t cos_param; + odp_queue_param_t queue_param; + odp_pmr_param_t pmr_param; + odp_cos_t default_cos; + uint32_t num_cos = appl_args->opt.num_pmr + 1; + uint32_t num_pmr = num_cos - 1; + uint32_t cos_created = 0; + uint32_t queue_created = 0; + uint16_t val = 1024; + uint16_t mask = 0xffff; + int ret = 0; + odp_time_t t1, t2; + odp_cos_t cos[num_cos]; + odp_queue_t queue[num_cos]; + odp_pmr_t pmr[num_pmr]; + uint8_t id1 = bench_tm_func_register(res, "odp_cls_pmr_create()"); + uint8_t id2 = bench_tm_func_register(res, "odp_cls_pmr_destroy()"); + + odp_queue_param_init(&queue_param); + queue_param.type = ODP_QUEUE_TYPE_SCHED; + + odp_cls_cos_param_init(&cos_param); + + for (uint32_t i = 0; i < num_cos; i++) { + queue[i] = odp_queue_create(NULL, &queue_param); + if (queue[i] == ODP_QUEUE_INVALID) { + ODPH_ERR("odp_queue_create() failed %u / %u\n", i + 1, num_cos); + break; + } + + cos_param.queue = queue[i]; + queue_created++; + + cos[i] = odp_cls_cos_create(NULL, &cos_param); + if (cos[i] == ODP_COS_INVALID) { + ODPH_ERR("odp_cls_cos_create() failed %u / %u\n", i + 1, num_cos); + break; + } + cos_created++; + } + + if (queue_created != num_cos) + ODPH_ERR("Unable to create all queues: %u/%u\n", queue_created, num_cos); + + if (cos_created != num_cos) { + ODPH_ERR("Unable to create all CoSes: %u/%u\n", cos_created, num_cos); + goto destroy_cos; + } + + default_cos = cos[0]; + + ret = odp_pktio_default_cos_set(pktio, default_cos); + if (ret) { + ODPH_ERR("Setting default CoS failed: %d\n", ret); + goto destroy_cos; + } + + odp_cls_pmr_param_init(&pmr_param); + pmr_param.term = appl_args->cls_pmr_create.term; + pmr_param.match.value = &val; + pmr_param.match.mask = &mask; + pmr_param.val_sz = sizeof(val); + + for (uint32_t i = 0; i < (uint32_t)repeat_count; i++) { + uint32_t pmr_created = 0; + + for (uint32_t j = 0; j < num_pmr; j++) { + t1 = odp_time_local_strict(); + pmr[j] = odp_cls_pmr_create(&pmr_param, 1, default_cos, cos[j + 1]); + t2 = odp_time_local_strict(); + + if (pmr[j] == ODP_PMR_INVALID) + break; + bench_tm_func_record(t2, t1, res, id1); + + val++; + pmr_created++; + } + + for (uint32_t j = 0; j < pmr_created; j++) { + t1 = odp_time_local_strict(); + ret = odp_cls_pmr_destroy(pmr[j]); + t2 = odp_time_local_strict(); + + if (ret) + ODPH_ABORT("Destroying PMR failed: %d\n", ret); + + bench_tm_func_record(t2, t1, res, id2); + } + + if (i == 0) + ODPH_DBG("Created %u PMRs\n", pmr_created); + } + + ret = odp_pktio_default_cos_set(pktio, ODP_COS_INVALID); + +destroy_cos: + for (uint32_t i = 0; i < cos_created; i++) + ret = odp_cos_destroy(cos[i]); + + for (uint32_t i = 0; i < queue_created; i++) + ret = odp_queue_destroy(queue[i]); + + return ret; +} + bench_tm_info_t test_suite[] = { - BENCH_INFO(pktio_capability, pktio_setup, pktio_clean, 0), - BENCH_INFO(pktio_lookup, pktio_setup, pktio_clean, 0), - BENCH_INFO(pktio_open_start_stop_close, NULL, NULL, 0), - BENCH_INFO(pktio_stats, pktio_setup, pktio_clean, 0), - BENCH_INFO(pktin_queue_stats, pktio_setup_direct_rx, pktio_clean_direct_rx, 0), - BENCH_INFO(pktin_event_queue_stats, pktio_setup_sched_rx, pktio_clean_sched_rx, 0), - BENCH_INFO(pktout_queue_stats, pktio_setup_direct_tx, pktio_clean_direct_tx, 0), - BENCH_INFO(pktout_event_queue_stats, pktio_setup_queue_tx, pktio_clean_queue_tx, 0), - BENCH_INFO(pktio_stats_reset, pktio_setup, pktio_clean, 0) + BENCH_INFO(pktio_capability, pktio_setup, pktio_clean, NULL, 0), + BENCH_INFO(pktio_lookup, pktio_setup, pktio_clean, NULL, 0), + BENCH_INFO(pktio_open_start_stop_close, NULL, NULL, NULL, 0), + BENCH_INFO(pktio_stats, pktio_setup, pktio_clean, NULL, 0), + BENCH_INFO(pktin_queue_stats, pktio_setup_direct_rx, pktio_clean_direct_rx, NULL, 0), + BENCH_INFO(pktin_event_queue_stats, pktio_setup_sched_rx, pktio_clean_sched_rx, NULL, 0), + BENCH_INFO(pktout_queue_stats, pktio_setup_direct_tx, pktio_clean, NULL, 0), + BENCH_INFO(pktout_event_queue_stats, pktio_setup_queue_tx, pktio_clean, NULL, 0), + BENCH_INFO(pktio_stats_reset, pktio_setup, pktio_clean, NULL, 0), + BENCH_INFO(cls_pmr_create, pktio_setup_cls, pktio_clean_sched_rx, check_cls_cond, 0) }; /* Print usage information */ @@ -642,6 +801,7 @@ static void usage(void) " -o, --out_mode Packet output mode\n" " 0: Direct mode: PKTOUT_MODE_DIRECT (default)\n" " 1: Queue mode: PKTOUT_MODE_QUEUE\n" + " -p, --pmr Number of PMRs to create/destroy per round (default 1)\n" " -q, --rx_queues Number of packet input queues (default 1)\n" " -t, --tx_queues Number of packet output queues (default 1)\n" " -r, --rounds Run each test case 'num' times (default %u).\n" @@ -670,6 +830,7 @@ static int parse_args(int argc, char *argv[]) {"interface", required_argument, NULL, 'i'}, {"in_mode", required_argument, NULL, 'm'}, {"out_mode", required_argument, NULL, 'o'}, + {"pmr", required_argument, NULL, 'p'}, {"rx_queues", required_argument, NULL, 'q'}, {"tx_queues", required_argument, NULL, 't'}, {"rounds", required_argument, NULL, 'r'}, @@ -678,7 +839,7 @@ static int parse_args(int argc, char *argv[]) {NULL, 0, NULL, 0} }; - static const char *shortopts = "i:m:o:q:r:s:t:h"; + static const char *shortopts = "i:m:o:p:q:r:s:t:h"; strncpy(gbl_args->opt.name, "loop", MAX_NAME_LEN); gbl_args->opt.rounds = ROUNDS; @@ -686,6 +847,7 @@ static int parse_args(int argc, char *argv[]) gbl_args->opt.out_mode = ODP_PKTOUT_MODE_DIRECT; gbl_args->opt.num_input_queues = 1; gbl_args->opt.num_output_queues = 1; + gbl_args->opt.num_pmr = 1; while (1) { opt = getopt_long(argc, argv, shortopts, longopts, &long_index); @@ -712,6 +874,9 @@ static int parse_args(int argc, char *argv[]) else gbl_args->opt.out_mode = ODP_PKTOUT_MODE_DIRECT; break; + case 'p': + gbl_args->opt.num_pmr = atoi(optarg); + break; case 'q': gbl_args->opt.num_input_queues = atoi(optarg); break; @@ -768,7 +933,7 @@ static int check_args(appl_args_t *appl_args) ret = odp_pktio_capability(pktio, &capa); if (ret) { - ODPH_ERR("Reading pktio capa failed\n"); + ODPH_ERR("Reading pktio capa failed: %d\n", ret); return -1; } @@ -796,6 +961,9 @@ static int check_args(appl_args_t *appl_args) return -1; } + if (check_cls_capa() < 0) + return -1; + return 0; } @@ -825,6 +993,7 @@ static void print_info(appl_args_t *appl_args) printf("Input queues: %u\n", gbl_args->opt.num_input_queues); printf("Output queues: %u\n", gbl_args->opt.num_output_queues); + printf("PMRs: %u\n", gbl_args->opt.num_pmr); printf("Test rounds: %d\n", gbl_args->opt.rounds); printf("\n"); } From a27d53ddd611fb4d4fe99b4291c86ca3783b8b28 Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Wed, 18 Oct 2023 11:16:05 +0300 Subject: [PATCH 114/192] validation: timer: check periodic support per clk src Record periodic timer support per clock source. Fix support check with the default clock source. It used capa from the last clock source instead of the default. Signed-off-by: Petri Savolainen Reviewed-by: Matias Elo --- test/validation/api/timer/timer.c | 35 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index 3ed7d02385..c225ba1e61 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -69,6 +69,12 @@ typedef struct { /* Clock source support flags */ uint8_t clk_supported[ODP_CLOCK_NUM_SRC]; + /* Periodic timer support per clock source*/ + uint8_t periodic_support[ODP_CLOCK_NUM_SRC]; + + /* Periodic timers not supported with any clock source */ + int no_periodic; + /* Default resolution / timeout parameters */ struct { uint64_t res_ns; @@ -97,9 +103,6 @@ typedef struct { /* Number of timers allocated per thread */ uint32_t timers_per_thread; - /* Periodic timers supported */ - int periodic; - /* Queue type to be tested */ odp_queue_type_t test_queue_type; @@ -117,6 +120,7 @@ static int timer_global_init(odp_instance_t *inst) uint64_t res_ns, min_tmo, max_tmo; unsigned int range; int i; + int num_periodic = 0; if (odph_options(&helper_options)) { ODPH_ERR("odph_options() failed\n"); @@ -184,23 +188,26 @@ static int timer_global_init(odp_instance_t *inst) return -1; } - /* Default parameters for test cases */ - global_mem->clk_supported[0] = 1; + /* Default parameters for test cases using the default clock source */ global_mem->param.res_ns = res_ns; global_mem->param.min_tmo = min_tmo; global_mem->param.max_tmo = max_tmo; global_mem->param.queue_type_plain = capa.queue_type_plain; global_mem->param.queue_type_sched = capa.queue_type_sched; - /* Check which other source clocks are supported */ - for (i = 1; i < ODP_CLOCK_NUM_SRC; i++) { - if (odp_timer_capability(ODP_CLOCK_SRC_0 + i, &capa) == 0) + /* Check which clock sources are supported */ + for (i = 0; i < ODP_CLOCK_NUM_SRC; i++) { + if (odp_timer_capability(ODP_CLOCK_SRC_0 + i, &capa) == 0) { global_mem->clk_supported[i] = 1; + + if (capa.periodic.max_pools) { + global_mem->periodic_support[i] = 1; + num_periodic++; + } + } } - /* Check if periodic timers are supported */ - if (capa.periodic.max_pools > 0) - global_mem->periodic = 1; + global_mem->no_periodic = !num_periodic; return 0; } @@ -248,7 +255,7 @@ check_plain_queue_support(void) static int check_periodic_support(void) { - if (global_mem->periodic) + if (global_mem->periodic_support[0]) return ODP_TEST_ACTIVE; return ODP_TEST_INACTIVE; @@ -256,7 +263,7 @@ static int check_periodic_support(void) static int check_periodic_sched_support(void) { - if (global_mem->periodic && global_mem->param.queue_type_sched) + if (global_mem->periodic_support[0] && global_mem->param.queue_type_sched) return ODP_TEST_ACTIVE; return ODP_TEST_INACTIVE; @@ -264,7 +271,7 @@ static int check_periodic_sched_support(void) static int check_periodic_plain_support(void) { - if (global_mem->periodic && global_mem->param.queue_type_plain) + if (global_mem->periodic_support[0] && global_mem->param.queue_type_plain) return ODP_TEST_ACTIVE; return ODP_TEST_INACTIVE; From 4faf5837120fa3c923431fb693ed0f2845cc9198 Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Thu, 19 Oct 2023 16:17:51 +0300 Subject: [PATCH 115/192] validation: timer: periodic timer capa per clock source Extend periodic timer capability test to use all supported clock sources. Signed-off-by: Petri Savolainen Reviewed-by: Matias Elo --- test/validation/api/timer/timer.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index c225ba1e61..0f8d893e1e 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -255,10 +255,10 @@ check_plain_queue_support(void) static int check_periodic_support(void) { - if (global_mem->periodic_support[0]) - return ODP_TEST_ACTIVE; + if (global_mem->no_periodic) + return ODP_TEST_INACTIVE; - return ODP_TEST_INACTIVE; + return ODP_TEST_ACTIVE; } static int check_periodic_sched_support(void) @@ -2645,7 +2645,7 @@ static void timer_test_sched_all(void) timer_test_all(ODP_QUEUE_TYPE_SCHED); } -static void timer_test_periodic_capa(void) +static void timer_test_periodic_capa_run(odp_timer_clk_src_t clk_src) { odp_timer_capability_t timer_capa; odp_timer_periodic_capability_t capa; @@ -2657,7 +2657,7 @@ static void timer_test_periodic_capa(void) uint32_t num = 100; memset(&timer_capa, 0, sizeof(odp_timer_capability_t)); - CU_ASSERT_FATAL(odp_timer_capability(ODP_CLOCK_DEFAULT, &timer_capa) == 0); + CU_ASSERT_FATAL(odp_timer_capability(clk_src, &timer_capa) == 0); CU_ASSERT(timer_capa.periodic.max_pools); CU_ASSERT(timer_capa.periodic.max_timers); @@ -2688,7 +2688,7 @@ static void timer_test_periodic_capa(void) capa.max_multiplier = 1; capa.res_ns = 0; - CU_ASSERT(odp_timer_periodic_capability(ODP_CLOCK_DEFAULT, &capa) == 1); + CU_ASSERT(odp_timer_periodic_capability(clk_src, &capa) == 1); CU_ASSERT(capa.base_freq_hz.integer == min_fract.integer); CU_ASSERT(capa.base_freq_hz.numer == min_fract.numer); CU_ASSERT(capa.base_freq_hz.denom == min_fract.denom); @@ -2700,7 +2700,7 @@ static void timer_test_periodic_capa(void) capa.max_multiplier = 1; capa.res_ns = 0; - CU_ASSERT(odp_timer_periodic_capability(ODP_CLOCK_DEFAULT, &capa) == 1); + CU_ASSERT(odp_timer_periodic_capability(clk_src, &capa) == 1); CU_ASSERT(capa.base_freq_hz.integer == max_fract.integer); CU_ASSERT(capa.base_freq_hz.numer == max_fract.numer); CU_ASSERT(capa.base_freq_hz.denom == max_fract.denom); @@ -2750,7 +2750,7 @@ static void timer_test_periodic_capa(void) ODPH_DBG("freq %" PRIu64 ", multip %" PRIu64 ", res %" PRIu64 ",\n", base_freq.integer, max_multiplier, res_ns); - ret = odp_timer_periodic_capability(ODP_CLOCK_DEFAULT, &capa); + ret = odp_timer_periodic_capability(clk_src, &capa); if (ret == 1) { CU_ASSERT(capa.base_freq_hz.integer == base_freq.integer); @@ -2785,6 +2785,20 @@ static void timer_test_periodic_capa(void) } } +static void timer_test_periodic_capa(void) +{ + odp_timer_clk_src_t clk_src; + int i; + + for (i = 0; i < ODP_CLOCK_NUM_SRC; i++) { + clk_src = ODP_CLOCK_SRC_0 + i; + if (global_mem->periodic_support[i]) { + ODPH_DBG("\nTesting clock source: %i\n", clk_src); + timer_test_periodic_capa_run(clk_src); + } + } +} + static void timer_test_periodic(odp_queue_type_t queue_type, int use_first, int rounds, int reuse_event) { From 1b10c8c0270a95cf361024bb84c1c37c457d2214 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 19 Oct 2023 13:16:50 +0300 Subject: [PATCH 116/192] test: l2fwd: print pktio extra statistics Print packet IO interface extra statistics (if available) in verbose mode. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- test/performance/odp_l2fwd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index 853f292694..c6bcc558ef 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -2437,7 +2437,14 @@ int main(int argc, char *argv[]) } for (i = 0; i < if_count; ++i) { - if (odp_pktio_close(gbl_args->pktios[i].pktio)) { + odp_pktio_t pktio = gbl_args->pktios[i].pktio; + + if (gbl_args->appl.verbose && odp_pktio_extra_stat_info(pktio, NULL, 0) > 0) { + printf("Pktio %s extra statistics:\n", gbl_args->appl.if_names[i]); + odp_pktio_extra_stats_print(pktio); + } + + if (odp_pktio_close(pktio)) { ODPH_ERR("Pktio close failed: %s\n", gbl_args->appl.if_names[i]); exit(EXIT_FAILURE); } From 8e50476663a3ebe3c4c2db8c556438b2e3e19ac6 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 28 Aug 2023 08:53:29 +0300 Subject: [PATCH 117/192] api: pktio: add ODP_PKTIO_MAX_INDEX define Add new API define ODP_PKTIO_MAX_INDEX for maximum packet IO interface index. The value of ODP_PKTIO_MAX_INDEX is always greater or equal to odp_pktio_max_index(), so the new define can be used for example when defining static length arrays. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen Reviewed-by: Jerin Jacob --- include/odp/api/abi-default/packet_io_types.h | 4 +++- include/odp/api/spec/packet_io.h | 3 ++- include/odp/api/spec/packet_io_types.h | 6 ++++++ .../linux-generic/include-abi/odp/api/abi/packet_io_types.h | 4 +++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/odp/api/abi-default/packet_io_types.h b/include/odp/api/abi-default/packet_io_types.h index c13dd97e51..ddf8c3a3fa 100644 --- a/include/odp/api/abi-default/packet_io_types.h +++ b/include/odp/api/abi-default/packet_io_types.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) 2015-2018 Linaro Limited - * Copyright (c) 2020-2022 Nokia + * Copyright (c) 2020-2023 Nokia */ /** @@ -47,6 +47,8 @@ typedef struct odp_pktout_queue_t { #define ODP_PKTIO_INVALID ((odp_pktio_t)0) #define ODP_LSO_PROFILE_INVALID ((odp_lso_profile_t)0) +#define ODP_PKTIO_MAX_INDEX 63 + #define ODP_PKTIO_MACADDR_MAXSIZE 16 #define ODP_PKTIN_NO_WAIT 0 diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index d653ad72d8..cfb463c394 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) 2013-2018 Linaro Limited - * Copyright (c) 2020-2022 Nokia + * Copyright (c) 2020-2023 Nokia */ /** @@ -126,6 +126,7 @@ int odp_pktio_capability(odp_pktio_t pktio, odp_pktio_capability_t *capa); * * Return the maximum packet IO interface index. Interface indexes * (e.g. returned by odp_pktio_index()) range from zero to this maximum value. + * The return value does not exceed #ODP_PKTIO_MAX_INDEX. * * @return Maximum packet IO interface index */ diff --git a/include/odp/api/spec/packet_io_types.h b/include/odp/api/spec/packet_io_types.h index 47b77b9383..6b80611eca 100644 --- a/include/odp/api/spec/packet_io_types.h +++ b/include/odp/api/spec/packet_io_types.h @@ -58,6 +58,12 @@ extern "C" { * Invalid LSO profile handle */ +/** + * @def ODP_PKTIO_MAX_INDEX + * Maximum packet IO interface index. Use odp_pktio_max_index() to check the + * runtime maximum value, which may be smaller than this value. + */ + /** * @def ODP_PKTIO_MACADDR_MAXSIZE * Minimum size of output buffer for odp_pktio_mac_addr() 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 1692e71b16..87e297f1d3 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,5 +1,5 @@ /* Copyright (c) 2015-2018, Linaro Limited - * Copyright (c) 2020-2022, Nokia + * Copyright (c) 2020-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -43,6 +43,8 @@ typedef struct odp_pktout_queue_t { #define ODP_PKTIO_INVALID _odp_cast_scalar(odp_pktio_t, 0) #define ODP_LSO_PROFILE_INVALID _odp_cast_scalar(odp_lso_profile_t, 0) +#define ODP_PKTIO_MAX_INDEX 63 + #define ODP_PKTIO_MACADDR_MAXSIZE 16 #define ODP_PKTIN_NO_WAIT 0 From e42a672aad071e568dc33ed880ebbf058d001eed Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 28 Aug 2023 09:17:26 +0300 Subject: [PATCH 118/192] validation: pktio: add test for ODP_PKTIO_MAX_INDEX Add simple tests for ODP_PKTIO_MAX_INDEX and odp_pktio_max_index(). The value of ODP_PKTIO_MAX_INDEX is expected to be reasonable small as it's likely used to reserve memory. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- test/validation/api/pktio/pktio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c index 79d835f603..5feeea4c0a 100644 --- a/test/validation/api/pktio/pktio.c +++ b/test/validation/api/pktio/pktio.c @@ -1705,6 +1705,9 @@ static void pktio_test_index(void) ndx = odp_pktio_index(pktio); CU_ASSERT(ndx >= 0); + CU_ASSERT(ODP_PKTIO_MAX_INDEX >= odp_pktio_max_index()); + CU_ASSERT(ODP_PKTIO_MAX_INDEX >= 0 && ODP_PKTIO_MAX_INDEX <= 1024); + CU_ASSERT(odp_pktio_close(pktio) == 0); } From d2030a21a93e0cdb548f7d920bc3c0d37e405940 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 28 Aug 2023 09:32:07 +0300 Subject: [PATCH 119/192] linux-gen: pktio: add assert check for odp_pktio_max_index() return value Add compile time check for odp_pktio_max_index() return value. Test that implementation internal ODP_CONFIG_PKTIO_ENTRIES define is smaller or equal than the new ODP_PKTIO_MAX_INDEX define. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- platform/linux-generic/odp_packet_io.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 406916de25..38c1c2b033 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -1625,6 +1626,9 @@ int odp_pktio_capability(odp_pktio_t pktio, odp_pktio_capability_t *capa) return 0; } +ODP_STATIC_ASSERT(ODP_CONFIG_PKTIO_ENTRIES - 1 <= ODP_PKTIO_MAX_INDEX, + "ODP_CONFIG_PKTIO_ENTRIES larger than ODP_PKTIO_MAX_INDEX"); + unsigned int odp_pktio_max_index(void) { return ODP_CONFIG_PKTIO_ENTRIES - 1; From 8e9ffd0b17f4995cba0b7753685ea6a7caf1416d Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 28 Aug 2023 09:44:14 +0300 Subject: [PATCH 120/192] example: ping: use new ODP_PKTIO_MAX_INDEX define Replace MAX_PKTIO_INDEXES with ODP_PKTIO_MAX_INDEX API define, which value is quaranteed to be >= odp_pktio_max_index() and odp_pktio_index(). Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- example/ping/odp_ping.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/example/ping/odp_ping.c b/example/ping/odp_ping.c index 52efda9d8f..2c7d507f24 100644 --- a/example/ping/odp_ping.c +++ b/example/ping/odp_ping.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2019-2022, Nokia +/* Copyright (c) 2019-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -16,7 +16,6 @@ #include #define MAX_PKTIOS 32 -#define MAX_PKTIO_INDEXES 1024 #define MAX_PKTIO_NAME 255 #define MAX_PKT_NUM 1024 @@ -48,7 +47,7 @@ typedef struct test_global_t { } pktio[MAX_PKTIOS]; /* Pktio index lookup table */ - uint8_t pktio_from_idx[MAX_PKTIO_INDEXES]; + uint8_t pktio_from_idx[ODP_PKTIO_MAX_INDEX + 1]; } test_global_t; @@ -196,9 +195,6 @@ static int open_pktios(test_global_t *global) return -1; } - if (odp_pktio_max_index() >= MAX_PKTIO_INDEXES) - printf("Warning: max pktio index (%u) is too large\n", odp_pktio_max_index()); - odp_pktio_param_init(&pktio_param); pktio_param.in_mode = ODP_PKTIN_MODE_SCHED; pktio_param.out_mode = ODP_PKTOUT_MODE_DIRECT; @@ -287,8 +283,8 @@ static int init_pktio_lookup_tbl(test_global_t *global) odp_pktio_t pktio = global->pktio[i].pktio; int pktio_idx = odp_pktio_index(pktio); - if (pktio_idx < 0 || pktio_idx >= MAX_PKTIO_INDEXES) { - ODPH_ERR("Bad pktio index: %i\n", pktio_idx); + if (pktio_idx < 0) { + ODPH_ERR("odp_pktio_index() failed: %s\n", global->opt.pktio_name[i]); return -1; } From 21eac7e64094aaa2546ed6149dd1e3a858fe0c5a Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 28 Aug 2023 09:46:08 +0300 Subject: [PATCH 121/192] test: performance: use new ODP_PKTIO_MAX_INDEX define Replace MAX_PKTIO_INDEXES with ODP_PKTIO_MAX_INDEX API define, which value is quaranteed to be >= odp_pktio_max_index() and odp_pktio_index(). Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- test/performance/odp_dmafwd.c | 9 +-------- test/performance/odp_l2fwd.c | 17 ++++++----------- test/performance/odp_packet_gen.c | 11 +++-------- test/performance/odp_sched_pktio.c | 2 +- 4 files changed, 11 insertions(+), 28 deletions(-) diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c index 5e0d4366db..03ac1b6400 100644 --- a/test/performance/odp_dmafwd.c +++ b/test/performance/odp_dmafwd.c @@ -44,7 +44,6 @@ enum { #define MAX_OUT_QS 32U #define MAX_BURST 32U #define MAX_WORKERS (ODP_THREAD_COUNT_MAX - 1) -#define MAX_PKTIO_INDEXES 1024U #define MIN(a, b) (((a) <= (b)) ? (a) : (b)) #define MAX(a, b) (((a) >= (b)) ? (a) : (b)) @@ -126,7 +125,7 @@ typedef void (*pkt_fn_t)(odp_packet_t pkts[], int num, pktio_t *pktio, init_fn_t typedef void (*drain_fn_t)(thread_config_t *config); typedef struct prog_config_s { - uint8_t pktio_idx_map[MAX_PKTIO_INDEXES]; + uint8_t pktio_idx_map[ODP_PKTIO_MAX_INDEX + 1]; odph_thread_t thread_tbl[MAX_WORKERS]; thread_config_t thread_config[MAX_WORKERS]; pktio_t pktios[MAX_IFS]; @@ -298,7 +297,6 @@ static odp_bool_t get_stash_capa(odp_stash_capability_t *stash_capa, odp_stash_t static parse_result_t check_options(prog_config_t *config) { - const unsigned int idx = odp_pktio_max_index(); odp_dma_capability_t dma_capa; uint32_t burst_size; odp_stash_capability_t stash_capa; @@ -312,11 +310,6 @@ static parse_result_t check_options(prog_config_t *config) return PRS_NOK; } - if (idx >= MAX_PKTIO_INDEXES) { - ODPH_ERR("Invalid packet I/O maximum index: %u (max: %u)\n", idx, - MAX_PKTIO_INDEXES); - } - if (config->copy_type != SW_COPY && config->copy_type != DMA_COPY_EV && config->copy_type != DMA_COPY_POLL) { ODPH_ERR("Invalid copy type: %u\n", config->copy_type); diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c index c6bcc558ef..8b97ba34cc 100644 --- a/test/performance/odp_l2fwd.c +++ b/test/performance/odp_l2fwd.c @@ -1,5 +1,5 @@ /* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia + * Copyright (c) 2019-2023, Nokia * Copyright (c) 2020-2021, Marvell * All rights reserved. * @@ -42,9 +42,6 @@ /* Maximum number of pktio interfaces */ #define MAX_PKTIOS 8 -/* Maximum pktio index table size */ -#define MAX_PKTIO_INDEXES 1024 - /* Default vector size */ #define DEFAULT_VEC_SIZE MAX_PKT_BURST @@ -200,7 +197,7 @@ typedef struct { /* Destination port lookup table. * Table index is pktio_index of the API. This is used by the sched * mode. */ - uint8_t dst_port_from_idx[MAX_PKTIO_INDEXES]; + uint8_t dst_port_from_idx[ODP_PKTIO_MAX_INDEX + 1]; /* Break workers loop if set to 1 */ odp_atomic_u32_t exit_threads; @@ -1411,8 +1408,10 @@ static void init_port_lookup_tbl(void) int pktio_idx = odp_pktio_index(pktio); int dst_port = find_dest_port(rx_idx); - if (pktio_idx < 0 || pktio_idx >= MAX_PKTIO_INDEXES) { - ODPH_ERR("Bad pktio index %i\n", pktio_idx); + if (pktio_idx < 0) { + ODPH_ERR("Reading pktio (%s) index failed: %i\n", + gbl_args->appl.if_names[rx_idx], pktio_idx); + exit(EXIT_FAILURE); } @@ -2216,10 +2215,6 @@ int main(int argc, char *argv[]) } } - if (odp_pktio_max_index() >= MAX_PKTIO_INDEXES) - ODPH_DBG("Warning: max pktio index (%u) is too large\n", - odp_pktio_max_index()); - bind_workers(); odp_schedule_config_init(&sched_config); diff --git a/test/performance/odp_packet_gen.c b/test/performance/odp_packet_gen.c index 5e68320733..247ea2eb6f 100644 --- a/test/performance/odp_packet_gen.c +++ b/test/performance/odp_packet_gen.c @@ -48,8 +48,6 @@ ODP_STATIC_ASSERT(MAX_WORKERS >= 2, "Too few threads"); #define RAND_16BIT_WORDS 128 /* Max retries to generate random data */ #define MAX_RAND_RETRIES 1000 -/* Maximum pktio index table size */ -#define MAX_PKTIO_INDEXES 1024 /* Used don't free */ #define TX_MODE_DF 0 @@ -174,7 +172,7 @@ typedef struct test_global_t { } pktio[MAX_PKTIOS]; /* Interface lookup table. Table index is pktio_index of the API. */ - uint8_t if_from_pktio_idx[MAX_PKTIO_INDEXES]; + uint8_t if_from_pktio_idx[ODP_PKTIO_MAX_INDEX + 1]; uint32_t num_tx_pkt; uint32_t num_bins; @@ -883,9 +881,6 @@ static int open_pktios(test_global_t *global) global->pool = pool; - if (odp_pktio_max_index() >= MAX_PKTIO_INDEXES) - ODPH_ERR("Warning: max pktio index (%u) is too large\n", odp_pktio_max_index()); - odp_pktio_param_init(&pktio_param); if (test_options->direct_rx) @@ -913,8 +908,8 @@ static int open_pktios(test_global_t *global) odp_pktio_print(pktio); pktio_idx = odp_pktio_index(pktio); - if (pktio_idx < 0 || pktio_idx >= MAX_PKTIO_INDEXES) { - ODPH_ERR("Error (%s): Bad pktio index: %i\n", name, pktio_idx); + if (pktio_idx < 0) { + ODPH_ERR("Error (%s): Reading pktio index failed: %i\n", name, pktio_idx); return -1; } global->if_from_pktio_idx[pktio_idx] = i; diff --git a/test/performance/odp_sched_pktio.c b/test/performance/odp_sched_pktio.c index e8532e0f10..927d35cbd5 100644 --- a/test/performance/odp_sched_pktio.c +++ b/test/performance/odp_sched_pktio.c @@ -16,7 +16,7 @@ #define DEBUG_PRINT 0 #define MAX_WORKERS 64 -#define MAX_PKTIOS 32 +#define MAX_PKTIOS (ODP_PKTIO_MAX_INDEX + 1) #define MAX_PKTIO_NAME 31 #define MAX_PKTIO_QUEUES MAX_WORKERS #define MAX_PIPE_STAGES 64 From a90db168c32912ae320093be29287bebd32ff497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jere=20Lepp=C3=A4nen?= Date: Mon, 28 Aug 2023 14:01:46 +0300 Subject: [PATCH 122/192] api: timer: clean up odp_timer_pool_param_t.num_timers description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the limitation on application. This change implies that application may attempt to allocate more timers than there are in a timer pool. In that case, odp_timer_alloc() returns ODP_TIMER_INVALID. Signed-off-by: Jere Leppänen Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen Reviewed-by: Pavan Nikhilesh --- include/odp/api/spec/timer_types.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/odp/api/spec/timer_types.h b/include/odp/api/spec/timer_types.h index 2b088693c5..0fd5d4f70d 100644 --- a/include/odp/api/spec/timer_types.h +++ b/include/odp/api/spec/timer_types.h @@ -386,8 +386,7 @@ typedef struct { } periodic; - /** Number of timers needed. Application will create in maximum this - * many concurrent timers from the timer pool. */ + /** Number of timers in the pool. */ uint32_t num_timers; /** Thread private timer pool. When zero, multiple thread may use the From a1f172a6f2b37b9d3eecf3faf737cb0efb82ba7a Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 25 Sep 2023 09:22:24 +0300 Subject: [PATCH 123/192] api: queue: clarify odp_queue_param_t default value specification Move default queue type specification from odp_queue_create() to odp_queue_param_t to make it conform with the other parameters. Also, explicitly state that queue size default value is zero. This was already tested by the validation test. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen Reviewed-by: Pavan Nikhilesh --- include/odp/api/spec/queue.h | 11 +++++------ include/odp/api/spec/queue_types.h | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h index 32d13b0bcc..95832de071 100644 --- a/include/odp/api/spec/queue.h +++ b/include/odp/api/spec/queue.h @@ -28,12 +28,11 @@ extern "C" { /** * Queue create * - * Create a queue according to the queue parameters. Queue type is specified by - * queue parameter 'type'. Use odp_queue_param_init() to initialize parameters - * into their default values. Default values are also used when 'param' pointer - * is NULL. The default queue type is ODP_QUEUE_TYPE_PLAIN. The use of queue - * name is optional. Unique names are not required. However, odp_queue_lookup() - * returns only a single matching queue. + * Create a queue according to the queue parameters. The use of queue name is + * optional. Unique names are not required. However, odp_queue_lookup() returns + * only a single matching queue. Use odp_queue_param_init() to initialize + * parameters into their default values. Default values are also used when + * 'param' pointer is NULL. * * @param name Name of the queue or NULL. Maximum string length is * ODP_QUEUE_NAME_LEN. diff --git a/include/odp/api/spec/queue_types.h b/include/odp/api/spec/queue_types.h index 6dd31e6813..5f84a5f490 100644 --- a/include/odp/api/spec/queue_types.h +++ b/include/odp/api/spec/queue_types.h @@ -225,7 +225,7 @@ typedef struct odp_queue_param_t { /** Queue type * * Valid values for other parameters in this structure depend on - * the queue type. */ + * the queue type. The default value is ODP_QUEUE_TYPE_PLAIN. */ odp_queue_type_t type; /** Enqueue mode @@ -288,7 +288,7 @@ typedef struct odp_queue_param_t { * The queue must be able to store at minimum this many events * simultaneously. The value must not exceed 'max_size' queue * capability. The value of zero means implementation specific - * default size. */ + * default size. The default value is 0. */ uint32_t size; } odp_queue_param_t; From 7c1e1b7ba6b307d8d20afae1ad5dfee0acb84bb8 Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Tue, 19 Sep 2023 13:22:51 +0300 Subject: [PATCH 124/192] api: crypto: clarify packet ordering of async crypto ops Specify that packet order is preserved within one async crypto session but not between sessions. Specify that ordering is as if there was a session specific input queue to async crypto and then rely on generic ordering rules regarding queue enqueue without trying to specify the rules here. Signed-off-by: Janne Peltonen Reviewed-by: Petri Savolainen Reviewed-by: Anoob Joseph --- include/odp/api/spec/crypto.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 1feb4dba6a..be9f9c24b0 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -296,6 +296,17 @@ int odp_crypto_op(const odp_packet_t pkt_in[], * All arrays should be of num_pkt size, except that pkt_out parameter * is ignored when the crypto operation type is ODP_CRYPTO_OP_TYPE_BASIC. * + * From packet ordering perspective this function behaves as if each input + * packet was enqueued to a crypto session specific ODP queue in the order + * the packets appear in the parameter array. The conceptual session input + * queue has the same order type (ODP_QUEUE_ORDER_KEEP or + * ODP_QUEUE_ORDER_IGNORE) as the completion queue of the session. + * The order of output events of a crypto session in a completion queue is + * the same as the order of the corresponding input packets in the conceptual + * session input queue. The order of output events of different crypto + * sessions is not defined even when they go through the same crypto + * completion queue. + * * @param pkt_in Packets to be processed * @param pkt_out Packet handle array for resulting packets * @param param Operation parameters array From c4db60c25e21615b3da448cc5cc6f4b82f9e1af1 Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Tue, 19 Sep 2023 13:22:52 +0300 Subject: [PATCH 125/192] api: crypto: add null_crypto crypto op flag for skipping crypto Add a crypto operation parameter that tells that a packet should be processed as if the configured algorithms were the null cipher and null auth algorithm. This makes it possible to direct packets that do not require crypto through the same crypto session as packets that require the crypto configured in the session. That in turn may be useful in preserving packet order between those packets as there are ordering guarantees in async crypto only within the same crypto session. Signed-off-by: Janne Peltonen Reviewed-by: Petri Savolainen Reviewed-by: Anoob Joseph --- include/odp/api/spec/crypto_types.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/odp/api/spec/crypto_types.h b/include/odp/api/spec/crypto_types.h index 565951221a..2576e715b4 100644 --- a/include/odp/api/spec/crypto_types.h +++ b/include/odp/api/spec/crypto_types.h @@ -611,6 +611,20 @@ typedef struct odp_crypto_session_param_t { */ odp_bool_t hash_result_in_auth_range; + /** Enable skipping crypto on per-packet basis + * + * When this flag is true, the null_crypto flag of crypto operation + * parameters can be set to request skipping of ciphering and + * authentication of a packet regardless of session configuration. + * This may be useful for preserving packet order between packets + * that require crypto processing and packets that do not. + * + * This flag must be set false when op_mode is ODP_CRYPTO_SYNC. + * + * The default value is false. + */ + odp_bool_t null_crypto_enable; + /** Operation mode when using packet interface: sync or async * * The default value is ODP_CRYPTO_SYNC. @@ -801,6 +815,14 @@ typedef struct odp_crypto_packet_op_param_t { */ int32_t dst_offset_shift; + /** Use null crypto algorithms + * + * Process packet using the null cipher and null auth algorithm + * instead of the algoithms configured in the session. This flag is + * ignored if the null_crypto_enable session parameter is not set. + */ + uint8_t null_crypto :1; + } odp_crypto_packet_op_param_t; /** From f2688f283c97056bf0276be7edb92610347178fb Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Mon, 9 Oct 2023 09:50:13 +0300 Subject: [PATCH 126/192] linux-gen: crypto: implement the null_crypto crypto op param Add support for the null_crypto crypto operation parameter. Signed-off-by: Janne Peltonen Reviewed-by: Petri Savolainen --- platform/linux-generic/arch/aarch64/odp_crypto_armv8.c | 5 +++++ platform/linux-generic/odp_crypto_ipsecmb.c | 9 +++++++++ platform/linux-generic/odp_crypto_openssl.c | 10 ++++++++++ 3 files changed, 24 insertions(+) diff --git a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c index 0a17355b4a..7bbaa04081 100644 --- a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c +++ b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c @@ -826,9 +826,14 @@ int crypto_int(odp_packet_t pkt_in, return -1; } + if (odp_unlikely(session->p.null_crypto_enable && + param->null_crypto)) + goto out; + /* Invoke the crypto function */ session->func(out_pkt, param, session); +out: packet_subtype_set(out_pkt, ODP_EVENT_PACKET_CRYPTO); /* Synchronous, simply return results */ diff --git a/platform/linux-generic/odp_crypto_ipsecmb.c b/platform/linux-generic/odp_crypto_ipsecmb.c index b41938cafa..6a847cc6f3 100644 --- a/platform/linux-generic/odp_crypto_ipsecmb.c +++ b/platform/linux-generic/odp_crypto_ipsecmb.c @@ -90,6 +90,7 @@ struct odp_crypto_generic_session_t { odp_crypto_session_param_t p; odp_bool_t do_cipher_first; + uint8_t null_crypto_enable :1; struct { union { @@ -590,6 +591,10 @@ odp_crypto_session_create(const odp_crypto_session_param_t *param, rc = -1; } + if (param->null_crypto_enable && param->op_mode == ODP_CRYPTO_SYNC) + rc = -1; + session->null_crypto_enable = !!param->null_crypto_enable; + if (rc) { *status = ODP_CRYPTO_SES_ERR_CIPHER; goto err; @@ -812,6 +817,9 @@ int crypto_int(odp_packet_t pkt_in, return -1; } + if (odp_unlikely(session->null_crypto_enable && param->null_crypto)) + goto out; + /* Invoke the crypto function */ if (session->do_cipher_first) { rc_cipher = session->cipher.func(out_pkt, param, session); @@ -821,6 +829,7 @@ int crypto_int(odp_packet_t pkt_in, rc_cipher = session->cipher.func(out_pkt, param, session); } +out: packet_subtype_set(out_pkt, ODP_EVENT_PACKET_CRYPTO); op_result = &packet_hdr(out_pkt)->crypto_op_result; op_result->cipher_status.alg_err = rc_cipher; diff --git a/platform/linux-generic/odp_crypto_openssl.c b/platform/linux-generic/odp_crypto_openssl.c index 26c9ce7b7c..13b027f3ed 100644 --- a/platform/linux-generic/odp_crypto_openssl.c +++ b/platform/linux-generic/odp_crypto_openssl.c @@ -217,6 +217,7 @@ struct odp_crypto_generic_session_t { uint8_t cipher_range_in_bits : 1; uint8_t auth_range_in_bits : 1; uint8_t auth_range_used : 1; + uint8_t null_crypto_enable : 1; struct { uint8_t key_data[EVP_MAX_KEY_LENGTH]; @@ -2058,6 +2059,12 @@ odp_crypto_session_create(const odp_crypto_session_param_t *param, session->cipher_range_in_bits = !!param->cipher_range_in_bits; session->auth_range_in_bits = !!param->auth_range_in_bits; session->auth_range_used = 1; + session->null_crypto_enable = !!param->null_crypto_enable; + + if (session->null_crypto_enable && param->op_mode == ODP_CRYPTO_SYNC) { + *status = ODP_CRYPTO_SES_ERR_CIPHER; + goto err; + } if (session->p.cipher_iv_len > EVP_MAX_IV_LENGTH) { _ODP_DBG("Maximum IV length exceeded\n"); @@ -2591,6 +2598,9 @@ int crypto_int(odp_packet_t pkt_in, return -1; } + if (odp_unlikely(session->null_crypto_enable && param->null_crypto)) + goto out; + if (ODP_DEBUG) { if (session->p.auth_alg != ODP_AUTH_ALG_NULL && param->hash_result_offset + session->p.auth_digest_len From de17bdb0a36e1cbfe0924cad90c78eb13eaa8d56 Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Mon, 9 Oct 2023 09:50:15 +0300 Subject: [PATCH 127/192] validation: crypto: test the null_crypto crypto operation parameter Veridy that the null_crypto flag causes crypto to be skipped when null_crypto is enabled at session creation and that the flag has no effect otherwise. Signed-off-by: Janne Peltonen Reviewed-by: Petri Savolainen --- test/validation/api/crypto/crypto_op_test.c | 23 +++++++- test/validation/api/crypto/crypto_op_test.h | 2 + .../api/crypto/odp_crypto_test_inp.c | 59 +++++++++++++------ 3 files changed, 66 insertions(+), 18 deletions(-) diff --git a/test/validation/api/crypto/crypto_op_test.c b/test/validation/api/crypto/crypto_op_test.c index 1d883f6b8f..0d7482fa27 100644 --- a/test/validation/api/crypto/crypto_op_test.c +++ b/test/validation/api/crypto/crypto_op_test.c @@ -199,6 +199,8 @@ static int prepare_input_packet(const crypto_op_test_param_t *param, pkt_len = param->header_len + reflength + param->trailer_len; if (param->digest_offset == param->header_len + reflength) pkt_len += ref->digest_length; + if (pkt_len == 0) + pkt_len = 1; pkt = odp_packet_alloc(suite_context.pool, pkt_len); @@ -482,7 +484,7 @@ static int is_digest_in_cipher_range(const crypto_op_test_param_t *param, d_offset < op_params->cipher_range.offset + op_params->cipher_range.length; } -void test_crypto_op(const crypto_op_test_param_t *param) +static void do_test_crypto_op(const crypto_op_test_param_t *param) { odp_bool_t ok = false; odp_packet_t pkt; @@ -497,6 +499,7 @@ void test_crypto_op(const crypto_op_test_param_t *param) .hash_result_offset = param->digest_offset, .aad_ptr = param->ref->aad, .dst_offset_shift = param->oop_shift, + .null_crypto = param->null_crypto, }; odp_bool_t failure_allowed = false; @@ -589,3 +592,21 @@ void test_crypto_op(const crypto_op_test_param_t *param) out: odp_packet_free(pkt_out); } + +void test_crypto_op(const crypto_op_test_param_t *param) +{ + crypto_op_test_param_t null_param = *param; + crypto_test_reference_t ref = *param->ref; + + if (param->session.null_crypto_enable && param->null_crypto) { + null_param = *param; + null_param.ref = &ref; + ref = *param->ref; + ref.cipher = ODP_CIPHER_ALG_NULL; + ref.auth = ODP_AUTH_ALG_NULL; + ref.digest_length = 0; + memcpy(ref.ciphertext, ref.plaintext, sizeof(ref.ciphertext)); + param = &null_param; + } + do_test_crypto_op(param); +} diff --git a/test/validation/api/crypto/crypto_op_test.h b/test/validation/api/crypto/crypto_op_test.h index 4f59578209..a93f10f2fd 100644 --- a/test/validation/api/crypto/crypto_op_test.h +++ b/test/validation/api/crypto/crypto_op_test.h @@ -18,6 +18,7 @@ typedef struct crypto_session_t { odp_crypto_op_type_t op_type; odp_bool_t cipher_range_in_bits; odp_bool_t auth_range_in_bits; + odp_bool_t null_crypto_enable; } crypto_session_t; typedef struct crypto_op_test_param_t { @@ -27,6 +28,7 @@ typedef struct crypto_op_test_param_t { odp_packet_data_range_t cipher_range; odp_packet_data_range_t auth_range; uint32_t digest_offset; + odp_bool_t null_crypto; odp_bool_t adjust_segmentation; odp_bool_t wrong_digest; uint32_t first_seg_len; diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index d4bceac81a..8da90c7504 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -39,6 +39,7 @@ static void test_defaults(uint8_t fill) CU_ASSERT_EQUAL(param.cipher_range_in_bits, false); CU_ASSERT_EQUAL(param.auth_range_in_bits, false); CU_ASSERT_EQUAL(param.auth_cipher_text, false); + CU_ASSERT_EQUAL(param.null_crypto_enable, false); CU_ASSERT_EQUAL(param.op_mode, ODP_CRYPTO_SYNC); CU_ASSERT_EQUAL(param.cipher_alg, ODP_CIPHER_ALG_NULL); CU_ASSERT_EQUAL(param.cipher_iv_len, 0); @@ -92,6 +93,10 @@ static void print_alg_test_param(const crypto_op_test_param_t *p) printf("segmentation adjusted, first_seg_len: %d\n", p->first_seg_len); if (p->session.op_type == ODP_CRYPTO_OP_TYPE_OOP) printf("oop_shift: %d\n", p->oop_shift); + if (p->session.null_crypto_enable) + printf("null crypto enabled in session\n"); + if (p->null_crypto) + printf("null crypto requested\n"); } static void alg_test_execute_and_print(crypto_op_test_param_t *param) @@ -127,8 +132,17 @@ static void alg_test_op(crypto_op_test_param_t *param) param->wrong_digest = false; alg_test_execute_and_print(param); + + param->null_crypto = true; + alg_test_execute_and_print(param); + param->null_crypto = false; + if (full_test) alg_test_execute_and_print(param); /* rerun with the same parameters */ + + if (!full_test && param->session.null_crypto_enable) + break; + param->wrong_digest = true; alg_test_execute_and_print(param); } @@ -177,6 +191,7 @@ static int session_create(crypto_session_t *session, ses_params.cipher_range_in_bits = session->cipher_range_in_bits; ses_params.auth_range_in_bits = session->auth_range_in_bits; ses_params.auth_cipher_text = (order == AUTH_CIPHERTEXT); + ses_params.null_crypto_enable = session->null_crypto_enable; ses_params.op_mode = suite_context.op_mode; ses_params.cipher_alg = ref->cipher; ses_params.auth_alg = ref->auth; @@ -258,6 +273,7 @@ static void alg_test_ses(odp_crypto_op_t op, uint32_t digest_offset, odp_bool_t cipher_range_in_bits, odp_bool_t auth_range_in_bits, + odp_bool_t null_crypto_enable, odp_bool_t session_creation_must_fail) { unsigned int initial_num_failures = CU_get_number_of_failures(); @@ -269,6 +285,9 @@ static void alg_test_ses(odp_crypto_op_t op, uint32_t max_shift; crypto_op_test_param_t test_param; + if (null_crypto_enable && suite_context.op_mode == ODP_CRYPTO_SYNC) + return; + if (digest_offset * auth_scale >= auth_range.offset && digest_offset * auth_scale < auth_range.offset + auth_range.length) hash_mode = HASH_OVERLAP; @@ -278,6 +297,7 @@ static void alg_test_ses(odp_crypto_op_t op, test_param.session.op_type = op_type; test_param.session.cipher_range_in_bits = cipher_range_in_bits; test_param.session.auth_range_in_bits = auth_range_in_bits; + test_param.session.null_crypto_enable = null_crypto_enable; if (session_create(&test_param.session, order, ref, hash_mode, session_creation_must_fail)) return; test_param.ref = ref; @@ -290,13 +310,14 @@ static void alg_test_ses(odp_crypto_op_t op, max_shift = reflength + ref->digest_length; seg_len = 0; - if (!full_test && - ref->cipher != ODP_CIPHER_ALG_NULL && - ref->auth != ODP_AUTH_ALG_NULL) { - /* run the loop body just once */ - seg_len = max_shift / 2; - max_shift = seg_len; - } + if (!full_test) + if ((ref->cipher != ODP_CIPHER_ALG_NULL && + ref->auth != ODP_AUTH_ALG_NULL) || + test_param.session.null_crypto_enable) { + /* run the loop body just once */ + seg_len = max_shift / 2; + max_shift = seg_len; + } /* * Test with segmented packets with all possible segment boundaries @@ -345,16 +366,18 @@ static void alg_test_op_types(odp_crypto_op_t op, }; for (unsigned int n = 0; n < ARRAY_SIZE(op_types); n++) { - alg_test_ses(op, - op_types[n], - order, - ref, - cipher_range, - auth_range, - digest_offset, - cipher_range_in_bits, - auth_range_in_bits, - session_creation_must_fail); + for (unsigned int null_crypto = 0 ; null_crypto <= 1; null_crypto++) + alg_test_ses(op, + op_types[n], + order, + ref, + cipher_range, + auth_range, + digest_offset, + cipher_range_in_bits, + auth_range_in_bits, + null_crypto, + session_creation_must_fail); } } @@ -603,6 +626,7 @@ static int create_hash_test_reference(odp_auth_alg_t auth, session.op_type = ODP_CRYPTO_OP_TYPE_BASIC; session.cipher_range_in_bits = false; session.auth_range_in_bits = false; + session.null_crypto_enable = false; if (session_create(&session, AUTH_PLAINTEXT, ref, HASH_NO_OVERLAP, false)) return -1; @@ -810,6 +834,7 @@ static int crypto_encode_ref(crypto_test_reference_t *ref, session.op_type = ODP_CRYPTO_OP_TYPE_BASIC; session.cipher_range_in_bits = false; session.auth_range_in_bits = false; + session.null_crypto_enable = false; if (session_create(&session, AUTH_PLAINTEXT, ref, HASH_OVERLAP, false)) { odp_packet_free(pkt); return 1; From 88bab54ee0cdec624755d60995dc5f65a54d5fe3 Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Mon, 9 Oct 2023 09:50:11 +0300 Subject: [PATCH 128/192] validation: crypto: make test compile if new op types are added Add a default case in a switch statement looking at crypto op types. This avoids a compilation failure due to -Wswitch and -Werror if a new crypto operation type is added in ODP API. Signed-off-by: Janne Peltonen Reviewed-by: Petri Savolainen --- test/validation/api/crypto/odp_crypto_test_inp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index 8da90c7504..c6fdc20df1 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -69,6 +69,9 @@ static void print_alg_test_param(const crypto_op_test_param_t *p) case ODP_CRYPTO_OP_TYPE_OOP: printf("out-of-place "); break; + default: + printf("unknown (internal error) "); + break; } printf("%s\n", p->session.op == ODP_CRYPTO_OP_ENCODE ? "encode" : "decode"); From 68baf7ce355f8f4b24cfd054c3c9f1bc773a0ac5 Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Tue, 19 Sep 2023 13:22:54 +0300 Subject: [PATCH 129/192] api: crypto: allow both basic and out-of-place ops in one session Introduce ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP crypto operation type that allows both basic and out-of-place operations in the same session. The actual operation type applied depends on whether an output packet is specified. This can be useful for applications that want to perform both basic and out-of-place operations with the same crypto and cannot have two different sessions due to memory pressure or packet ordering constraints. Signed-off-by: Janne Peltonen Reviewed-by: Petri Savolainen Reviewed-by: Anoob Joseph --- include/odp/api/spec/crypto.h | 8 +++++++- include/odp/api/spec/crypto_types.h | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index be9f9c24b0..e0e232dbef 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -236,7 +236,7 @@ int odp_crypto_result(odp_crypto_packet_result_t *result, * segmentation) of the output packet may differ from that of the input * packet. * - * The value of pktout[n] is ignored as pktout[n] is used purely as an + * The value of pkt_out[n] is ignored as pkt_out[n] is used purely as an * output parameter that returns the handle of the newly allocated packet. * * ODP_CRYPTO_OP_TYPE_OOP: @@ -264,6 +264,12 @@ int odp_crypto_result(odp_crypto_packet_result_t *result, * the MAC/digest result. pkt_out[n] must not be the same as any input * packet or any other output packet. * + * OOP_CRYPTO_OP_TYPE_BASIC_AND_OOP: + * + * Behaves as the ODP_CRYPTO_OP_TYPE_BASIC operation type if pkt_out[n] is + * ODP_PACKET_INVALID. Otherwise behaves as the ODP_CRYPTO_OP_TYPE_OOP + * operation type. + * * @param pkt_in Packets to be processed * @param[in,out] pkt_out Packet handle array for resulting packets * @param param Operation parameters array diff --git a/include/odp/api/spec/crypto_types.h b/include/odp/api/spec/crypto_types.h index 2576e715b4..7752f19570 100644 --- a/include/odp/api/spec/crypto_types.h +++ b/include/odp/api/spec/crypto_types.h @@ -534,6 +534,21 @@ typedef enum odp_crypto_op_type_t { * MAC/digest (in encode sessions) of the input packet. */ ODP_CRYPTO_OP_TYPE_OOP, + + /** + * Basic or out-of-place crypto operation depending on op params. + * + * If the output packet specified in a crypto operation (i.e. + * pkt_out[i] is ODP_PACKET_INVALID) then the packet is processed + * the same way as in the ODP_CRYPTO_OP_TYPE_BASIC operation type. + * Otherwise the packet is processed as in the ODP_CRYPTO_OP_TYPE_OOP + * operation type. + * + * Sessions of this operation type may have lower performance than + * the more specific operation types. + */ + ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP, + } odp_crypto_op_type_t; /** From cf95c7e0e18297e1825db6292cfabd325dabfa76 Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Mon, 9 Oct 2023 09:50:14 +0300 Subject: [PATCH 130/192] linux-gen: crypto: implement ODP_CRYPTO_TYPE_BASIC_AND_OOP Implement the BASIC_AND_OOP crypto op type which allows both basic and out-of-place operations with the same session. Add the support only for the openssl crypto module as that is now the only one which supports out-of-place crypto. Signed-off-by: Janne Peltonen Reviewed-by: Petri Savolainen --- .../arch/aarch64/odp_crypto_armv8.c | 3 +- platform/linux-generic/odp_crypto_ipsecmb.c | 3 +- platform/linux-generic/odp_crypto_null.c | 3 +- platform/linux-generic/odp_crypto_openssl.c | 33 +++++++++++++++---- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c index 7bbaa04081..52936dacf2 100644 --- a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c +++ b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c @@ -534,7 +534,8 @@ odp_crypto_session_create(const odp_crypto_session_param_t *param, *session_out = ODP_CRYPTO_SESSION_INVALID; return -1; } - if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP) { + if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP || + param->op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP) { *status = ODP_CRYPTO_SES_ERR_PARAMS; *session_out = ODP_CRYPTO_SESSION_INVALID; return -1; diff --git a/platform/linux-generic/odp_crypto_ipsecmb.c b/platform/linux-generic/odp_crypto_ipsecmb.c index 6a847cc6f3..e588440985 100644 --- a/platform/linux-generic/odp_crypto_ipsecmb.c +++ b/platform/linux-generic/odp_crypto_ipsecmb.c @@ -555,7 +555,8 @@ odp_crypto_session_create(const odp_crypto_session_param_t *param, *session_out = ODP_CRYPTO_SESSION_INVALID; return -1; } - if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP) { + if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP || + param->op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP) { *status = ODP_CRYPTO_SES_ERR_PARAMS; *session_out = ODP_CRYPTO_SESSION_INVALID; return -1; diff --git a/platform/linux-generic/odp_crypto_null.c b/platform/linux-generic/odp_crypto_null.c index 5e3a4e8373..6eda0f4558 100644 --- a/platform/linux-generic/odp_crypto_null.c +++ b/platform/linux-generic/odp_crypto_null.c @@ -219,7 +219,8 @@ odp_crypto_session_create(const odp_crypto_session_param_t *param, *session_out = ODP_CRYPTO_SESSION_INVALID; return -1; } - if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP) { + if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP || + param->op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP) { *status = ODP_CRYPTO_SES_ERR_PARAMS; *session_out = ODP_CRYPTO_SESSION_INVALID; return -1; diff --git a/platform/linux-generic/odp_crypto_openssl.c b/platform/linux-generic/odp_crypto_openssl.c index 13b027f3ed..879ce0b97a 100644 --- a/platform/linux-generic/odp_crypto_openssl.c +++ b/platform/linux-generic/odp_crypto_openssl.c @@ -2592,6 +2592,9 @@ int crypto_int(odp_packet_t pkt_in, if (odp_likely(session->p.op_type == ODP_CRYPTO_OP_TYPE_BASIC)) { out_pkt = pkt_in; + } else if (session->p.op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP && + *pkt_out == ODP_PACKET_INVALID) { + out_pkt = pkt_in; } else { out_pkt = get_output_packet(session, pkt_in, *pkt_out); if (odp_unlikely(out_pkt == ODP_PACKET_INVALID)) @@ -2762,10 +2765,19 @@ int odp_crypto_op(const odp_packet_t pkt_in[], session = (odp_crypto_generic_session_t *)(intptr_t)param[i].session; _ODP_ASSERT(ODP_CRYPTO_SYNC == session->p.op_mode); - if (odp_unlikely(session->p.op_type == ODP_CRYPTO_OP_TYPE_OOP)) + if (odp_likely(session->p.op_type == ODP_CRYPTO_OP_TYPE_BASIC)) { + rc = crypto_int(pkt_in[i], &pkt_out[i], ¶m[i]); + } else if (session->p.op_type == ODP_CRYPTO_OP_TYPE_OOP) { rc = crypto_int_oop(pkt_in[i], &pkt_out[i], ¶m[i]); - else + } else if (session->p.op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP) { + if (pkt_out[i] == ODP_PACKET_INVALID) /* basic */ + rc = crypto_int(pkt_in[i], &pkt_out[i], ¶m[i]); + else /* oop */ + rc = crypto_int_oop(pkt_in[i], &pkt_out[i], ¶m[i]); + } else { + _ODP_ASSERT(session->p.op_type == ODP_CRYPTO_OP_TYPE_LEGACY); rc = crypto_int(pkt_in[i], &pkt_out[i], ¶m[i]); + } if (rc < 0) break; } @@ -2788,13 +2800,22 @@ int odp_crypto_op_enq(const odp_packet_t pkt_in[], _ODP_ASSERT(ODP_CRYPTO_ASYNC == session->p.op_mode); _ODP_ASSERT(ODP_QUEUE_INVALID != session->p.compl_queue); - if (session->p.op_type != ODP_CRYPTO_OP_TYPE_BASIC) + if (odp_likely(session->p.op_type == ODP_CRYPTO_OP_TYPE_BASIC)) { + rc = crypto_int(pkt_in[i], &pkt, ¶m[i]); + } else if (session->p.op_type == ODP_CRYPTO_OP_TYPE_OOP) { pkt = pkt_out[i]; - - if (odp_unlikely(session->p.op_type == ODP_CRYPTO_OP_TYPE_OOP)) rc = crypto_int_oop(pkt_in[i], &pkt, ¶m[i]); - else + } else if (session->p.op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP) { + pkt = pkt_out[i]; + if (pkt_out[i] == ODP_PACKET_INVALID) /* basic */ + rc = crypto_int(pkt_in[i], &pkt, ¶m[i]); + else /* oop */ + rc = crypto_int_oop(pkt_in[i], &pkt, ¶m[i]); + } else { + _ODP_ASSERT(session->p.op_type == ODP_CRYPTO_OP_TYPE_LEGACY); + pkt = pkt_out[i]; rc = crypto_int(pkt_in[i], &pkt, ¶m[i]); + } if (rc < 0) break; From ab21193c5887ce8c2c9d4c055c97c0a797665e79 Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Mon, 9 Oct 2023 09:50:17 +0300 Subject: [PATCH 131/192] validation: crypto: test ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP Test session created with the ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP operation type with both basic and out-of-place operatons. Signed-off-by: Janne Peltonen Reviewed-by: Petri Savolainen --- test/validation/api/crypto/crypto_op_test.c | 22 ++++++----- test/validation/api/crypto/crypto_op_test.h | 2 + .../api/crypto/odp_crypto_test_inp.c | 38 +++++++++++++++---- 3 files changed, 44 insertions(+), 18 deletions(-) diff --git a/test/validation/api/crypto/crypto_op_test.c b/test/validation/api/crypto/crypto_op_test.c index 0d7482fa27..9e8ab05843 100644 --- a/test/validation/api/crypto/crypto_op_test.c +++ b/test/validation/api/crypto/crypto_op_test.c @@ -46,6 +46,7 @@ int crypto_op(odp_packet_t pkt_in, odp_packet_t *pkt_out, odp_bool_t *ok, const odp_crypto_packet_op_param_t *op_params, + odp_crypto_op_type_t session_op_type, odp_crypto_op_type_t op_type) { int rc; @@ -69,7 +70,7 @@ int crypto_op(odp_packet_t pkt_in, } else { odp_packet_t *out_param = pkt_out; - if (op_type == ODP_CRYPTO_OP_TYPE_BASIC) + if (session_op_type == ODP_CRYPTO_OP_TYPE_BASIC) out_param = NULL; rc = odp_crypto_op_enq(&pkt_in, out_param, op_params, 1); @@ -337,7 +338,7 @@ static void prepare_ignore_info(const crypto_op_test_param_t *param, param->session.op == ODP_CRYPTO_OP_DECODE) { uint32_t offs = param->digest_offset; - if (param->session.op_type != ODP_CRYPTO_OP_TYPE_OOP || + if (param->op_type != ODP_CRYPTO_OP_TYPE_OOP || is_in_range(offs, cipher_offset, cipher_len) || is_in_range(offs, auth_offset, auth_len)) { add_ignored_range(ignore, @@ -351,7 +352,7 @@ static void prepare_ignore_info(const crypto_op_test_param_t *param, param->wrong_digest) { add_ignored_range(ignore, cipher_offset + shift, cipher_len); /* In OOP case, auth range may not get copied */ - if (param->session.op_type == ODP_CRYPTO_OP_TYPE_OOP) + if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP) add_ignored_range(ignore, auth_offset + shift, auth_len); } } @@ -368,9 +369,9 @@ static void prepare_expected_data(const crypto_op_test_param_t *param, uint32_t cipher_len = cipher_range->length; uint32_t auth_offset = auth_range->offset; uint32_t auth_len = auth_range->length; - const int32_t shift = param->session.op_type == ODP_CRYPTO_OP_TYPE_OOP ? param->oop_shift + const int32_t shift = param->op_type == ODP_CRYPTO_OP_TYPE_OOP ? param->oop_shift : 0; - const odp_packet_t base_pkt = param->session.op_type == ODP_CRYPTO_OP_TYPE_OOP ? pkt_out + const odp_packet_t base_pkt = param->op_type == ODP_CRYPTO_OP_TYPE_OOP ? pkt_out : pkt_in; int rc; uint32_t cipher_offset_in_ref = param->cipher_range.offset; @@ -400,7 +401,7 @@ static void prepare_expected_data(const crypto_op_test_param_t *param, rc = odp_packet_copy_to_mem(base_pkt, 0, ex->len, ex->data); CU_ASSERT(rc == 0); - if (param->session.op_type == ODP_CRYPTO_OP_TYPE_OOP && auth_len > 0) { + if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP && auth_len > 0) { /* copy auth range from input packet */ rc = odp_packet_copy_to_mem(pkt_in, auth_offset, auth_len, ex->data + auth_offset + shift); @@ -516,7 +517,7 @@ static void do_test_crypto_op(const crypto_op_test_param_t *param) if (prepare_input_packet(param, &pkt)) return; - if (param->session.op_type == ODP_CRYPTO_OP_TYPE_OOP) { + if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP) { prepare_oop_output_packet(param, &pkt_out, odp_packet_len(pkt)); pkt_copy = odp_packet_copy(pkt, suite_context.pool); @@ -535,7 +536,7 @@ static void do_test_crypto_op(const crypto_op_test_param_t *param) prepare_expected_data(param, &op_params.cipher_range, &op_params.auth_range, pkt, pkt_out, &expected); - if (param->session.op_type == ODP_CRYPTO_OP_TYPE_OOP && + if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP && param->session.op == ODP_CRYPTO_OP_ENCODE) { /* * In this type of sessions digest offset is an offset to the output @@ -547,12 +548,13 @@ static void do_test_crypto_op(const crypto_op_test_param_t *param) test_packet_set_md(pkt); test_packet_get_md(pkt, &md_in); - if (crypto_op(pkt, &pkt_out, &ok, &op_params, param->session.op_type)) + if (crypto_op(pkt, &pkt_out, &ok, &op_params, + param->session.op_type, param->op_type)) return; test_packet_get_md(pkt_out, &md_out); - if (param->session.op_type == ODP_CRYPTO_OP_TYPE_OOP) { + if (param->op_type == ODP_CRYPTO_OP_TYPE_OOP) { test_packet_md_t md; /* check that input packet has not changed */ diff --git a/test/validation/api/crypto/crypto_op_test.h b/test/validation/api/crypto/crypto_op_test.h index a93f10f2fd..9805457ad4 100644 --- a/test/validation/api/crypto/crypto_op_test.h +++ b/test/validation/api/crypto/crypto_op_test.h @@ -23,6 +23,7 @@ typedef struct crypto_session_t { typedef struct crypto_op_test_param_t { crypto_session_t session; + odp_crypto_op_type_t op_type; int32_t oop_shift; crypto_test_reference_t *ref; odp_packet_data_range_t cipher_range; @@ -42,6 +43,7 @@ int crypto_op(odp_packet_t pkt_in, odp_packet_t *pkt_out, odp_bool_t *ok, const odp_crypto_packet_op_param_t *op_params, + odp_crypto_op_type_t session_op_type, odp_crypto_op_type_t op_type); #endif diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index c6fdc20df1..59e734174f 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -69,6 +69,10 @@ static void print_alg_test_param(const crypto_op_test_param_t *p) case ODP_CRYPTO_OP_TYPE_OOP: printf("out-of-place "); break; + case ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP: + printf("basic-and-out-of-place (%s)", + p->op_type == ODP_CRYPTO_OP_TYPE_BASIC ? "basic" : "oop"); + break; default: printf("unknown (internal error) "); break; @@ -94,7 +98,7 @@ static void print_alg_test_param(const crypto_op_test_param_t *p) printf("header length: %d, trailer length: %d\n", p->header_len, p->trailer_len); if (p->adjust_segmentation) printf("segmentation adjusted, first_seg_len: %d\n", p->first_seg_len); - if (p->session.op_type == ODP_CRYPTO_OP_TYPE_OOP) + if (p->op_type == ODP_CRYPTO_OP_TYPE_OOP) printf("oop_shift: %d\n", p->oop_shift); if (p->session.null_crypto_enable) printf("null crypto enabled in session\n"); @@ -121,13 +125,13 @@ static void alg_test_execute_and_print(crypto_op_test_param_t *param) } } -static void alg_test_op(crypto_op_test_param_t *param) +static void alg_test_op2(crypto_op_test_param_t *param) { int32_t oop_shifts[] = {0, 3, 130, -10}; for (uint32_t n = 0; n < ARRAY_SIZE(oop_shifts); n++) { if (oop_shifts[n] != 0 && - param->session.op_type != ODP_CRYPTO_OP_TYPE_OOP) + param->op_type != ODP_CRYPTO_OP_TYPE_OOP) continue; if ((int32_t)param->header_len + oop_shifts[n] < 0) continue; @@ -145,12 +149,25 @@ static void alg_test_op(crypto_op_test_param_t *param) if (!full_test && param->session.null_crypto_enable) break; + if (!full_test && param->session.op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP) + break; param->wrong_digest = true; alg_test_execute_and_print(param); } } +static void alg_test_op(crypto_op_test_param_t *param) +{ + param->op_type = param->session.op_type; + if (param->op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP) { + param->op_type = ODP_CRYPTO_OP_TYPE_BASIC; + alg_test_op2(param); + param->op_type = ODP_CRYPTO_OP_TYPE_OOP; + } + alg_test_op2(param); +} + static int combo_warning_shown; static int oop_warning_shown; @@ -244,9 +261,10 @@ static int session_create(crypto_session_t *session, /* For now, allow out-of-place sessions not to be supported. */ if (rc < 0 && status == ODP_CRYPTO_SES_ERR_PARAMS && - ses_params.op_type == ODP_CRYPTO_OP_TYPE_OOP) { + (ses_params.op_type == ODP_CRYPTO_OP_TYPE_OOP || + ses_params.op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP)) { if (!oop_warning_shown) - printf("\n Skipping ODP_CRYPTO_OP_TYPE_OOP tests\n"); + printf("\n Skipping out-of-place tests\n"); oop_warning_shown = 1; return -1; } @@ -316,7 +334,8 @@ static void alg_test_ses(odp_crypto_op_t op, if (!full_test) if ((ref->cipher != ODP_CIPHER_ALG_NULL && ref->auth != ODP_AUTH_ALG_NULL) || - test_param.session.null_crypto_enable) { + test_param.session.null_crypto_enable || + test_param.session.op_type == ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP) { /* run the loop body just once */ seg_len = max_shift / 2; max_shift = seg_len; @@ -366,6 +385,7 @@ static void alg_test_op_types(odp_crypto_op_t op, ODP_CRYPTO_OP_TYPE_LEGACY, ODP_CRYPTO_OP_TYPE_BASIC, ODP_CRYPTO_OP_TYPE_OOP, + ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP, }; for (unsigned int n = 0; n < ARRAY_SIZE(op_types); n++) { @@ -643,7 +663,8 @@ static int create_hash_test_reference(odp_auth_alg_t auth, .auth_range = { .offset = 0, .length = auth_bytes }, .dst_offset_shift = 0, }; - rc = crypto_op(pkt, &pkt, &ok, &op_params, ODP_CRYPTO_OP_TYPE_BASIC); + rc = crypto_op(pkt, &pkt, &ok, &op_params, + ODP_CRYPTO_OP_TYPE_BASIC, ODP_CRYPTO_OP_TYPE_BASIC); CU_ASSERT(rc == 0); if (rc) { @@ -862,7 +883,8 @@ static int crypto_encode_ref(crypto_test_reference_t *ref, .auth_range = auth_range, .dst_offset_shift = 0, }; - rc = crypto_op(pkt, &pkt, &ok, &op_params, ODP_CRYPTO_OP_TYPE_BASIC); + rc = crypto_op(pkt, &pkt, &ok, &op_params, + ODP_CRYPTO_OP_TYPE_BASIC, ODP_CRYPTO_OP_TYPE_BASIC); CU_ASSERT(rc == 0); if (rc) { (void)odp_crypto_session_destroy(session.session); From 6284d3c9f7f8aab8eb5d5682e42eb3189252f4d8 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 13 Oct 2023 15:28:58 +0300 Subject: [PATCH 132/192] api: sysinfo: add new ARMv8 and v9 enumerations Add enumerations for ARM ISA versions ARMv8.8-A, ARMv8.9-A, and ARMv9.3-A. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen Reviewed-by: Jerin Jacob --- include/odp/api/spec/system_info.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/odp/api/spec/system_info.h b/include/odp/api/spec/system_info.h index e3420ea8e1..98efe06f78 100644 --- a/include/odp/api/spec/system_info.h +++ b/include/odp/api/spec/system_info.h @@ -88,6 +88,12 @@ typedef enum odp_cpu_arch_arm_t { /** ARMv8.7-A ISA */ ODP_CPU_ARCH_ARMV8_7, + /** ARMv8.8-A ISA */ + ODP_CPU_ARCH_ARMV8_8, + + /** ARMv8.9-A ISA */ + ODP_CPU_ARCH_ARMV8_9, + /** ARMv9.0-A ISA */ ODP_CPU_ARCH_ARMV9_0, @@ -97,6 +103,9 @@ typedef enum odp_cpu_arch_arm_t { /** ARMv9.2-A ISA */ ODP_CPU_ARCH_ARMV9_2, + /** ARMv9.3-A ISA */ + ODP_CPU_ARCH_ARMV9_3, + } odp_cpu_arch_arm_t; /** From 9ffd50a2f771bfbf25e8762d6879d66229049e8b Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 16 Oct 2023 08:15:10 +0300 Subject: [PATCH 133/192] linux-gen: sysinfo: add new ARMv8 and v9 enumerations Add support for ARM ISA versions ARMv8.8-A, ARMv8.9-A, and ARMv9.3-A. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c b/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c index 890004afcd..f242c845e7 100644 --- a/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/aarch64/odp_sysinfo_parse.c @@ -263,6 +263,10 @@ static odp_cpu_arch_arm_t arm_isa_version(void) return ODP_CPU_ARCH_ARMV8_6; case 7: return ODP_CPU_ARCH_ARMV8_7; + case 8: + return ODP_CPU_ARCH_ARMV8_8; + case 9: + return ODP_CPU_ARCH_ARMV8_9; default: return ODP_CPU_ARCH_ARM_UNKNOWN; } @@ -274,6 +278,8 @@ static odp_cpu_arch_arm_t arm_isa_version(void) return ODP_CPU_ARCH_ARMV9_1; case 2: return ODP_CPU_ARCH_ARMV9_2; + case 3: + return ODP_CPU_ARCH_ARMV9_3; default: return ODP_CPU_ARCH_ARM_UNKNOWN; } From 77dbeefc9627b7ae1de51aec231010c36c64b975 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 16 Oct 2023 08:17:29 +0300 Subject: [PATCH 134/192] example: sysinfo: detect new ARMv8 and v9 ISAs Add support for ARM ISA versions ARMv8.8-A, ARMv8.9-A, and ARMv9.3-A. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- example/sysinfo/odp_sysinfo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/example/sysinfo/odp_sysinfo.c b/example/sysinfo/odp_sysinfo.c index 05635eec29..0bebac4a20 100644 --- a/example/sysinfo/odp_sysinfo.c +++ b/example/sysinfo/odp_sysinfo.c @@ -98,12 +98,18 @@ static const char *arm_isa(odp_cpu_arch_arm_t isa) return "ARMv8.6-A"; case ODP_CPU_ARCH_ARMV8_7: return "ARMv8.7-A"; + case ODP_CPU_ARCH_ARMV8_8: + return "ARMv8.8-A"; + case ODP_CPU_ARCH_ARMV8_9: + return "ARMv8.9-A"; case ODP_CPU_ARCH_ARMV9_0: return "ARMv9.0-A"; case ODP_CPU_ARCH_ARMV9_1: return "ARMv9.1-A"; case ODP_CPU_ARCH_ARMV9_2: return "ARMv9.2-A"; + case ODP_CPU_ARCH_ARMV9_3: + return "ARMv9.3-A"; default: return "Unknown"; } From 4da335409f849b70d285ebcb3cd7efdb5a900243 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 16 Oct 2023 08:20:22 +0300 Subject: [PATCH 135/192] validation: sysinfo: add tests for new ARMv8 and v9 ISAs Add validation tests for ARM ISA versions ARMv8.8-A, ARMv8.9-A, and ARMv9.3-A. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- test/validation/api/system/system.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/validation/api/system/system.c b/test/validation/api/system/system.c index a98ebb6343..89a46a7f2c 100644 --- a/test/validation/api/system/system.c +++ b/test/validation/api/system/system.c @@ -534,12 +534,18 @@ static void system_test_info(void) printf(" ODP_CPU_ARCH_ARMV8_6\n"); else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV8_7) printf(" ODP_CPU_ARCH_ARMV8_7\n"); + else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV8_8) + printf(" ODP_CPU_ARCH_ARMV8_8\n"); + else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV8_9) + printf(" ODP_CPU_ARCH_ARMV8_9\n"); else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV9_0) printf(" ODP_CPU_ARCH_ARMV9_0\n"); else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV9_1) printf(" ODP_CPU_ARCH_ARMV9_1\n"); else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV9_2) printf(" ODP_CPU_ARCH_ARMV9_2\n"); + else if (info.cpu_isa_sw.arm == ODP_CPU_ARCH_ARMV9_3) + printf(" ODP_CPU_ARCH_ARMV9_3\n"); else CU_FAIL("Unknown CPU ISA SW ARCH found!"); @@ -566,12 +572,18 @@ static void system_test_info(void) printf(" ODP_CPU_ARCH_ARMV8_6\n"); else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV8_7) printf(" ODP_CPU_ARCH_ARMV8_7\n"); + else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV8_8) + printf(" ODP_CPU_ARCH_ARMV8_8\n"); + else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV8_9) + printf(" ODP_CPU_ARCH_ARMV8_9\n"); else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV9_0) printf(" ODP_CPU_ARCH_ARMV9_0\n"); else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV9_1) printf(" ODP_CPU_ARCH_ARMV9_1\n"); else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV9_2) printf(" ODP_CPU_ARCH_ARMV9_2\n"); + else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARMV9_3) + printf(" ODP_CPU_ARCH_ARMV9_3\n"); else if (info.cpu_isa_hw.arm == ODP_CPU_ARCH_ARM_UNKNOWN) printf(" ODP_CPU_ARCH_ARM_UNKNOWN\n"); else From 367a977f9b1db69784e150e1ea60d76da3a4e612 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 18 Sep 2023 14:25:54 +0300 Subject: [PATCH 136/192] api: timer: add odp_timeout_alloc_multi() function Add new odp_timeout_alloc_multi() function for allocating multiple timeouts with a single call. Depending on the implementation, utilizing this new function may improve performance. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen Reviewed-by: Pavan Nikhilesh --- include/odp/api/spec/timer.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h index 203031c3cf..c2b8a91e40 100644 --- a/include/odp/api/spec/timer.h +++ b/include/odp/api/spec/timer.h @@ -578,6 +578,20 @@ void *odp_timeout_user_area(odp_timeout_t tmo); */ odp_timeout_t odp_timeout_alloc(odp_pool_t pool); +/** + * Allocate multiple timeouts + * + * Otherwise like odp_timeout_alloc(), but allocates multiple timeouts from a pool. + * + * @param pool Pool handle + * @param[out] tmo Array of timeout handles for output + * @param num Number of timeouts to allocate + * + * @return Number of timeouts actually allocated (0 ... num) + * @retval <0 on failure + */ +int odp_timeout_alloc_multi(odp_pool_t pool, odp_timeout_t tmo[], int num); + /** * Timeout free * From 189f0258d04d86df1e1ab2daf38565531dc6dc8d Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 20 Sep 2023 15:59:25 +0300 Subject: [PATCH 137/192] linux-gen: timer: implement odp_timeout_alloc_multi() function Implement new odp_timeout_alloc_multi() function for allocating multiple timeouts with a single call. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- platform/linux-generic/odp_timer.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index c6d399d12f..e697b5962e 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -1873,6 +1873,27 @@ odp_timeout_t odp_timeout_alloc(odp_pool_t pool_hdl) return odp_timeout_from_event(event); } +int odp_timeout_alloc_multi(odp_pool_t pool_hdl, odp_timeout_t tmo[], int num) +{ + pool_t *pool; + int ret; + + _ODP_ASSERT(pool_hdl != ODP_POOL_INVALID); + _ODP_ASSERT(tmo != NULL); + _ODP_ASSERT(num > 0); + + pool = _odp_pool_entry(pool_hdl); + + _ODP_ASSERT(pool->type == ODP_POOL_TIMEOUT); + + ret = _odp_event_alloc_multi(pool, (_odp_event_hdr_t **)tmo, num); + + for (int i = 0; i < ret; i++) + timeout_hdr(tmo[i])->timer = ODP_TIMER_INVALID; + + return ret; +} + void odp_timeout_free(odp_timeout_t tmo) { _odp_event_free(odp_timeout_to_event(tmo)); From f44d7f00288ded75718b706e5a695d8ef35218a6 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 18 Sep 2023 14:26:09 +0300 Subject: [PATCH 138/192] api: timer: add odp_timeout_free_multi() function Add new odp_timeout_free_multi() function for freeing multiple timeouts with a single call. Depending on the implementation, utilizing this new function may improve performance. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen Reviewed-by: Pavan Nikhilesh --- include/odp/api/spec/timer.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h index c2b8a91e40..c42c5cf5ef 100644 --- a/include/odp/api/spec/timer.h +++ b/include/odp/api/spec/timer.h @@ -601,6 +601,16 @@ int odp_timeout_alloc_multi(odp_pool_t pool, odp_timeout_t tmo[], int num); */ void odp_timeout_free(odp_timeout_t tmo); +/** + * Free multiple timeouts + * + * Otherwise like odp_timeout_free(), but frees multiple timeouts to their originating pools. + * + * @param tmo Array of timeout handles + * @param num Number of timeouts to free + */ +void odp_timeout_free_multi(odp_timeout_t tmo[], int num); + /** * Print timer pool debug information * From 1eacb4743c481376cb13c83c4ff1bc6279d53164 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 20 Sep 2023 16:01:09 +0300 Subject: [PATCH 139/192] linux-gen: timer: implement odp_timeout_free_multi() function Implement new odp_timeout_free_multi() function for freeing multiple timeouts with a single call. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- platform/linux-generic/odp_timer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index e697b5962e..eaedcea8c0 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -1899,6 +1899,14 @@ void odp_timeout_free(odp_timeout_t tmo) _odp_event_free(odp_timeout_to_event(tmo)); } +void odp_timeout_free_multi(odp_timeout_t tmo[], int num) +{ + _ODP_ASSERT(tmo != NULL); + _ODP_ASSERT(num > 0); + + _odp_event_free_multi((_odp_event_hdr_t **)(uintptr_t)tmo, num); +} + void odp_timer_pool_print(odp_timer_pool_t timer_pool) { timer_pool_t *tp; From 60e136ac4b18b8fe4cb06cb5a2da510e0793416e Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 22 Sep 2023 16:26:36 +0300 Subject: [PATCH 140/192] validation: timer: add test for timeout alloc/free multi functions Add validation tests for new odp_timeout_alloc_multi() and odp_timeout_free_multi() APIs. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- test/validation/api/timer/timer.c | 61 +++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index 0f8d893e1e..a7a2d3e543 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -468,6 +468,66 @@ static void timer_test_timeout_pool_alloc(void) CU_ASSERT(odp_pool_destroy(pool) == 0); } +static void timer_test_timeout_pool_alloc_multi(void) +{ + odp_pool_capability_t capa; + odp_pool_t pool; + odp_pool_param_t params; + uint32_t num_timeouts = 1000; + uint32_t num_allocated = 0; + uint32_t num_freed = 0; + uint32_t num_retries = 0; + + CU_ASSERT_FATAL(!odp_pool_capability(&capa)); + + if (capa.tmo.max_num && capa.tmo.max_num < num_timeouts) + num_timeouts = capa.tmo.max_num; + + odp_pool_param_init(¶ms); + params.type = ODP_POOL_TIMEOUT; + params.tmo.num = num_timeouts; + + pool = odp_pool_create("timeout_pool_alloc_multi", ¶ms); + CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); + + odp_timeout_t tmo[num_timeouts]; + + do { + int ret; + int num = (num_timeouts - num_allocated) / 2; + + if (num < 1) + num = 1; + + ret = odp_timeout_alloc_multi(pool, &tmo[num_allocated], num); + if (ret < 0) { + CU_FAIL("Timeout alloc multi failed"); + break; + } + CU_ASSERT_FATAL(ret <= num); + + num_retries = (ret == 0) ? num_retries + 1 : 0; + num_allocated += ret; + } while (num_allocated < num_timeouts && num_retries < 100); + CU_ASSERT(num_allocated == num_timeouts) + + if (num_allocated) { + do { + int num = num_allocated / 2; + + if (num < 1) + num = 1; + + odp_timeout_free_multi(&tmo[num_freed], num); + + num_freed += num; + num_allocated -= num; + } while (num_allocated); + } + + CU_ASSERT(odp_pool_destroy(pool) == 0); +} + static void timer_test_timeout_from_event(void) { odp_pool_t pool; @@ -3105,6 +3165,7 @@ odp_testinfo_t timer_suite[] = { ODP_TEST_INFO(timer_test_capa), ODP_TEST_INFO(timer_test_param_init), ODP_TEST_INFO(timer_test_timeout_pool_alloc), + ODP_TEST_INFO(timer_test_timeout_pool_alloc_multi), ODP_TEST_INFO(timer_test_timeout_from_event), ODP_TEST_INFO(timer_test_timeout_pool_free), ODP_TEST_INFO(timer_test_timeout_user_area), From 0a48d8cf1093ffe716133494c89e2d23dbb9146a Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 8 Sep 2023 11:21:48 +0300 Subject: [PATCH 141/192] api: cls: add odp_cls_pmr_create_multi() function Add new odp_cls_pmr_create_multi() function for creating multiple packet matching rules with a single call. Depending on the implementation, using the multi variant can decrease per PMR rule create latency. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen Reviewed-by: Kiran Kumar K --- include/odp/api/spec/classification.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index 1504d1961f..0798241ad7 100644 --- a/include/odp/api/spec/classification.h +++ b/include/odp/api/spec/classification.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) 2014-2018 Linaro Limited - * Copyright (c) 2021-2022 Nokia + * Copyright (c) 2021-2023 Nokia */ /** @@ -988,6 +988,30 @@ odp_pmr_t odp_cls_pmr_create(const odp_pmr_param_t *terms, int num_terms, */ odp_pmr_t odp_cls_pmr_create_opt(const odp_pmr_create_opt_t *opt, odp_cos_t src_cos, odp_cos_t dst_cos); + +/** + * Create multiple packet matching rules + * + * Otherwise like odp_cls_pmr_create_opt(), but creates multiple rules with a + * single call. The output PMR handles are written in the same order as input + * parameters. A single odp_cls_pmr_create_multi() call is equivalent to calling + * odp_cls_pmr_create_opt() 'num' times in row. + * + * Each parameter array must contain 'num' elements. + * + * @param opt Array of PMR create options + * @param src_cos Array of source CoS handles + * @param dst_cos Array of destination CoS handles + * @param[out] pmr Array of PMR handles for output + * @param num Number of packet matching rules to create + * + * @return Number of PMRs actually created (0 ... num) + * @retval <0 on failure + */ +int odp_cls_pmr_create_multi(const odp_pmr_create_opt_t opt[], + odp_cos_t src_cos[], odp_cos_t dst_cos[], + odp_pmr_t pmr[], int num); + /** * Function to destroy a packet match rule * From f4358f4ea81ad5445517e807039b273698ea413f Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 8 Sep 2023 12:05:22 +0300 Subject: [PATCH 142/192] linux-gen: cls: implement odp_cls_pmr_create_multi() function Implement new odp_cls_pmr_create_multi() function for creating multiple packet matching rules with a single call. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- platform/linux-generic/odp_classification.c | 33 +++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 7c90ee8ac1..54f104f3c6 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -1,5 +1,5 @@ /* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2019-2022, Nokia + * Copyright (c) 2019-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -7,17 +7,20 @@ #include #include -#include #include +#include +#include #include +#include +#include +#include + #include #include #include -#include #include #include #include -#include #include #include #include @@ -28,7 +31,6 @@ #include #include #include -#include /* Debug level for per packet classification operations */ #define CLS_DBG 3 @@ -855,6 +857,27 @@ odp_pmr_t odp_cls_pmr_create_opt(const odp_pmr_create_opt_t *opt, return cls_pmr_create(opt->terms, opt->num_terms, opt->mark, src_cos, dst_cos); } +int odp_cls_pmr_create_multi(const odp_pmr_create_opt_t opt[], odp_cos_t src_cos[], + odp_cos_t dst_cos[], odp_pmr_t pmr[], int num) +{ + int i; + + _ODP_ASSERT(opt != NULL); + _ODP_ASSERT(src_cos != NULL); + _ODP_ASSERT(dst_cos != NULL); + _ODP_ASSERT(pmr != NULL); + + for (i = 0; i < num; i++) { + odp_pmr_t new_pmr = odp_cls_pmr_create_opt(&opt[i], src_cos[i], dst_cos[i]); + + if (odp_unlikely(new_pmr == ODP_PMR_INVALID)) + return (i == 0) ? -1 : i; + + pmr[i] = new_pmr; + } + return i; +} + int odp_cls_cos_pool_set(odp_cos_t cos_id, odp_pool_t pool) { cos_t *cos; From 5c96bcd5e3aeacfec2a9694892881c63eb58318f Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 8 Sep 2023 13:22:11 +0300 Subject: [PATCH 143/192] api: cls: add odp_cls_cos_create_multi() function Add new odp_cls_cos_create_multi() function for creating multiple class-of- services with a single call. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen Reviewed-by: Kiran Kumar K --- include/odp/api/spec/classification.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index 0798241ad7..f598faf80f 100644 --- a/include/odp/api/spec/classification.h +++ b/include/odp/api/spec/classification.h @@ -739,6 +739,30 @@ int odp_cls_capability(odp_cls_capability_t *capability); odp_cos_t odp_cls_cos_create(const char *name, const odp_cls_cos_param_t *param); +/** + * Create multiple class-of-services + * + * Otherwise like odp_cls_cos_create(), but creates multiple CoSes with a + * single call. The output CoS handles are written in the same order as input + * parameters. A single odp_cls_cos_create_multi() call is equivalent to calling + * odp_cls_cos_create() 'num' times in row. + * + * Each parameter array must contain 'num' elements with the exception that + * 'name' array may also be NULL. + * + * @param name Array of CoS name pointers or NULL. NULL is also valid + * CoS name pointer value. + * @param param Array of CoS parameters + * @param[out] cos Array of CoS handles for output + * @param num Number of CoSes to create + * + * @return Number of CoSes actually created (0 ... num) + * @retval <0 on failure + */ +int odp_cls_cos_create_multi(const char *name[], + const odp_cls_cos_param_t param[], + odp_cos_t cos[], int num); + /** * Queue hash result * Returns the queue within a CoS in which a particular packet will be enqueued From 67dbb462fa3f119eb26e11bf23eb37e5bc2bdc42 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 18 Sep 2023 13:37:36 +0300 Subject: [PATCH 144/192] linux-gen: cls: implement odp_cls_cos_create_multi() function Implement new odp_cls_cos_create_multi() function for creating multiple class-of-services with a single call. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- platform/linux-generic/odp_classification.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 54f104f3c6..21fed6d5eb 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -364,6 +364,26 @@ odp_cos_t odp_cls_cos_create(const char *name, const odp_cls_cos_param_t *param_ return ODP_COS_INVALID; } +int odp_cls_cos_create_multi(const char *name[], const odp_cls_cos_param_t param[], + odp_cos_t cos[], int num) +{ + int i; + + _ODP_ASSERT(param != NULL); + _ODP_ASSERT(cos != NULL); + + for (i = 0; i < num; i++) { + const char *cur_name = name != NULL ? name[i] : NULL; + odp_cos_t new_cos = odp_cls_cos_create(cur_name, ¶m[i]); + + if (odp_unlikely(new_cos == ODP_COS_INVALID)) + return (i == 0) ? -1 : i; + + cos[i] = new_cos; + } + return i; +} + /* * Allocate an odp_pmr_t Handle */ From 8349c40aae18d204625d5852fdcb1680dc1d9433 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 27 Sep 2023 12:31:04 +0300 Subject: [PATCH 145/192] api: cls: add odp_cos_destroy_multi() function Add new odp_cos_destroy_multi() function for destroying multiple CoSes with a single call. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen Reviewed-by: Kiran Kumar K --- include/odp/api/spec/classification.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index f598faf80f..3067ddef75 100644 --- a/include/odp/api/spec/classification.h +++ b/include/odp/api/spec/classification.h @@ -794,6 +794,20 @@ odp_queue_t odp_cls_hash_result(odp_cos_t cos, odp_packet_t packet); */ int odp_cos_destroy(odp_cos_t cos); +/** + * Destroy multiple class-of-services + * + * Otherwise like odp_cos_destroy(), but destroys multiple CoSes with a single + * call. + * + * @param cos Array of CoS handles + * @param num Number of CoSes to destroy + * + * @retval Number of CoSes actually destroyed (1 ... num) + * @retval <0 on failure + */ +int odp_cos_destroy_multi(odp_cos_t cos[], int num); + /** * Assign a queue for a class-of-service * From ffadb6b3e9260b71dee1ca76ad7dc95b898e083f Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 28 Sep 2023 10:04:47 +0300 Subject: [PATCH 146/192] linux-gen: cls: implement odp_cos_destroy_multi() function Implement new odp_cos_destroy_multi() function for destroying multiple CoSes with a single call. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- platform/linux-generic/odp_classification.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 21fed6d5eb..225870dd49 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -448,6 +448,23 @@ int odp_cos_destroy(odp_cos_t cos_id) return 0; } +int odp_cos_destroy_multi(odp_cos_t cos[], int num) +{ + int i; + + _ODP_ASSERT(cos != NULL); + _ODP_ASSERT(num > 0); + + for (i = 0; i < num; i++) { + int ret = odp_cos_destroy(cos[i]); + + if (ret) + return (i == 0) ? ret : i; + } + + return i; +} + int odp_cos_queue_set(odp_cos_t cos_id, odp_queue_t queue_id) { cos_t *cos = get_cos_entry(cos_id); From b0368a3a4f2db95c6e6b5149e36945f712cacefd Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 27 Sep 2023 12:43:07 +0300 Subject: [PATCH 147/192] api: cls: add odp_cls_pmr_destroy_multi() function Add new odp_cls_pmr_destroy_multi() function for destroying multiple PMRs with a single call. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen Reviewed-by: Kiran Kumar K --- include/odp/api/spec/classification.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index 3067ddef75..f513eea947 100644 --- a/include/odp/api/spec/classification.h +++ b/include/odp/api/spec/classification.h @@ -1069,6 +1069,20 @@ int odp_cls_pmr_create_multi(const odp_pmr_create_opt_t opt[], */ int odp_cls_pmr_destroy(odp_pmr_t pmr); +/** + * Destroy multiple packet matching rules + * + * Otherwise like odp_cls_pmr_destroy(), but destroys multiple PMRs with a + * single call. + * + * @param pmr Array of PMR handles + * @param num Number of PMRs to destroy + * + * @retval Number of PMRs actually destroyed (1 ... num) + * @retval <0 on failure + */ +int odp_cls_pmr_destroy_multi(odp_pmr_t pmr[], int num); + /** * Assigns a packet pool for a specific class of service * From 65625c64830399539fc32814598912d805bbe7e4 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 28 Sep 2023 10:07:21 +0300 Subject: [PATCH 148/192] linux-gen: cls: implement odp_cls_pmr_destroy_multi() function Implement new odp_cls_pmr_destroy_multi() function for destroying multiple PMRs with a single call. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- platform/linux-generic/odp_classification.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 225870dd49..eee64e78c3 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -824,6 +824,23 @@ int odp_cls_pmr_destroy(odp_pmr_t pmr_id) return 0; } +int odp_cls_pmr_destroy_multi(odp_pmr_t pmr[], int num) +{ + int i; + + _ODP_ASSERT(pmr != NULL); + _ODP_ASSERT(num > 0); + + for (i = 0; i < num; i++) { + int ret = odp_cls_pmr_destroy(pmr[i]); + + if (ret) + return (i == 0) ? ret : i; + } + + return i; +} + static odp_pmr_t cls_pmr_create(const odp_pmr_param_t *terms, int num_terms, uint16_t mark, odp_cos_t src_cos, odp_cos_t dst_cos) { From 6a2d33c8b94139b5e1a1e74c5978b85f41527a38 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 28 Sep 2023 14:09:01 +0300 Subject: [PATCH 149/192] validation: cls: add tests for create/destroy cos multi variants Add validation tests for new odp_cls_cos_create_multi() and odp_cos_destroy_multi() APIs. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- .../classification/odp_classification_basic.c | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/test/validation/api/classification/odp_classification_basic.c b/test/validation/api/classification/odp_classification_basic.c index 1e0be14d21..cc55d307c6 100644 --- a/test/validation/api/classification/odp_classification_basic.c +++ b/test/validation/api/classification/odp_classification_basic.c @@ -102,6 +102,78 @@ static void cls_create_cos_max_common(odp_bool_t stats) CU_ASSERT(!odp_cos_destroy(cos[j])); } +static int cos_create_multi(const char *name[], const odp_cls_cos_param_t param[], odp_cos_t cos[], + uint32_t num) +{ + const uint32_t max_retries = 100; + uint32_t num_created = 0; + uint32_t num_retries = 0; + + do { + const char **cur_name = (name != NULL) ? &name[num_created] : NULL; + int ret = odp_cls_cos_create_multi(cur_name, ¶m[num_created], + &cos[num_created], num - num_created); + if (ret < 0) { + CU_FAIL("CoS create multi failed"); + break; + } + num_retries = (ret == 0) ? num_retries + 1 : 0; + num_created += ret; + } while (num_created < num && num_retries < max_retries); + + return num_created; +} + +static void cos_destroy_multi(odp_cos_t cos[], uint32_t num) +{ + uint32_t num_left = num; + uint32_t num_freed = 0; + + while (num_left) { + int ret = odp_cos_destroy_multi(&cos[num_freed], num_left); + + CU_ASSERT_FATAL(ret > 0 && (uint32_t)ret <= num_left); + + num_left -= ret; + num_freed += ret; + } + CU_ASSERT_FATAL(num_freed == num); +} + +static void cls_create_cos_multi(void) +{ + odp_cls_cos_param_t param_single; + odp_cls_cos_param_t param[MAX_HANDLES]; + odp_cls_capability_t capa; + odp_cos_t cos[MAX_HANDLES]; + const char *name[MAX_HANDLES] = {NULL, "aaa", NULL, "bbb", "ccc", NULL, "ddd"}; + uint32_t num, num_created; + + CU_ASSERT_FATAL(odp_cls_capability(&capa) == 0); + CU_ASSERT_FATAL(capa.max_cos); + + num = capa.max_cos < MAX_HANDLES ? capa.max_cos : MAX_HANDLES; + + for (uint32_t i = 0; i < num; i++) { + odp_cls_cos_param_init(¶m[i]); + param[i].action = ODP_COS_ACTION_DROP; + } + odp_cls_cos_param_init(¶m_single); + param_single.action = ODP_COS_ACTION_DROP; + + num_created = cos_create_multi(NULL, ¶m_single, cos, 1); + CU_ASSERT(num_created == 1) + cos_destroy_multi(cos, num_created); + + num_created = cos_create_multi(name, param, cos, num); + CU_ASSERT(num_created == num) + cos_destroy_multi(cos, num_created); + + num_created = cos_create_multi(NULL, param, cos, num); + CU_ASSERT(num_created == num) + cos_destroy_multi(cos, num_created); +} + static void cls_create_cos_max(void) { cls_create_cos_max_common(false); @@ -598,6 +670,7 @@ static int check_capa_cos_hashing(void) odp_testinfo_t classification_suite_basic[] = { ODP_TEST_INFO(cls_default_values), ODP_TEST_INFO(cls_create_cos), + ODP_TEST_INFO(cls_create_cos_multi), ODP_TEST_INFO(cls_create_cos_max), ODP_TEST_INFO(cls_create_cos_max_stats), ODP_TEST_INFO(cls_destroy_cos), From 8afd898a6f829bd721f7507b8b460fda0be607eb Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 28 Sep 2023 16:36:55 +0300 Subject: [PATCH 150/192] validation: cls: add tests for create/destroy pmr multi variants Add validation tests for new odp_cls_pmr_create_multi() and odp_cls_pmr_destroy_multi() APIs. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- .../classification/odp_classification_basic.c | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/test/validation/api/classification/odp_classification_basic.c b/test/validation/api/classification/odp_classification_basic.c index cc55d307c6..2eb5c86b16 100644 --- a/test/validation/api/classification/odp_classification_basic.c +++ b/test/validation/api/classification/odp_classification_basic.c @@ -425,6 +425,120 @@ static void cls_max_pmr_from_default_enqueue(void) cls_max_pmr_from_default_action(0); } +static void cls_create_pmr_multi(void) +{ + odp_cls_cos_param_t cos_param; + odp_cls_capability_t capa; + odp_pool_t pool; + odp_pktio_t pktio; + uint32_t i, num_cos, num_pmr, num_left; + int ret; + const uint32_t max_retries = 100; + uint32_t num_retries = 0; + uint32_t num_freed = 0; + uint32_t cos_created = 0; + uint32_t pmr_created = 0; + uint16_t mask = 0xffff; + + CU_ASSERT_FATAL(odp_cls_capability(&capa) == 0); + + pool = pool_create("pkt_pool"); + CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); + + pktio = create_pktio(ODP_QUEUE_TYPE_SCHED, pool, true); + CU_ASSERT_FATAL(pktio != ODP_PKTIO_INVALID); + + num_cos = capa.max_cos; + if (num_cos > MAX_HANDLES) + num_cos = MAX_HANDLES; + + CU_ASSERT_FATAL(num_cos > 1); + + num_pmr = num_cos - 1; + + odp_cos_t src_cos[num_cos]; + odp_cos_t cos[num_cos]; + odp_pmr_t pmr[num_pmr]; + odp_pmr_create_opt_t pmr_opt[num_pmr]; + odp_pmr_param_t pmr_param[num_pmr]; + uint16_t val[num_pmr]; + + odp_cls_cos_param_init(&cos_param); + cos_param.action = ODP_COS_ACTION_DROP; + + for (i = 0; i < num_cos; i++) { + cos[i] = odp_cls_cos_create(NULL, &cos_param); + + if (cos[i] == ODP_COS_INVALID) { + ODPH_ERR("odp_cls_cos_create() failed %u / %u\n", i + 1, num_cos); + break; + } + /* Same source CoS used for all PMRs */ + src_cos[i] = cos[0]; + + cos_created++; + } + + CU_ASSERT(cos_created == num_cos); + + if (cos_created != num_cos) + goto destroy_cos; + + ret = odp_pktio_default_cos_set(pktio, cos[0]); + CU_ASSERT_FATAL(ret == 0); + + for (i = 0; i < num_pmr; i++) { + val[i] = 1024 + i; + + odp_cls_pmr_param_init(&pmr_param[i]); + pmr_param[i].term = find_first_supported_l3_pmr(); + pmr_param[i].match.value = &val[i]; + pmr_param[i].match.mask = &mask; + pmr_param[i].val_sz = sizeof(val[i]); + + odp_cls_pmr_create_opt_init(&pmr_opt[i]); + pmr_opt[i].terms = &pmr_param[i]; + pmr_opt[i].num_terms = 1; + } + + do { + ret = odp_cls_pmr_create_multi(&pmr_opt[pmr_created], + &src_cos[pmr_created], + &cos[pmr_created + 1], + &pmr[pmr_created], + num_pmr - pmr_created); + CU_ASSERT_FATAL(ret <= (int)(num_pmr - pmr_created)); + + if (ret < 0) + break; + + num_retries = (ret == 0) ? num_retries + 1 : 0; + pmr_created += ret; + } while (pmr_created < num_pmr && num_retries < max_retries); + + CU_ASSERT(pmr_created > 0); + + num_left = pmr_created; + while (num_left) { + ret = odp_cls_pmr_destroy_multi(&pmr[num_freed], num_left); + + CU_ASSERT_FATAL(ret > 0 && (uint32_t)ret <= num_left); + + num_left -= ret; + num_freed += ret; + } + + ret = odp_pktio_default_cos_set(pktio, ODP_COS_INVALID); + CU_ASSERT_FATAL(ret == 0); + +destroy_cos: + for (i = 0; i < cos_created; i++) + CU_ASSERT(odp_cos_destroy(cos[i]) == 0); + + CU_ASSERT(odp_pktio_close(pktio) == 0); + CU_ASSERT(odp_pool_destroy(pool) == 0); +} + static void cls_cos_set_queue(void) { int retval; @@ -675,6 +789,7 @@ odp_testinfo_t classification_suite_basic[] = { ODP_TEST_INFO(cls_create_cos_max_stats), ODP_TEST_INFO(cls_destroy_cos), ODP_TEST_INFO(cls_create_pmr_match), + ODP_TEST_INFO(cls_create_pmr_multi), ODP_TEST_INFO(cls_max_pmr_from_default_drop), ODP_TEST_INFO(cls_max_pmr_from_default_enqueue), ODP_TEST_INFO(cls_cos_set_queue), From f0c021b25c63ccc0d06800a75aebd90d54a63dea Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 8 Sep 2023 13:12:56 +0300 Subject: [PATCH 151/192] api: queue: add odp_queue_create_multi() function Add new odp_queue_create_multi() function for creating multiple queues with a single call. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen Reviewed-by: Jerin Jacob --- include/odp/api/spec/queue.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h index 95832de071..c278ce9c95 100644 --- a/include/odp/api/spec/queue.h +++ b/include/odp/api/spec/queue.h @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) 2013-2018 Linaro Limited + * Copyright (c) 2023 Nokia */ /** @@ -43,6 +44,34 @@ extern "C" { */ odp_queue_t odp_queue_create(const char *name, const odp_queue_param_t *param); +/** + * Create multiple queues + * + * Otherwise like odp_queue_create(), but creates multiple queues with a single + * call. The output queue handles are written in the same order as input + * parameters. A single odp_queue_create_multi() call is equivalent to calling + * odp_queue_create() 'num' times in row. + * + * If 'share_param' value is false, 'param' array must contain 'num' elements. + * If the value is true, only a single element is required and it's used as + * queue parameters for all created queues. If 'name' array is not NULL, the + * array must contain 'num' elements. + * + * @param name Array of queue name pointers or NULL. NULL is also + * valid queue name pointer value. + * @param param Array of queue parameters + * @param share_param If true, use same parameters ('param[0]') for all + * queues. + * @param[out] queue Array of queue handles for output + * @param num Number of queues to create + * + * @return Number of queues actually created (0 ... num) + * @retval <0 on failure + */ +int odp_queue_create_multi(const char *name[], const odp_queue_param_t param[], + odp_bool_t share_param, odp_queue_t queue[], + int num); + /** * Destroy ODP queue * From 9eef10280a69045b92cbf85aafc6ca30fb1f99a0 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 21 Sep 2023 15:01:21 +0300 Subject: [PATCH 152/192] linux-gen: queue: implement odp_queue_create_multi() function Implement new odp_queue_create_multi() function for creating multiple queues with a single call. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- .../include/odp/api/plat/queue_inline_types.h | 5 ++++ platform/linux-generic/odp_queue_basic.c | 24 +++++++++++++++++++ platform/linux-generic/odp_queue_if.c | 8 +++++++ platform/linux-generic/odp_queue_scalable.c | 24 +++++++++++++++++++ 4 files changed, 61 insertions(+) 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 e957785c4e..9ad037e4d0 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,4 +1,5 @@ /* Copyright (c) 2018, Linaro Limited + * Copyright (c) 2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -32,6 +33,10 @@ typedef struct _odp_queue_inline_offset_t { typedef struct { odp_queue_t (*queue_create)(const char *name, const odp_queue_param_t *param); + int (*queue_create_multi)(const char *name[], + const odp_queue_param_t param[], + odp_bool_t share_param, odp_queue_t queue[], + int num); int (*queue_destroy)(odp_queue_t queue); odp_queue_t (*queue_lookup)(const char *name); int (*queue_capability)(odp_queue_capability_t *capa); diff --git a/platform/linux-generic/odp_queue_basic.c b/platform/linux-generic/odp_queue_basic.c index 83694f84ff..70f05be0e6 100644 --- a/platform/linux-generic/odp_queue_basic.c +++ b/platform/linux-generic/odp_queue_basic.c @@ -370,6 +370,29 @@ static odp_queue_t queue_create(const char *name, return handle; } +static int queue_create_multi(const char *name[], const odp_queue_param_t param[], + odp_bool_t share_param, odp_queue_t queue[], int num) +{ + int i; + + _ODP_ASSERT(param != NULL); + _ODP_ASSERT(queue != NULL); + _ODP_ASSERT(num > 0); + + for (i = 0; i < num; i++) { + odp_queue_t cur_queue; + const char *cur_name = name != NULL ? name[i] : NULL; + const odp_queue_param_t *cur_param = share_param ? ¶m[0] : ¶m[i]; + + cur_queue = queue_create(cur_name, cur_param); + if (cur_queue == ODP_QUEUE_INVALID) + return (i == 0) ? -1 : i; + + queue[i] = cur_queue; + } + return i; +} + void _odp_sched_queue_set_status(uint32_t queue_index, int status) { queue_entry_t *queue = qentry_from_index(queue_index); @@ -1221,6 +1244,7 @@ static odp_event_t queue_api_deq(odp_queue_t handle) /* API functions */ _odp_queue_api_fn_t _odp_queue_basic_api = { .queue_create = queue_create, + .queue_create_multi = queue_create_multi, .queue_destroy = queue_destroy, .queue_lookup = queue_lookup, .queue_capability = queue_capability, diff --git a/platform/linux-generic/odp_queue_if.c b/platform/linux-generic/odp_queue_if.c index b702e01052..fc08fdca89 100644 --- a/platform/linux-generic/odp_queue_if.c +++ b/platform/linux-generic/odp_queue_if.c @@ -1,4 +1,5 @@ /* Copyright (c) 2017, ARM Limited + * Copyright (c) 2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -36,6 +37,13 @@ odp_queue_t odp_queue_create(const char *name, const odp_queue_param_t *param) return _odp_queue_api->queue_create(name, param); } +int odp_queue_create_multi(const char *name[], const odp_queue_param_t param[], + odp_bool_t share_param, odp_queue_t queue[], int num) +{ + return _odp_queue_api->queue_create_multi(name, param, share_param, + queue, num); +} + int odp_queue_destroy(odp_queue_t queue) { return _odp_queue_api->queue_destroy(queue); diff --git a/platform/linux-generic/odp_queue_scalable.c b/platform/linux-generic/odp_queue_scalable.c index 4a4be1ecfc..1c7e8f91e9 100644 --- a/platform/linux-generic/odp_queue_scalable.c +++ b/platform/linux-generic/odp_queue_scalable.c @@ -399,6 +399,29 @@ static odp_queue_t queue_create(const char *name, return handle; } +static int queue_create_multi(const char *name[], const odp_queue_param_t param[], + odp_bool_t share_param, odp_queue_t queue[], int num) +{ + int i; + + _ODP_ASSERT(param != NULL); + _ODP_ASSERT(queue != NULL); + _ODP_ASSERT(num > 0); + + for (i = 0; i < num; i++) { + odp_queue_t cur_queue; + const char *cur_name = name != NULL ? name[i] : NULL; + const odp_queue_param_t *cur_param = share_param ? ¶m[0] : ¶m[i]; + + cur_queue = queue_create(cur_name, cur_param); + if (cur_queue == ODP_QUEUE_INVALID) + return (i == 0) ? -1 : i; + + queue[i] = cur_queue; + } + return i; +} + static int queue_destroy(odp_queue_t handle) { queue_entry_t *queue; @@ -1137,6 +1160,7 @@ static void queue_timer_rem(odp_queue_t handle) /* API functions */ _odp_queue_api_fn_t _odp_queue_scalable_api = { .queue_create = queue_create, + .queue_create_multi = queue_create_multi, .queue_destroy = queue_destroy, .queue_lookup = queue_lookup, .queue_capability = queue_capability, From 978e1f6480c0cb66eddcd234dbc7d729fd97308e Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 27 Sep 2023 10:00:04 +0300 Subject: [PATCH 153/192] api: queue: add odp_queue_destroy_multi() function Add new odp_queue_destroy_multi() function for destroying multiple queues with a single call. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen Reviewed-by: Jerin Jacob --- include/odp/api/spec/queue.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h index c278ce9c95..87f6e0d19c 100644 --- a/include/odp/api/spec/queue.h +++ b/include/odp/api/spec/queue.h @@ -87,6 +87,20 @@ int odp_queue_create_multi(const char *name[], const odp_queue_param_t param[], */ int odp_queue_destroy(odp_queue_t queue); +/** + * Destroy multiple queues + * + * Otherwise like odp_queue_destroy(), but destroys multiple queues with a + * single call. + * + * @param queue Array of queue handles + * @param num Number of queues to destroy + * + * @retval Number of queues actually destroyed (1 ... num) + * @retval <0 on failure + */ +int odp_queue_destroy_multi(odp_queue_t queue[], int num); + /** * Find a queue by name * From 319bb59816b54f0b8e8291c7687aff6366a0f2a4 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 27 Sep 2023 15:21:26 +0300 Subject: [PATCH 154/192] linux-gen: queue: implement odp_queue_destroy_multi() function Implement new odp_queue_destroy_multi() function for destroying multiple queues with a single call. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- .../include/odp/api/plat/queue_inline_types.h | 1 + platform/linux-generic/odp_queue_basic.c | 18 ++++++++++++++++++ platform/linux-generic/odp_queue_if.c | 5 +++++ platform/linux-generic/odp_queue_scalable.c | 18 ++++++++++++++++++ 4 files changed, 42 insertions(+) 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 9ad037e4d0..593942072e 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 @@ -38,6 +38,7 @@ typedef struct { odp_bool_t share_param, odp_queue_t queue[], int num); int (*queue_destroy)(odp_queue_t queue); + int (*queue_destroy_multi)(odp_queue_t queue[], int num); odp_queue_t (*queue_lookup)(const char *name); int (*queue_capability)(odp_queue_capability_t *capa); int (*queue_context_set)(odp_queue_t queue, void *context, diff --git a/platform/linux-generic/odp_queue_basic.c b/platform/linux-generic/odp_queue_basic.c index 70f05be0e6..f9700742ca 100644 --- a/platform/linux-generic/odp_queue_basic.c +++ b/platform/linux-generic/odp_queue_basic.c @@ -463,6 +463,23 @@ static int queue_destroy(odp_queue_t handle) return 0; } +static int queue_destroy_multi(odp_queue_t handle[], int num) +{ + int i; + + _ODP_ASSERT(handle != NULL); + _ODP_ASSERT(num > 0); + + for (i = 0; i < num; i++) { + int ret = queue_destroy(handle[i]); + + if (ret) + return (i == 0) ? ret : i; + } + + return i; +} + static int queue_context_set(odp_queue_t handle, void *context, uint32_t len ODP_UNUSED) { @@ -1246,6 +1263,7 @@ _odp_queue_api_fn_t _odp_queue_basic_api = { .queue_create = queue_create, .queue_create_multi = queue_create_multi, .queue_destroy = queue_destroy, + .queue_destroy_multi = queue_destroy_multi, .queue_lookup = queue_lookup, .queue_capability = queue_capability, .queue_context_set = queue_context_set, diff --git a/platform/linux-generic/odp_queue_if.c b/platform/linux-generic/odp_queue_if.c index fc08fdca89..cc6594afde 100644 --- a/platform/linux-generic/odp_queue_if.c +++ b/platform/linux-generic/odp_queue_if.c @@ -49,6 +49,11 @@ int odp_queue_destroy(odp_queue_t queue) return _odp_queue_api->queue_destroy(queue); } +int odp_queue_destroy_multi(odp_queue_t queue[], int num) +{ + return _odp_queue_api->queue_destroy_multi(queue, num); +} + odp_queue_t odp_queue_lookup(const char *name) { return _odp_queue_api->queue_lookup(name); diff --git a/platform/linux-generic/odp_queue_scalable.c b/platform/linux-generic/odp_queue_scalable.c index 1c7e8f91e9..c7040dd3ca 100644 --- a/platform/linux-generic/odp_queue_scalable.c +++ b/platform/linux-generic/odp_queue_scalable.c @@ -499,6 +499,23 @@ static int queue_destroy(odp_queue_t handle) return 0; } +static int queue_destroy_multi(odp_queue_t handle[], int num) +{ + int i; + + _ODP_ASSERT(handle != NULL); + _ODP_ASSERT(num > 0); + + for (i = 0; i < num; i++) { + int ret = queue_destroy(handle[i]); + + if (ret) + return (i == 0) ? ret : i; + } + + return i; +} + static int queue_context_set(odp_queue_t handle, void *context, uint32_t len ODP_UNUSED) { @@ -1162,6 +1179,7 @@ _odp_queue_api_fn_t _odp_queue_scalable_api = { .queue_create = queue_create, .queue_create_multi = queue_create_multi, .queue_destroy = queue_destroy, + .queue_destroy_multi = queue_destroy_multi, .queue_lookup = queue_lookup, .queue_capability = queue_capability, .queue_context_set = queue_context_set, From cf839f33582997388f8699fc60997eac7a9fc1b0 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 21 Sep 2023 16:05:29 +0300 Subject: [PATCH 155/192] validation: queue: add test for queue create/destroy multi functions Add validation tests for new odp_queue_create_multi() and odp_queue_destroy_multi() APIs. Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- test/validation/api/queue/queue.c | 80 ++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/test/validation/api/queue/queue.c b/test/validation/api/queue/queue.c index 2cd4744557..cb2b147acf 100644 --- a/test/validation/api/queue/queue.c +++ b/test/validation/api/queue/queue.c @@ -1,5 +1,5 @@ /* Copyright (c) 2014-2018, Linaro Limited - * Copyright (c) 2021-2022, Nokia + * Copyright (c) 2021-2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -208,6 +208,83 @@ static void queue_test_max_plain(void) CU_ASSERT(odp_queue_destroy(queue[i]) == 0); } +static int queue_create_multi(const char *name[], const odp_queue_param_t param[], + odp_bool_t share_param, odp_queue_t queue[], uint32_t num) +{ + const uint32_t max_retries = 100; + uint32_t num_created = 0; + uint32_t num_retries = 0; + + do { + const char **cur_name = name != NULL ? &name[num_created] : NULL; + const odp_queue_param_t *cur_param = share_param ? ¶m[0] : ¶m[num_created]; + int ret = odp_queue_create_multi(cur_name, cur_param, share_param, + &queue[num_created], num - num_created); + if (ret < 0) { + CU_FAIL("Queue create multi failed"); + break; + } + CU_ASSERT_FATAL((uint32_t)ret <= num - num_created); + + num_retries = ret == 0 ? num_retries + 1 : 0; + num_created += ret; + } while (num_created < num && num_retries < max_retries); + + return num_created; +} + +static void queue_destroy_multi(odp_queue_t queue[], uint32_t num) +{ + uint32_t num_left = num; + uint32_t num_freed = 0; + + while (num_left) { + int ret = odp_queue_destroy_multi(&queue[num_freed], num_left); + + CU_ASSERT_FATAL(ret > 0 && (uint32_t)ret <= num_left); + + num_left -= ret; + num_freed += ret; + } + CU_ASSERT_FATAL(num_freed == num); +} + +static void queue_test_create_destroy_multi(void) +{ + odp_queue_capability_t capa; + odp_queue_param_t param_single; + odp_queue_param_t param[MAX_QUEUES]; + odp_queue_t queue[MAX_QUEUES]; + const char *name[MAX_QUEUES] = {NULL, "aaa", NULL, "bbb", "ccc", NULL, "ddd"}; + uint32_t num_queues, num_created; + + CU_ASSERT_FATAL(odp_queue_capability(&capa) == 0); + CU_ASSERT_FATAL(capa.plain.max_num != 0); + + num_queues = capa.plain.max_num < MAX_QUEUES ? capa.plain.max_num : MAX_QUEUES; + for (uint32_t i = 0; i < num_queues; i++) + odp_queue_param_init(¶m[i]); + odp_queue_param_init(¶m_single); + + /* Create queues using shared parameters */ + num_created = queue_create_multi(name, ¶m_single, true, queue, num_queues); + CU_ASSERT(num_created == num_queues); + queue_destroy_multi(queue, num_created); + + num_created = queue_create_multi(NULL, ¶m_single, true, queue, num_queues); + CU_ASSERT(num_created == num_queues); + queue_destroy_multi(queue, num_created); + + /* Use separate parameters for each queue */ + num_created = queue_create_multi(name, param, false, queue, num_queues); + CU_ASSERT(num_created == num_queues); + queue_destroy_multi(queue, num_created); + + num_created = queue_create_multi(NULL, param, false, queue, num_queues); + CU_ASSERT(num_created == num_queues); + queue_destroy_multi(queue, num_created); +} + static void queue_test_mode(void) { odp_queue_param_t qparams; @@ -1051,6 +1128,7 @@ odp_testinfo_t queue_suite[] = { ODP_TEST_INFO(queue_test_param_init), ODP_TEST_INFO(queue_test_mode), ODP_TEST_INFO(queue_test_max_plain), + ODP_TEST_INFO(queue_test_create_destroy_multi), ODP_TEST_INFO(queue_test_burst), ODP_TEST_INFO(queue_test_burst_spmc), ODP_TEST_INFO(queue_test_burst_mpsc), From 06938e959dc1dbedf0eec6b616fac9e99d4e892f Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 24 Aug 2023 17:28:01 +0300 Subject: [PATCH 156/192] helper: gtp: use correct prefix for GTP header length Rename ODP_GTP_HLEN define to ODPH_GTP_HLEN. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- helper/include/odp/helper/gtp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper/include/odp/helper/gtp.h b/helper/include/odp/helper/gtp.h index e9f5a8c618..b4fb21cb8f 100644 --- a/helper/include/odp/helper/gtp.h +++ b/helper/include/odp/helper/gtp.h @@ -35,7 +35,7 @@ typedef struct ODP_PACKED { } odph_gtphdr_t; /** GTP header length */ -#define ODP_GTP_HLEN sizeof(odph_gtphdr_t) +#define ODPH_GTP_HLEN sizeof(odph_gtphdr_t) /** * @} From e784307d5c78fd9874f560ddd07ada39ab038909 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 25 Aug 2023 13:14:32 +0300 Subject: [PATCH 157/192] helper: igmp: use correct prefix for IGMP header length Rename ODP_IGMP_HLEN define to ODPH_IGMP_HLEN. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- helper/include/odp/helper/igmp.h | 2 +- test/validation/api/classification/odp_classification_common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/helper/include/odp/helper/igmp.h b/helper/include/odp/helper/igmp.h index 7ab0d20ad1..64adc1bdaf 100644 --- a/helper/include/odp/helper/igmp.h +++ b/helper/include/odp/helper/igmp.h @@ -35,7 +35,7 @@ typedef struct ODP_PACKED { } odph_igmphdr_t; /** IGMP header length */ -#define ODP_IGMP_HLEN sizeof(odph_igmphdr_t) +#define ODPH_IGMP_HLEN sizeof(odph_igmphdr_t) /** * @} diff --git a/test/validation/api/classification/odp_classification_common.c b/test/validation/api/classification/odp_classification_common.c index d057ea40b6..1172dcc36b 100644 --- a/test/validation/api/classification/odp_classification_common.c +++ b/test/validation/api/classification/odp_classification_common.c @@ -360,7 +360,7 @@ odp_packet_t create_packet(cls_packet_info_t pkt_info) break; case CLS_PKT_L4_IGMP: next_hdr = ODPH_IPPROTO_IGMP; - l4_hdr_len = ODP_IGMP_HLEN; + l4_hdr_len = ODPH_IGMP_HLEN; break; case CLS_PKT_L4_AH: next_hdr = ODPH_IPPROTO_AH; From 5182ce145834f70501ff707f4790399d8512bb00 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 24 Aug 2023 17:51:04 +0300 Subject: [PATCH 158/192] helper: icmp: remove and rename defines Remove unused ICMP defines and add missing ODPH_ prefix to the remaining ones. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- example/generator/odp_generator.c | 6 +-- example/ipsec_crypto/odp_ipsec_stream.c | 4 +- example/ping/odp_ping.c | 10 ++-- helper/include/odp/helper/icmp.h | 47 +------------------ .../odp_classification_common.c | 2 +- .../odp_classification_test_pmr.c | 4 +- 6 files changed, 14 insertions(+), 59 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index cefe136830..b1d1f83e23 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -462,7 +462,7 @@ static odp_packet_t setup_icmp_pkt_ref(odp_pool_t pool, /* icmp */ icmp = (odph_icmphdr_t *)(buf + ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN); - icmp->type = ICMP_ECHO; + icmp->type = ODPH_ICMP_ECHO; icmp->code = 0; icmp->un.echo.id = 0; icmp->un.echo.sequence = 0; @@ -813,7 +813,7 @@ static void process_icmp_pkt(int thr, thread_args_t *thr_args, uint64_t rtt_ms, rtt_us; odph_icmphdr_t *icmp = (odph_icmphdr_t *)_icmp; - if (icmp->type == ICMP_ECHOREPLY) { + if (icmp->type == ODPH_ICMP_ECHOREPLY) { thr_args->counters.ctr_icmp_reply_rcv++; memcpy(&tsend, (uint8_t *)icmp + ODPH_ICMPHDR_LEN, @@ -826,7 +826,7 @@ static void process_icmp_pkt(int thr, thread_args_t *thr_args, PRIu64 ".%.03" PRIu64" ms\n", thr, odp_be_to_cpu_16(icmp->un.echo.sequence), rtt_ms, rtt_us); - } else if (icmp->type == ICMP_ECHO) { + } else if (icmp->type == ODPH_ICMP_ECHO) { printf(" [%02i] ICMP Echo Request\n", thr); } } diff --git a/example/ipsec_crypto/odp_ipsec_stream.c b/example/ipsec_crypto/odp_ipsec_stream.c index 0a0710a138..f8bc64eae7 100644 --- a/example/ipsec_crypto/odp_ipsec_stream.c +++ b/example/ipsec_crypto/odp_ipsec_stream.c @@ -324,7 +324,7 @@ odp_packet_t create_ipv4_packet(stream_db_entry_t *stream, /* ICMP header so we can see it on wireshark */ icmp = (odph_icmphdr_t *)data; data += sizeof(*icmp); - icmp->type = ICMP_ECHO; + icmp->type = ODPH_ICMP_ECHO; icmp->code = 0; icmp->un.echo.id = odp_cpu_to_be_16(0x1234); icmp->un.echo.sequence = odp_cpu_to_be_16(stream->created); @@ -583,7 +583,7 @@ odp_bool_t verify_ipv4_packet(stream_db_entry_t *stream, /* Verify ICMP header */ data += sizeof(*icmp); - if (ICMP_ECHO != icmp->type) + if (ODPH_ICMP_ECHO != icmp->type) return FALSE; if (0x1234 != odp_be_to_cpu_16(icmp->un.echo.id)) return FALSE; diff --git a/example/ping/odp_ping.c b/example/ping/odp_ping.c index 2c7d507f24..dbe4533197 100644 --- a/example/ping/odp_ping.c +++ b/example/ping/odp_ping.c @@ -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 */ #include @@ -560,12 +558,12 @@ static void icmp_reply(test_global_t *global, odp_packet_t pkt) if (icmp_hdr == NULL || len < 4) goto error; - if (icmp_hdr->type != 8 || icmp_hdr->code != 0) + if (icmp_hdr->type != ODPH_ICMP_ECHO || icmp_hdr->code != 0) goto error; /* Echo reply */ old = *(uint16_t *)(uintptr_t)icmp_hdr; - icmp_hdr->type = 0; + icmp_hdr->type = ODPH_ICMP_ECHOREPLY; new = *(uint16_t *)(uintptr_t)icmp_hdr; icmp_hdr->chksum = update_chksum(icmp_hdr->chksum, old, new); diff --git a/helper/include/odp/helper/icmp.h b/helper/include/odp/helper/icmp.h index 8f3215428e..9dbc02a9f9 100644 --- a/helper/include/odp/helper/icmp.h +++ b/helper/include/odp/helper/icmp.h @@ -47,51 +47,8 @@ typedef struct ODP_PACKED { } un; /**< icmp sub header */ } odph_icmphdr_t; -#define ICMP_ECHOREPLY 0 /**< Echo Reply */ -#define ICMP_DEST_UNREACH 3 /**< Destination Unreachable */ -#define ICMP_SOURCE_QUENCH 4 /**< Source Quench */ -#define ICMP_REDIRECT 5 /**< Redirect (change route) */ -#define ICMP_ECHO 8 /**< Echo Request */ -#define ICMP_TIME_EXCEEDED 11 /**< Time Exceeded */ -#define ICMP_PARAMETERPROB 12 /**< Parameter Problem */ -#define ICMP_TIMESTAMP 13 /**< Timestamp Request */ -#define ICMP_TIMESTAMPREPLY 14 /**< Timestamp Reply */ -#define ICMP_INFO_REQUEST 15 /**< Information Request */ -#define ICMP_INFO_REPLY 16 /**< Information Reply */ -#define ICMP_ADDRESS 17 /**< Address Mask Request */ -#define ICMP_ADDRESSREPLY 18 /**< Address Mask Reply */ -#define NR_ICMP_TYPES 18 /**< Number of icmp types */ - -/* Codes for UNREACH. */ -#define ICMP_NET_UNREACH 0 /**< Network Unreachable */ -#define ICMP_HOST_UNREACH 1 /**< Host Unreachable */ -#define ICMP_PROT_UNREACH 2 /**< Protocol Unreachable */ -#define ICMP_PORT_UNREACH 3 /**< Port Unreachable */ -#define ICMP_FRAG_NEEDED 4 /**< Fragmentation Needed/DF set*/ -#define ICMP_SR_FAILED 5 /**< Source Route failed */ -#define ICMP_NET_UNKNOWN 6 /**< Network Unknown */ -#define ICMP_HOST_UNKNOWN 7 /**< Host Unknown */ -#define ICMP_HOST_ISOLATED 8 /**< Host Isolated */ -#define ICMP_NET_ANO 9 /**< ICMP_NET_ANO */ -#define ICMP_HOST_ANO 10 /**< ICMP_HOST_ANO */ -#define ICMP_NET_UNR_TOS 11 /**< ICMP_NET_UNR_TOS */ -#define ICMP_HOST_UNR_TOS 12 /**< ICMP_HOST_UNR_TOS */ -#define ICMP_PKT_FILTERED 13 /**< Packet filtered */ -#define ICMP_PREC_VIOLATION 14 /**< Precedence violation */ -#define ICMP_PREC_CUTOFF 15 /**< Precedence cut off */ -#define NR_ICMP_UNREACH 15 /**< instead of hardcoding - immediate value */ - -/* Codes for REDIRECT. */ -#define ICMP_REDIR_NET 0 /**< Redirect Net */ -#define ICMP_REDIR_HOST 1 /**< Redirect Host */ -#define ICMP_REDIR_NETTOS 2 /**< Redirect Net for TOS */ -#define ICMP_REDIR_HOSTTOS 3 /**< Redirect Host for TOS */ - -/* Codes for TIME_EXCEEDED. */ -#define ICMP_EXC_TTL 0 /**< TTL count exceeded */ -#define ICMP_EXC_FRAGTIME 1 /**< Fragment Reass time - exceeded*/ +#define ODPH_ICMP_ECHOREPLY 0 /**< Echo Reply */ +#define ODPH_ICMP_ECHO 8 /**< Echo Request */ /** @cond _ODP_HIDE_FROM_DOXYGEN_ */ ODP_STATIC_ASSERT(sizeof(odph_icmphdr_t) == ODPH_ICMPHDR_LEN, diff --git a/test/validation/api/classification/odp_classification_common.c b/test/validation/api/classification/odp_classification_common.c index 1172dcc36b..1fb4c51b50 100644 --- a/test/validation/api/classification/odp_classification_common.c +++ b/test/validation/api/classification/odp_classification_common.c @@ -465,7 +465,7 @@ odp_packet_t create_packet(cls_packet_info_t pkt_info) igmp->code = 0; igmp->csum = 0; } else if (pkt_info.l4_type == CLS_PKT_L4_ICMP) { - icmp->type = ICMP_ECHO; + icmp->type = ODPH_ICMP_ECHO; icmp->code = 0; icmp->un.echo.id = 0; icmp->un.echo.sequence = 0; diff --git a/test/validation/api/classification/odp_classification_test_pmr.c b/test/validation/api/classification/odp_classification_test_pmr.c index f8a1703dc7..b88f7becac 100644 --- a/test/validation/api/classification/odp_classification_test_pmr.c +++ b/test/validation/api/classification/odp_classification_test_pmr.c @@ -1699,7 +1699,7 @@ static void cls_pmr_term_icmp_type(void) odp_pmr_param_t pmr_param; cls_packet_info_t pkt_info; - val = ICMP_ECHO; + val = ODPH_ICMP_ECHO; mask = 0xff; odp_cls_pmr_param_init(&pmr_param); @@ -1720,7 +1720,7 @@ static void cls_pmr_term_icmp_type(void) pkt = create_packet(pkt_info); CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); icmp = (odph_icmphdr_t *)odp_packet_l4_ptr(pkt, NULL); - icmp->type = ICMP_ECHOREPLY; + icmp->type = ODPH_ICMP_ECHOREPLY; test_pmr(&pmr_param, pkt, NO_MATCH); } From bdebb244d66b6baa6a2a1c3650e18cb90f9400a4 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 11 Aug 2023 11:07:13 +0300 Subject: [PATCH 159/192] helper: macros: add new macros for min/max comparison operations Add new ODPH_MIN() and ODPH_MAX() helper macros. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- helper/Makefile.am | 1 + helper/include/odp/helper/macros.h | 53 ++++++++++++++++++++++++++++ helper/include/odp/helper/odph_api.h | 1 + 3 files changed, 55 insertions(+) create mode 100644 helper/include/odp/helper/macros.h diff --git a/helper/Makefile.am b/helper/Makefile.am index 458a99f924..6e1ce583f1 100644 --- a/helper/Makefile.am +++ b/helper/Makefile.am @@ -23,6 +23,7 @@ helperinclude_HEADERS = \ include/odp/helper/igmp.h\ include/odp/helper/ip.h\ include/odp/helper/ipsec.h\ + include/odp/helper/macros.h\ include/odp/helper/odph_api.h\ include/odp/helper/odph_cuckootable.h\ include/odp/helper/odph_hashtable.h\ diff --git a/helper/include/odp/helper/macros.h b/helper/include/odp/helper/macros.h new file mode 100644 index 0000000000..bfcb768b13 --- /dev/null +++ b/helper/include/odp/helper/macros.h @@ -0,0 +1,53 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2023 Nokia + */ + +/** + * @file + * + * Common helper macros + */ + +#ifndef ODPH_MACROS_H_ +#define ODPH_MACROS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup odph_macros ODPH MACROS + * Helper macros + * + * @{ + */ + +/** + * Return minimum of two numbers + */ +#define ODPH_MIN(a, b) \ + __extension__ ({ \ + __typeof__(a) tmp_a = (a); \ + __typeof__(b) tmp_b = (b); \ + tmp_a < tmp_b ? tmp_a : tmp_b; \ + }) + +/** + * Return maximum of two numbers + */ +#define ODPH_MAX(a, b) \ + __extension__ ({ \ + __typeof__(a) tmp_a = (a); \ + __typeof__(b) tmp_b = (b); \ + tmp_a > tmp_b ? tmp_a : tmp_b; \ + }) + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* ODPH_MACROS_H_ */ diff --git a/helper/include/odp/helper/odph_api.h b/helper/include/odp/helper/odph_api.h index b4e3985c86..94d43a61be 100644 --- a/helper/include/odp/helper/odph_api.h +++ b/helper/include/odp/helper/odph_api.h @@ -28,6 +28,7 @@ extern "C" { #include #include #include +#include #include #include #include From ab22998f4d2ec452d48831689d9112ef37d78b04 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 11 Aug 2023 13:01:41 +0300 Subject: [PATCH 160/192] helper: macros: add test application Add test application for new ODPH_MIN() and ODPH_MAX() macros. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- helper/test/.gitignore | 1 + helper/test/Makefile.am | 10 +++++---- helper/test/macros.c | 46 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 helper/test/macros.c diff --git a/helper/test/.gitignore b/helper/test/.gitignore index e1e5ab7b28..3db451f683 100644 --- a/helper/test/.gitignore +++ b/helper/test/.gitignore @@ -4,6 +4,7 @@ chksum cli cuckootable iplookuptable +macros odpthreads parse process diff --git a/helper/test/Makefile.am b/helper/test/Makefile.am index a8fcee5745..80aac10833 100644 --- a/helper/test/Makefile.am +++ b/helper/test/Makefile.am @@ -3,10 +3,11 @@ include $(top_srcdir)/test/Makefile.inc EXECUTABLES = version \ debug \ chksum \ - cuckootable \ - parse\ - table \ - iplookuptable + cuckootable \ + macros \ + parse\ + table \ + iplookuptable #These are platform specific extensions that are not portable #They are a convenience to app writers who have chosen to @@ -39,6 +40,7 @@ dist_check_SCRIPTS = odpthreads_as_processes odpthreads_as_pthreads chksum_SOURCES = chksum.c cuckootable_SOURCES = cuckootable.c +macros_SOURCES = macros.c odpthreads_SOURCES = odpthreads.c parse_SOURCES = parse.c table_SOURCES = table.c diff --git a/helper/test/macros.c b/helper/test/macros.c new file mode 100644 index 0000000000..cb6bd491a0 --- /dev/null +++ b/helper/test/macros.c @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2023 Nokia + */ + +#include +#include + +#include +#include + +int main(void) +{ + int a, b; + int ret = 0; + + printf("Running helper macro tests\n"); + + if (ODPH_MIN(0, 10) != 0) + ret++; + + if (ODPH_MAX(0, 10) != 10) + ret++; + + if (ODPH_MIN(-1, 10) != -1) + ret++; + + if (ODPH_MAX(-1, 10) != 10) + ret++; + + a = 0; + b = 10; + if (ODPH_MIN(a--, b--) != 0) + ret++; + + a = 0; + b = 10; + if (ODPH_MAX(++a, ++b) != 11) + ret++; + + if (!ret) + printf("All tests passed\n"); + else + printf("%d tests failed\n", ret); + + return ret ? EXIT_FAILURE : EXIT_SUCCESS; +} From c5ada8c5c4a498020bc8b8cb4371a506d2800f2c Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 25 Aug 2023 15:54:11 +0300 Subject: [PATCH 161/192] example: use new ODPH_MIN and ODPH_MAX macros Utilize new ODPH_MIN() and ODPH_MAX() macros in example applications. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- example/generator/odp_generator.c | 1 - example/timer/odp_timer_simple.c | 6 ++---- example/timer/odp_timer_test.c | 5 +---- example/traffic_mgmt/odp_traffic_mgmt.c | 10 ++++------ 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index b1d1f83e23..95ba04c1e8 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -35,7 +35,6 @@ #define APPL_MODE_UDP 0 /**< UDP mode */ #define APPL_MODE_PING 1 /**< ping mode */ #define APPL_MODE_RCV 2 /**< receive mode */ -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) #define PING_THR_TX 0 #define PING_THR_RX 1 diff --git a/example/timer/odp_timer_simple.c b/example/timer/odp_timer_simple.c index 4e31206532..fdf38c9d3b 100644 --- a/example/timer/odp_timer_simple.c +++ b/example/timer/odp_timer_simple.c @@ -19,8 +19,6 @@ #include -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) - int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED) { odp_instance_t instance; @@ -71,8 +69,8 @@ int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED) } odp_timer_pool_param_init(&tparams); - tparams.res_ns = MAX(10 * ODP_TIME_MSEC_IN_NS, - timer_capa.highest_res_ns); + tparams.res_ns = ODPH_MAX(10 * ODP_TIME_MSEC_IN_NS, + timer_capa.highest_res_ns); tparams.min_tmo = 10 * ODP_TIME_MSEC_IN_NS; tparams.max_tmo = 1 * ODP_TIME_SEC_IN_NS; tparams.num_timers = 1; /* One timer per worker */ diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 0e3fa73468..924ffe13fe 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -21,7 +21,6 @@ #define MAX_WORKERS (ODP_THREAD_COUNT_MAX - 1) #define NUM_TMOS 10000 /**< Number of timers */ #define WAIT_NUM 10 /**< Max tries to rx last tmo per worker */ -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) /** Test arguments */ typedef struct { @@ -282,9 +281,7 @@ static int parse_args(int argc, char *argv[], test_args_t *args) return -1; args->cpu_count = 1; - args->resolution_us = MAX(10000, - timer_capa.highest_res_ns / - ODP_TIME_USEC_IN_NS); + args->resolution_us = ODPH_MAX(10000u, timer_capa.highest_res_ns / ODP_TIME_USEC_IN_NS); args->min_us = 0; args->max_us = 10000000; args->period_us = 1000000; diff --git a/example/traffic_mgmt/odp_traffic_mgmt.c b/example/traffic_mgmt/odp_traffic_mgmt.c index 689cac2ae1..5c97c54338 100644 --- a/example/traffic_mgmt/odp_traffic_mgmt.c +++ b/example/traffic_mgmt/odp_traffic_mgmt.c @@ -21,6 +21,7 @@ #include #include +#include #define NUM_SVC_CLASSES 4 #define USERS_PER_SVC_CLASS 2 @@ -39,9 +40,6 @@ #define FALSE 0 #define TRUE 1 -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) - #define RANDOM_BUF_LEN 1024 typedef struct { @@ -302,7 +300,7 @@ static uint32_t tm_shaper_max_burst; static uint64_t clamp_rate(uint64_t rate) { - uint64_t val = MIN(MAX(rate, tm_shaper_min_rate), tm_shaper_max_rate); + uint64_t val = ODPH_MIN(ODPH_MAX(rate, tm_shaper_min_rate), tm_shaper_max_rate); if (!rate) return 0; @@ -316,7 +314,7 @@ clamp_rate(uint64_t rate) static uint32_t clamp_burst(uint32_t burst) { - uint32_t val = MIN(MAX(burst, tm_shaper_min_burst), tm_shaper_max_burst); + uint32_t val = ODPH_MIN(ODPH_MAX(burst, tm_shaper_min_burst), tm_shaper_max_burst); if (!burst) return 0; @@ -765,7 +763,7 @@ static int traffic_generator(uint32_t pkts_to_send) queue_num = random_16() & (TM_QUEUES_PER_CLASS - 1); tm_queue = queue_num_tbls[svc_class][queue_num]; pkt_len = ((uint32_t)((random_8() & 0x7F) + 2)) * 32; - pkt_len = MIN(pkt_len, 1500); + pkt_len = ODPH_MIN(pkt_len, 1500u); pkt = make_odp_packet(pkt_len); pkt_cnt++; From 1dc038704b4948010b0de5624fa72340211be68c Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 25 Aug 2023 16:01:34 +0300 Subject: [PATCH 162/192] test: performance: use new ODPH_MIN and ODPH_MAX macros Utilize new ODPH_MIN() and ODPH_MAX() macros in performance test applications. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- test/performance/odp_dma_perf.c | 67 ++++++++++++++++----------------- test/performance/odp_dmafwd.c | 33 ++++++++-------- test/performance/odp_ipsecfwd.c | 17 ++++----- 3 files changed, 56 insertions(+), 61 deletions(-) diff --git a/test/performance/odp_dma_perf.c b/test/performance/odp_dma_perf.c index b47d222e25..7e9d489dfe 100644 --- a/test/performance/odp_dma_perf.c +++ b/test/performance/odp_dma_perf.c @@ -54,9 +54,6 @@ enum { #define MAX_SEGS 1024U #define MAX_WORKERS 24 -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#define MAX(a, b) (((a) < (b)) ? (b) : (a)) - #define GIGAS 1000000000 #define MEGAS 1000000 #define KILOS 1000 @@ -314,7 +311,7 @@ static parse_result_t check_options(prog_config_t *config) return PRS_NOK; } - max_workers = MIN(odp_thread_count_max() - 1, MAX_WORKERS); + max_workers = ODPH_MIN(odp_thread_count_max() - 1, MAX_WORKERS); if (config->num_workers <= 0 || config->num_workers > max_workers) { ODPH_ERR("Invalid thread count: %d (min: 1, max: %d)\n", config->num_workers, @@ -364,7 +361,7 @@ static parse_result_t check_options(prog_config_t *config) config->num_out_segs + config->src_seg_len * config->num_in_segs % config->num_out_segs; - max_seg_len = MAX(config->src_seg_len, config->dst_seg_len); + max_seg_len = ODPH_MAX(config->src_seg_len, config->dst_seg_len); if (max_seg_len > dma_capa.max_seg_len) { ODPH_ERR("Unsupported total DMA segment length: %u (max: %u)\n", max_seg_len, @@ -422,7 +419,7 @@ static parse_result_t check_options(prog_config_t *config) config->compl_mode_mask |= mode_map[config->compl_mode]; } - max_trs = MIN(dma_capa.max_transfers, MAX_SEGS); + max_trs = ODPH_MIN(dma_capa.max_transfers, MAX_SEGS); if (config->num_inflight == 0U) config->num_inflight = max_trs; @@ -435,7 +432,7 @@ static parse_result_t check_options(prog_config_t *config) max_in = config->num_in_segs * config->num_inflight; max_out = config->num_out_segs * config->num_inflight; - max_segs = MAX(max_in, max_out); + max_segs = ODPH_MAX(max_in, max_out); if (max_segs > MAX_SEGS) { ODPH_ERR("Unsupported input/output * inflight segment combination: %u (max: %u)\n", @@ -690,7 +687,7 @@ static void configure_packet_dma_transfer(sd_t *sd) seg = &start_dst_seg[j]; seg->packet = pkt; seg->offset = 0U; - seg->len = MIN(len, sd->dma.dst_seg_len); + seg->len = ODPH_MIN(len, sd->dma.dst_seg_len); len -= sd->dma.dst_seg_len; } @@ -769,7 +766,7 @@ static void configure_address_dma_transfer(sd_t *sd) for (uint32_t j = 0U; j < sd->dma.num_out_segs; ++j, ++z) { seg = &start_dst_seg[j]; seg->addr = (uint8_t *)sd->seg.dst + z * sd->dma.dst_seg_len; - seg->len = MIN(len, sd->dma.dst_seg_len); + seg->len = ODPH_MIN(len, sd->dma.dst_seg_len); len -= sd->dma.dst_seg_len; } @@ -809,17 +806,17 @@ static void run_transfer(odp_dma_t handle, trs_info_t *info, stats_t *stats) ++stats->start_errs; } else { trs_tm = end_tm - start_tm; - stats->max_trs_tm = MAX(trs_tm, stats->max_trs_tm); - stats->min_trs_tm = MIN(trs_tm, stats->min_trs_tm); + stats->max_trs_tm = ODPH_MAX(trs_tm, stats->max_trs_tm); + stats->min_trs_tm = ODPH_MIN(trs_tm, stats->min_trs_tm); stats->trs_tm += trs_tm; trs_cc = odp_cpu_cycles_diff(end_cc, start_cc); - stats->max_trs_cc = MAX(trs_cc, stats->max_trs_cc); - stats->min_trs_cc = MIN(trs_cc, stats->min_trs_cc); + stats->max_trs_cc = ODPH_MAX(trs_cc, stats->max_trs_cc); + stats->min_trs_cc = ODPH_MIN(trs_cc, stats->min_trs_cc); stats->trs_cc += trs_cc; ++stats->trs_cnt; start_cc_diff = odp_cpu_cycles_diff(end_cc, start_cc); - stats->max_start_cc = MAX(start_cc_diff, stats->max_start_cc); - stats->min_start_cc = MIN(start_cc_diff, stats->min_start_cc); + stats->max_start_cc = ODPH_MAX(start_cc_diff, stats->max_start_cc); + stats->min_start_cc = ODPH_MIN(start_cc_diff, stats->min_start_cc); stats->start_cc += start_cc_diff; ++stats->start_cnt; @@ -894,8 +891,8 @@ static void poll_transfer(odp_dma_t handle, trs_info_t *info, stats_t *stats) ++info->trs_poll_cnt; wait_cc = odp_cpu_cycles_diff(end_cc, start_cc); - stats->max_wait_cc = MAX(wait_cc, stats->max_wait_cc); - stats->min_wait_cc = MIN(wait_cc, stats->min_wait_cc); + stats->max_wait_cc = ODPH_MAX(wait_cc, stats->max_wait_cc); + stats->min_wait_cc = ODPH_MIN(wait_cc, stats->min_wait_cc); stats->wait_cc += wait_cc; ++stats->wait_cnt; @@ -903,12 +900,12 @@ static void poll_transfer(odp_dma_t handle, trs_info_t *info, stats_t *stats) return; trs_tm = odp_time_global_strict_ns() - info->trs_start_tm; - stats->max_trs_tm = MAX(trs_tm, stats->max_trs_tm); - stats->min_trs_tm = MIN(trs_tm, stats->min_trs_tm); + stats->max_trs_tm = ODPH_MAX(trs_tm, stats->max_trs_tm); + stats->min_trs_tm = ODPH_MIN(trs_tm, stats->min_trs_tm); stats->trs_tm += trs_tm; trs_cc = odp_cpu_cycles_diff(odp_cpu_cycles(), info->trs_start_cc); - stats->max_trs_cc = MAX(trs_cc, stats->max_trs_cc); - stats->min_trs_cc = MIN(trs_cc, stats->min_trs_cc); + stats->max_trs_cc = ODPH_MAX(trs_cc, stats->max_trs_cc); + stats->min_trs_cc = ODPH_MIN(trs_cc, stats->min_trs_cc); stats->trs_cc += trs_cc; stats->trs_poll_cnt += info->trs_poll_cnt; ++stats->trs_cnt; @@ -932,8 +929,8 @@ static void poll_transfer(odp_dma_t handle, trs_info_t *info, stats_t *stats) info->trs_start_cc = start_cc; info->trs_poll_cnt = 0U; start_cc_diff = odp_cpu_cycles_diff(end_cc, start_cc); - stats->max_start_cc = MAX(start_cc_diff, stats->max_start_cc); - stats->min_start_cc = MIN(start_cc_diff, stats->min_start_cc); + stats->max_start_cc = ODPH_MAX(start_cc_diff, stats->max_start_cc); + stats->min_start_cc = ODPH_MIN(start_cc_diff, stats->min_start_cc); stats->start_cc += start_cc_diff; ++stats->start_cnt; info->is_running = true; @@ -1074,17 +1071,17 @@ static void wait_compl_event(sd_t *sd, stats_t *stats) odp_dma_compl_result(odp_dma_compl_from_event(ev), &res); info = res.user_ptr; trs_tm = odp_time_global_strict_ns() - info->trs_start_tm; - stats->max_trs_tm = MAX(trs_tm, stats->max_trs_tm); - stats->min_trs_tm = MIN(trs_tm, stats->min_trs_tm); + stats->max_trs_tm = ODPH_MAX(trs_tm, stats->max_trs_tm); + stats->min_trs_tm = ODPH_MIN(trs_tm, stats->min_trs_tm); stats->trs_tm += trs_tm; trs_cc = odp_cpu_cycles_diff(odp_cpu_cycles(), info->trs_start_cc); - stats->max_trs_cc = MAX(trs_cc, stats->max_trs_cc); - stats->min_trs_cc = MIN(trs_cc, stats->min_trs_cc); + stats->max_trs_cc = ODPH_MAX(trs_cc, stats->max_trs_cc); + stats->min_trs_cc = ODPH_MIN(trs_cc, stats->min_trs_cc); stats->trs_cc += trs_cc; ++stats->trs_cnt; wait_cc = odp_cpu_cycles_diff(end_cc, start_cc); - stats->max_wait_cc = MAX(wait_cc, stats->max_wait_cc); - stats->min_wait_cc = MIN(wait_cc, stats->min_wait_cc); + stats->max_wait_cc = ODPH_MAX(wait_cc, stats->max_wait_cc); + stats->min_wait_cc = ODPH_MIN(wait_cc, stats->min_wait_cc); stats->wait_cc += wait_cc; ++stats->wait_cnt; @@ -1104,8 +1101,8 @@ static void wait_compl_event(sd_t *sd, stats_t *stats) info->trs_start_tm = start_tm; info->trs_start_cc = start_cc; start_cc_diff = odp_cpu_cycles_diff(end_cc, start_cc); - stats->max_start_cc = MAX(start_cc_diff, stats->max_start_cc); - stats->min_start_cc = MIN(start_cc_diff, stats->min_start_cc); + stats->max_start_cc = ODPH_MAX(start_cc_diff, stats->max_start_cc); + stats->min_start_cc = ODPH_MIN(start_cc_diff, stats->min_start_cc); stats->start_cc += start_cc_diff; ++stats->start_cnt; } @@ -1418,10 +1415,10 @@ static void print_stats(const prog_config_t *config) tot_trs_tm += stats->trs_tm; tot_trs_cc += stats->trs_cc; tot_trs_cnt += stats->trs_cnt; - tot_min_tm = MIN(tot_min_tm, stats->min_trs_tm); - tot_max_tm = MAX(tot_max_tm, stats->max_trs_tm); - tot_min_cc = MIN(tot_min_cc, stats->min_trs_cc); - tot_max_cc = MAX(tot_max_cc, stats->max_trs_cc); + tot_min_tm = ODPH_MIN(tot_min_tm, stats->min_trs_tm); + tot_max_tm = ODPH_MAX(tot_max_tm, stats->max_trs_tm); + tot_min_cc = ODPH_MIN(tot_min_cc, stats->min_trs_cc); + tot_max_cc = ODPH_MAX(tot_max_cc, stats->max_trs_cc); printf(" worker %d:\n", i); printf(" successful transfers: %" PRIu64 "\n" diff --git a/test/performance/odp_dmafwd.c b/test/performance/odp_dmafwd.c index 03ac1b6400..188a8e358e 100644 --- a/test/performance/odp_dmafwd.c +++ b/test/performance/odp_dmafwd.c @@ -45,8 +45,6 @@ enum { #define MAX_BURST 32U #define MAX_WORKERS (ODP_THREAD_COUNT_MAX - 1) -#define MIN(a, b) (((a) <= (b)) ? (a) : (b)) -#define MAX(a, b) (((a) >= (b)) ? (a) : (b)) #define DIV_IF(a, b) ((b) > 0U ? ((a) / (b)) : 0U) ODP_STATIC_ASSERT(MAX_IFS < UINT8_MAX, "Too large maximum interface count"); @@ -185,16 +183,16 @@ static void init_config(prog_config_t *config) memset(config, 0, sizeof(*config)); if (odp_dma_capability(&dma_capa) == 0) { - burst_size = MIN(dma_capa.max_src_segs, dma_capa.max_dst_segs); - burst_size = MIN(burst_size, MAX_BURST); + burst_size = ODPH_MIN(dma_capa.max_src_segs, dma_capa.max_dst_segs); + burst_size = ODPH_MIN(burst_size, MAX_BURST); config->dyn_defs.burst_size = burst_size; } if (odp_pool_capability(&pool_capa) == 0) { config->dyn_defs.num_pkts = pool_capa.pkt.max_num > 0U ? - MIN(pool_capa.pkt.max_num, DEF_CNT) : DEF_CNT; + ODPH_MIN(pool_capa.pkt.max_num, DEF_CNT) : DEF_CNT; config->dyn_defs.pkt_len = pool_capa.pkt.max_len > 0U ? - MIN(pool_capa.pkt.max_len, DEF_LEN) : DEF_LEN; + ODPH_MIN(pool_capa.pkt.max_len, DEF_LEN) : DEF_LEN; odp_pool_param_init(&pool_param); config->dyn_defs.cache_size = pool_param.pkt.cache_size; } @@ -333,8 +331,8 @@ static parse_result_t check_options(prog_config_t *config) return PRS_NOT_SUP; } - burst_size = MIN(dma_capa.max_src_segs, dma_capa.max_dst_segs); - burst_size = MIN(burst_size, MAX_BURST); + burst_size = ODPH_MIN(dma_capa.max_src_segs, dma_capa.max_dst_segs); + burst_size = ODPH_MIN(burst_size, MAX_BURST); if (config->burst_size == 0U || config->burst_size > burst_size) { ODPH_ERR("Invalid segment count for DMA: %u (min: 1, max: %u)\n", @@ -363,8 +361,9 @@ static parse_result_t check_options(prog_config_t *config) } if (config->copy_type != SW_COPY) - config->trs_cache_size = MIN(MAX(config->cache_size, pool_capa.buf.min_cache_size), - pool_capa.buf.max_cache_size); + config->trs_cache_size = ODPH_MIN(ODPH_MAX(config->cache_size, + pool_capa.buf.min_cache_size), + pool_capa.buf.max_cache_size); if (config->copy_type == DMA_COPY_EV) { if ((dma_capa.compl_mode_mask & ODP_DMA_COMPL_EVENT) == 0U || @@ -387,9 +386,9 @@ static parse_result_t check_options(prog_config_t *config) return PRS_NOK; } - config->compl_cache_size = MIN(MAX(config->cache_size, - dma_capa.pool.min_cache_size), - dma_capa.pool.max_cache_size); + config->compl_cache_size = ODPH_MIN(ODPH_MAX(config->cache_size, + dma_capa.pool.min_cache_size), + dma_capa.pool.max_cache_size); } else if (config->copy_type == DMA_COPY_POLL) { if ((dma_capa.compl_mode_mask & ODP_DMA_COMPL_POLL) == 0U) { ODPH_ERR("Unsupported DMA completion mode: poll (mode support: %x)\n", @@ -430,7 +429,7 @@ static parse_result_t check_options(prog_config_t *config) } config->inflight_obj_size = obj_size; - config->stash_cache_size = MIN(config->cache_size, stash_capa.max_cache_size); + config->stash_cache_size = ODPH_MIN(config->cache_size, stash_capa.max_cache_size); } if (config->num_pkts == 0U || @@ -963,9 +962,9 @@ static odp_bool_t setup_pktios(prog_config_t *config) return false; } - num_input_qs = MIN((uint32_t)config->num_thrs, capa.max_input_queues); - num_output_qs = MIN((uint32_t)config->num_thrs, capa.max_output_queues); - num_output_qs = MIN(num_output_qs, MAX_OUT_QS); + num_input_qs = ODPH_MIN((uint32_t)config->num_thrs, capa.max_input_queues); + num_output_qs = ODPH_MIN((uint32_t)config->num_thrs, capa.max_output_queues); + num_output_qs = ODPH_MIN(num_output_qs, MAX_OUT_QS); odp_pktin_queue_param_init(&pktin_param); if (num_input_qs > 1) { diff --git a/test/performance/odp_ipsecfwd.c b/test/performance/odp_ipsecfwd.c index d2441a4167..efbcab078b 100644 --- a/test/performance/odp_ipsecfwd.c +++ b/test/performance/odp_ipsecfwd.c @@ -22,8 +22,6 @@ #define SHORT_PROG_NAME "ipsfwd" #define DELIMITER "," -#define MIN(a, b) (((a) <= (b)) ? (a) : (b)) - #define MAX_IFS 2U #define MAX_SAS 4000U #define MAX_FWDS 64U @@ -416,8 +414,9 @@ static void print_usage(void) " options are ignored, input and output queue counts will\n" " match worker count.\n" " -h, --help This help.\n" - "\n", pool_capa.pkt.max_num > 0U ? MIN(pool_capa.pkt.max_num, PKT_CNT) : PKT_CNT, - pool_capa.pkt.max_len > 0U ? MIN(pool_capa.pkt.max_len, PKT_SIZE) : PKT_SIZE); + "\n", pool_capa.pkt.max_num > 0U ? ODPH_MIN(pool_capa.pkt.max_num, PKT_CNT) : + PKT_CNT, pool_capa.pkt.max_len > 0U ? ODPH_MIN(pool_capa.pkt.max_len, PKT_SIZE) : + PKT_SIZE); } static inline odp_ipsec_sa_t *get_in_sa(odp_packet_t pkt) @@ -965,7 +964,7 @@ static odp_bool_t create_sa_dest_queues(odp_ipsec_capability_t *ipsec_capa, prog_config_t *config) { odp_queue_param_t q_param; - const uint32_t max_sa_qs = MIN(MAX_SA_QUEUES, ipsec_capa->max_queues); + const uint32_t max_sa_qs = ODPH_MIN(MAX_SA_QUEUES, ipsec_capa->max_queues); if (config->num_sa_qs == 0U || config->num_sa_qs > max_sa_qs) { ODPH_ERR("Invalid number of SA queues: %u (min: 1, max: %u)\n", config->num_sa_qs, @@ -1276,7 +1275,7 @@ static void parse_sas(config_t *cfg, prog_config_t *config) if (!config->is_dir_rx && !create_sa_dest_queues(&ipsec_capa, config)) return; - max_num_sa = MIN(MAX_SAS, ipsec_capa.max_num_sa); + max_num_sa = ODPH_MIN(MAX_SAS, ipsec_capa.max_num_sa); parse_and_create_sa_entries(cfg, config, max_num_sa); } @@ -1400,7 +1399,7 @@ static parse_result_t check_options(prog_config_t *config) if (config->num_pkts == 0U) config->num_pkts = pool_capa.pkt.max_num > 0U ? - MIN(pool_capa.pkt.max_num, PKT_CNT) : PKT_CNT; + ODPH_MIN(pool_capa.pkt.max_num, PKT_CNT) : PKT_CNT; if (pool_capa.pkt.max_len > 0U && config->pkt_len > pool_capa.pkt.max_len) { ODPH_ERR("Invalid pool packet length: %u (max: %u)\n", config->pkt_len, @@ -1410,7 +1409,7 @@ static parse_result_t check_options(prog_config_t *config) if (config->pkt_len == 0U) config->pkt_len = pool_capa.pkt.max_len > 0U ? - MIN(pool_capa.pkt.max_len, PKT_SIZE) : PKT_SIZE; + ODPH_MIN(pool_capa.pkt.max_len, PKT_SIZE) : PKT_SIZE; if (config->num_thrs <= 0 || config->num_thrs > MAX_WORKERS) { ODPH_ERR("Invalid thread count: %d (min: 1, max: %d)\n", config->num_thrs, @@ -1620,7 +1619,7 @@ static odp_bool_t setup_pktios(prog_config_t *config) return false; } - max_output_qs = MIN(MAX_QUEUES, capa.max_output_queues); + max_output_qs = ODPH_MIN(MAX_QUEUES, capa.max_output_queues); if (config->num_output_qs == 0U || config->num_output_qs > max_output_qs) { ODPH_ERR("Invalid number of output queues for packet I/O: %u (min: 1, " From 5f94b501439ed5155ae89b2a82a7a8904ad68ae1 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 25 Aug 2023 16:07:35 +0300 Subject: [PATCH 163/192] validation: use new ODPH_MIN and ODPH_MAX macros Utilize new ODPH_MIN() and ODPH_MAX() macros in validation tests. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- test/validation/api/atomic/atomic.c | 9 +++---- test/validation/api/dma/dma.c | 24 ++++++++--------- test/validation/api/pool/pool.c | 22 +++++++-------- test/validation/api/timer/timer.c | 2 -- .../api/traffic_mngr/traffic_mngr.c | 27 +++++++++---------- 5 files changed, 36 insertions(+), 48 deletions(-) diff --git a/test/validation/api/atomic/atomic.c b/test/validation/api/atomic/atomic.c index 17d9dc82a3..76e3c0d497 100644 --- a/test/validation/api/atomic/atomic.c +++ b/test/validation/api/atomic/atomic.c @@ -25,9 +25,6 @@ #define UNUSED __attribute__((__unused__)) -#define min(a, b) (a < b ? a : b) -#define max(a, b) (a > b ? a : b) - typedef __volatile uint32_t volatile_u32_t; typedef __volatile uint64_t volatile_u64_t; @@ -929,7 +926,7 @@ static void test_atomic_validate_max_min(void) * a long test, counter may overflow, in which case max is saturated at * UINT32_MAX, and min at 0. */ - const uint32_t a32u_max = min(U32_INIT_VAL + total_count - 1, UINT32_MAX); + const uint32_t a32u_max = ODPH_MIN(U32_INIT_VAL + total_count - 1, UINT32_MAX); const uint32_t a32u_min = U32_INIT_VAL + total_count - 1 > UINT32_MAX ? 0 : U32_INIT_VAL; CU_ASSERT(odp_atomic_load_u32(&global_mem->a32u_max) == a32u_max); @@ -1546,7 +1543,7 @@ static void test_atomic_validate_max(void) { const uint64_t total_count = CNT * global_mem->g_num_threads - 1; /* In a long test, counter may overflow, in which case max is saturated at UINT32_MAX. */ - const uint32_t a32u_max = min(U32_INIT_VAL + total_count, UINT32_MAX); + const uint32_t a32u_max = ODPH_MIN(U32_INIT_VAL + total_count, UINT32_MAX); CU_ASSERT(a32u_max == odp_atomic_load_u32(&global_mem->a32u_max)); CU_ASSERT(U64_INIT_VAL + total_count == odp_atomic_load_u64(&global_mem->a64u_max)); @@ -1561,7 +1558,7 @@ static void test_atomic_validate_min(void) { const uint64_t total_count = CNT * global_mem->g_num_threads - 1; /* In a long test, counter may underflow, in which case min is saturated at 0. */ - const uint32_t a32u_min = max((int64_t)U32_INIT_VAL - (int64_t)total_count, 0); + const uint32_t a32u_min = ODPH_MAX((int64_t)U32_INIT_VAL - (int64_t)total_count, 0); CU_ASSERT(a32u_min == odp_atomic_load_u32(&global_mem->a32u_min)); CU_ASSERT(U64_INIT_VAL - total_count == odp_atomic_load_u64(&global_mem->a64u_min)); diff --git a/test/validation/api/dma/dma.c b/test/validation/api/dma/dma.c index 557e1ff0a5..7129315eff 100644 --- a/test/validation/api/dma/dma.c +++ b/test/validation/api/dma/dma.c @@ -19,11 +19,9 @@ #define MULTI 1 #define RESULT 1 #define USER_DATA 0xdeadbeef -#define ELEM_NUM 10 +#define ELEM_NUM 10u #define UAREA 0xaa -#define MIN(a, b) (a < b ? a : b) - typedef struct global_t { odp_dma_capability_t dma_capa; odp_shm_t shm; @@ -105,7 +103,7 @@ static int dma_suite_init(void) if (pkt_len == 0) pkt_len = 4000; - pkt_len = MIN(pkt_len, global.dma_capa.max_seg_len); + pkt_len = ODPH_MIN(pkt_len, global.dma_capa.max_seg_len); odp_pool_param_init(&pool_param); pool_param.type = ODP_POOL_PACKET; pool_param.pkt.num = global.dma_capa.max_src_segs + global.dma_capa.max_dst_segs; @@ -426,7 +424,7 @@ static void test_dma_compl_pool_max_pools(void) static void test_dma_compl_user_area(void) { odp_dma_pool_param_t dma_pool_param; - uint32_t num = MIN(ELEM_NUM, global.dma_capa.pool.max_num), + uint32_t num = ODPH_MIN(ELEM_NUM, global.dma_capa.pool.max_num), size = global.dma_capa.pool.max_uarea_size, i; odp_pool_t pool; odp_dma_compl_t compl_evs[num]; @@ -482,7 +480,7 @@ static void init_event_uarea(void *uarea, uint32_t size, void *args, uint32_t in static void test_dma_compl_user_area_init(void) { odp_dma_pool_param_t dma_pool_param; - uint32_t num = MIN(ELEM_NUM, global.dma_capa.pool.max_num), i; + uint32_t num = ODPH_MIN(ELEM_NUM, global.dma_capa.pool.max_num), i; odp_pool_t pool; uarea_init_t data; odp_dma_compl_t compl_evs[num]; @@ -721,7 +719,7 @@ static void test_dma_addr_to_addr(odp_dma_compl_mode_t compl_mode_mask, uint32_t uint32_t i, cur_len; uint8_t *src = global.src_addr + OFFSET; uint8_t *dst = global.dst_addr + OFFSET; - uint32_t seg_len = MIN(global.len / num, global.dma_capa.max_seg_len); + uint32_t seg_len = ODPH_MIN(global.len / num, global.dma_capa.max_seg_len); uint32_t len = seg_len * num; uint32_t offset = 0; @@ -781,7 +779,7 @@ static void test_dma_addr_to_addr_trs(odp_dma_compl_mode_t compl_mode_mask, uint odp_dma_compl_mode_t compl_mode; uint8_t *src = global.src_addr + OFFSET; uint8_t *dst = global.dst_addr + OFFSET; - uint32_t trs_len = MIN(global.len / num_trs, global.dma_capa.max_seg_len); + uint32_t trs_len = ODPH_MIN(global.len / num_trs, global.dma_capa.max_seg_len); uint32_t len = trs_len * num_trs; uint32_t offset = 0; int ret = -1; @@ -852,7 +850,7 @@ static void test_dma_addr_to_addr_max_trs(odp_dma_compl_mode_t compl_mode_mask) uint32_t i, cur_len; uint8_t *src = global.src_addr + OFFSET; uint8_t *dst = global.dst_addr + OFFSET; - uint32_t seg_len = MIN(global.len / num_trs, global.dma_capa.max_seg_len); + uint32_t seg_len = ODPH_MIN(global.len / num_trs, global.dma_capa.max_seg_len); uint32_t len = seg_len * num_trs; uint32_t offset = 0; @@ -1315,9 +1313,9 @@ static void test_dma_addr_to_addr_sync_res(void) static void get_seg_lens(uint32_t max_len, uint32_t *src, uint32_t *dst) { - uint32_t src_segs = *src, dst_segs = *dst, denom = MIN(src_segs, dst_segs); + uint32_t src_segs = *src, dst_segs = *dst, denom = ODPH_MIN(src_segs, dst_segs); - max_len = MIN(max_len / denom, global.dma_capa.max_seg_len) * denom; + max_len = ODPH_MIN(max_len / denom, global.dma_capa.max_seg_len) * denom; *src = max_len / src_segs; *dst = *src * src_segs / dst_segs + *src * src_segs % dst_segs; } @@ -1358,7 +1356,7 @@ static void test_dma_addr_to_addr_sync_max_seg(void) memset(&dst_seg[i], 0, sizeof(odp_dma_seg_t)); dst_seg[i].addr = addr; - dst_seg[i].len = MIN(len, dst_len); + dst_seg[i].len = ODPH_MIN(len, dst_len); len -= dst_len; } @@ -1441,7 +1439,7 @@ static void test_dma_pkt_to_pkt_sync_max_seg(void) memset(odp_packet_data(pkt), 0, dst_len); memset(&dst_seg[i], 0, sizeof(odp_dma_seg_t)); dst_seg[i].packet = pkt; - dst_seg[i].len = MIN(len, dst_len); + dst_seg[i].len = ODPH_MIN(len, dst_len); len -= dst_len; } diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c index 7074095548..e713827bfc 100644 --- a/test/validation/api/pool/pool.c +++ b/test/validation/api/pool/pool.c @@ -20,8 +20,8 @@ #define VEC_LEN 32 #define PKT_LEN 400 #define PKT_NUM 500 -#define ELEM_NUM 10 -#define ELEM_SIZE 128 +#define ELEM_NUM 10u +#define ELEM_SIZE 128u #define CACHE_SIZE 32 #define MAX_NUM_DEFAULT (10 * 1024 * 1024) #define UAREA 0xaa @@ -34,8 +34,6 @@ #define EXT_HEADROOM 16 #define MAGIC_U8 0x7a -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) - typedef struct { odp_barrier_t init_barrier; odp_atomic_u32_t index; @@ -204,8 +202,8 @@ static void init_event_uarea(void *uarea, uint32_t size, void *args, uint32_t in static void pool_test_buffer_uarea_init(void) { odp_pool_param_t param; - uint32_t num = MIN(global_pool_capa.buf.max_num, ELEM_NUM), - size = MIN(global_pool_capa.buf.max_size, ELEM_SIZE), i; + uint32_t num = ODPH_MIN(global_pool_capa.buf.max_num, ELEM_NUM), + size = ODPH_MIN(global_pool_capa.buf.max_size, ELEM_SIZE), i; odp_pool_t pool; uarea_init_t data; odp_buffer_t bufs[num]; @@ -246,8 +244,8 @@ static void pool_test_buffer_uarea_init(void) static void pool_test_packet_uarea_init(void) { odp_pool_param_t param; - uint32_t num = MIN(global_pool_capa.pkt.max_num, ELEM_NUM), - size = MIN(global_pool_capa.pkt.max_len, ELEM_SIZE), i; + uint32_t num = ODPH_MIN(global_pool_capa.pkt.max_num, ELEM_NUM), + size = ODPH_MIN(global_pool_capa.pkt.max_len, ELEM_SIZE), i; odp_pool_t pool; uarea_init_t data; odp_packet_t pkts[num]; @@ -288,8 +286,8 @@ static void pool_test_packet_uarea_init(void) static void pool_test_vector_uarea_init(void) { odp_pool_param_t param; - uint32_t num = MIN(global_pool_capa.vector.max_num, ELEM_NUM), - size = MIN(global_pool_capa.vector.max_size, ELEM_NUM), i; + uint32_t num = ODPH_MIN(global_pool_capa.vector.max_num, ELEM_NUM), + size = ODPH_MIN(global_pool_capa.vector.max_size, ELEM_NUM), i; odp_pool_t pool; uarea_init_t data; odp_packet_vector_t vecs[num]; @@ -332,7 +330,7 @@ static void pool_test_vector_uarea_init(void) static void pool_test_timeout_uarea_init(void) { odp_pool_param_t param; - uint32_t num = MIN(global_pool_capa.tmo.max_num, ELEM_NUM), i; + uint32_t num = ODPH_MIN(global_pool_capa.tmo.max_num, ELEM_NUM), i; odp_pool_t pool; uarea_init_t data; odp_timeout_t tmos[num]; @@ -2047,7 +2045,7 @@ static void test_packet_pool_ext_uarea_init(void) pool_ext_init_packet_pool_param(¶m); param.uarea_init.init_fn = init_event_uarea; param.uarea_init.args = &data; - num = MIN(num, param.pkt.num_buf); + num = ODPH_MIN(num, param.pkt.num_buf); param.pkt.num_buf = num; param.pkt.uarea_size = 1; pool = odp_pool_ext_create(NULL, ¶m); diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index a7a2d3e543..db66b36646 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -21,8 +21,6 @@ #define GLOBAL_SHM_NAME "GlobalTimerTest" -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) - #define MAX_TIMER_POOLS 1024 /* Timeout range in milliseconds (ms) */ diff --git a/test/validation/api/traffic_mngr/traffic_mngr.c b/test/validation/api/traffic_mngr/traffic_mngr.c index 28d163fd34..edb845b603 100644 --- a/test/validation/api/traffic_mngr/traffic_mngr.c +++ b/test/validation/api/traffic_mngr/traffic_mngr.c @@ -27,7 +27,7 @@ #define NUM_LEVELS 3 #define NUM_PRIORITIES 4 #define NUM_QUEUES_PER_NODE NUM_PRIORITIES -#define FANIN_RATIO 8 +#define FANIN_RATIO 8u #define NUM_LEVEL0_TM_NODES 1 #define NUM_LEVEL1_TM_NODES FANIN_RATIO #define NUM_LEVEL2_TM_NODES (FANIN_RATIO * FANIN_RATIO) @@ -65,7 +65,7 @@ #define MED_DROP_PROB 4 #define MAX_DROP_PROB 8 -#define MAX_PKTS 1000 +#define MAX_PKTS 1000u #define PKT_BUF_SIZE 1460 #define MAX_PAYLOAD 1400 #define USE_IPV4 false @@ -109,9 +109,6 @@ #define MBPS 1000000 #define GBPS 1000000000 -#define MIN(a, b) (((a) <= (b)) ? (a) : (b)) -#define MAX(a, b) (((a) <= (b)) ? (b) : (a)) - #define TM_PERCENT(percent) ((uint32_t)(100 * percent)) #define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0])) @@ -400,13 +397,13 @@ static odp_bool_t approx_eq64(uint64_t val, uint64_t correct) static uint64_t clamp_rate(uint64_t rate) { - return MIN(MAX(rate, tm_shaper_min_rate), tm_shaper_max_rate); + return ODPH_MIN(ODPH_MAX(rate, tm_shaper_min_rate), tm_shaper_max_rate); } static uint32_t clamp_burst(uint32_t burst) { - return MIN(MAX(burst, tm_shaper_min_burst), tm_shaper_max_burst); + return ODPH_MIN(ODPH_MAX(burst, tm_shaper_min_burst), tm_shaper_max_burst); } static int test_overall_capabilities(void) @@ -1464,8 +1461,8 @@ static inline void calc_rcv_stats(rcv_stats_t *rcv_stats, last_rcv_gap_idx = (rcv_gap_cnt * (100 - ending_drop_percent)) / 100; for (idx = first_rcv_gap_idx; idx <= last_rcv_gap_idx; idx++) { rcv_gap = rcv_gaps[idx]; - rcv_stats->min_rcv_gap = MIN(rcv_stats->min_rcv_gap, rcv_gap); - rcv_stats->max_rcv_gap = MAX(rcv_stats->max_rcv_gap, rcv_gap); + rcv_stats->min_rcv_gap = ODPH_MIN(rcv_stats->min_rcv_gap, rcv_gap); + rcv_stats->max_rcv_gap = ODPH_MAX(rcv_stats->max_rcv_gap, rcv_gap); rcv_stats->total_rcv_gap += rcv_gap; rcv_stats->total_rcv_gap_squared += rcv_gap * rcv_gap; rcv_stats->num_samples++; @@ -2365,7 +2362,7 @@ static int traffic_mngr_suite_init(void) payload_len = 0; while (payload_len < MAX_PAYLOAD) { - copy_len = MIN(MAX_PAYLOAD - payload_len, sizeof(ALPHABET)); + copy_len = ODPH_MIN(MAX_PAYLOAD - payload_len, sizeof(ALPHABET)); memcpy(&payload_data[payload_len], ALPHABET, copy_len); payload_len += copy_len; } @@ -3087,7 +3084,7 @@ static int set_sched_fanin(const char *node_name, CU_ASSERT_FATAL(odp_tm_stop(odp_tm_systems[0]) == 0); } - fanin_cnt = MIN(node_desc->num_children, FANIN_RATIO); + fanin_cnt = ODPH_MIN(node_desc->num_children, FANIN_RATIO); for (fanin = 0; fanin < fanin_cnt; fanin++) { odp_tm_sched_params_init(&sched_params); sched_weight = sched_weights[fanin]; @@ -3352,7 +3349,7 @@ static int test_sched_wfq(const char *sched_base_name, /* Now determine at least one tm_queue that feeds into each fanin/ * child node. */ priority = 0; - fanin_cnt = MIN(node_desc->num_children, FANIN_RATIO); + fanin_cnt = ODPH_MIN(node_desc->num_children, FANIN_RATIO); for (fanin = 0; fanin < fanin_cnt; fanin++) { child_desc = node_desc->children[fanin]; num_queues = find_child_queues(0, child_desc, priority, @@ -3482,7 +3479,7 @@ static int test_threshold(const char *threshold_name, odp_tm_threshold_params_init(&threshold_params); if (max_pkts != 0) { - max_pkts = MIN(max_pkts, MAX_PKTS / 3); + max_pkts = ODPH_MIN(max_pkts, MAX_PKTS / 3); threshold_params.max_pkts = max_pkts; threshold_params.enable_max_pkts = true; num_pkts = 2 * max_pkts; @@ -3490,7 +3487,7 @@ static int test_threshold(const char *threshold_name, } if (max_bytes != 0) { - max_bytes = MIN(max_bytes, MAX_PKTS * MAX_PAYLOAD / 3); + max_bytes = ODPH_MIN(max_bytes, MAX_PKTS * MAX_PAYLOAD / 3); threshold_params.max_bytes = max_bytes; threshold_params.enable_max_bytes = true; num_pkts = 2 * max_bytes / MAX_PAYLOAD; @@ -4662,7 +4659,7 @@ static void traffic_mngr_test_queue_stats(void) odp_tm_capabilities_t capa; pkt_info_t pkt_info; uint32_t pkts_sent; - uint32_t num_pkts = MIN(50, MAX_PKTS); + uint32_t num_pkts = ODPH_MIN(50u, MAX_PKTS); uint32_t pkt_len = 256; CU_ASSERT_FATAL(odp_tm_capability(odp_tm_systems[0], &capa) == 0); From 5c2dc9513ef08977cb05f84e7a7b0f123b72f90f Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 8 Sep 2023 16:16:27 +0300 Subject: [PATCH 164/192] helper: macros: add new macro for array size calculation Add new ODPH_ARRAY_SIZE() helper macro for calculating array size. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- helper/include/odp/helper/macros.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/helper/include/odp/helper/macros.h b/helper/include/odp/helper/macros.h index bfcb768b13..223caf1dc8 100644 --- a/helper/include/odp/helper/macros.h +++ b/helper/include/odp/helper/macros.h @@ -22,6 +22,11 @@ extern "C" { * @{ */ +/** + * Return number of elements in array + */ +#define ODPH_ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) + /** * Return minimum of two numbers */ From 96907bad71bb93958612c2d533562d6ad2b738ae Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 8 Sep 2023 16:31:30 +0300 Subject: [PATCH 165/192] test: performance: use new ODPH_ARRAY_SIZE macro Utilize new ODPH_ARRAY_SIZE() macro in performance test applications. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- test/performance/odp_atomic_perf.c | 2 +- test/performance/odp_bench_buffer.c | 2 +- test/performance/odp_bench_misc.c | 5 ++--- test/performance/odp_bench_packet.c | 4 ++-- test/performance/odp_bench_pktio_sp.c | 4 ++-- test/performance/odp_bench_timer.c | 4 ++-- test/performance/odp_crypto.c | 13 ++++--------- test/performance/odp_ipsec.c | 13 ++++--------- test/performance/odp_ipsecfwd.c | 2 +- test/performance/odp_lock_perf.c | 2 +- 10 files changed, 20 insertions(+), 31 deletions(-) diff --git a/test/performance/odp_atomic_perf.c b/test/performance/odp_atomic_perf.c index 5eeba84424..28217f5d76 100644 --- a/test/performance/odp_atomic_perf.c +++ b/test/performance/odp_atomic_perf.c @@ -1354,7 +1354,7 @@ int main(int argc, char **argv) print_info(&test_global->test_options); /* Loop all test cases */ - num_tests = sizeof(test_suite) / sizeof(test_suite[0]); + num_tests = ODPH_ARRAY_SIZE(test_suite); for (i = 0; i < num_tests; i++) { /* Initialize test variables */ diff --git a/test/performance/odp_bench_buffer.c b/test/performance/odp_bench_buffer.c index deed9aa92b..8b041eee0c 100644 --- a/test/performance/odp_bench_buffer.c +++ b/test/performance/odp_bench_buffer.c @@ -658,7 +658,7 @@ int main(int argc, char *argv[]) bench_suite_init(&gbl_args->suite); gbl_args->suite.bench = test_suite; - gbl_args->suite.num_bench = sizeof(test_suite) / sizeof(test_suite[0]); + gbl_args->suite.num_bench = ODPH_ARRAY_SIZE(test_suite); gbl_args->suite.indef_idx = gbl_args->appl.bench_idx; gbl_args->suite.rounds = gbl_args->appl.rounds; gbl_args->suite.repeat_count = TEST_REPEAT_COUNT; diff --git a/test/performance/odp_bench_misc.c b/test/performance/odp_bench_misc.c index 925bfc193d..e21208ff2d 100644 --- a/test/performance/odp_bench_misc.c +++ b/test/performance/odp_bench_misc.c @@ -800,8 +800,7 @@ static int parse_args(int argc, char *argv[]) return -1; } - if (appl_args->bench_idx < 0 || - appl_args->bench_idx > (int)(sizeof(test_suite) / sizeof(test_suite[0]))) { + if (appl_args->bench_idx < 0 || appl_args->bench_idx > (int)ODPH_ARRAY_SIZE(test_suite)) { ODPH_ERR("Bad bench index %i\n", appl_args->bench_idx); return -1; } @@ -900,7 +899,7 @@ int main(int argc, char *argv[]) bench_suite_init(&gbl_args->suite); gbl_args->suite.bench = test_suite; - gbl_args->suite.num_bench = sizeof(test_suite) / sizeof(test_suite[0]); + gbl_args->suite.num_bench = ODPH_ARRAY_SIZE(test_suite); gbl_args->suite.measure_time = !!gbl_args->appl.time; gbl_args->suite.indef_idx = gbl_args->appl.bench_idx; gbl_args->suite.rounds = gbl_args->appl.rounds; diff --git a/test/performance/odp_bench_packet.c b/test/performance/odp_bench_packet.c index b8b08a4032..67b6b9cfcb 100644 --- a/test/performance/odp_bench_packet.c +++ b/test/performance/odp_bench_packet.c @@ -146,7 +146,7 @@ static int run_benchmarks(void *arg) int i; args_t *args = arg; bench_suite_t *suite = &args->suite; - int num_sizes = sizeof(test_packet_len) / sizeof(test_packet_len[0]); + int num_sizes = ODPH_ARRAY_SIZE(test_packet_len); double results[num_sizes][suite->num_bench]; memset(results, 0, sizeof(results)); @@ -1613,7 +1613,7 @@ int main(int argc, char *argv[]) bench_suite_init(&gbl_args->suite); gbl_args->suite.bench = test_suite; - gbl_args->suite.num_bench = sizeof(test_suite) / sizeof(test_suite[0]); + gbl_args->suite.num_bench = ODPH_ARRAY_SIZE(test_suite); gbl_args->suite.indef_idx = gbl_args->appl.bench_idx; gbl_args->suite.rounds = gbl_args->appl.rounds; gbl_args->suite.repeat_count = TEST_REPEAT_COUNT; diff --git a/test/performance/odp_bench_pktio_sp.c b/test/performance/odp_bench_pktio_sp.c index e8708e6d6a..65d85a062e 100644 --- a/test/performance/odp_bench_pktio_sp.c +++ b/test/performance/odp_bench_pktio_sp.c @@ -914,7 +914,7 @@ static int check_args(appl_args_t *appl_args) return -1; } - if (gbl_args->opt.case_idx > sizeof(test_suite) / sizeof(test_suite[0])) { + if (gbl_args->opt.case_idx > ODPH_ARRAY_SIZE(test_suite)) { ODPH_ERR("Invalid test case index: %u\n", gbl_args->opt.case_idx); return -1; } @@ -1069,7 +1069,7 @@ int main(int argc, char *argv[]) bench_tm_suite_init(&gbl_args->suite); gbl_args->suite.bench = test_suite; - gbl_args->suite.num_bench = sizeof(test_suite) / sizeof(test_suite[0]); + gbl_args->suite.num_bench = ODPH_ARRAY_SIZE(test_suite); gbl_args->suite.rounds = gbl_args->opt.rounds; gbl_args->suite.bench_idx = gbl_args->opt.case_idx; diff --git a/test/performance/odp_bench_timer.c b/test/performance/odp_bench_timer.c index f6762175eb..b1c43c1785 100644 --- a/test/performance/odp_bench_timer.c +++ b/test/performance/odp_bench_timer.c @@ -356,7 +356,7 @@ static int parse_args(int argc, char *argv[]) } if (gbl_args->opt.bench_idx < 0 || - gbl_args->opt.bench_idx > (int)(sizeof(test_suite) / sizeof(test_suite[0]))) { + gbl_args->opt.bench_idx > (int)ODPH_ARRAY_SIZE(test_suite)) { ODPH_ERR("Bad bench index %i\n", gbl_args->opt.bench_idx); return -1; } @@ -645,7 +645,7 @@ int main(int argc, char *argv[]) bench_suite_init(&gbl_args->suite); gbl_args->suite.bench = test_suite; - gbl_args->suite.num_bench = sizeof(test_suite) / sizeof(test_suite[0]); + gbl_args->suite.num_bench = ODPH_ARRAY_SIZE(test_suite); gbl_args->suite.measure_time = !!gbl_args->opt.time; gbl_args->suite.indef_idx = gbl_args->opt.bench_idx; gbl_args->suite.rounds = gbl_args->opt.rounds; diff --git a/test/performance/odp_crypto.c b/test/performance/odp_crypto.c index fed3ebad8d..93315ce05a 100644 --- a/test/performance/odp_crypto.c +++ b/test/performance/odp_crypto.c @@ -505,8 +505,7 @@ find_config_by_name(const char *name) { unsigned int i; crypto_alg_config_t *ret = NULL; - for (i = 0; i < (sizeof(algs_config) / sizeof(crypto_alg_config_t)); - i++) { + for (i = 0; i < ODPH_ARRAY_SIZE(algs_config); i++) { if (strcmp(algs_config[i].name, name) == 0) { ret = algs_config + i; break; @@ -523,10 +522,8 @@ static void print_config_names(const char *prefix) { unsigned int i; - for (i = 0; i < (sizeof(algs_config) / sizeof(crypto_alg_config_t)); - i++) { + for (i = 0; i < ODPH_ARRAY_SIZE(algs_config); i++) printf("%s %s\n", prefix, algs_config[i].name); - } } /** @@ -1287,7 +1284,7 @@ int main(int argc, char *argv[]) max_seg_len = pool_capa.pkt.max_seg_len; - for (i = 0; i < sizeof(payloads) / sizeof(unsigned int); i++) { + for (i = 0; i < ODPH_ARRAY_SIZE(payloads); i++) { if (payloads[i] + MAX_AUTH_DIGEST_LEN > max_seg_len) break; } @@ -1371,9 +1368,7 @@ int main(int argc, char *argv[]) } else { unsigned int i; - for (i = 0; - i < (sizeof(algs_config) / sizeof(crypto_alg_config_t)); - i++) { + for (i = 0; i < ODPH_ARRAY_SIZE(algs_config); i++) { test_run_arg.crypto_alg_config = algs_config + i; run_measure_one_config(&test_run_arg); } diff --git a/test/performance/odp_ipsec.c b/test/performance/odp_ipsec.c index 6ad6037efc..8a0bc29898 100644 --- a/test/performance/odp_ipsec.c +++ b/test/performance/odp_ipsec.c @@ -413,8 +413,7 @@ find_config_by_name(const char *name) unsigned int i; ipsec_alg_config_t *ret = NULL; - for (i = 0; i < (sizeof(algs_config) / sizeof(ipsec_alg_config_t)); - i++) { + for (i = 0; i < ODPH_ARRAY_SIZE(algs_config); i++) { if (strcmp(algs_config[i].name, name) == 0) { ret = algs_config + i; break; @@ -432,10 +431,8 @@ print_config_names(const char *prefix) { unsigned int i; - for (i = 0; i < (sizeof(algs_config) / sizeof(ipsec_alg_config_t)); - i++) { + for (i = 0; i < ODPH_ARRAY_SIZE(algs_config); i++) printf("%s %s\n", prefix, algs_config[i].name); - } } /** @@ -1223,7 +1220,7 @@ int main(int argc, char *argv[]) max_seg_len = capa.pkt.max_seg_len; - for (i = 0; i < sizeof(global_payloads) / sizeof(unsigned int); i++) { + for (i = 0; i < ODPH_ARRAY_SIZE(global_payloads); i++) { if (global_payloads[i] > max_seg_len) break; } @@ -1380,9 +1377,7 @@ int main(int argc, char *argv[]) } else { unsigned int i; - for (i = 0; - i < (sizeof(algs_config) / sizeof(ipsec_alg_config_t)); - i++) { + for (i = 0; i < ODPH_ARRAY_SIZE(algs_config); i++) { if (cargs.ah && algs_config[i].crypto.cipher_alg != ODP_CIPHER_ALG_NULL) diff --git a/test/performance/odp_ipsecfwd.c b/test/performance/odp_ipsecfwd.c index efbcab078b..33525a4d23 100644 --- a/test/performance/odp_ipsecfwd.c +++ b/test/performance/odp_ipsecfwd.c @@ -249,7 +249,7 @@ static void parse_interfaces(prog_config_t *config, const char *optarg) static void print_supported_algos(const odp_ipsec_capability_t *ipsec_capa) { int c_cnt, a_cnt; - const size_t len = sizeof(exposed_algs) / sizeof(exposed_algs[0]); + const size_t len = ODPH_ARRAY_SIZE(exposed_algs); printf(" Cipher algorithms:\n"); diff --git a/test/performance/odp_lock_perf.c b/test/performance/odp_lock_perf.c index e1c0c039ec..c12f8c9501 100644 --- a/test/performance/odp_lock_perf.c +++ b/test/performance/odp_lock_perf.c @@ -634,7 +634,7 @@ int main(int argc, char **argv) print_info(&test_global->test_options); /* Loop all test cases */ - num_tests = sizeof(test_suite) / sizeof(test_suite[0]); + num_tests = ODPH_ARRAY_SIZE(test_suite); while (1) { for (i = 0; i < num_tests; i++) { From 04a16e72144f788e18f492d8f42841426c2684ba Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 8 Sep 2023 16:45:23 +0300 Subject: [PATCH 166/192] test: validation: use new ODPH_ARRAY_SIZE macro Utilize new ODPH_ARRAY_SIZE() macro in validation test applications. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- test/common/mask_common.c | 3 +- .../api/crypto/odp_crypto_test_inp.c | 146 +++++++++--------- test/validation/api/crypto/util.h | 2 - test/validation/api/hash/hash.c | 10 +- test/validation/api/init/init_main.c | 2 +- test/validation/api/ipsec/ipsec.h | 2 - test/validation/api/ipsec/ipsec_test_in.c | 20 +-- test/validation/api/ipsec/ipsec_test_out.c | 10 +- test/validation/api/packet/packet.c | 2 +- test/validation/api/pool/pool.c | 2 +- test/validation/api/scheduler/scheduler.c | 2 +- .../api/traffic_mngr/traffic_mngr.c | 6 +- 12 files changed, 102 insertions(+), 105 deletions(-) diff --git a/test/common/mask_common.c b/test/common/mask_common.c index 3b6b441021..65c9c66293 100644 --- a/test/common/mask_common.c +++ b/test/common/mask_common.c @@ -5,6 +5,7 @@ */ #include +#include #include "odp_cunit_common.h" #include "mask_common.h" @@ -457,7 +458,7 @@ MASK_TESTFUNC(next) _odp_mask_from_str(&mask1, TEST_MASK_1_3); - for (i = 0; i < sizeof(expected) / sizeof(int); i++) + for (i = 0; i < ODPH_ARRAY_SIZE(expected); i++) CU_ASSERT(_odp_mask_next(&mask1, i) == expected[i]); } diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index 59e734174f..d5f2e3e7a2 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -129,7 +129,7 @@ static void alg_test_op2(crypto_op_test_param_t *param) { int32_t oop_shifts[] = {0, 3, 130, -10}; - for (uint32_t n = 0; n < ARRAY_SIZE(oop_shifts); n++) { + for (uint32_t n = 0; n < ODPH_ARRAY_SIZE(oop_shifts); n++) { if (oop_shifts[n] != 0 && param->op_type != ODP_CRYPTO_OP_TYPE_OOP) continue; @@ -388,7 +388,7 @@ static void alg_test_op_types(odp_crypto_op_t op, ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP, }; - for (unsigned int n = 0; n < ARRAY_SIZE(op_types); n++) { + for (unsigned int n = 0; n < ODPH_ARRAY_SIZE(op_types); n++) { for (unsigned int null_crypto = 0 ; null_crypto <= 1; null_crypto++) alg_test_ses(op, op_types[n], @@ -807,7 +807,7 @@ static odp_auth_alg_t auth_algs[] = { static void test_auth_hashes_in_auth_range(void) { - for (size_t n = 0; n < ARRAY_SIZE(auth_algs); n++) { + for (size_t n = 0; n < ODPH_ARRAY_SIZE(auth_algs); n++) { odp_auth_alg_t auth = auth_algs[n]; odp_crypto_cipher_capability_t c_capa; int num; @@ -1359,8 +1359,8 @@ static void test_all_combinations(void) } printf("\n"); - for (size_t n = 0; n < ARRAY_SIZE(cipher_algs); n++) - for (size_t i = 0; i < ARRAY_SIZE(auth_algs); i++) + for (size_t n = 0; n < ODPH_ARRAY_SIZE(cipher_algs); n++) + for (size_t i = 0; i < ODPH_ARRAY_SIZE(auth_algs); i++) test_combo_variants(cipher_algs[n], auth_algs[i]); } @@ -1373,14 +1373,14 @@ static void crypto_test_enc_alg_null(void) { check_alg(ODP_CRYPTO_OP_ENCODE, null_reference, - ARRAY_SIZE(null_reference)); + ODPH_ARRAY_SIZE(null_reference)); } static void crypto_test_dec_alg_null(void) { check_alg(ODP_CRYPTO_OP_DECODE, null_reference, - ARRAY_SIZE(null_reference)); + ODPH_ARRAY_SIZE(null_reference)); } static int check_alg_3des_cbc(void) @@ -1392,14 +1392,14 @@ static void crypto_test_enc_alg_3des_cbc(void) { check_alg(ODP_CRYPTO_OP_ENCODE, tdes_cbc_reference, - ARRAY_SIZE(tdes_cbc_reference)); + ODPH_ARRAY_SIZE(tdes_cbc_reference)); } static void crypto_test_dec_alg_3des_cbc(void) { check_alg(ODP_CRYPTO_OP_DECODE, tdes_cbc_reference, - ARRAY_SIZE(tdes_cbc_reference)); + ODPH_ARRAY_SIZE(tdes_cbc_reference)); } static int check_alg_3des_ecb(void) @@ -1411,14 +1411,14 @@ static void crypto_test_enc_alg_3des_ecb(void) { check_alg(ODP_CRYPTO_OP_ENCODE, tdes_ecb_reference, - ARRAY_SIZE(tdes_ecb_reference)); + ODPH_ARRAY_SIZE(tdes_ecb_reference)); } static void crypto_test_dec_alg_3des_ecb(void) { check_alg(ODP_CRYPTO_OP_DECODE, tdes_ecb_reference, - ARRAY_SIZE(tdes_ecb_reference)); + ODPH_ARRAY_SIZE(tdes_ecb_reference)); } static int check_alg_chacha20_poly1305(void) @@ -1431,14 +1431,14 @@ static void crypto_test_enc_alg_chacha20_poly1305(void) { check_alg(ODP_CRYPTO_OP_ENCODE, chacha20_poly1305_reference, - ARRAY_SIZE(chacha20_poly1305_reference)); + ODPH_ARRAY_SIZE(chacha20_poly1305_reference)); } static void crypto_test_dec_alg_chacha20_poly1305(void) { check_alg(ODP_CRYPTO_OP_DECODE, chacha20_poly1305_reference, - ARRAY_SIZE(chacha20_poly1305_reference)); + ODPH_ARRAY_SIZE(chacha20_poly1305_reference)); } static int check_alg_aes_gcm(void) @@ -1450,14 +1450,14 @@ static void crypto_test_enc_alg_aes_gcm(void) { check_alg(ODP_CRYPTO_OP_ENCODE, aes_gcm_reference, - ARRAY_SIZE(aes_gcm_reference)); + ODPH_ARRAY_SIZE(aes_gcm_reference)); } static void crypto_test_dec_alg_aes_gcm(void) { check_alg(ODP_CRYPTO_OP_DECODE, aes_gcm_reference, - ARRAY_SIZE(aes_gcm_reference)); + ODPH_ARRAY_SIZE(aes_gcm_reference)); } static int check_alg_aes_ccm(void) @@ -1469,14 +1469,14 @@ static void crypto_test_enc_alg_aes_ccm(void) { check_alg(ODP_CRYPTO_OP_ENCODE, aes_ccm_reference, - ARRAY_SIZE(aes_ccm_reference)); + ODPH_ARRAY_SIZE(aes_ccm_reference)); } static void crypto_test_dec_alg_aes_ccm(void) { check_alg(ODP_CRYPTO_OP_DECODE, aes_ccm_reference, - ARRAY_SIZE(aes_ccm_reference)); + ODPH_ARRAY_SIZE(aes_ccm_reference)); } static int check_alg_aes_cbc(void) @@ -1488,14 +1488,14 @@ static void crypto_test_enc_alg_aes_cbc(void) { check_alg(ODP_CRYPTO_OP_ENCODE, aes_cbc_reference, - ARRAY_SIZE(aes_cbc_reference)); + ODPH_ARRAY_SIZE(aes_cbc_reference)); } static void crypto_test_dec_alg_aes_cbc(void) { check_alg(ODP_CRYPTO_OP_DECODE, aes_cbc_reference, - ARRAY_SIZE(aes_cbc_reference)); + ODPH_ARRAY_SIZE(aes_cbc_reference)); } static int check_alg_aes_ctr(void) @@ -1507,14 +1507,14 @@ static void crypto_test_enc_alg_aes_ctr(void) { check_alg(ODP_CRYPTO_OP_ENCODE, aes_ctr_reference, - ARRAY_SIZE(aes_ctr_reference)); + ODPH_ARRAY_SIZE(aes_ctr_reference)); } static void crypto_test_dec_alg_aes_ctr(void) { check_alg(ODP_CRYPTO_OP_DECODE, aes_ctr_reference, - ARRAY_SIZE(aes_ctr_reference)); + ODPH_ARRAY_SIZE(aes_ctr_reference)); } static int check_alg_aes_ecb(void) @@ -1526,14 +1526,14 @@ static void crypto_test_enc_alg_aes_ecb(void) { check_alg(ODP_CRYPTO_OP_ENCODE, aes_ecb_reference, - ARRAY_SIZE(aes_ecb_reference)); + ODPH_ARRAY_SIZE(aes_ecb_reference)); } static void crypto_test_dec_alg_aes_ecb(void) { check_alg(ODP_CRYPTO_OP_DECODE, aes_ecb_reference, - ARRAY_SIZE(aes_ecb_reference)); + ODPH_ARRAY_SIZE(aes_ecb_reference)); } static int check_alg_aes_cfb128(void) @@ -1545,14 +1545,14 @@ static void crypto_test_enc_alg_aes_cfb128(void) { check_alg(ODP_CRYPTO_OP_ENCODE, aes_cfb128_reference, - ARRAY_SIZE(aes_cfb128_reference)); + ODPH_ARRAY_SIZE(aes_cfb128_reference)); } static void crypto_test_dec_alg_aes_cfb128(void) { check_alg(ODP_CRYPTO_OP_DECODE, aes_cfb128_reference, - ARRAY_SIZE(aes_cfb128_reference)); + ODPH_ARRAY_SIZE(aes_cfb128_reference)); } static int check_alg_aes_xts(void) @@ -1564,14 +1564,14 @@ static void crypto_test_enc_alg_aes_xts(void) { check_alg(ODP_CRYPTO_OP_ENCODE, aes_xts_reference, - ARRAY_SIZE(aes_xts_reference)); + ODPH_ARRAY_SIZE(aes_xts_reference)); } static void crypto_test_dec_alg_aes_xts(void) { check_alg(ODP_CRYPTO_OP_DECODE, aes_xts_reference, - ARRAY_SIZE(aes_xts_reference)); + ODPH_ARRAY_SIZE(aes_xts_reference)); } static int check_alg_kasumi_f8(void) @@ -1583,14 +1583,14 @@ static void crypto_test_enc_alg_kasumi_f8(void) { check_alg(ODP_CRYPTO_OP_ENCODE, kasumi_f8_reference, - ARRAY_SIZE(kasumi_f8_reference)); + ODPH_ARRAY_SIZE(kasumi_f8_reference)); } static void crypto_test_dec_alg_kasumi_f8(void) { check_alg(ODP_CRYPTO_OP_DECODE, kasumi_f8_reference, - ARRAY_SIZE(kasumi_f8_reference)); + ODPH_ARRAY_SIZE(kasumi_f8_reference)); } static int check_alg_snow3g_uea2(void) @@ -1602,14 +1602,14 @@ static void crypto_test_enc_alg_snow3g_uea2(void) { check_alg(ODP_CRYPTO_OP_ENCODE, snow3g_uea2_reference, - ARRAY_SIZE(snow3g_uea2_reference)); + ODPH_ARRAY_SIZE(snow3g_uea2_reference)); } static void crypto_test_dec_alg_snow3g_uea2(void) { check_alg(ODP_CRYPTO_OP_DECODE, snow3g_uea2_reference, - ARRAY_SIZE(snow3g_uea2_reference)); + ODPH_ARRAY_SIZE(snow3g_uea2_reference)); } static int check_alg_aes_eea2(void) @@ -1622,14 +1622,14 @@ static void crypto_test_enc_alg_aes_eea2(void) { check_alg(ODP_CRYPTO_OP_ENCODE, aes_eea2_reference, - ARRAY_SIZE(aes_eea2_reference)); + ODPH_ARRAY_SIZE(aes_eea2_reference)); } static void crypto_test_dec_alg_aes_eea2(void) { check_alg(ODP_CRYPTO_OP_DECODE, aes_eea2_reference, - ARRAY_SIZE(aes_eea2_reference)); + ODPH_ARRAY_SIZE(aes_eea2_reference)); } static int check_alg_zuc_eea3(void) @@ -1641,14 +1641,14 @@ static void crypto_test_enc_alg_zuc_eea3(void) { check_alg(ODP_CRYPTO_OP_ENCODE, zuc_eea3_reference, - ARRAY_SIZE(zuc_eea3_reference)); + ODPH_ARRAY_SIZE(zuc_eea3_reference)); } static void crypto_test_dec_alg_zuc_eea3(void) { check_alg(ODP_CRYPTO_OP_DECODE, zuc_eea3_reference, - ARRAY_SIZE(zuc_eea3_reference)); + ODPH_ARRAY_SIZE(zuc_eea3_reference)); } static int check_alg_hmac_md5(void) @@ -1660,14 +1660,14 @@ static void crypto_test_gen_alg_hmac_md5(void) { check_alg(ODP_CRYPTO_OP_ENCODE, hmac_md5_reference, - ARRAY_SIZE(hmac_md5_reference)); + ODPH_ARRAY_SIZE(hmac_md5_reference)); } static void crypto_test_check_alg_hmac_md5(void) { check_alg(ODP_CRYPTO_OP_DECODE, hmac_md5_reference, - ARRAY_SIZE(hmac_md5_reference)); + ODPH_ARRAY_SIZE(hmac_md5_reference)); } static int check_alg_hmac_sha1(void) @@ -1679,14 +1679,14 @@ static void crypto_test_gen_alg_hmac_sha1(void) { check_alg(ODP_CRYPTO_OP_ENCODE, hmac_sha1_reference, - ARRAY_SIZE(hmac_sha1_reference)); + ODPH_ARRAY_SIZE(hmac_sha1_reference)); } static void crypto_test_check_alg_hmac_sha1(void) { check_alg(ODP_CRYPTO_OP_DECODE, hmac_sha1_reference, - ARRAY_SIZE(hmac_sha1_reference)); + ODPH_ARRAY_SIZE(hmac_sha1_reference)); } static int check_alg_hmac_sha224(void) @@ -1698,14 +1698,14 @@ static void crypto_test_gen_alg_hmac_sha224(void) { check_alg(ODP_CRYPTO_OP_ENCODE, hmac_sha224_reference, - ARRAY_SIZE(hmac_sha224_reference)); + ODPH_ARRAY_SIZE(hmac_sha224_reference)); } static void crypto_test_check_alg_hmac_sha224(void) { check_alg(ODP_CRYPTO_OP_DECODE, hmac_sha224_reference, - ARRAY_SIZE(hmac_sha224_reference)); + ODPH_ARRAY_SIZE(hmac_sha224_reference)); } static int check_alg_hmac_sha256(void) @@ -1717,14 +1717,14 @@ static void crypto_test_gen_alg_hmac_sha256(void) { check_alg(ODP_CRYPTO_OP_ENCODE, hmac_sha256_reference, - ARRAY_SIZE(hmac_sha256_reference)); + ODPH_ARRAY_SIZE(hmac_sha256_reference)); } static void crypto_test_check_alg_hmac_sha256(void) { check_alg(ODP_CRYPTO_OP_DECODE, hmac_sha256_reference, - ARRAY_SIZE(hmac_sha256_reference)); + ODPH_ARRAY_SIZE(hmac_sha256_reference)); } static int check_alg_hmac_sha384(void) @@ -1736,14 +1736,14 @@ static void crypto_test_gen_alg_hmac_sha384(void) { check_alg(ODP_CRYPTO_OP_ENCODE, hmac_sha384_reference, - ARRAY_SIZE(hmac_sha384_reference)); + ODPH_ARRAY_SIZE(hmac_sha384_reference)); } static void crypto_test_check_alg_hmac_sha384(void) { check_alg(ODP_CRYPTO_OP_DECODE, hmac_sha384_reference, - ARRAY_SIZE(hmac_sha384_reference)); + ODPH_ARRAY_SIZE(hmac_sha384_reference)); } static int check_alg_hmac_sha512(void) @@ -1755,14 +1755,14 @@ static void crypto_test_gen_alg_hmac_sha512(void) { check_alg(ODP_CRYPTO_OP_ENCODE, hmac_sha512_reference, - ARRAY_SIZE(hmac_sha512_reference)); + ODPH_ARRAY_SIZE(hmac_sha512_reference)); } static void crypto_test_check_alg_hmac_sha512(void) { check_alg(ODP_CRYPTO_OP_DECODE, hmac_sha512_reference, - ARRAY_SIZE(hmac_sha512_reference)); + ODPH_ARRAY_SIZE(hmac_sha512_reference)); } static int check_alg_aes_xcbc(void) @@ -1775,14 +1775,14 @@ static void crypto_test_gen_alg_aes_xcbc(void) { check_alg(ODP_CRYPTO_OP_ENCODE, aes_xcbc_reference, - ARRAY_SIZE(aes_xcbc_reference)); + ODPH_ARRAY_SIZE(aes_xcbc_reference)); } static void crypto_test_check_alg_aes_xcbc(void) { check_alg(ODP_CRYPTO_OP_DECODE, aes_xcbc_reference, - ARRAY_SIZE(aes_xcbc_reference)); + ODPH_ARRAY_SIZE(aes_xcbc_reference)); } static int check_alg_aes_gmac(void) @@ -1794,14 +1794,14 @@ static void crypto_test_gen_alg_aes_gmac(void) { check_alg(ODP_CRYPTO_OP_ENCODE, aes_gmac_reference, - ARRAY_SIZE(aes_gmac_reference)); + ODPH_ARRAY_SIZE(aes_gmac_reference)); } static void crypto_test_check_alg_aes_gmac(void) { check_alg(ODP_CRYPTO_OP_DECODE, aes_gmac_reference, - ARRAY_SIZE(aes_gmac_reference)); + ODPH_ARRAY_SIZE(aes_gmac_reference)); } static int check_alg_aes_cmac(void) @@ -1813,14 +1813,14 @@ static void crypto_test_gen_alg_aes_cmac(void) { check_alg(ODP_CRYPTO_OP_ENCODE, aes_cmac_reference, - ARRAY_SIZE(aes_cmac_reference)); + ODPH_ARRAY_SIZE(aes_cmac_reference)); } static void crypto_test_check_alg_aes_cmac(void) { check_alg(ODP_CRYPTO_OP_DECODE, aes_cmac_reference, - ARRAY_SIZE(aes_cmac_reference)); + ODPH_ARRAY_SIZE(aes_cmac_reference)); } static int check_alg_kasumi_f9(void) @@ -1832,14 +1832,14 @@ static void crypto_test_gen_alg_kasumi_f9(void) { check_alg(ODP_CRYPTO_OP_ENCODE, kasumi_f9_reference, - ARRAY_SIZE(kasumi_f9_reference)); + ODPH_ARRAY_SIZE(kasumi_f9_reference)); } static void crypto_test_check_alg_kasumi_f9(void) { check_alg(ODP_CRYPTO_OP_DECODE, kasumi_f9_reference, - ARRAY_SIZE(kasumi_f9_reference)); + ODPH_ARRAY_SIZE(kasumi_f9_reference)); } static int check_alg_snow3g_uia2(void) @@ -1851,14 +1851,14 @@ static void crypto_test_gen_alg_snow3g_uia2(void) { check_alg(ODP_CRYPTO_OP_ENCODE, snow3g_uia2_reference, - ARRAY_SIZE(snow3g_uia2_reference)); + ODPH_ARRAY_SIZE(snow3g_uia2_reference)); } static void crypto_test_check_alg_snow3g_uia2(void) { check_alg(ODP_CRYPTO_OP_DECODE, snow3g_uia2_reference, - ARRAY_SIZE(snow3g_uia2_reference)); + ODPH_ARRAY_SIZE(snow3g_uia2_reference)); } static int check_alg_aes_eia2(void) @@ -1871,14 +1871,14 @@ static void crypto_test_gen_alg_aes_eia2(void) { check_alg(ODP_CRYPTO_OP_ENCODE, aes_eia2_reference, - ARRAY_SIZE(aes_eia2_reference)); + ODPH_ARRAY_SIZE(aes_eia2_reference)); } static void crypto_test_check_alg_aes_eia2(void) { check_alg(ODP_CRYPTO_OP_DECODE, aes_eia2_reference, - ARRAY_SIZE(aes_eia2_reference)); + ODPH_ARRAY_SIZE(aes_eia2_reference)); } static int check_alg_zuc_eia3(void) @@ -1890,14 +1890,14 @@ static void crypto_test_gen_alg_zuc_eia3(void) { check_alg(ODP_CRYPTO_OP_ENCODE, zuc_eia3_reference, - ARRAY_SIZE(zuc_eia3_reference)); + ODPH_ARRAY_SIZE(zuc_eia3_reference)); } static void crypto_test_check_alg_zuc_eia3(void) { check_alg(ODP_CRYPTO_OP_DECODE, zuc_eia3_reference, - ARRAY_SIZE(zuc_eia3_reference)); + ODPH_ARRAY_SIZE(zuc_eia3_reference)); } static int check_alg_md5(void) @@ -1909,14 +1909,14 @@ static void crypto_test_gen_alg_md5(void) { check_alg(ODP_CRYPTO_OP_ENCODE, md5_reference, - ARRAY_SIZE(md5_reference)); + ODPH_ARRAY_SIZE(md5_reference)); } static void crypto_test_check_alg_md5(void) { check_alg(ODP_CRYPTO_OP_DECODE, md5_reference, - ARRAY_SIZE(md5_reference)); + ODPH_ARRAY_SIZE(md5_reference)); } static int check_alg_sha1(void) @@ -1928,14 +1928,14 @@ static void crypto_test_gen_alg_sha1(void) { check_alg(ODP_CRYPTO_OP_ENCODE, sha1_reference, - ARRAY_SIZE(sha1_reference)); + ODPH_ARRAY_SIZE(sha1_reference)); } static void crypto_test_check_alg_sha1(void) { check_alg(ODP_CRYPTO_OP_DECODE, sha1_reference, - ARRAY_SIZE(sha1_reference)); + ODPH_ARRAY_SIZE(sha1_reference)); } static int check_alg_sha224(void) @@ -1947,14 +1947,14 @@ static void crypto_test_gen_alg_sha224(void) { check_alg(ODP_CRYPTO_OP_ENCODE, sha224_reference, - ARRAY_SIZE(sha224_reference)); + ODPH_ARRAY_SIZE(sha224_reference)); } static void crypto_test_check_alg_sha224(void) { check_alg(ODP_CRYPTO_OP_DECODE, sha224_reference, - ARRAY_SIZE(sha224_reference)); + ODPH_ARRAY_SIZE(sha224_reference)); } static int check_alg_sha256(void) @@ -1966,14 +1966,14 @@ static void crypto_test_gen_alg_sha256(void) { check_alg(ODP_CRYPTO_OP_ENCODE, sha256_reference, - ARRAY_SIZE(sha256_reference)); + ODPH_ARRAY_SIZE(sha256_reference)); } static void crypto_test_check_alg_sha256(void) { check_alg(ODP_CRYPTO_OP_DECODE, sha256_reference, - ARRAY_SIZE(sha256_reference)); + ODPH_ARRAY_SIZE(sha256_reference)); } static int check_alg_sha384(void) @@ -1985,14 +1985,14 @@ static void crypto_test_gen_alg_sha384(void) { check_alg(ODP_CRYPTO_OP_ENCODE, sha384_reference, - ARRAY_SIZE(sha384_reference)); + ODPH_ARRAY_SIZE(sha384_reference)); } static void crypto_test_check_alg_sha384(void) { check_alg(ODP_CRYPTO_OP_DECODE, sha384_reference, - ARRAY_SIZE(sha384_reference)); + ODPH_ARRAY_SIZE(sha384_reference)); } static int check_alg_sha512(void) @@ -2004,14 +2004,14 @@ static void crypto_test_gen_alg_sha512(void) { check_alg(ODP_CRYPTO_OP_ENCODE, sha512_reference, - ARRAY_SIZE(sha512_reference)); + ODPH_ARRAY_SIZE(sha512_reference)); } static void crypto_test_check_alg_sha512(void) { check_alg(ODP_CRYPTO_OP_DECODE, sha512_reference, - ARRAY_SIZE(sha512_reference)); + ODPH_ARRAY_SIZE(sha512_reference)); } static odp_queue_t sched_compl_queue_create(void) diff --git a/test/validation/api/crypto/util.h b/test/validation/api/crypto/util.h index e0d8e15a3c..5cba218906 100644 --- a/test/validation/api/crypto/util.h +++ b/test/validation/api/crypto/util.h @@ -12,8 +12,6 @@ #include #include -#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) - struct suite_context_s { odp_crypto_op_mode_t op_mode; odp_pool_t pool; diff --git a/test/validation/api/hash/hash.c b/test/validation/api/hash/hash.c index a5dc2e2867..5e42098006 100644 --- a/test/validation/api/hash/hash.c +++ b/test/validation/api/hash/hash.c @@ -6,6 +6,8 @@ */ #include +#include + #include #include @@ -216,7 +218,7 @@ static void hash_test_crc32c(void) { uint32_t ret, result; int i; - int num = sizeof(crc32c_test_vector) / sizeof(hash_test_vector_t); + int num = ODPH_ARRAY_SIZE(crc32c_test_vector); for (i = 0; i < num; i++) { ret = odp_hash_crc32c(crc32c_test_vector[i].data, @@ -232,7 +234,7 @@ static void hash_test_crc32(void) { uint32_t ret, result; int i; - int num = sizeof(crc32_test_vector) / sizeof(hash_test_vector_t); + int num = ODPH_ARRAY_SIZE(crc32_test_vector); for (i = 0; i < num; i++) { ret = odp_hash_crc32(crc32_test_vector[i].data, @@ -341,7 +343,7 @@ static void hash_test_crc32_generic(void) crc_param.poly = 0x04c11db7; crc_param.reflect_in = 1; crc_param.reflect_out = 1; - num = sizeof(crc32_test_vector) / sizeof(hash_test_vector_t); + num = ODPH_ARRAY_SIZE(crc32_test_vector); for (i = 0; i < num; i++) { if (odp_hash_crc_gen64(crc32_test_vector[i].data, @@ -360,7 +362,7 @@ static void hash_test_crc32_generic(void) crc_param.poly = 0x1edc6f41; crc_param.reflect_in = 1; crc_param.reflect_out = 1; - num = sizeof(crc32c_test_vector) / sizeof(hash_test_vector_t); + num = ODPH_ARRAY_SIZE(crc32c_test_vector); for (i = 0; i < num; i++) { if (odp_hash_crc_gen64(crc32c_test_vector[i].data, diff --git a/test/validation/api/init/init_main.c b/test/validation/api/init/init_main.c index c3dba105ea..64cefa30bc 100644 --- a/test/validation/api/init/init_main.c +++ b/test/validation/api/init/init_main.c @@ -284,7 +284,7 @@ odp_suiteinfo_t init_suites[] = { static int fill_testinfo(odp_testinfo_t *info, unsigned int test_case) { - if (test_case >= (sizeof(testinfo) / sizeof(odp_testinfo_t))) { + if (test_case >= ODPH_ARRAY_SIZE(testinfo)) { ODPH_ERR("Bad test case number %u\n", test_case); return -1; } diff --git a/test/validation/api/ipsec/ipsec.h b/test/validation/api/ipsec/ipsec.h index 1c17693f7f..8eed65c50b 100644 --- a/test/validation/api/ipsec/ipsec.h +++ b/test/validation/api/ipsec/ipsec.h @@ -16,8 +16,6 @@ ((c) << 8) | \ ((d) << 0)) -#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) - /* test arrays: */ extern odp_testinfo_t ipsec_in_suite[]; extern odp_testinfo_t ipsec_out_suite[]; diff --git a/test/validation/api/ipsec/ipsec_test_in.c b/test/validation/api/ipsec/ipsec_test_in.c index e72c01c949..b5251544e7 100644 --- a/test/validation/api/ipsec/ipsec_test_in.c +++ b/test/validation/api/ipsec/ipsec_test_in.c @@ -1847,7 +1847,7 @@ static void test_in_ipv4_esp_reass_success_two_frags(odp_ipsec_sa_t out_sa, ipsec_test_packet *result_packet = &pkt_ipv4_udp_p1; test_multi_out_in(out_sa, in_sa, ODPH_IPV4, - ARRAY_SIZE(input_packets), + ODPH_ARRAY_SIZE(input_packets), input_packets, result_packet, ODP_PACKET_REASS_COMPLETE); @@ -1865,7 +1865,7 @@ static void test_in_ipv4_esp_reass_success_four_frags(odp_ipsec_sa_t out_sa, ipsec_test_packet *result_packet = &pkt_ipv4_udp_p2; test_multi_out_in(out_sa, in_sa, ODPH_IPV4, - ARRAY_SIZE(input_packets), + ODPH_ARRAY_SIZE(input_packets), input_packets, result_packet, ODP_PACKET_REASS_COMPLETE); @@ -1881,7 +1881,7 @@ static void test_in_ipv4_esp_reass_success_two_frags_ooo(odp_ipsec_sa_t out_sa, ipsec_test_packet *result_packet = &pkt_ipv4_udp_p1; test_multi_out_in(out_sa, in_sa, ODPH_IPV4, - ARRAY_SIZE(input_packets), + ODPH_ARRAY_SIZE(input_packets), input_packets, result_packet, ODP_PACKET_REASS_COMPLETE); @@ -1899,7 +1899,7 @@ static void test_in_ipv4_esp_reass_success_four_frags_ooo(odp_ipsec_sa_t out_sa, ipsec_test_packet *result_packet = &pkt_ipv4_udp_p2; test_multi_out_in(out_sa, in_sa, ODPH_IPV4, - ARRAY_SIZE(input_packets), + ODPH_ARRAY_SIZE(input_packets), input_packets, result_packet, ODP_PACKET_REASS_COMPLETE); @@ -1914,7 +1914,7 @@ static void test_in_ipv4_esp_reass_incomp_missing(odp_ipsec_sa_t out_sa, ipsec_test_packet *result_packet = &pkt_ipv4_udp_p1_f1; test_multi_out_in(out_sa, in_sa, ODPH_IPV4, - ARRAY_SIZE(input_packets), + ODPH_ARRAY_SIZE(input_packets), input_packets, result_packet, ODP_PACKET_REASS_INCOMPLETE); @@ -2031,7 +2031,7 @@ static void test_in_ipv6_esp_reass_success_two_frags(odp_ipsec_sa_t out_sa, ipsec_test_packet *result_packet = &pkt_ipv6_udp_p1; test_multi_out_in(out_sa, in_sa, ODPH_IPV6, - ARRAY_SIZE(input_packets), + ODPH_ARRAY_SIZE(input_packets), input_packets, result_packet, ODP_PACKET_REASS_COMPLETE); @@ -2049,7 +2049,7 @@ static void test_in_ipv6_esp_reass_success_four_frags(odp_ipsec_sa_t out_sa, ipsec_test_packet *result_packet = &pkt_ipv6_udp_p2; test_multi_out_in(out_sa, in_sa, ODPH_IPV6, - ARRAY_SIZE(input_packets), + ODPH_ARRAY_SIZE(input_packets), input_packets, result_packet, ODP_PACKET_REASS_COMPLETE); @@ -2065,7 +2065,7 @@ static void test_in_ipv6_esp_reass_success_two_frags_ooo(odp_ipsec_sa_t out_sa, ipsec_test_packet *result_packet = &pkt_ipv6_udp_p1; test_multi_out_in(out_sa, in_sa, ODPH_IPV6, - ARRAY_SIZE(input_packets), + ODPH_ARRAY_SIZE(input_packets), input_packets, result_packet, ODP_PACKET_REASS_COMPLETE); @@ -2083,7 +2083,7 @@ static void test_in_ipv6_esp_reass_success_four_frags_ooo(odp_ipsec_sa_t out_sa, ipsec_test_packet *result_packet = &pkt_ipv6_udp_p2; test_multi_out_in(out_sa, in_sa, ODPH_IPV6, - ARRAY_SIZE(input_packets), + ODPH_ARRAY_SIZE(input_packets), input_packets, result_packet, ODP_PACKET_REASS_COMPLETE); @@ -2098,7 +2098,7 @@ static void test_in_ipv6_esp_reass_incomp_missing(odp_ipsec_sa_t out_sa, ipsec_test_packet *result_packet = &pkt_ipv6_udp_p1_f1; test_multi_out_in(out_sa, in_sa, ODPH_IPV6, - ARRAY_SIZE(input_packets), + ODPH_ARRAY_SIZE(input_packets), input_packets, result_packet, ODP_PACKET_REASS_INCOMPLETE); diff --git a/test/validation/api/ipsec/ipsec_test_out.c b/test/validation/api/ipsec/ipsec_test_out.c index 1a013289b7..ca8bf97a58 100644 --- a/test/validation/api/ipsec/ipsec_test_out.c +++ b/test/validation/api/ipsec/ipsec_test_out.c @@ -715,11 +715,11 @@ static void test_esp_out_in_all(const ipsec_test_flags *flags_in) flags.ah = false; - for (c = 0; c < ARRAY_SIZE(ciphers); c++) - for (a = 0; a < ARRAY_SIZE(auths); a++) + for (c = 0; c < ODPH_ARRAY_SIZE(ciphers); c++) + for (a = 0; a < ODPH_ARRAY_SIZE(auths); a++) test_esp_out_in(&ciphers[c], &auths[a], &flags); - for (c = 0; c < ARRAY_SIZE(cipher_auth_comb); c++) + for (c = 0; c < ODPH_ARRAY_SIZE(cipher_auth_comb); c++) test_esp_out_in(&cipher_auth_comb[c].cipher, &cipher_auth_comb[c].auth, &flags); @@ -777,9 +777,9 @@ static void test_ah_out_in_all(const ipsec_test_flags *flags) { uint32_t a; - for (a = 0; a < ARRAY_SIZE(auths); a++) + for (a = 0; a < ODPH_ARRAY_SIZE(auths); a++) test_ah_out_in(&auths[a], flags); - for (a = 0; a < ARRAY_SIZE(ah_auths); a++) + for (a = 0; a < ODPH_ARRAY_SIZE(ah_auths); a++) test_ah_out_in(&ah_auths[a], flags); } diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index b7a4d14cf4..40cfc14810 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -3531,7 +3531,7 @@ static int packet_parse_suite_init(void) return -1; } - num_test_pkt = sizeof(parse_test_pkt_len) / sizeof(uint32_t); + num_test_pkt = ODPH_ARRAY_SIZE(parse_test_pkt_len); max_len = 0; for (i = 0; i < num_test_pkt; i++) { diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c index e713827bfc..8515f9b64e 100644 --- a/test/validation/api/pool/pool.c +++ b/test/validation/api/pool/pool.c @@ -1699,7 +1699,7 @@ static void test_packet_pool_ext_capa(void) odp_pool_type_t type; const odp_pool_type_t unsupported_types[] = {ODP_POOL_BUFFER, ODP_POOL_TIMEOUT, ODP_POOL_VECTOR, ODP_POOL_DMA_COMPL}; - const int num_types = sizeof(unsupported_types) / sizeof(unsupported_types[0]); + const int num_types = ODPH_ARRAY_SIZE(unsupported_types); /* Verify operation for unsupported pool types */ for (int i = 0; i < num_types; i++) { diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c index e735faa93d..8f450a057a 100644 --- a/test/validation/api/scheduler/scheduler.c +++ b/test/validation/api/scheduler/scheduler.c @@ -1360,7 +1360,7 @@ static void chaos_run(unsigned int qtype) odp_schedule_sync_t sync[] = {ODP_SCHED_SYNC_PARALLEL, ODP_SCHED_SYNC_ATOMIC, ODP_SCHED_SYNC_ORDERED}; - const unsigned num_sync = (sizeof(sync) / sizeof(odp_schedule_sync_t)); + const unsigned int num_sync = ODPH_ARRAY_SIZE(sync); const char *const qtypes[] = {"parallel", "atomic", "ordered"}; /* Set up the scheduling environment */ diff --git a/test/validation/api/traffic_mngr/traffic_mngr.c b/test/validation/api/traffic_mngr/traffic_mngr.c index edb845b603..ed07db7516 100644 --- a/test/validation/api/traffic_mngr/traffic_mngr.c +++ b/test/validation/api/traffic_mngr/traffic_mngr.c @@ -111,8 +111,6 @@ #define TM_PERCENT(percent) ((uint32_t)(100 * percent)) -#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0])) - typedef enum { SHAPER_PROFILE, SCHED_PROFILE, THRESHOLD_PROFILE, WRED_PROFILE } profile_kind_t; @@ -3542,7 +3540,7 @@ static wred_pkt_cnts_t *search_expected_pkt_rcv_tbl(odp_tm_percent_t confidence, uint32_t idx, table_size; /* Search the EXPECTED_PKT_RCVD table to find a matching entry */ - table_size = sizeof(EXPECTED_PKT_RCVD) / sizeof(wred_pkt_cnts_t); + table_size = ODPH_ARRAY_SIZE(EXPECTED_PKT_RCVD); for (idx = 0; idx < table_size; idx++) { wred_pkt_cnts = &EXPECTED_PKT_RCVD[idx]; if ((wred_pkt_cnts->confidence_percent == confidence) && @@ -5036,7 +5034,7 @@ int main(int argc, char *argv[]) ret = odp_cunit_run(); /* Exit with 77 in order to indicate that test is skipped completely */ - if (!ret && suite_inactive == (ARRAY_SIZE(traffic_mngr_suites) - 1)) + if (!ret && suite_inactive == (ODPH_ARRAY_SIZE(traffic_mngr_suites) - 1)) return 77; return ret; } From ff9c83099901299a81dc071f15295afb7c3b48d6 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 8 Sep 2023 16:50:14 +0300 Subject: [PATCH 167/192] checkpatch: stop ignoring ARRAY_SIZE warning ODPH_ARRAY_SIZE() macro (or _ODP_ARRAY_SIZE() inside implementation) should now be used, so remove ignore rule for checkpatch array size warnings. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- .checkpatch.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/.checkpatch.conf b/.checkpatch.conf index 3a0190debf..16235c39b5 100644 --- a/.checkpatch.conf +++ b/.checkpatch.conf @@ -9,7 +9,6 @@ --ignore=VOLATILE --ignore=AVOID_EXTERNS --ignore=CONST_STRUCT ---ignore=ARRAY_SIZE --ignore=PREFER_KERNEL_TYPES --ignore=CONSTANT_COMPARISON --ignore=BLOCK_COMMENT_STYLE From 3e026ab4954e221c674427dbccd09eb73a99dcf7 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Fri, 8 Sep 2023 17:05:27 +0300 Subject: [PATCH 168/192] helper: macros: add test for ODPH_ARRAY_SIZE() Add simple tests for new ODPH_ARRAY_SIZE() macro. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- helper/test/macros.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/helper/test/macros.c b/helper/test/macros.c index cb6bd491a0..878d4abd36 100644 --- a/helper/test/macros.c +++ b/helper/test/macros.c @@ -12,6 +12,8 @@ int main(void) { int a, b; int ret = 0; + int arr_1[1]; + int arr_10[10]; printf("Running helper macro tests\n"); @@ -37,6 +39,12 @@ int main(void) if (ODPH_MAX(++a, ++b) != 11) ret++; + if (ODPH_ARRAY_SIZE(arr_1) != 1) + ret++; + + if (ODPH_ARRAY_SIZE(arr_10) != 10) + ret++; + if (!ret) printf("All tests passed\n"); else From 225023616d7980172d7b2671481999551c5fe11e Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 11 Oct 2023 10:50:00 +0300 Subject: [PATCH 169/192] helper: macros: add new macro for absolute value Add new ODPH_ABS() helper macro for calculating the absolute value of a signed variable. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- helper/include/odp/helper/macros.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/helper/include/odp/helper/macros.h b/helper/include/odp/helper/macros.h index 223caf1dc8..e30db7babc 100644 --- a/helper/include/odp/helper/macros.h +++ b/helper/include/odp/helper/macros.h @@ -47,6 +47,15 @@ extern "C" { tmp_a > tmp_b ? tmp_a : tmp_b; \ }) +/** + * Return absolute value of signed variable + */ +#define ODPH_ABS(v) \ + __extension__ ({ \ + __typeof__(v) tmp_v = (v); \ + tmp_v < 0 ? -tmp_v : tmp_v; \ + }) + /** * @} */ From 4ed9c08af315a18fa61ac9781d3a5bf595a0cfcb Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 11 Oct 2023 12:41:11 +0300 Subject: [PATCH 170/192] helper: macros: add test for ODPH_ABS() Add simple tests for new ODPH_ABS() macro. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- helper/test/macros.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/helper/test/macros.c b/helper/test/macros.c index 878d4abd36..e6a203e206 100644 --- a/helper/test/macros.c +++ b/helper/test/macros.c @@ -45,6 +45,23 @@ int main(void) if (ODPH_ARRAY_SIZE(arr_10) != 10) ret++; + if (ODPH_ABS(-1) != 1) + ret++; + + if (ODPH_ABS(1) != 1) + ret++; + + if (ODPH_ABS(0) != 0) + ret++; + + a = -1; + if (ODPH_ABS(a++) != 1) + ret++; + + a = -1; + if (ODPH_ABS(--a) != 2) + ret++; + if (!ret) printf("All tests passed\n"); else From 303fb45b65e2ae9615a921935decdeeb728f9e97 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 11 Oct 2023 12:44:28 +0300 Subject: [PATCH 171/192] example: timer_accuracy: use new ODPH_ABS macro Utilize new ODPH_ABS() macro in timer accuracy example application. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Petri Savolainen --- example/timer/odp_timer_accuracy.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/example/timer/odp_timer_accuracy.c b/example/timer/odp_timer_accuracy.c index ff6794166f..9a4593a9a4 100644 --- a/example/timer/odp_timer_accuracy.c +++ b/example/timer/odp_timer_accuracy.c @@ -21,8 +21,6 @@ #define MAX_QUEUES 1024 #define MAX_FILENAME 128 -#define ABS(v) ((v) < 0 ? -(v) : (v)) - enum mode_e { MODE_ONESHOT = 0, MODE_RESTART_ABS, @@ -973,7 +971,7 @@ static void print_stat(test_global_t *test_global) timer_ctx_t *t = &test_global->timer_ctx[i]; int64_t v = t->first_tmo_diff; - if (ABS(v) > ABS(max)) { + if (ODPH_ABS(v) > ODPH_ABS(max)) { max = v; idx = i; } @@ -990,7 +988,7 @@ static void print_stat(test_global_t *test_global) timer_ctx_t *t = &test_global->timer_ctx[i]; int64_t v = t->nsec_final; - if (ABS(v) > ABS(max)) + if (ODPH_ABS(v) > ODPH_ABS(max)) max = v; } From 14915c20de199e2cda397b157cbba8a86c105d04 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 18 Oct 2023 10:16:28 +0300 Subject: [PATCH 172/192] api: increment ODP API version to 1.42.1 Increment API version number to reflect the following changes: Backward compatible: - cls: add odp_cls_pmr_create_multi() function - cls: add odp_cls_pmr_destroy_multi() function - cls: add odp_cls_cos_create_multi() function - cls: add odp_cos_destroy_multi() function - crypto: clarify packet ordering of async crypto ops - crypto: add null_crypto crypto op flag for skipping crypto - crypto: allow both basic and out-of-place ops in one session - pktio: add ODP_PKTIO_MAX_INDEX define - queue: add odp_queue_create_multi() function - queue: add odp_queue_destroy_multi() function - queue: clarify odp_queue_param_t default value specification - system: add new ARMv8 and v9 enumerations - timer: clean up odp_timer_pool_param_t.num_timers description - timer: add odp_timeout_alloc_multi() function - timer: add odp_timeout_free_multi() function Helper library (1.4.0): Backward incompatible: - protocols: rename ODP_GTP_HLEN define to ODPH_GTP_HLEN - protocols: rename ODP_IGMP_HLEN define to ODPH_IGMP_HLEN - protocols: remove unused ICMP defines and add missing ODPH_ prefix to the remaining defines Backward compatible: - macros: add ODPH_MIN() and ODPH_MAX() helper macros - macros: add ODPH_ARRAY_SIZE() helper macro - macros: add ODPH_ABS() helper macro Signed-off-by: Matias Elo Reviewed-by: Petri Savolainen --- CHANGELOG | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 4 +- 2 files changed, 104 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 82d0cd1baf..4cb2a57cbf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,105 @@ +== OpenDataPlane (1.42.1.0) + +=== Backward compatible API changes +==== Classifier +* Add new `odp_cls_pmr_create_multi()` function for creating multiple packet +matching rules with a single call. +* Add new `odp_cls_pmr_destroy_multi()` function for destroying multiple PMRs +with a single call. +* Add new `odp_cls_cos_create_multi()` function for creating multiple class-of- +services with a single call. +* Add new `odp_cos_destroy_multi()` function for destroying multiple CoSes with +a single call. + +==== Crypto +* Clarify packet ordering of async crypto ops (`odp_crypto_op_enq()`). +* Add `odp_crypto_packet_op_param_t.null_crypto` parameter that tells that a +packet should be processed as if the configured algorithms were null cipher and +null auth algorithm. +* Add `ODP_CRYPTO_OP_TYPE_BASIC_AND_OOP` crypto operation type that allows both +basic and out-of-place operations in the same session. + +==== Packet IO +* Add new API define `ODP_PKTIO_MAX_INDEX` for maximum packet IO interface +index. + +==== Queue +* Add new `odp_queue_create_multi()` function for creating multiple queues with +a single call. +* Add new `odp_queue_destroy_multi()` function for destroying multiple queues +with a single call. +* Clarify `odp_queue_param_t` default value specification. + +==== System +* Add enumerations for ARM ISA versions ARMv8.8-A, ARMv8.9-A, and ARMv9.3-A. + +==== Timer +* Change `odp_timer_pool_param_t.num_timers` description to allow applications +to attempt to allocate more timers than there are in a timer pool. +* Add new `odp_timeout_alloc_multi()` function for allocating multiple timeouts +with a single call. +* Add new `odp_timeout_free_multi()` function for freeing multiple timeouts with +a single call. + +=== Helper (1.4.0) +==== Backward incompatible changes +===== Protocols +* Rename `ODP_GTP_HLEN` define to `ODPH_GTP_HLEN`. +* Rename `ODP_IGMP_HLEN` define to `ODPH_IGMP_HLEN`. +* Remove unused ICMP defines and add missing `ODPH_` prefix to the remaining +ones. + +==== Backward compatible changes +===== Macros +* Add new `ODPH_MIN()` and `ODPH_MAX()` helper macros for comparison operations. +* Add new `ODPH_ARRAY_SIZE()` helper macro for calculating array size. +* Add new `ODPH_ABS()` helper macro for calculating the absolute value of a +signed variable. + +=== Implementation +==== CPU +* Optimize `odp_cpu_cycles()` performance on aarch64 by implementing the +function using `cntvct_el0` virtual counter register. + +==== Packet IO +* Transmitting packet vectors is not supported by the current API, so remove +the code from the implementation. This may improve performance when transmitting +packets through event queues. +* Add support for packet transmit completion check through polling +(`ODP_PACKET_TX_COMPL_POLL`). + +=== Example Applications +==== sysinfo +* Add prints for various missing capabilities (e.g. pool, packet IO, timer). + +==== timer_accuracy +* Add new (`-c, --count`) option to set the CPU count. +* Add new (`-t, --queue_type`) option to set the queue sync type. +* Add new (`-q, --num_queue`) option to set the number of queues. +* Add new (`-G, --sched_groups`) option to use a dedicated schedule group for +each queue. + +=== Performance Tests +==== bench_pktio_sp +* Add new `odp_bench_pktio_sp` application for measuring delays of ODP packet IO +slow path functions. + +==== dmafwd +* Add new `odp_dmafwd` application for comparing packet forwarding throughput +when received packets are first copied either with software memory copy +or with DMA offload and then echoed back to sender(s). + +==== packet_gen +* Add new (`-m, --tx_mode`) option for selecting how packets are transmitted. + +==== stash_perf +* Add new `odp_stash_perf` application for measuring ODP stash fast path API +performance. + +==== timer_perf +* Add new mode (`-m 2`) for measuring `odp_schedule()` overhead while +continuously restarting expiring timers. + == OpenDataPlane (1.42.0.0) === Backward incompatible API changes diff --git a/configure.ac b/configure.ac index 69290e34b2..8459553b44 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_PREREQ([2.5]) ########################################################################## m4_define([odp_version_generation], [1]) m4_define([odp_version_major], [42]) -m4_define([odp_version_minor], [0]) +m4_define([odp_version_minor], [1]) m4_define([odp_version_patch], [0]) m4_define([odp_version_api], @@ -27,7 +27,7 @@ AC_SUBST(ODP_VERSION_API) # Helper library version ########################################################################## m4_define([odph_version_generation], [1]) -m4_define([odph_version_major], [3]) +m4_define([odph_version_major], [4]) m4_define([odph_version_minor], [0]) m4_define([odph_version], From 8aa8c2ece83c52b190e8fbbe748592d002d74246 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 25 Oct 2023 13:32:38 +0300 Subject: [PATCH 173/192] Port 30c50f461 "linux-gen: fix typos" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port original commit from linux-generic. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- platform/linux-dpdk/m4/configure.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-dpdk/m4/configure.m4 b/platform/linux-dpdk/m4/configure.m4 index 70295400f6..74b4e43f25 100644 --- a/platform/linux-dpdk/m4/configure.m4 +++ b/platform/linux-dpdk/m4/configure.m4 @@ -39,7 +39,7 @@ AC_ARG_ENABLE([dpdk-shared], # Check for DPDK availability # # DPDK pmd drivers are not linked unless the --whole-archive option is -# used. No spaces are allowed between the --whole-arhive flags. +# used. No spaces are allowed between the --whole-archive flags. ########################################################################## ODP_DPDK([$DPDK_PATH], [$dpdk_shared], [], [AC_MSG_FAILURE([can't find DPDK])]) From 6b9a949eac36527e7b1040671d698409573c6b10 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 25 Oct 2023 14:23:05 +0300 Subject: [PATCH 174/192] Port 9dd86d494 "linux-gen: cpu: optimize aarch64 odp_cpu_cycles() implementation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port original commit from linux-generic. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- platform/linux-dpdk/Makefile.am | 5 +++-- .../arch/aarch64/odp/api/abi/time_cpu.h | 1 + .../linux-dpdk/arch/aarch64/odp_cpu_cycles.c | 1 + platform/linux-dpdk/odp_init.c | 17 ++++++++--------- 4 files changed, 13 insertions(+), 11 deletions(-) create mode 120000 platform/linux-dpdk/arch/aarch64/odp/api/abi/time_cpu.h create mode 120000 platform/linux-dpdk/arch/aarch64/odp_cpu_cycles.c diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am index ad608c4e14..8598b767a5 100644 --- a/platform/linux-dpdk/Makefile.am +++ b/platform/linux-dpdk/Makefile.am @@ -310,12 +310,13 @@ noinst_HEADERS += arch/arm/odp_atomic.h \ endif if ARCH_IS_AARCH64 __LIB__libodp_dpdk_la_SOURCES += arch/aarch64/odp_atomic.c \ - arch/default/odp_cpu_cycles.c \ + arch/aarch64/odp_cpu_cycles.c \ arch/aarch64/cpu_flags.c \ arch/default/odp_hash_crc32.c \ arch/default/odp_random.c \ arch/aarch64/odp_sysinfo_parse.c -odpapiabiarchinclude_HEADERS += arch/aarch64/odp/api/abi/hash_crc32.h +odpapiabiarchinclude_HEADERS += arch/aarch64/odp/api/abi/hash_crc32.h \ + arch/aarch64/odp/api/abi/time_cpu.h if !ODP_ABI_COMPAT odpapiabiarchinclude_HEADERS += arch/default/odp/api/abi/atomic_generic.h \ arch/aarch64/odp/api/abi/atomic_inlines.h \ diff --git a/platform/linux-dpdk/arch/aarch64/odp/api/abi/time_cpu.h b/platform/linux-dpdk/arch/aarch64/odp/api/abi/time_cpu.h new file mode 120000 index 0000000000..f00ac2b3f0 --- /dev/null +++ b/platform/linux-dpdk/arch/aarch64/odp/api/abi/time_cpu.h @@ -0,0 +1 @@ +../../../../../../linux-generic/arch/aarch64/odp/api/abi/time_cpu.h \ No newline at end of file diff --git a/platform/linux-dpdk/arch/aarch64/odp_cpu_cycles.c b/platform/linux-dpdk/arch/aarch64/odp_cpu_cycles.c new file mode 120000 index 0000000000..7cf2fef20b --- /dev/null +++ b/platform/linux-dpdk/arch/aarch64/odp_cpu_cycles.c @@ -0,0 +1 @@ +../../../linux-generic/arch/aarch64/odp_cpu_cycles.c \ No newline at end of file diff --git a/platform/linux-dpdk/odp_init.c b/platform/linux-dpdk/odp_init.c index 7e6aaab550..4d6f395c5a 100644 --- a/platform/linux-dpdk/odp_init.c +++ b/platform/linux-dpdk/odp_init.c @@ -34,8 +34,8 @@ enum init_stage { NO_INIT = 0, /* No init stages completed */ LIBCONFIG_INIT, CPUMASK_INIT, - CPU_CYCLES_INIT, SYSINFO_INIT, + CPU_CYCLES_INIT, TIME_INIT, ISHM_INIT, FDSERVER_INIT, @@ -480,6 +480,7 @@ static int term_global(enum init_stage stage) } /* Fall through */ + case CPU_CYCLES_INIT: case SYSINFO_INIT: if (_odp_system_info_term()) { _ODP_ERR("ODP system info term failed.\n"); @@ -487,8 +488,6 @@ static int term_global(enum init_stage stage) } /* Fall through */ - case CPU_CYCLES_INIT: - /* Fall through */ case CPUMASK_INIT: if (_odp_cpumask_term_global()) { _ODP_ERR("ODP cpumask term failed.\n"); @@ -547,12 +546,6 @@ int odp_init_global(odp_instance_t *instance, } stage = CPUMASK_INIT; - if (_odp_cpu_cycles_init_global()) { - _ODP_ERR("ODP cpu cycle init failed.\n"); - goto init_failed; - } - stage = CPU_CYCLES_INIT; - if (_odp_init_dpdk((const char *)platform_params)) { _ODP_ERR("ODP dpdk init failed.\n"); return -1; @@ -564,6 +557,12 @@ int odp_init_global(odp_instance_t *instance, } stage = SYSINFO_INIT; + if (_odp_cpu_cycles_init_global()) { + _ODP_ERR("ODP cpu cycle init failed.\n"); + goto init_failed; + } + stage = CPU_CYCLES_INIT; + if (_odp_time_init_global()) { _ODP_ERR("ODP time init failed.\n"); goto init_failed; From 810313ae807650dd41ced011d66ab9aa38f19907 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 25 Oct 2023 14:35:28 +0300 Subject: [PATCH 175/192] Port edc008440 "test: dmafwd: add CI integration" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port original commit from linux-generic. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- platform/linux-dpdk/m4/configure.m4 | 2 + platform/linux-dpdk/test/Makefile.am | 6 +- .../linux-dpdk/test/performance/Makefile.am | 1 + .../test/performance/dmafwd/Makefile.am | 18 ++++++ .../test/performance/dmafwd/pktio_env | 59 +++++++++++++++++++ 5 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 platform/linux-dpdk/test/performance/Makefile.am create mode 100644 platform/linux-dpdk/test/performance/dmafwd/Makefile.am create mode 100644 platform/linux-dpdk/test/performance/dmafwd/pktio_env diff --git a/platform/linux-dpdk/m4/configure.m4 b/platform/linux-dpdk/m4/configure.m4 index 74b4e43f25..a7c58eb918 100644 --- a/platform/linux-dpdk/m4/configure.m4 +++ b/platform/linux-dpdk/m4/configure.m4 @@ -104,5 +104,7 @@ AC_CONFIG_FILES([platform/linux-dpdk/Makefile platform/linux-dpdk/test/example/ping/Makefile platform/linux-dpdk/test/example/simple_pipeline/Makefile platform/linux-dpdk/test/example/switch/Makefile + platform/linux-dpdk/test/performance/Makefile + platform/linux-dpdk/test/performance/dmafwd/Makefile platform/linux-dpdk/test/validation/api/pktio/Makefile]) ]) diff --git a/platform/linux-dpdk/test/Makefile.am b/platform/linux-dpdk/test/Makefile.am index 5758a2af76..c210edbdc2 100644 --- a/platform/linux-dpdk/test/Makefile.am +++ b/platform/linux-dpdk/test/Makefile.am @@ -16,11 +16,13 @@ TESTS += validation/api/pktio/pktio_run.sh test_SCRIPTS = $(dist_check_SCRIPTS) SUBDIRS += validation/api/pktio \ - example + example \ + performance else #performance tests refer to pktio_env if test_perf -SUBDIRS += validation/api/pktio +SUBDIRS += validation/api/pktio \ + performance endif endif diff --git a/platform/linux-dpdk/test/performance/Makefile.am b/platform/linux-dpdk/test/performance/Makefile.am new file mode 100644 index 0000000000..4070f09f2e --- /dev/null +++ b/platform/linux-dpdk/test/performance/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = dmafwd diff --git a/platform/linux-dpdk/test/performance/dmafwd/Makefile.am b/platform/linux-dpdk/test/performance/dmafwd/Makefile.am new file mode 100644 index 0000000000..91d42cc745 --- /dev/null +++ b/platform/linux-dpdk/test/performance/dmafwd/Makefile.am @@ -0,0 +1,18 @@ +EXTRA_DIST = pktio_env + +all-local: + if [ "x$(srcdir)" != "x$(builddir)" ]; then \ + for f in $(EXTRA_DIST); do \ + if [ -e $(srcdir)/$$f ]; then \ + mkdir -p $(builddir)/$$(dirname $$f); \ + cp -f $(srcdir)/$$f $(builddir)/$$f; \ + fi \ + done \ + fi + +clean-local: + if [ "x$(srcdir)" != "x$(builddir)" ]; then \ + for f in $(EXTRA_DIST); do \ + rm -f $(builddir)/$$f; \ + done \ + fi diff --git a/platform/linux-dpdk/test/performance/dmafwd/pktio_env b/platform/linux-dpdk/test/performance/dmafwd/pktio_env new file mode 100644 index 0000000000..7135ca17d8 --- /dev/null +++ b/platform/linux-dpdk/test/performance/dmafwd/pktio_env @@ -0,0 +1,59 @@ +#!/bin/sh +# +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2023 Nokia + +PCAP_IN=`find . ${TEST_DIR} $(dirname $0) -name udp64.pcap -print -quit` +PCAP_OUT=dmafwd_out.pcap +IF0=0 +DUMP=tcpdump + +export ODP_PLATFORM_PARAMS="--no-pci --vdev net_pcap0,rx_pcap=${PCAP_IN},tx_pcap=${PCAP_OUT}" + +if [ "$0" = "$BASH_SOURCE" ]; then + echo "ERROR: Platform specific env file has to be sourced." +fi + +validate_result() +{ + local RET=0 + + if command -v ${DUMP}; then + local VALIN=valin + local VALOUT=valout + + ${DUMP} -r ${PCAP_IN} -t -x > ${VALIN} + ${DUMP} -r ${PCAP_OUT} -t -x > ${VALOUT} + diff ${VALIN} ${VALOUT} + RET=$? + rm -f ${VALIN} + rm -f ${VALOUT} + else + echo "WARNING: No ${DUMP} available, using \"stat\" for diff" + local SZIN=$(stat -c %s ${PCAP_IN}) + local SZOUT=$(stat -c %s ${PCAP_OUT}) + + if [ ${SZIN} -ne ${SZOUT} ]; then + RET=1 + fi + fi + + rm -f ${PCAP_OUT} + + if [ $RET -ne 0 ]; then + echo "ERROR: Input and output captures do not match, exiting" + exit 1 + fi + + return 0 +} + +setup_interfaces() +{ + return 0 +} + +cleanup_interfaces() +{ + return 0 +} From dba79fafa09c0e3b4dae986c92f249eace1a1bff Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 25 Oct 2023 14:38:04 +0300 Subject: [PATCH 176/192] Port a18fd930f "linux-gen: pool: fix odp_pool_ext_capability() return value" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port original commit from linux-generic. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- platform/linux-dpdk/odp_pool.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/platform/linux-dpdk/odp_pool.c b/platform/linux-dpdk/odp_pool.c index fd27cd79e1..6d284ddf97 100644 --- a/platform/linux-dpdk/odp_pool.c +++ b/platform/linux-dpdk/odp_pool.c @@ -1085,8 +1085,21 @@ int odp_pool_ext_capability(odp_pool_type_t type, { odp_pool_stats_opt_t supported_stats; - if (type != ODP_POOL_PACKET) + _ODP_ASSERT(capa != NULL); + + switch (type) { + case ODP_POOL_PACKET: + break; + case ODP_POOL_BUFFER: + case ODP_POOL_TIMEOUT: + case ODP_POOL_VECTOR: + case ODP_POOL_DMA_COMPL: + memset(capa, 0, sizeof(odp_pool_ext_capability_t)); + return 0; + default: + _ODP_ERR("Invalid pool type: %d\n", type); return -1; + } supported_stats.all = 0; From d83caf6605ab5411b787830a16033e0b8870c411 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 25 Oct 2023 14:43:01 +0300 Subject: [PATCH 177/192] Port 926a4cbc0 "linux-gen: packet: add fields for TX completion poll mode" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port original commit from linux-generic. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- .../include/odp/api/plat/packet_inline_types.h | 9 +++++---- platform/linux-dpdk/include/odp_packet_internal.h | 3 +++ platform/linux-dpdk/odp_packet.c | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) 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 5466ce58b6..5bbcadd32e 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 @@ -121,7 +121,7 @@ typedef union { uint32_t all_flags; struct { - uint32_t reserved1: 5; + uint32_t reserved1: 4; /* * Init flags @@ -139,7 +139,8 @@ typedef union { uint32_t l4_chksum_set: 1; /* L4 chksum bit is valid */ uint32_t l4_chksum: 1; /* L4 chksum override */ uint32_t ts_set: 1; /* Set Tx timestamp */ - uint32_t tx_compl: 1; /* Tx completion event requested */ + uint32_t tx_compl_ev: 1; /* Tx completion event requested */ + uint32_t tx_compl_poll: 1; /* Tx completion poll requested */ uint32_t free_ctrl: 1; /* Don't free option */ uint32_t tx_aging: 1; /* Packet aging at Tx requested */ uint32_t shaper_len_adj: 8; /* Adjustment for traffic mgr */ @@ -158,8 +159,8 @@ typedef union { /* Flag groups */ struct { - uint32_t reserved2: 5; - uint32_t other: 20; /* All other flags */ + uint32_t reserved2: 4; + uint32_t other: 21; /* All other flags */ uint32_t error: 7; /* All error flags */ } all; diff --git a/platform/linux-dpdk/include/odp_packet_internal.h b/platform/linux-dpdk/include/odp_packet_internal.h index b4d1f5d443..c86f0646a7 100644 --- a/platform/linux-dpdk/include/odp_packet_internal.h +++ b/platform/linux-dpdk/include/odp_packet_internal.h @@ -161,6 +161,9 @@ typedef struct ODP_ALIGNED_CACHE odp_packet_hdr_t { * request + requested drop timeout). */ uint64_t tx_aging_ns; + /* Tx completion poll completion identifier */ + uint32_t tx_compl_id; + /* LSO profile index */ uint8_t lso_profile_idx; diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_packet.c index 95149118e1..a77b7f9076 100644 --- a/platform/linux-dpdk/odp_packet.c +++ b/platform/linux-dpdk/odp_packet.c @@ -1766,7 +1766,7 @@ int odp_packet_tx_compl_request(odp_packet_t pkt, const odp_packet_tx_compl_opt_ { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - pkt_hdr->p.flags.tx_compl = opt->mode == ODP_PACKET_TX_COMPL_EVENT ? 1 : 0; + pkt_hdr->p.flags.tx_compl_ev = opt->mode == ODP_PACKET_TX_COMPL_EVENT ? 1 : 0; pkt_hdr->dst_queue = opt->queue; return 0; @@ -1776,7 +1776,7 @@ int odp_packet_has_tx_compl_request(odp_packet_t pkt) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - return pkt_hdr->p.flags.tx_compl; + return pkt_hdr->p.flags.tx_compl_ev; } void odp_packet_tx_compl_free(odp_packet_tx_compl_t tx_compl) From 5e653aa9896aa5d21ca2dfda48cf6e983eb0c8da Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 25 Oct 2023 14:47:03 +0300 Subject: [PATCH 178/192] Port 4cf41a56e "linux-gen: pktio: implement TX completion poll mode" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port original commit from linux-generic. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- platform/linux-dpdk/include/odp_config_internal.h | 7 ++++--- platform/linux-dpdk/include/odp_packet_io_internal.h | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/platform/linux-dpdk/include/odp_config_internal.h b/platform/linux-dpdk/include/odp_config_internal.h index e104b9d24a..0c9d6def7a 100644 --- a/platform/linux-dpdk/include/odp_config_internal.h +++ b/platform/linux-dpdk/include/odp_config_internal.h @@ -133,10 +133,11 @@ extern "C" { /* * Number of shared memory blocks reserved for implementation internal use. * - * Each packet pool requires one SHM block and 20 blocks are reserved for - * ODP module global data. + * Each packet pool requires one SHM block, 20 blocks are reserved for ODP + * module global data, and one block per packet I/O is reserved for TX + * completion usage. */ -#define CONFIG_INTERNAL_SHM_BLOCKS (ODP_CONFIG_POOLS + 20) +#define CONFIG_INTERNAL_SHM_BLOCKS (ODP_CONFIG_POOLS + 20 + ODP_CONFIG_PKTIO_ENTRIES) /* * Maximum number of shared memory blocks. diff --git a/platform/linux-dpdk/include/odp_packet_io_internal.h b/platform/linux-dpdk/include/odp_packet_io_internal.h index ac22cff99c..ece33b5384 100644 --- a/platform/linux-dpdk/include/odp_packet_io_internal.h +++ b/platform/linux-dpdk/include/odp_packet_io_internal.h @@ -126,6 +126,10 @@ typedef struct ODP_ALIGNED_CACHE { /* Pool for Tx completion events */ odp_pool_t tx_compl_pool; + /* Status map SHM handle */ + odp_shm_t tx_compl_status_shm; + /* Status map for Tx completion identifiers */ + odp_atomic_u32_t *tx_compl_status; /* Storage for queue handles * Multi-queue support is pktio driver specific */ @@ -313,8 +317,8 @@ int _odp_lso_create_packets(odp_packet_t packet, const odp_packet_lso_opt_t *lso uint32_t payload_len, uint32_t left_over_len, odp_packet_t pkt_out[], int num_pkt); -void _odp_pktio_allocate_and_send_tx_compl_events(const pktio_entry_t *entry, - const odp_packet_t packets[], int num); +void _odp_pktio_process_tx_compl(const pktio_entry_t *entry, const odp_packet_t packets[], + int num); static inline int _odp_pktio_packet_to_pool(odp_packet_t *pkt, odp_packet_hdr_t **pkt_hdr, From 5a741e7bce5962a6044a7ce086b1f9f2b9988ab7 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 25 Oct 2023 15:15:31 +0300 Subject: [PATCH 179/192] Port e2e487619 "linux-gen: packet: implement TX completion poll mode" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port original commit from linux-generic. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- platform/linux-dpdk/odp_packet.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_packet.c index a77b7f9076..a61c4c34ae 100644 --- a/platform/linux-dpdk/odp_packet.c +++ b/platform/linux-dpdk/odp_packet.c @@ -1766,8 +1766,26 @@ int odp_packet_tx_compl_request(odp_packet_t pkt, const odp_packet_tx_compl_opt_ { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - pkt_hdr->p.flags.tx_compl_ev = opt->mode == ODP_PACKET_TX_COMPL_EVENT ? 1 : 0; - pkt_hdr->dst_queue = opt->queue; + switch (opt->mode) { + case ODP_PACKET_TX_COMPL_DISABLED: + pkt_hdr->p.flags.tx_compl_ev = 0; + pkt_hdr->p.flags.tx_compl_poll = 0; + break; + case ODP_PACKET_TX_COMPL_EVENT: + _ODP_ASSERT(opt->queue != ODP_QUEUE_INVALID); + pkt_hdr->p.flags.tx_compl_ev = 1; + pkt_hdr->p.flags.tx_compl_poll = 0; + pkt_hdr->dst_queue = opt->queue; + break; + case ODP_PACKET_TX_COMPL_POLL: + pkt_hdr->p.flags.tx_compl_ev = 0; + pkt_hdr->p.flags.tx_compl_poll = 1; + pkt_hdr->tx_compl_id = opt->compl_id; + break; + default: + _ODP_ERR("Bad TX completion mode: %i\n", opt->mode); + return -1; + } return 0; } @@ -1776,7 +1794,7 @@ int odp_packet_has_tx_compl_request(odp_packet_t pkt) { odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); - return pkt_hdr->p.flags.tx_compl_ev; + return pkt_hdr->p.flags.tx_compl_ev || pkt_hdr->p.flags.tx_compl_poll; } void odp_packet_tx_compl_free(odp_packet_tx_compl_t tx_compl) @@ -1803,10 +1821,7 @@ void *odp_packet_tx_compl_user_ptr(odp_packet_tx_compl_t tx_compl) int odp_packet_tx_compl_done(odp_pktio_t pktio, uint32_t compl_id) { - (void)pktio; - (void)compl_id; - - return -1; + return odp_atomic_load_acq_u32(&get_pktio_entry(pktio)->tx_compl_status[compl_id]); } void odp_packet_free_ctrl_set(odp_packet_t pkt, odp_packet_free_ctrl_t ctrl) From 543fae4081050144dd1581d72ed1ebd8b9348e4b Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 26 Oct 2023 08:44:24 +0300 Subject: [PATCH 180/192] Port 189f0258d "linux-gen: timer: implement odp_timeout_alloc_multi() function" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port original commit from linux-generic. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- platform/linux-dpdk/odp_timer.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/platform/linux-dpdk/odp_timer.c b/platform/linux-dpdk/odp_timer.c index 4056018ae4..4e79000931 100644 --- a/platform/linux-dpdk/odp_timer.c +++ b/platform/linux-dpdk/odp_timer.c @@ -1335,6 +1335,27 @@ odp_timeout_t odp_timeout_alloc(odp_pool_t pool_hdl) return odp_timeout_from_event(event); } +int odp_timeout_alloc_multi(odp_pool_t pool_hdl, odp_timeout_t tmo[], int num) +{ + pool_t *pool; + int ret; + + _ODP_ASSERT(pool_hdl != ODP_POOL_INVALID); + _ODP_ASSERT(tmo != NULL); + _ODP_ASSERT(num > 0); + + pool = _odp_pool_entry(pool_hdl); + + _ODP_ASSERT(pool->type == ODP_POOL_TIMEOUT); + + ret = _odp_event_alloc_multi(pool, (_odp_event_hdr_t **)tmo, num); + + for (int i = 0; i < ret; i++) + timeout_to_hdr(tmo[i])->timer = ODP_TIMER_INVALID; + + return ret; +} + void odp_timeout_free(odp_timeout_t tmo) { _odp_event_free(odp_timeout_to_event(tmo)); From 0ce60b2a32d4d4c0b26e46eea6c016321d4d923b Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 26 Oct 2023 08:45:30 +0300 Subject: [PATCH 181/192] Port 1eacb4743 "linux-gen: timer: implement odp_timeout_free_multi() function" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port original commit from linux-generic. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- platform/linux-dpdk/odp_timer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/linux-dpdk/odp_timer.c b/platform/linux-dpdk/odp_timer.c index 4e79000931..9d30f6929f 100644 --- a/platform/linux-dpdk/odp_timer.c +++ b/platform/linux-dpdk/odp_timer.c @@ -1361,6 +1361,14 @@ void odp_timeout_free(odp_timeout_t tmo) _odp_event_free(odp_timeout_to_event(tmo)); } +void odp_timeout_free_multi(odp_timeout_t tmo[], int num) +{ + _ODP_ASSERT(tmo != NULL); + _ODP_ASSERT(num > 0); + + _odp_event_free_multi((_odp_event_hdr_t **)(uintptr_t)tmo, num); +} + void odp_timer_pool_print(odp_timer_pool_t timer_pool) { timer_pool_t *tp; From 8b94ef1dea3441fb91136a196bb613e42ecf1f0f Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 26 Oct 2023 08:48:06 +0300 Subject: [PATCH 182/192] Port 9eef10280 "linux-gen: queue: implement odp_queue_create_multi() function" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port original commit from linux-generic. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- platform/linux-dpdk/odp_queue_basic.c | 24 ++++++++++++++++++++++++ platform/linux-dpdk/odp_queue_if.c | 8 ++++++++ 2 files changed, 32 insertions(+) diff --git a/platform/linux-dpdk/odp_queue_basic.c b/platform/linux-dpdk/odp_queue_basic.c index ebe86ef1b1..0cf30ff146 100644 --- a/platform/linux-dpdk/odp_queue_basic.c +++ b/platform/linux-dpdk/odp_queue_basic.c @@ -349,6 +349,29 @@ static odp_queue_t queue_create(const char *name, return handle; } +static int queue_create_multi(const char *name[], const odp_queue_param_t param[], + odp_bool_t share_param, odp_queue_t queue[], int num) +{ + int i; + + _ODP_ASSERT(param != NULL); + _ODP_ASSERT(queue != NULL); + _ODP_ASSERT(num > 0); + + for (i = 0; i < num; i++) { + odp_queue_t cur_queue; + const char *cur_name = name != NULL ? name[i] : NULL; + const odp_queue_param_t *cur_param = share_param ? ¶m[0] : ¶m[i]; + + cur_queue = queue_create(cur_name, cur_param); + if (cur_queue == ODP_QUEUE_INVALID) + return (i == 0) ? -1 : i; + + queue[i] = cur_queue; + } + return i; +} + void _odp_sched_queue_set_status(uint32_t queue_index, int status) { queue_entry_t *queue = qentry_from_index(queue_index); @@ -1177,6 +1200,7 @@ static odp_event_t queue_api_deq(odp_queue_t handle) /* API functions */ _odp_queue_api_fn_t _odp_queue_basic_api = { .queue_create = queue_create, + .queue_create_multi = queue_create_multi, .queue_destroy = queue_destroy, .queue_lookup = queue_lookup, .queue_capability = queue_capability, diff --git a/platform/linux-dpdk/odp_queue_if.c b/platform/linux-dpdk/odp_queue_if.c index 04ac1fd606..dd977e7e17 100644 --- a/platform/linux-dpdk/odp_queue_if.c +++ b/platform/linux-dpdk/odp_queue_if.c @@ -1,4 +1,5 @@ /* Copyright (c) 2018, Linaro Limited + * Copyright (c) 2023, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -36,6 +37,13 @@ odp_queue_t odp_queue_create(const char *name, const odp_queue_param_t *param) return _odp_queue_api->queue_create(name, param); } +int odp_queue_create_multi(const char *name[], const odp_queue_param_t param[], + odp_bool_t share_param, odp_queue_t queue[], int num) +{ + return _odp_queue_api->queue_create_multi(name, param, share_param, + queue, num); +} + int odp_queue_destroy(odp_queue_t queue) { return _odp_queue_api->queue_destroy(queue); From a67435221966cdf7d16d74f3a7f38afc6b170b22 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Thu, 26 Oct 2023 08:49:11 +0300 Subject: [PATCH 183/192] Port 319bb5981 "linux-gen: queue: implement odp_queue_destroy_multi() function" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port original commit from linux-generic. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- platform/linux-dpdk/odp_queue_basic.c | 18 ++++++++++++++++++ platform/linux-dpdk/odp_queue_if.c | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/platform/linux-dpdk/odp_queue_basic.c b/platform/linux-dpdk/odp_queue_basic.c index 0cf30ff146..4b9dee8912 100644 --- a/platform/linux-dpdk/odp_queue_basic.c +++ b/platform/linux-dpdk/odp_queue_basic.c @@ -448,6 +448,23 @@ static int queue_destroy(odp_queue_t handle) return 0; } +static int queue_destroy_multi(odp_queue_t handle[], int num) +{ + int i; + + _ODP_ASSERT(handle != NULL); + _ODP_ASSERT(num > 0); + + for (i = 0; i < num; i++) { + int ret = queue_destroy(handle[i]); + + if (ret) + return (i == 0) ? ret : i; + } + + return i; +} + static int queue_context_set(odp_queue_t handle, void *context, uint32_t len ODP_UNUSED) { @@ -1202,6 +1219,7 @@ _odp_queue_api_fn_t _odp_queue_basic_api = { .queue_create = queue_create, .queue_create_multi = queue_create_multi, .queue_destroy = queue_destroy, + .queue_destroy_multi = queue_destroy_multi, .queue_lookup = queue_lookup, .queue_capability = queue_capability, .queue_context_set = queue_context_set, diff --git a/platform/linux-dpdk/odp_queue_if.c b/platform/linux-dpdk/odp_queue_if.c index dd977e7e17..efe3eb1555 100644 --- a/platform/linux-dpdk/odp_queue_if.c +++ b/platform/linux-dpdk/odp_queue_if.c @@ -49,6 +49,11 @@ int odp_queue_destroy(odp_queue_t queue) return _odp_queue_api->queue_destroy(queue); } +int odp_queue_destroy_multi(odp_queue_t queue[], int num) +{ + return _odp_queue_api->queue_destroy_multi(queue, num); +} + odp_queue_t odp_queue_lookup(const char *name) { return _odp_queue_api->queue_lookup(name); From d6cff556d65ff35a60aaadeac429a8cca65b6fbe Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 1 Nov 2023 15:47:17 +0200 Subject: [PATCH 184/192] build: merge differences to linux-generic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sync missing changes from odp-linux repository. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- helper/test/Makefile.am | 2 +- platform/linux-generic/m4/configure.m4 | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/helper/test/Makefile.am b/helper/test/Makefile.am index 919585f1c8..80aac10833 100644 --- a/helper/test/Makefile.am +++ b/helper/test/Makefile.am @@ -36,7 +36,7 @@ endif test_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY) -EXTRA_DIST = odpthreads_as_processes odpthreads_as_pthreads +dist_check_SCRIPTS = odpthreads_as_processes odpthreads_as_pthreads chksum_SOURCES = chksum.c cuckootable_SOURCES = cuckootable.c diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4 index 154a00acdd..556f01c19a 100644 --- a/platform/linux-generic/m4/configure.m4 +++ b/platform/linux-generic/m4/configure.m4 @@ -19,7 +19,9 @@ AC_ARG_WITH([pcap], have_pcap=no AS_IF([test "x$with_pcap" != xno], [ODP_PCAP([with_pcap=yes]‚[with_pcap=no])]) +AC_CONFIG_COMMANDS_PRE([dnl AM_CONDITIONAL([ODP_PKTIO_PCAP], [test x$have_pcap = xyes]) +]) m4_include([platform/linux-generic/m4/odp_libconfig.m4]) m4_include([platform/linux-generic/m4/odp_openssl.m4]) From ac767d47f39341da2fd86dcf1c8baaba38f8811c Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 1 Nov 2023 14:30:36 +0200 Subject: [PATCH 185/192] example: switch: start pktio devices before creating workers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As a workaround, start pktio devices before creating workers in odp_switch example application to enable limited DPDK process mode support. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- example/switch/odp_switch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/switch/odp_switch.c b/example/switch/odp_switch.c index b40f5c07c5..ae12b0b11b 100644 --- a/example/switch/odp_switch.c +++ b/example/switch/odp_switch.c @@ -1114,8 +1114,6 @@ int main(int argc, char **argv) thr_param[i].thr_type = ODP_THREAD_WORKER; } - odph_thread_create(thread_tbl, &thr_common, thr_param, num_workers); - /* Start packet receive and transmit */ for (i = 0; i < if_count; ++i) { odp_pktio_t pktio; @@ -1129,6 +1127,8 @@ int main(int argc, char **argv) } } + odph_thread_create(thread_tbl, &thr_common, thr_param, num_workers); + ret = print_speed_stats(num_workers, gbl_args->stats, gbl_args->appl.time, gbl_args->appl.accuracy); odp_atomic_store_u32(&gbl_args->exit_threads, 1); From ecb147cd82af85797d99d762e42ec4b5655a5b2d Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 1 Nov 2023 08:33:29 +0200 Subject: [PATCH 186/192] test: packet_gen: remove memory preallocation from test script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove DPDK memory preallocation option from packet_gen test script to fix running the application in process mode in the CI. The amount of preallocated memory is configured using 'process_mode_memory_mb' config option. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- test/performance/odp_packet_gen_run.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/performance/odp_packet_gen_run.sh b/test/performance/odp_packet_gen_run.sh index f7dc0aa09b..af272f6190 100755 --- a/test/performance/odp_packet_gen_run.sh +++ b/test/performance/odp_packet_gen_run.sh @@ -46,9 +46,8 @@ run_packet_gen() exit $TEST_SKIPPED fi - export ODP_PLATFORM_PARAMS="-m 256 --file-prefix="l2fwd" \ ---proc-type auto --no-pci --vdev net_pcap1,iface=$IF0 \ ---vdev net_pcap2,iface=$IF1" + export ODP_PLATFORM_PARAMS="--no-pci \ +--vdev net_pcap1,iface=$IF0 --vdev net_pcap2,iface=$IF1" # Runs 500 * 10ms = 5 sec # Sends 500 packets through both interfaces => total 1000 packets From 52fa5a646400ba69e6c118bc255ba0778a83407c Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 1 Nov 2023 10:27:45 +0200 Subject: [PATCH 187/192] m4: dpdk: detect dpdk pcap driver availability when using pkg-config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, rte_net_pcap driver was not detected when using pkg-config with DPDK library. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- m4/odp_dpdk.m4 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/m4/odp_dpdk.m4 b/m4/odp_dpdk.m4 index 140debfb04..9871cb537a 100644 --- a/m4/odp_dpdk.m4 +++ b/m4/odp_dpdk.m4 @@ -234,6 +234,13 @@ if test "x$use_pkg_config" = "xyes"; then DPDK_LIBS_LT="$DPDK_LIBS_LIBODP" fi DPDK_LIBS=$DPDK_LIBS_LIBODP + + # Use PKG_CHECK_MODULES_STATIC to look for rte_net_pcap in Libs.private + PKG_CHECK_MODULES_STATIC([DPDK_STATIC], [libdpdk]) + have_pmd_pcap=no + if grep -q "librte_net_pcap" <<< "$DPDK_STATIC_LIBS"; then + have_pmd_pcap=yes + fi fi ]) From be195812c6b0c19d99df56a27a4e022154559611 Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Fri, 27 Oct 2023 15:04:10 +0300 Subject: [PATCH 188/192] linux-dpdk: crypto: implement the null_crypto crypto op param MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for the null_crypto crypto operation parameter. Signed-off-by: Janne Peltonen Reviewed-by: Jere Leppänen --- platform/linux-dpdk/odp_crypto.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_crypto.c index 59854c11f6..aeb9c11e3b 100644 --- a/platform/linux-dpdk/odp_crypto.c +++ b/platform/linux-dpdk/odp_crypto.c @@ -1936,6 +1936,10 @@ static void op_prepare(crypto_op_t *ops[], op->state.status = S_NOP; continue; } + if (odp_unlikely(session->p.null_crypto_enable && param->null_crypto)) { + op->state.status = S_NOP; + continue; + } if (odp_unlikely(linearize_pkt(session, op->state.pkt))) { op->state.status = S_ERROR_LIN; From 36a5601d3a79006cd5dcf98a59466a503861aff3 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Tue, 31 Oct 2023 16:31:41 +0200 Subject: [PATCH 189/192] linux-dpdk: shm: print dpdk memzones in odp_shm_print_all() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Print DPDK memzones in odp_shm_print_all() implementation. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- platform/linux-dpdk/odp_shared_memory.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/linux-dpdk/odp_shared_memory.c b/platform/linux-dpdk/odp_shared_memory.c index 871a22ed76..3987717080 100644 --- a/platform/linux-dpdk/odp_shared_memory.c +++ b/platform/linux-dpdk/odp_shared_memory.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -550,6 +551,10 @@ void odp_shm_print_all(void) } odp_spinlock_unlock(&shm_tbl->lock); + + _ODP_PRINT("\nDPDK memzones\n-------------\n"); + rte_memzone_dump(stdout); + _ODP_PRINT("\n"); } void odp_shm_print(odp_shm_t shm) From 118d2821f732e22e20806a2153a7d327aa643fa0 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Tue, 31 Oct 2023 15:56:47 +0200 Subject: [PATCH 190/192] linux-dpdk: timer: print dpdk timer statistics in odp_timer_pool_print() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Print DPDK global timer statistics in odp_timer_pool_print() implementation. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- platform/linux-dpdk/odp_timer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/linux-dpdk/odp_timer.c b/platform/linux-dpdk/odp_timer.c index 9d30f6929f..aa841ae0ff 100644 --- a/platform/linux-dpdk/odp_timer.c +++ b/platform/linux-dpdk/odp_timer.c @@ -36,6 +36,7 @@ #include #include +#include #include /* One divided by one nanosecond in Hz */ @@ -1397,6 +1398,13 @@ void odp_timer_pool_print(odp_timer_pool_t timer_pool) str[len] = 0; _ODP_PRINT("%s\n", str); + + _ODP_PRINT("DPDK timer statistics\n---------------------\n"); + if (timer_global->use_alternate) + rte_timer_alt_dump_stats(timer_global->data_id, stdout); + else + rte_timer_dump_stats(stdout); + _ODP_PRINT("\n"); } void odp_timer_print(odp_timer_t timer_hdl) From 0f948fc013e643e6da49e7936ffdb31dce63fa20 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Tue, 31 Oct 2023 15:18:11 +0200 Subject: [PATCH 191/192] linux-dpdk: timer: use alternate dpdk timer API by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change alternate DPDK timer API to be the default as this API matches better to the ODP timer API. For example, threads can process timers stared by any other thread. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- .github/workflows/ci-pipeline.yml | 6 +++--- config/odp-linux-dpdk.conf | 4 ++-- .../test/{alternate-timer.conf => default-timer.conf} | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) rename platform/linux-dpdk/test/{alternate-timer.conf => default-timer.conf} (59%) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 81349afcdb..13108c1bf2 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -312,13 +312,13 @@ jobs: - if: ${{ failure() }} uses: ./.github/actions/run-failure-log - Run_alternate_timer: + Run_default_timer: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - run: sudo docker run -i -v `pwd`:/odp --privileged --shm-size 8g -e CC="${CC}" -e ARCH="${ARCH}" - -e ODP_CONFIG_FILE=/odp/platform/linux-dpdk/test/alternate-timer.conf - -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check.sh + -e ODP_CONFIG_FILE=/odp/platform/linux-dpdk/test/default-timer.conf + -e CONF="${CONF}" $CONTAINER_NAMESPACE/odp-ci-${OS}-${ARCH} /odp/scripts/ci/check_validation.sh - if: ${{ failure() }} uses: ./.github/actions/run-failure-log diff --git a/config/odp-linux-dpdk.conf b/config/odp-linux-dpdk.conf index de61303624..e2c64c5b31 100644 --- a/config/odp-linux-dpdk.conf +++ b/config/odp-linux-dpdk.conf @@ -275,8 +275,8 @@ timer: { # accordingly. inline_poll_interval_nsec = 500000 - # Use experimental DPDK alternate timer API based implementation - alternate = 0 + # Use DPDK alternate timer API based implementation + alternate = 1 } ipsec: { diff --git a/platform/linux-dpdk/test/alternate-timer.conf b/platform/linux-dpdk/test/default-timer.conf similarity index 59% rename from platform/linux-dpdk/test/alternate-timer.conf rename to platform/linux-dpdk/test/default-timer.conf index 9cc3a0fc2c..d7930cf8d4 100644 --- a/platform/linux-dpdk/test/alternate-timer.conf +++ b/platform/linux-dpdk/test/default-timer.conf @@ -3,6 +3,6 @@ odp_implementation = "linux-dpdk" config_file_version = "0.1.24" timer: { - # Enable alternate DPDK timer implementation - alternate = 1 + # Use DPDK default timer API based implementation + alternate = 0 } From b99536f95356223e3470ccf2d0039b4b8456b02c Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 1 Nov 2023 15:59:16 +0200 Subject: [PATCH 192/192] test: performance: sync application tests with linux-generic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now when DPDK alternate timer API based timer implementation is the default, the same test applications and options can be run than with ODP linux-generic. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- test/performance/Makefile.am | 4 ++-- test/performance/odp_timer_perf_run.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am index 3fb6da58d8..7b0adbe090 100644 --- a/test/performance/Makefile.am +++ b/test/performance/Makefile.am @@ -15,7 +15,8 @@ EXECUTABLES = odp_atomic_perf \ odp_pool_perf \ odp_queue_perf \ odp_stash_perf \ - odp_random + odp_random \ + odp_stress COMPILE_ONLY = odp_cpu_bench \ odp_crypto \ @@ -29,7 +30,6 @@ COMPILE_ONLY = odp_cpu_bench \ odp_sched_perf \ odp_sched_pktio \ odp_scheduling \ - odp_stress \ odp_timer_perf if LIBCONFIG diff --git a/test/performance/odp_timer_perf_run.sh b/test/performance/odp_timer_perf_run.sh index 4f1cd69777..7738ca91bf 100755 --- a/test/performance/odp_timer_perf_run.sh +++ b/test/performance/odp_timer_perf_run.sh @@ -11,7 +11,7 @@ TEST_DIR="${TEST_DIR:-$(dirname $0)}" echo odp_timer_perf: odp_schedule overhead mode echo =============================================== -$TEST_DIR/odp_timer_perf${EXEEXT} -m 0 -c 1 -s 0 +$TEST_DIR/odp_timer_perf${EXEEXT} -m 0 -c 1 RET_VAL=$? if [ $RET_VAL -ne 0 ]; then @@ -22,7 +22,7 @@ fi echo odp_timer_perf: timer set + cancel mode echo =============================================== -$TEST_DIR/odp_timer_perf${EXEEXT} -m 1 -c 1 -t 10 -R 50 -s 0 +$TEST_DIR/odp_timer_perf${EXEEXT} -m 1 -c 1 -t 10 -R 50 RET_VAL=$? if [ $RET_VAL -ne 0 ]; then