lists.linaro.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2026
September
August
July
June
May
April
March
February
January
2025
December
November
October
September
August
July
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
List overview
Download
git-lng-odp
----- 2026 -----
September 2026
August 2026
July 2026
June 2026
May 2026
April 2026
March 2026
February 2026
January 2026
----- 2025 -----
December 2025
November 2025
October 2025
September 2025
August 2025
July 2025
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
git-lng-odp@lists.linaro.org
1 participants
1241 discussions
Start a n
N
ew thread
[COMMIT] branch master updated. v1.19.0.1_tigermoth-94-g719ac450
by git@git-us.linaro.org
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "". The branch, master has been updated via 719ac4509920bad7d5c8d563426d21f2a0c9e80e (commit) via b1eadcb681dbe7a3d7db4d3ddb18528ebd15211b (commit) via ac851856893867331ab9f692a135a40677daa351 (commit) from 492390a79f20c7aaaf16f232fbd5ecf0d9b700e7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 719ac4509920bad7d5c8d563426d21f2a0c9e80e Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Mon Jun 11 14:57:51 2018 +0300 validation: hash: add generic CRC test cases Added test cases for odp_hash_crc_gen64(). Test cases are defined for 32, 24 and 16 bit CRCs. Tests include various polynoms, init, output XOR and reflection values. Test data is "123456789" for most of the test cases, since that is used commonly as the CRC "check" data. Used CRC names, parameters and check values are listed e.g. here:
http://reveng.sourceforge.net/crc-catalogue
Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/test/validation/api/hash/hash.c b/test/validation/api/hash/hash.c index d3b01548..4edcb08a 100644 --- a/test/validation/api/hash/hash.c +++ b/test/validation/api/hash/hash.c @@ -9,6 +9,10 @@ #include <odp_api.h> #include <odp_cunit_common.h> +/* Commonly used CRC check string */ +#define CHECK_STR "123456789" +#define CHECK_LEN 9 + #define CRC32C_INIT 0xffffffff #define CRC32C_XOR 0xffffffff #define CRC32_INIT 0xffffffff @@ -84,8 +88,7 @@ static const uint8_t test_data_11[] = "abcdefg"; static const uint8_t test_data_12[] = "The five boxing wizards jump quickly."; -/* String of the common "check" value. */ -static const uint8_t test_data_13[] = "123456789"; +static const uint8_t test_data_13[] = CHECK_STR; static const hash_test_vector_t crc32c_test_vector[] = { { .data = test_data_0, @@ -237,9 +240,421 @@ static void hash_test_crc32(void) } } +/* + * Test various commonly used 32 bit CRCs. Used CRC names, parameters and + * check values can be found e.g. here: + *
http://reveng.sourceforge.net/crc-catalogue
+ */ +static void hash_test_crc32_generic(void) +{ + uint64_t result_u64; + uint32_t result_u32, result; + int i, num; + odp_hash_crc_param_t crc_param; + + memset(&crc_param, 0, sizeof(odp_hash_crc_param_t)); + crc_param.width = 32; + crc_param.xor_out = 0; + + /* CRC-32 */ + crc_param.poly = 0x04c11db7; + crc_param.reflect_in = 1; + crc_param.reflect_out = 1; + num = sizeof(crc32_test_vector) / sizeof(hash_test_vector_t); + + for (i = 0; i < num; i++) { + if (odp_hash_crc_gen64(crc32_test_vector[i].data, + crc32_test_vector[i].len, + CRC32_INIT, + &crc_param, &result_u64)) { + printf("CRC-32 not supported\n."); + break; + } + + result_u32 = CRC32_XOR ^ result_u64; + CU_ASSERT(result_u32 == crc32_test_vector[i].result.u32); + } + + /* CRC-32C */ + crc_param.poly = 0x1edc6f41; + crc_param.reflect_in = 1; + crc_param.reflect_out = 1; + num = sizeof(crc32c_test_vector) / sizeof(hash_test_vector_t); + + for (i = 0; i < num; i++) { + if (odp_hash_crc_gen64(crc32c_test_vector[i].data, + crc32c_test_vector[i].len, + CRC32C_INIT, + &crc_param, &result_u64)) { + printf("CRC-32C not supported\n."); + break; + } + + result_u32 = CRC32C_XOR ^ result_u64; + CU_ASSERT(result_u32 == crc32c_test_vector[i].result.u32); + } + + /* CRC-32/AUTOSAR */ + crc_param.poly = 0xf4acfb13; + crc_param.reflect_in = 1; + crc_param.reflect_out = 1; + result = 0x1697d06a; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0xffffffff, + &crc_param, &result_u64) == 0) { + result_u32 = 0xffffffff ^ result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-32/AUTOSAR not supported\n."); + } + + /* CRC-32/BZIP2 */ + crc_param.poly = 0x04c11db7; + crc_param.reflect_in = 0; + crc_param.reflect_out = 0; + result = 0xfc891918; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0xffffffff, + &crc_param, &result_u64) == 0) { + result_u32 = 0xffffffff ^ result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-32/BZIP2 not supported\n."); + } + + /* CRC-32D */ + crc_param.poly = 0xa833982b; + crc_param.reflect_in = 1; + crc_param.reflect_out = 1; + result = 0x87315576; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0xffffffff, + &crc_param, &result_u64) == 0) { + result_u32 = 0xffffffff ^ result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-32D not supported\n."); + } + + /* CRC-32/MPEG-2 */ + crc_param.poly = 0x04c11db7; + crc_param.reflect_in = 0; + crc_param.reflect_out = 0; + result = 0x0376e6e7; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0xffffffff, + &crc_param, &result_u64) == 0) { + result_u32 = 0x0 ^ result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-32/MPEG-2 not supported\n."); + } + + /* CRC-32/POSIX */ + crc_param.poly = 0x04c11db7; + crc_param.reflect_in = 0; + crc_param.reflect_out = 0; + result = 0x765e7680; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0x0, + &crc_param, &result_u64) == 0) { + result_u32 = 0xffffffff ^ result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-32/POSIX not supported\n."); + } + + /* CRC-32/POSIX - with XOR parameter used */ + crc_param.xor_out = 0xffffffff; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0x0, + &crc_param, &result_u64) == 0) { + result_u32 = result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-32/POSIX (with XOR) not supported\n."); + } + + crc_param.xor_out = 0; + + /* CRC-32Q */ + crc_param.poly = 0x814141ab; + crc_param.reflect_in = 0; + crc_param.reflect_out = 0; + result = 0x3010bf7f; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0x0, + &crc_param, &result_u64) == 0) { + result_u32 = 0x0 ^ result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-32Q not supported\n."); + } + + /* CRC-32/JAMCRC */ + crc_param.poly = 0x04c11db7; + crc_param.reflect_in = 1; + crc_param.reflect_out = 1; + result = 0x340bc6d9; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0xffffffff, + &crc_param, &result_u64) == 0) { + result_u32 = 0x0 ^ result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-32/JAMCRC not supported\n."); + } + + /* CRC-32/XFER */ + crc_param.poly = 0x000000af; + crc_param.reflect_in = 0; + crc_param.reflect_out = 0; + result = 0xbd0be338; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0x0, + &crc_param, &result_u64) == 0) { + result_u32 = 0x0 ^ result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-32/XFER not supported\n."); + } +} + +static void hash_test_crc24_generic(void) +{ + uint64_t result_u64; + uint32_t result_u32, result; + odp_hash_crc_param_t crc_param; + + memset(&crc_param, 0, sizeof(odp_hash_crc_param_t)); + crc_param.width = 24; + crc_param.xor_out = 0; + + /* CRC-24 */ + crc_param.poly = 0x864cfb; + crc_param.reflect_in = 0; + crc_param.reflect_out = 0; + result = 0x21cf02; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0xb704ce, + &crc_param, &result_u64) == 0) { + result_u32 = 0x0 ^ result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-24 not supported\n."); + } + + /* CRC-24/FLEXRAY-A */ + crc_param.poly = 0x5d6dcb; + crc_param.reflect_in = 0; + crc_param.reflect_out = 0; + result = 0x7979bd; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0xfedcba, + &crc_param, &result_u64) == 0) { + result_u32 = 0x0 ^ result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-24/FLEXRAY-A not supported\n."); + } + + /* CRC-24/FLEXRAY-B */ + result = 0x1f23b8; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0xabcdef, + &crc_param, &result_u64) == 0) { + result_u32 = 0x0 ^ result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-24/FLEXRAY-B not supported\n."); + } + + /* CRC-24/INTERLAKEN */ + crc_param.poly = 0x328b63; + crc_param.reflect_in = 0; + crc_param.reflect_out = 0; + result = 0xb4f3e6; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0xffffff, + &crc_param, &result_u64) == 0) { + result_u32 = 0xffffff ^ result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-24/INTERLAKEN not supported\n."); + } + + /* CRC-24/LTE-A */ + crc_param.poly = 0x864cfb; + crc_param.reflect_in = 0; + crc_param.reflect_out = 0; + result = 0xcde703; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0x0, + &crc_param, &result_u64) == 0) { + result_u32 = 0x0 ^ result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-24/LTE-A not supported\n."); + } + + /* CRC-24/LTE-B */ + crc_param.poly = 0x800063; + crc_param.reflect_in = 0; + crc_param.reflect_out = 0; + result = 0x23ef52; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0x0, + &crc_param, &result_u64) == 0) { + result_u32 = 0x0 ^ result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-24/LTE-B not supported\n."); + } + + /* CRC-24/BLE */ + crc_param.poly = 0x00065b; + crc_param.reflect_in = 1; + crc_param.reflect_out = 1; + result = 0xc25a56; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0x555555, + &crc_param, &result_u64) == 0) { + result_u32 = 0x0 ^ result_u64; + CU_ASSERT(result_u32 == result); + } else { + printf("CRC-24/BLE not supported\n."); + } +} + +static void hash_test_crc16_generic(void) +{ + uint64_t result_u64; + uint16_t result_u16, result; + odp_hash_crc_param_t crc_param; + + memset(&crc_param, 0, sizeof(odp_hash_crc_param_t)); + crc_param.width = 16; + crc_param.xor_out = 0; + + /* CRC-16/ARC */ + crc_param.poly = 0x8005; + crc_param.reflect_in = 1; + crc_param.reflect_out = 1; + result = 0xbb3d; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0x0, + &crc_param, &result_u64) == 0) { + result_u16 = 0x0 ^ result_u64; + CU_ASSERT(result_u16 == result); + } else { + printf("CRC-16/ARC not supported\n."); + } + + /* CRC-16/UMTS */ + crc_param.poly = 0x8005; + crc_param.reflect_in = 0; + crc_param.reflect_out = 0; + result = 0xfee8; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0x0, + &crc_param, &result_u64) == 0) { + result_u16 = 0x0 ^ result_u64; + CU_ASSERT(result_u16 == result); + } else { + printf("CRC-16/UMTS not supported\n."); + } + + /* CRC-16/CDMA2000 */ + crc_param.poly = 0xc867; + crc_param.reflect_in = 0; + crc_param.reflect_out = 0; + result = 0x4c06; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0xffff, + &crc_param, &result_u64) == 0) { + result_u16 = 0x0 ^ result_u64; + CU_ASSERT(result_u16 == result); + } else { + printf("CRC-16/CDMA2000 not supported\n."); + } + + /* CRC-16/GENIBUS */ + crc_param.poly = 0x1021; + crc_param.reflect_in = 0; + crc_param.reflect_out = 0; + result = 0xd64e; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0xffff, + &crc_param, &result_u64) == 0) { + result_u16 = 0xffff ^ result_u64; + CU_ASSERT(result_u16 == result); + } else { + printf("CRC-16/GENIBUS not supported\n."); + } + + /* CRC-16/T10-DIF */ + crc_param.poly = 0x8bb7; + crc_param.reflect_in = 0; + crc_param.reflect_out = 0; + result = 0xd0db; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0x0, + &crc_param, &result_u64) == 0) { + result_u16 = 0x0 ^ result_u64; + CU_ASSERT(result_u16 == result); + } else { + printf("CRC-16/T10-DIF not supported\n."); + } + + /* CRC-16/USB */ + crc_param.poly = 0x8005; + crc_param.reflect_in = 1; + crc_param.reflect_out = 1; + result = 0xb4c8; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0xffff, + &crc_param, &result_u64) == 0) { + result_u16 = 0xffff ^ result_u64; + CU_ASSERT(result_u16 == result); + } else { + printf("CRC-16/USB not supported\n."); + } + + /* CRC-16/CCITT */ + crc_param.poly = 0x1021; + crc_param.reflect_in = 1; + crc_param.reflect_out = 1; + result = 0x2189; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0x0, + &crc_param, &result_u64) == 0) { + result_u16 = 0x0 ^ result_u64; + CU_ASSERT(result_u16 == result); + } else { + printf("CRC-16/CCITT not supported\n."); + } + + /* CRC-16/X-25 */ + crc_param.poly = 0x1021; + crc_param.reflect_in = 1; + crc_param.reflect_out = 1; + result = 0x906e; + + if (odp_hash_crc_gen64(CHECK_STR, CHECK_LEN, 0xffff, + &crc_param, &result_u64) == 0) { + result_u16 = 0xffff ^ result_u64; + CU_ASSERT(result_u16 == result); + } else { + printf("CRC-16/X25 not supported\n."); + } +} + odp_testinfo_t hash_suite[] = { ODP_TEST_INFO(hash_test_crc32c), ODP_TEST_INFO(hash_test_crc32), + ODP_TEST_INFO(hash_test_crc32_generic), + ODP_TEST_INFO(hash_test_crc24_generic), + ODP_TEST_INFO(hash_test_crc16_generic), ODP_TEST_INFO_NULL, }; commit b1eadcb681dbe7a3d7db4d3ddb18528ebd15211b Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Mon Jun 11 15:41:18 2018 +0300 validation: hash: change result to 32 bit word Set results as 32 bit words. Also polynom is represented as 32 bit word in cpu endian. Majority of references list CRC values in this form (as an exception RFC 7143 lists those in big endian). Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/test/validation/api/hash/hash.c b/test/validation/api/hash/hash.c index 080201af..d3b01548 100644 --- a/test/validation/api/hash/hash.c +++ b/test/validation/api/hash/hash.c @@ -90,118 +90,118 @@ static const uint8_t test_data_13[] = "123456789"; static const hash_test_vector_t crc32c_test_vector[] = { { .data = test_data_0, .len = sizeof(test_data_0), - .result.u8 = {0xaa, 0x36, 0x91, 0x8a} + .result.u32 = 0x8a9136aa }, { .data = test_data_1, .len = sizeof(test_data_1), - .result.u8 = {0x43, 0xab, 0xa8, 0x62} + .result.u32 = 0x62a8ab43 }, { .data = test_data_2, .len = sizeof(test_data_2), - .result.u8 = {0x4e, 0x79, 0xdd, 0x46} + .result.u32 = 0x46dd794e }, { .data = test_data_3, .len = sizeof(test_data_3), - .result.u8 = {0x5c, 0xdb, 0x3f, 0x11} + .result.u32 = 0x113fdb5c }, { .data = test_data_4, .len = sizeof(test_data_4), - .result.u8 = {0x56, 0x3a, 0x96, 0xd9} + .result.u32 = 0xd9963a56 }, { .data = test_data_5, .len = sizeof(test_data_5) - 1, - .result.u8 = {0x31, 0x0a, 0xc8, 0x92} + .result.u32 = 0x92c80a31 }, { .data = test_data_6, .len = sizeof(test_data_6) - 1, - .result.u8 = {0xb7, 0x21, 0x94, 0x0a} + .result.u32 = 0x0a9421b7 }, { .data = test_data_7, .len = sizeof(test_data_7) - 1, - .result.u8 = {0xb3, 0x97, 0x00, 0x19} + .result.u32 = 0x190097b3 }, { .data = test_data_8, .len = sizeof(test_data_8) - 1, - .result.u8 = {0x30, 0x43, 0xd0, 0xc1} + .result.u32 = 0xc1d04330 }, { .data = test_data_9, .len = sizeof(test_data_9) - 1, - .result.u8 = {0x36, 0x29, 0xa2, 0xe2} + .result.u32 = 0xe2a22936 }, { .data = test_data_10, .len = sizeof(test_data_10) - 1, - .result.u8 = {0xb7, 0x3f, 0x4b, 0x36} + .result.u32 = 0x364b3fb7 }, { .data = test_data_11, .len = sizeof(test_data_11) - 1, - .result.u8 = {0x41, 0xf4, 0x27, 0xe6} + .result.u32 = 0xe627f441 }, { .data = test_data_12, .len = sizeof(test_data_12) - 1, - .result.u8 = {0x9a, 0x05, 0xd3, 0xde} + .result.u32 = 0xded3059a }, { .data = test_data_13, .len = sizeof(test_data_13) - 1, - .result.u8 = {0x83, 0x92, 0x06, 0xe3} + .result.u32 = 0xe3069283 } }; static const hash_test_vector_t crc32_test_vector[] = { { .data = test_data_0, .len = sizeof(test_data_0), - .result.u8 = {0xad, 0x55, 0x0a, 0x19} + .result.u32 = 0x190a55ad }, { .data = test_data_1, .len = sizeof(test_data_1), - .result.u8 = {0x0b, 0xab, 0x6c, 0xff} + .result.u32 = 0xff6cab0b }, { .data = test_data_2, .len = sizeof(test_data_2), - .result.u8 = {0x8a, 0x7e, 0x26, 0x91} + .result.u32 = 0x91267e8a }, { .data = test_data_3, .len = sizeof(test_data_3), - .result.u8 = {0x72, 0xef, 0xb0, 0x9a} + .result.u32 = 0x9ab0ef72 }, { .data = test_data_4, .len = sizeof(test_data_4), - .result.u8 = {0x12, 0x74, 0xe1, 0x51} + .result.u32 = 0x51e17412 }, { .data = test_data_5, .len = sizeof(test_data_5) - 1, - .result.u8 = {0x11, 0xcd, 0x82, 0xed} + .result.u32 = 0xed82cd11 }, { .data = test_data_6, .len = sizeof(test_data_6) - 1, - .result.u8 = {0x50, 0x2a, 0xef, 0xae} + .result.u32 = 0xaeef2a50 }, { .data = test_data_7, .len = sizeof(test_data_7) - 1, - .result.u8 = {0xe9, 0x25, 0x90, 0x51} + .result.u32 = 0x519025e9 }, { .data = test_data_8, .len = sizeof(test_data_8) - 1, - .result.u8 = {0x43, 0xbe, 0xb7, 0xe8} + .result.u32 = 0xe8b7be43 }, { .data = test_data_9, .len = sizeof(test_data_9) - 1, - .result.u8 = {0x6d, 0x48, 0x83, 0x9e} + .result.u32 = 0x9e83486d }, { .data = test_data_10, .len = sizeof(test_data_10) - 1, - .result.u8 = {0xc2, 0x41, 0x24, 0x35} + .result.u32 = 0x352441c2 }, { .data = test_data_11, .len = sizeof(test_data_11) - 1, - .result.u8 = {0xa6, 0x6a, 0x2a, 0x31} + .result.u32 = 0x312a6aa6 }, { .data = test_data_12, .len = sizeof(test_data_12) - 1, - .result.u8 = {0xcd, 0x2a, 0x91, 0xde} + .result.u32 = 0xde912acd }, { .data = test_data_13, .len = sizeof(test_data_13) - 1, - .result.u8 = {0x26, 0x39, 0xf4, 0xcb} + .result.u32 = 0xcbf43926 } }; commit ac851856893867331ab9f692a135a40677daa351 Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Mon Jun 11 14:41:54 2018 +0300 linux-gen: hash: generic crc implementation Added implementation of odp_hash_crc_gen64(). CRC widths of 32, 24 and 16 bits are supported. Only symmetric reflection setting (in/out: false/false or true/true) is supported. Currently, 24 bit width with reflection does not work and is marked as not supported. Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 1e617cc3..4d2ea9c4 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -163,6 +163,7 @@ __LIB__libodp_linux_la_SOURCES = \ odp_fdserver.c \ odp_hash_crc32.c \ odp_hash_crc32c.c \ + odp_hash_crc_gen.c \ odp_impl.c \ odp_init.c \ odp_ipsec.c \ diff --git a/platform/linux-generic/include/odp_init_internal.h b/platform/linux-generic/include/odp_init_internal.h index 3619d777..f585ceff 100644 --- a/platform/linux-generic/include/odp_init_internal.h +++ b/platform/linux-generic/include/odp_init_internal.h @@ -83,6 +83,8 @@ int _odp_ipsec_events_term_global(void); int _odp_cpu_cycles_init_global(void); +int _odp_hash_init_global(void); + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/odp_hash_crc_gen.c b/platform/linux-generic/odp_hash_crc_gen.c new file mode 100644 index 00000000..1ea6d8cd --- /dev/null +++ b/platform/linux-generic/odp_hash_crc_gen.c @@ -0,0 +1,222 @@ +/* Copyright (c) 2018, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <stdio.h> +#include <stdint.h> +#include <inttypes.h> +#include <string.h> + +#include <odp/api/hash.h> +#include <odp/api/hints.h> +#include <odp/api/rwlock.h> + +#include <odp_debug_internal.h> +#include <odp_init_internal.h> + +typedef struct crc_table_t { + uint32_t crc[256]; + uint32_t width; + uint32_t poly; + int reflect; + odp_rwlock_t rwlock; + +} crc_table_t; + +static crc_table_t crc_table; + +int _odp_hash_init_global(void) +{ + memset(&crc_table, 0, sizeof(crc_table_t)); + + odp_rwlock_init(&crc_table.rwlock); + + return 0; +} + +/* Reflect bits in a byte */ +static inline uint8_t reflect_u8(uint8_t byte) +{ + uint8_t u8[8]; + + u8[0] = (byte & (0x1 << 7)) >> 7; + u8[1] = (byte & (0x1 << 6)) >> 5; + u8[2] = (byte & (0x1 << 5)) >> 3; + u8[3] = (byte & (0x1 << 4)) >> 1; + + u8[4] = (byte & (0x1 << 3)) << 1; + u8[5] = (byte & (0x1 << 2)) << 3; + u8[6] = (byte & (0x1 << 1)) << 5; + u8[7] = (byte & 0x1) << 7; + + return u8[0] | u8[1] | u8[2] | u8[3] | u8[4] | u8[5] | u8[6] | u8[7]; +} + +/* Reflect 32 bits */ +static inline uint32_t reflect_u32(uint32_t u32) +{ + uint8_t u8[4]; + + u8[0] = reflect_u8((u32 & 0xff000000) >> 24); + u8[1] = reflect_u8((u32 & 0x00ff0000) >> 16); + u8[2] = reflect_u8((u32 & 0x0000ff00) >> 8); + u8[3] = reflect_u8(u32 & 0xff); + + return (u8[3] << 24) | (u8[2] << 16) | (u8[1] << 8) | u8[0]; +} + +/* Reflect 24 bits */ +static inline uint32_t reflect_u24(uint32_t u32) +{ + uint8_t u8[4]; + + u8[0] = reflect_u8((u32 & 0xff0000) >> 16); + u8[1] = reflect_u8((u32 & 0x00ff00) >> 8); + u8[2] = reflect_u8(u32 & 0xff); + + return (u8[2] << 16) | (u8[1] << 8) | u8[0]; +} + +/* Reflect 16 bits */ +static inline uint32_t reflect_u16(uint32_t u32) +{ + uint8_t u8[4]; + + u8[0] = reflect_u8((u32 & 0xff00) >> 8); + u8[1] = reflect_u8(u32 & 0xff); + + return (u8[1] << 8) | u8[0]; +} + +/* Generate table for a 32/24/16 bit CRCs. + * + * Based on an example in RFC 1952. + */ +static inline void crc_table_gen(uint32_t poly, int reflect, int width) +{ + uint32_t i, crc, bit, shift, msb, mask; + + crc_table.width = width; + crc_table.poly = poly; + crc_table.reflect = reflect; + + shift = width - 8; + mask = 0xffffffff >> (32 - width); + msb = 0x1 << (width - 1); + + if (reflect) { + if (width == 32) + poly = reflect_u32(poly); + else if (width == 24) + poly = reflect_u24(poly); + else + poly = reflect_u16(poly); + } + + for (i = 0; i < 256; i++) { + if (reflect) { + crc = i; + + for (bit = 0; bit < 8; bit++) { + if (crc & 0x1) + crc = poly ^ (crc >> 1); + else + crc = crc >> 1; + } + } else { + crc = i << shift; + + for (bit = 0; bit < 8; bit++) { + if (crc & msb) + crc = poly ^ (crc << 1); + else + crc = crc << 1; + } + } + + crc_table.crc[i] = crc & mask; + } +} + +static inline uint32_t crc_calc(const uint8_t *data, uint32_t data_len, + uint32_t init_val, int reflect, int width) +{ + uint32_t i, crc, shift; + uint8_t byte; + uint32_t mask; + + shift = width - 8; + mask = 0xffffffff >> (32 - width); + + crc = init_val; + + for (i = 0; i < data_len; i++) { + byte = data[i]; + + if (reflect) { + crc = crc_table.crc[(crc ^ byte) & 0xff] ^ (crc >> 8); + } else { + crc = crc_table.crc[(crc >> shift) ^ byte] ^ (crc << 8); + crc = crc & mask; + } + } + + return crc; +} + +int odp_hash_crc_gen64(const void *data_ptr, uint32_t data_len, + uint64_t init_val, odp_hash_crc_param_t *crc_param, + uint64_t *crc_out) +{ + uint32_t crc; + int update_table; + uint32_t poly = crc_param->poly; + uint32_t width = crc_param->width; + int reflect = crc_param->reflect_in; + + if (odp_unlikely(crc_param->reflect_in != crc_param->reflect_out)) { + ODP_ERR("Odd reflection setting not supported.\n"); + return -1; + } + + if (odp_unlikely(width != 32 && width != 24 && width != 16)) { + ODP_ERR("CRC width %" PRIu32 " bits not supported.\n", width); + return -1; + } + + /* TODO: fix implementation of 24 bit CRC with reflection */ + if (odp_unlikely(width == 24 && reflect)) { + ODP_ERR("24 bit CRC with reflection not supported.\n"); + return -1; + } + + odp_rwlock_read_lock(&crc_table.rwlock); + + update_table = (crc_table.width != width) || + (crc_table.poly != poly) || + (crc_table.reflect != reflect); + + /* Generate CRC table if not yet generated. */ + if (odp_unlikely(update_table)) { + odp_rwlock_read_unlock(&crc_table.rwlock); + odp_rwlock_write_lock(&crc_table.rwlock); + + crc_table_gen(poly, reflect, width); + } + + crc = crc_calc(data_ptr, data_len, init_val, reflect, width); + + if (odp_unlikely(update_table)) + odp_rwlock_write_unlock(&crc_table.rwlock); + else + odp_rwlock_read_unlock(&crc_table.rwlock); + + if (crc_param->xor_out) + crc = crc ^ (uint32_t)crc_param->xor_out; + + *crc_out = crc; + + return 0; +} diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index b2b75f12..61f99e4d 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -22,6 +22,7 @@ enum init_stage { LIBCONFIG_INIT, CPUMASK_INIT, CPU_CYCLES_INIT, + HASH_INIT, TIME_INIT, SYSINFO_INIT, ISHM_INIT, @@ -174,6 +175,8 @@ static int term_global(enum init_stage stage) } /* Fall through */ + case HASH_INIT: + /* Fall through */ case CPU_CYCLES_INIT: /* Fall through */ case CPUMASK_INIT: @@ -233,6 +236,12 @@ int odp_init_global(odp_instance_t *instance, } stage = CPU_CYCLES_INIT; + if (_odp_hash_init_global()) { + ODP_ERR("ODP hash init failed.\n"); + goto init_failed; + } + stage = HASH_INIT; + if (odp_time_init_global()) { ODP_ERR("ODP time init failed.\n"); goto init_failed; ----------------------------------------------------------------------- Summary of changes: platform/linux-generic/Makefile.am | 1 + platform/linux-generic/include/odp_init_internal.h | 2 + platform/linux-generic/odp_hash_crc_gen.c | 222 ++++++++++ platform/linux-generic/odp_init.c | 9 + test/validation/api/hash/hash.c | 475 +++++++++++++++++++-- 5 files changed, 679 insertions(+), 30 deletions(-) create mode 100644 platform/linux-generic/odp_hash_crc_gen.c hooks/post-receive --
8 years, 2 months
1
0
0
0
[COMMIT] branch api-next updated. v1.19.0.1_tigermoth-91-g492390a7
by git@git-us.linaro.org
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "". The branch, api-next has been updated via 492390a79f20c7aaaf16f232fbd5ecf0d9b700e7 (commit) via 53f3baf58256c085fa230992eb03c896276fc874 (commit) via 7266ca2e44705e550ba7c8c1a71fa373eabd7b99 (commit) via eb021ca3cba9635b861205b2fc94da2a3cdf37bc (commit) via f8136babc5601068ac0f3ab30414a5cbd99388c3 (commit) via a01d17348d6c34457a415935e702a24257adcf8a (commit) via 3e3f0f51da0af53d6161ffa270e1b1c13c88e3e4 (commit) via 61989fee80f613970445e9658979a7b9f58fe9fb (commit) via 30114714f7740b3ee309e0be05e679c7e03816ba (commit) via 40ac22bb63526e9a935d804513204a85a665d13a (commit) via 3239dd418ff3f02924fa71c0b805e709b6b6db63 (commit) via bfc31d006406481c26aa851257d643d480507e2c (commit) via 273fc3e2e0c92bbf22019ea7d686b061d640da78 (commit) via ff723f791449a5ba156a997459844b4be2e2ab82 (commit) via 3daf62015014e70b09ea6fc59d20a5facff4fe6d (commit) via bc2ca16611bdaac49e2ec22ecebe6ba67dd73812 (commit) via d511479f529fa71e76ff0d2941585f7467276982 (commit) via dc3746ac97c0dbb8e7b85de909c7356cc05ee8b9 (commit) via 4a6e7f9c28fe9ad0f90bbfd6d45bcd65b14d15e7 (commit) via ff0e06546eb8fb49f495c819efec984b70d29102 (commit) via 3c449bd75224b543de394bf6444c09cfbc6e104f (commit) via c3c447c96ab63092461dee2bac607f59a21bf8de (commit) via c7bf6a71fe08f3ba8228eced708c9d05496a825a (commit) via a832529f5430e0f60fee792a95a35ce7b2bed25d (commit) via 277cbcf414448fb7fd3fa8171a7cb8ffdcb6262b (commit) via 953246794f041282cb1a59ccf47f9bde6c369069 (commit) via 780d15ced4188a38984c656a9fca58fdd5226735 (commit) via afef45861d081c0722fff71992d45854923c0d0f (commit) via 75a996cfa0f3e2fa8530ea41ea3857eb86ab4b84 (commit) via 482da37abf31dc87fbe9bb28258122fa178cec45 (commit) via 07201e1277cfeb885c7ee2a666575ec9dc8c8d7c (commit) via 617d56864581c2c26dd03158aa5b60c7f845da4c (commit) via ff8eea5c2a9f5283a46376d3bb1bbedd8dd034a4 (commit) via 7cc7193c74553b5f46db482b6d8c7af599d0464a (commit) via 27de124db6343381c25335e611853b487880e9fc (commit) via a3e0a9ddf57e165e682700263f1e0a6e65037c04 (commit) via 9dd6633189cf15ca554cc4ae21996f7db91c6901 (commit) via bcb01a637648278bbbefcd6cdc3014a98de8ed4f (commit) via 8460c9c1b5afab84f4279e6e04cfb1e012965c14 (commit) via 09406916470553a85f30fc14889127443cc4a09b (commit) via ffc3f2bd0059664273425eb0c34411ac5cd88c3e (commit) via 6582ff6158b7e8380536f83da9b0fc25659e3c36 (commit) via fe280bface8fd28a8d0baa3ca95a71f221187fe8 (commit) via bd5112acbb750723958463cf0328ebb15855f7ab (commit) via 06b3650b581bf05ea2f015a02635382fb7c38fda (commit) via 678c2a149a3e7d48c4462fb2e6cc531a3cfed780 (commit) via c6cc6d3a79976bfe96cbb9ff192cf22daffc18c4 (commit) via 2a9d3323537d030c1b3385ed14b496bf9e2b20b3 (commit) via a2fb09b3a4178398a5528eeab2c119cc9a107629 (commit) via b5982d00b9e2ff6fbcb86d8602ca249236c1f06c (commit) via 78b552f62a65c6a873ed021d5579675b4fd84e3a (commit) via 68f26e2a86eb206dcdda9324b20afa208067e6c2 (commit) via 42a8b2f0dbaee653953170cbd0a7fa659bc32b38 (commit) via f4f4dcee96e534c0badc28258ad09ef50b35ec76 (commit) via d6e4b3df266ee1c847763ba50fa802d9e9e62b5e (commit) via bdc44eae6bac8aed26170d21cf05fe99ba9d84d6 (commit) via 170e93051d25ac491811f1ed66cd5552a0b26ec8 (commit) via 744d466a0fe5530bb6c036664413d799a3aeb871 (commit) via 4eb5acde3012effceaaf9af4318d95b02551fffa (commit) via 2315e146e19c937ff407f0a5aa0be1f8de655abf (commit) via 46064619d9bd9d2733089dcff044a9a86277dbdd (commit) via ec41adeed9884621f242c8153612a3f2eaa5bcee (commit) via 758fdf094deae51597b5e9f5f70584c3dba92ff1 (commit) via c5b855df5b9e4388efd387810959b0f81f072fc9 (commit) via 7299adcc939a3d55b2c694744037ea9ea1dd7835 (commit) via 455230a4331e25a1bb68e6fe1c0058bd790c9d9b (commit) via a4d31373e5a0f72d028ff73ca9eae0fd6671f350 (commit) via 37390a88fd35d972a8e399fc934c612c1043ad77 (commit) via 4b895826e62b9b6e7512d76d05999752ffc93432 (commit) via 3ee54c088ec06a65b1ae7ece2dae8cfabfe90d12 (commit) via 9e1aad1fbffad60e849c9cac613e282fd3f80646 (commit) via 1da9bcf69a3f2c364eb1674b44ede4c0cf280f06 (commit) via d61545b5b2ad42d7e9fca34d3b077942fcc04c01 (commit) via f426dbf3b4dc5be7a1b56d9cc3c0dab00eb9787c (commit) via 40699694b24cceb86ed441308309393de84c3478 (commit) via 215069d156f3612ff9e140a7e47232047c6870e6 (commit) via a459233d0ac535d67e3141e21dee3e805c4e906f (commit) via 0e81876e6119fd76282f3de4bb50dad9e67ec6f2 (commit) via 713f9d5dee94b6eb81cdbbb929bf875f414d339c (commit) via 0034b0c0c63194bd7aa227364b381d6b049631dc (commit) via 933a59910b2b95f579dbb11729192ccfcc26bcd7 (commit) via 894b80ee113440037b7899459eeb1c0f5c14b124 (commit) via 0ee8255c2555ed68721ea5e7679f26a2e53bd8b8 (commit) via ad3417a6fd2ba93616b937f9a2d8642eceeb0bf8 (commit) via db62337f2c0a3add91bbdbaa096f2a3c04162c60 (commit) via df1c292ed40d4c2c480917f1eab06a046c93c3b1 (commit) via 49c671e80fd2c88b6f36337ebd1cd4748eb8bae1 (commit) via 11207ff1e211658bfb44c635423ae818a0654239 (commit) via 3abbe8b729310d29b9a2c84a7d7a11771513908d (commit) via f49289a7f621ffe5c981caa8531623d9e0a4abd9 (commit) via cc6d68e1dcf0f4f9b8b7442a4739288892fcb345 (commit) via 332877d51e773a584d272a03f08446d18cbe1634 (commit) via bed462d28fa081a0d66dd29a8034f188256c7d04 (commit) via 2b27f75b587cf23d2687dd37897cbb26ed915890 (commit) via 79781031e28dee010425f575d1bf5de5b18af0d6 (commit) via 7d91fbd6c1a40e378b06f9be6dd3ef260c66dba9 (commit) via d189d704a29f490583057ccb5c762432a4e4b7a7 (commit) via 122b74c0074329f1758b2ed5d241e0e9a790087b (commit) via bd37df82b49faefef078558cdb2a54477bec6c5a (commit) via dea03d0a24117764ea9b8763e640a4836031e82b (commit) via 5c745f55a160b0a72d8e493604917a0d63dd71a5 (commit) via 15a30694560ba62160fa3a8ffddeb51b800e351a (commit) via 27a84cdfc0dfb82e3b86067e473658c091377892 (commit) via 3600304c30c4a345538f6c06ca50183b14cd12b1 (commit) via 4ec4a756c7607e3a78878e6699a82ccf6d0a1461 (commit) via 0f700e1a4b8e66c269081eba64eb5be8c37de868 (commit) via f0d0fd91978a8127ed270b03853ac0e04492a333 (commit) via 2ee48570ed824d5caff4f8cb121b7c293a481820 (commit) via 82499a9a4c80670de20825992478ccd4d764e28c (commit) via c164ad605422f90f3566e4c4ebed0ea3c2adb3a8 (commit) via 53dca8426775ed5bf40f2c2708915f02b2dccc74 (commit) via f69f033da3b6900acdd170668cae07ac6cd959f3 (commit) via 8d957f16105fa44d483478b2c05bae735680c007 (commit) via 5028177e4e795305b514d7164ff882dcf1d3622b (commit) via 24262a9aae62290dfd1a041d0bd5c6943270251d (commit) via 7e355890905a9195ff1027377991b4134e285a03 (commit) via 6947621e1b3a3c73c3ee351325f505e5e191474f (commit) from 29cb860583cb906bc16eddf9a4c98d6bb37333e5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: .codecov.yml | 4 +- .travis.yml | 23 +- CHANGELOG | 124 +++++ Makefile.inc | 1 + configure.ac | 3 +- doc/Makefile.inc | 3 +- doc/users-guide/Makefile.am | 3 +- .../users-guide-utilities-examples.adoc | 19 + doc/users-guide/users-guide.adoc | 2 + example/classifier/odp_classifier.c | 4 +- example/generator/odp_generator.c | 117 ++++- example/ipsec/odp_ipsec.c | 4 +- example/ipsec_api/odp_ipsec.c | 4 +- example/l2fwd_simple/l2fwd_simple_run.sh | 16 +- example/l2fwd_simple/odp_l2fwd_simple.c | 53 +- example/packet/odp_pktio.c | 4 +- example/switch/odp_switch.c | 4 +- example/time/time_global_test.c | 2 +- example/timer/.gitignore | 1 + example/timer/Makefile.am | 13 +- example/timer/odp_timer_accuracy.c | 461 +++++++++++++++++ example/timer/odp_timer_test.c | 4 +- helper/include/odp/helper/threads.h | 75 +-- helper/test/odpthreads.c | 2 +- helper/threads.c | 131 +---- include/odp/api/spec/cpu.h | 3 +- include/odp/arch/x86_32-linux/odp/api/abi/cpu.h | 9 - include/odp/arch/x86_64-linux/odp/api/abi/cpu.h | 5 - m4/odp_dpdk.m4 | 6 + platform/linux-generic/Makefile.am | 80 ++- .../linux-generic/arch/aarch64/odp_global_time.c | 44 +- .../arch/default/odp/api/abi/cpu_inlines.h | 15 + .../arch/default/odp/api/abi/cpu_time.h | 24 + .../linux-generic/arch/default/odp_cpu_cycles.c | 6 + .../linux-generic/arch/default/odp_global_time.c | 12 +- .../linux-generic/arch/default/odp_sysinfo_parse.c | 2 +- .../linux-generic/arch/mips64/odp_cpu_cycles.c | 6 + .../linux-generic/arch/mips64/odp_sysinfo_parse.c | 2 +- .../linux-generic/arch/odp_arch_time_internal.h | 24 - .../linux-generic/arch/powerpc/odp_sysinfo_parse.c | 2 +- platform/linux-generic/arch/x86/cpu_flags.c | 12 +- platform/linux-generic/arch/x86/cpu_flags.h | 1 + platform/linux-generic/arch/x86/odp/api/abi/cpu.h | 10 +- .../arch/x86/odp/api/abi/cpu_inlines.h | 37 ++ .../{odp_cpu_cycles.c => odp/api/abi/cpu_rdtsc.h} | 19 +- .../linux-generic/arch/x86/odp/api/abi/cpu_time.h | 29 ++ platform/linux-generic/arch/x86/odp_cpu_cycles.c | 31 +- platform/linux-generic/arch/x86/odp_global_time.c | 14 +- .../linux-generic/arch/x86/odp_sysinfo_parse.c | 2 +- .../include-abi/odp/api/abi/byteorder.h | 2 - .../linux-generic/include-abi/odp/api/abi/event.h | 3 + .../linux-generic/include-abi/odp/api/abi/packet.h | 2 - .../include-abi/odp/api/abi/packet_flags.h | 1 - .../include-abi/odp/api/abi/packet_io.h | 2 - .../linux-generic/include-abi/odp/api/abi/queue.h | 3 + .../linux-generic/include-abi/odp/api/abi/thread.h | 2 - .../include-abi/odp/api/abi/ticketlock.h | 2 - .../linux-generic/include-abi/odp/api/abi/time.h | 3 + .../include/odp/api/plat/atomic_inlines.h | 75 +++ .../include/odp/api/plat/buffer_inline_types.h | 35 ++ .../include/odp/api/plat/byteorder_inlines.h | 51 +- .../include/odp/api/plat/byteorder_inlines_api.h | 88 ---- .../include/odp/api/plat/cpu_inlines.h | 38 ++ .../include/odp/api/plat/event_inlines.h | 37 ++ .../include/odp/api/plat/packet_flag_inlines.h | 40 +- .../include/odp/api/plat/packet_flag_inlines_api.h | 41 -- .../include/odp/api/plat/packet_inline_types.h | 1 + .../include/odp/api/plat/packet_inlines.h | 155 +++--- .../include/odp/api/plat/packet_inlines_api.h | 186 ------- .../include/odp/api/plat/pktio_inlines.h | 11 +- .../include/odp/api/plat/pktio_inlines_api.h | 31 -- .../include/odp/api/plat/queue_inline_types.h | 35 ++ .../include/odp/api/plat/queue_inlines.h | 36 ++ .../include/odp/api/plat/std_clib_inlines.h | 18 +- .../include/odp/api/plat/sync_inlines.h | 18 +- .../include/odp/api/plat/thread_inlines.h | 16 +- .../include/odp/api/plat/thread_inlines_api.h | 41 -- .../include/odp/api/plat/ticketlock_inlines.h | 67 ++- .../include/odp/api/plat/ticketlock_inlines_api.h | 42 -- .../include/odp/api/plat/time_inlines.h | 101 ++++ .../linux-generic/include/odp_buffer_inlines.h | 40 -- .../linux-generic/include/odp_buffer_internal.h | 14 + .../include/odp_classification_inlines.h | 28 +- .../include/odp_classification_internal.h | 2 +- .../linux-generic/include/odp_debug_internal.h | 2 +- platform/linux-generic/include/odp_ethtool_rss.h | 65 +++ platform/linux-generic/include/odp_ethtool_stats.h | 25 + platform/linux-generic/include/odp_global_data.h | 68 +++ .../{odp_internal.h => odp_init_internal.h} | 86 +--- platform/linux-generic/include/odp_packet_dpdk.h | 82 +-- .../linux-generic/include/odp_packet_internal.h | 24 +- .../linux-generic/include/odp_packet_io_internal.h | 113 +---- .../include/odp_packet_io_ipc_internal.h | 1 - .../linux-generic/include/odp_packet_io_stats.h | 30 ++ .../include/odp_packet_io_stats_common.h | 23 + platform/linux-generic/include/odp_packet_netmap.h | 73 --- platform/linux-generic/include/odp_packet_null.h | 16 - platform/linux-generic/include/odp_packet_socket.h | 113 ----- platform/linux-generic/include/odp_packet_tap.h | 21 - platform/linux-generic/include/odp_pcapng.h | 56 +++ platform/linux-generic/include/odp_queue_if.h | 29 +- .../linux-generic/include/odp_queue_internal.h | 36 +- .../include/odp_queue_scalable_internal.h | 10 +- platform/linux-generic/include/odp_ring_internal.h | 3 + .../linux-generic/include/odp_ring_spsc_internal.h | 124 +++++ platform/linux-generic/include/odp_schedule_if.h | 2 +- .../include/odp_schedule_scalable_ordered.h | 1 - platform/linux-generic/include/odp_socket_common.h | 57 +++ platform/linux-generic/include/odp_sysfs_stats.h | 23 + .../linux-generic/include/odp_sysinfo_internal.h | 26 + .../include/odp_traffic_mngr_internal.h | 3 +- platform/linux-generic/include/protocols/thash.h | 8 +- platform/linux-generic/m4/configure.m4 | 1 + platform/linux-generic/m4/odp_dpdk.m4 | 8 + platform/linux-generic/m4/odp_pcapng.m4 | 18 + platform/linux-generic/odp_atomic_api.c | 2 +- platform/linux-generic/odp_barrier.c | 3 + platform/linux-generic/odp_buffer.c | 12 +- .../{odp_byteorder.c => odp_byteorder_api.c} | 3 +- platform/linux-generic/odp_classification.c | 17 +- platform/linux-generic/odp_cpu.c | 18 - platform/linux-generic/odp_cpu_api.c | 13 + platform/linux-generic/odp_cpumask.c | 2 + platform/linux-generic/odp_crypto.c | 6 +- platform/linux-generic/odp_errno.c | 1 - platform/linux-generic/odp_event.c | 7 +- platform/linux-generic/odp_event_api.c | 13 + platform/linux-generic/odp_fdserver.c | 52 +- platform/linux-generic/odp_hash.c | 491 ------------------ platform/linux-generic/odp_hash_crc32.c | 92 ++++ platform/linux-generic/odp_hash_crc32c.c | 409 +++++++++++++++ platform/linux-generic/odp_init.c | 390 ++++++++------- platform/linux-generic/odp_ipsec.c | 58 +-- platform/linux-generic/odp_ipsec_events.c | 5 +- platform/linux-generic/odp_ipsec_sad.c | 4 + platform/linux-generic/odp_ishm.c | 7 +- platform/linux-generic/odp_ishmphy.c | 3 +- platform/linux-generic/odp_ishmpool.c | 1 - platform/linux-generic/odp_libconfig.c | 4 +- platform/linux-generic/odp_packet.c | 254 ++++++++-- platform/linux-generic/odp_packet_api.c | 8 +- platform/linux-generic/odp_packet_flags.c | 5 - platform/linux-generic/odp_packet_flags_api.c | 5 +- platform/linux-generic/odp_packet_io.c | 108 ++-- platform/linux-generic/odp_pcapng.c | 434 ++++++++++++++++ platform/linux-generic/odp_pktio_api.c | 5 +- platform/linux-generic/odp_pool.c | 8 +- platform/linux-generic/odp_queue_api.c | 13 + platform/linux-generic/odp_queue_basic.c | 168 ++++--- platform/linux-generic/odp_queue_if.c | 16 +- platform/linux-generic/odp_queue_lf.c | 78 ++- platform/linux-generic/odp_queue_scalable.c | 91 ++-- platform/linux-generic/odp_queue_spsc.c | 131 +++++ platform/linux-generic/odp_random.c | 2 +- platform/linux-generic/odp_rwlock.c | 3 + platform/linux-generic/odp_rwlock_recursive.c | 10 +- platform/linux-generic/odp_schedule_basic.c | 17 +- platform/linux-generic/odp_schedule_if.c | 2 +- platform/linux-generic/odp_schedule_iquery.c | 9 +- platform/linux-generic/odp_schedule_scalable.c | 14 +- .../linux-generic/odp_schedule_scalable_ordered.c | 2 + platform/linux-generic/odp_schedule_sp.c | 4 +- platform/linux-generic/odp_shared_memory.c | 3 +- platform/linux-generic/odp_spinlock.c | 2 + platform/linux-generic/odp_spinlock_recursive.c | 6 +- .../{odp_std_clib.c => odp_std_clib_api.c} | 2 +- .../linux-generic/{odp_sync.c => odp_sync_api.c} | 2 +- platform/linux-generic/odp_system_info.c | 4 +- platform/linux-generic/odp_thread.c | 2 +- platform/linux-generic/odp_thread_api.c | 5 +- .../{odp_ticketlock.c => odp_ticketlock_api.c} | 6 +- platform/linux-generic/odp_time.c | 138 ++--- platform/linux-generic/odp_time_api.c | 13 + platform/linux-generic/odp_timer.c | 107 ++-- platform/linux-generic/odp_traffic_mngr.c | 61 ++- platform/linux-generic/odp_weak.c | 1 - platform/linux-generic/pktio/dpdk.c | 260 +++++----- platform/linux-generic/pktio/dpdk_parse.c | 492 ++++++++++++++++++ platform/linux-generic/pktio/ethtool_rss.c | 257 ++++++++++ platform/linux-generic/pktio/ipc.c | 231 +++++---- platform/linux-generic/pktio/loop.c | 49 +- platform/linux-generic/pktio/netmap.c | 169 +++++-- platform/linux-generic/pktio/null.c | 19 +- platform/linux-generic/pktio/pcap.c | 40 +- platform/linux-generic/pktio/pktio_common.c | 73 --- platform/linux-generic/pktio/ring.c | 4 +- platform/linux-generic/pktio/socket.c | 421 ++-------------- platform/linux-generic/pktio/socket_common.c | 143 ++++++ platform/linux-generic/pktio/socket_mmap.c | 85 ++-- .../pktio/{ethtool.c => stats/ethtool_stats.c} | 3 +- .../linux-generic/pktio/stats/packet_io_stats.c | 97 ++++ .../pktio/{sysfs.c => stats/sysfs_stats.c} | 3 +- platform/linux-generic/pktio/tap.c | 59 ++- .../test/mmap_vlan_ins/mmap_vlan_ins.c | 38 +- .../test/mmap_vlan_ins/mmap_vlan_ins.sh | 4 +- platform/linux-generic/test/ring/ring_basic.c | 1 + test/common/odp_cunit_common.c | 3 +- test/performance/.gitignore | 1 + test/performance/Makefile.am | 4 +- test/performance/odp_bench_packet.c | 4 +- test/performance/odp_crypto.c | 30 +- test/performance/odp_ipsec.c | 4 +- test/performance/odp_l2fwd.c | 4 +- test/performance/odp_pktio_ordered.c | 4 +- test/performance/odp_pktio_perf.c | 4 +- test/performance/odp_queue_perf.c | 377 ++++++++++++++ test/performance/odp_sched_latency.c | 3 +- test/performance/odp_sched_pktio.c | 553 +++++++++++++++++---- test/performance/odp_scheduling.c | 40 +- test/validation/api/Makefile.am | 2 +- test/validation/api/crypto/odp_crypto_test_inp.c | 2 + test/validation/api/hash/hash.c | 230 ++++++++- test/validation/api/ipsec/Makefile.am | 2 +- test/validation/api/queue/queue.c | 305 +++++++++++- test/validation/api/scheduler/scheduler.c | 104 ++-- test/validation/api/timer/timer.c | 90 +++- test/validation/api/traffic_mngr/Makefile.am | 5 - test/validation/api/traffic_mngr/traffic_mngr.c | 74 ++- test/validation/api/traffic_mngr/traffic_mngr.sh | 39 -- 219 files changed, 7674 insertions(+), 3896 deletions(-) create mode 100644 doc/users-guide/users-guide-utilities-examples.adoc create mode 100644 example/timer/odp_timer_accuracy.c create mode 100644 platform/linux-generic/arch/default/odp/api/abi/cpu_inlines.h create mode 100644 platform/linux-generic/arch/default/odp/api/abi/cpu_time.h delete mode 100644 platform/linux-generic/arch/odp_arch_time_internal.h create mode 100644 platform/linux-generic/arch/x86/odp/api/abi/cpu_inlines.h copy platform/linux-generic/arch/x86/{odp_cpu_cycles.c => odp/api/abi/cpu_rdtsc.h} (58%) create mode 100644 platform/linux-generic/arch/x86/odp/api/abi/cpu_time.h create mode 100644 platform/linux-generic/include/odp/api/plat/buffer_inline_types.h delete mode 100644 platform/linux-generic/include/odp/api/plat/byteorder_inlines_api.h create mode 100644 platform/linux-generic/include/odp/api/plat/cpu_inlines.h create mode 100644 platform/linux-generic/include/odp/api/plat/event_inlines.h delete mode 100644 platform/linux-generic/include/odp/api/plat/packet_flag_inlines_api.h delete mode 100644 platform/linux-generic/include/odp/api/plat/packet_inlines_api.h delete mode 100644 platform/linux-generic/include/odp/api/plat/pktio_inlines_api.h create mode 100644 platform/linux-generic/include/odp/api/plat/queue_inline_types.h create mode 100644 platform/linux-generic/include/odp/api/plat/queue_inlines.h delete mode 100644 platform/linux-generic/include/odp/api/plat/thread_inlines_api.h delete mode 100644 platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h create mode 100644 platform/linux-generic/include/odp/api/plat/time_inlines.h delete mode 100644 platform/linux-generic/include/odp_buffer_inlines.h create mode 100644 platform/linux-generic/include/odp_ethtool_rss.h create mode 100644 platform/linux-generic/include/odp_ethtool_stats.h create mode 100644 platform/linux-generic/include/odp_global_data.h rename platform/linux-generic/include/{odp_internal.h => odp_init_internal.h} (52%) create mode 100644 platform/linux-generic/include/odp_packet_io_stats.h create mode 100644 platform/linux-generic/include/odp_packet_io_stats_common.h delete mode 100644 platform/linux-generic/include/odp_packet_netmap.h delete mode 100644 platform/linux-generic/include/odp_packet_null.h delete mode 100644 platform/linux-generic/include/odp_packet_tap.h create mode 100644 platform/linux-generic/include/odp_pcapng.h create mode 100644 platform/linux-generic/include/odp_ring_spsc_internal.h create mode 100644 platform/linux-generic/include/odp_socket_common.h create mode 100644 platform/linux-generic/include/odp_sysfs_stats.h create mode 100644 platform/linux-generic/include/odp_sysinfo_internal.h create mode 100644 platform/linux-generic/m4/odp_pcapng.m4 rename platform/linux-generic/{odp_byteorder.c => odp_byteorder_api.c} (79%) delete mode 100644 platform/linux-generic/odp_cpu.c create mode 100644 platform/linux-generic/odp_cpu_api.c create mode 100644 platform/linux-generic/odp_event_api.c delete mode 100644 platform/linux-generic/odp_hash.c create mode 100644 platform/linux-generic/odp_hash_crc32.c create mode 100644 platform/linux-generic/odp_hash_crc32c.c create mode 100644 platform/linux-generic/odp_pcapng.c create mode 100644 platform/linux-generic/odp_queue_api.c create mode 100644 platform/linux-generic/odp_queue_spsc.c rename platform/linux-generic/{odp_std_clib.c => odp_std_clib_api.c} (92%) rename platform/linux-generic/{odp_sync.c => odp_sync_api.c} (91%) rename platform/linux-generic/{odp_ticketlock.c => odp_ticketlock_api.c} (64%) create mode 100644 platform/linux-generic/odp_time_api.c create mode 100644 platform/linux-generic/pktio/dpdk_parse.c create mode 100644 platform/linux-generic/pktio/ethtool_rss.c create mode 100644 platform/linux-generic/pktio/socket_common.c rename platform/linux-generic/pktio/{ethtool.c => stats/ethtool_stats.c} (98%) create mode 100644 platform/linux-generic/pktio/stats/packet_io_stats.c rename platform/linux-generic/pktio/{sysfs.c => stats/sysfs_stats.c} (97%) create mode 100644 test/performance/odp_queue_perf.c delete mode 100755 test/validation/api/traffic_mngr/traffic_mngr.sh hooks/post-receive --
8 years, 2 months
1
0
0
0
[COMMIT] branch master updated. v1.19.0.1_tigermoth-91-g492390a7
by git@git-us.linaro.org
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "". The branch, master has been updated via 492390a79f20c7aaaf16f232fbd5ecf0d9b700e7 (commit) via 53f3baf58256c085fa230992eb03c896276fc874 (commit) via 7266ca2e44705e550ba7c8c1a71fa373eabd7b99 (commit) via eb021ca3cba9635b861205b2fc94da2a3cdf37bc (commit) via f8136babc5601068ac0f3ab30414a5cbd99388c3 (commit) from a01d17348d6c34457a415935e702a24257adcf8a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 492390a79f20c7aaaf16f232fbd5ecf0d9b700e7 Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Fri Jun 15 16:48:26 2018 +0300 validation: queue: pair test Test a pair of queues with two threads. This simple multi-thread test can be executed in all enqueue/dequeue modes, also in single-producer / single-consumer mode. Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/test/validation/api/queue/queue.c b/test/validation/api/queue/queue.c index 20408da5..f009a24b 100644 --- a/test/validation/api/queue/queue.c +++ b/test/validation/api/queue/queue.c @@ -24,6 +24,17 @@ typedef struct { odp_queue_t queue; odp_atomic_u32_t num_event; + struct { + odp_queue_t queue_a; + odp_queue_t queue_b; + int passed_a; + int passed_b; + int burst; + odp_pool_t pool; + odp_barrier_t barrier; + odp_atomic_u32_t counter; + } pair; + struct { uint32_t num_event; } thread[ODP_THREAD_COUNT_MAX]; @@ -349,6 +360,208 @@ static void queue_test_burst_lf_spsc(void) ODP_QUEUE_OP_MT_UNSAFE); } +static int queue_pair_work_loop(void *arg) +{ + uint32_t i, events, burst, retry, max_retry; + odp_buffer_t buf; + odp_event_t ev; + uint32_t *data; + odp_queue_t src_queue, dst_queue; + odp_pool_t pool; + int passed; + int thread_a; + test_globals_t *globals = arg; + + burst = globals->pair.burst; + pool = globals->pair.pool; + + /* Select which thread is A */ + thread_a = odp_atomic_fetch_inc_u32(&globals->pair.counter); + + if (thread_a) { + src_queue = globals->pair.queue_a; + dst_queue = globals->pair.queue_b; + } else { + src_queue = globals->pair.queue_b; + dst_queue = globals->pair.queue_a; + } + + for (i = 0; i < burst; i++) { + buf = odp_buffer_alloc(pool); + CU_ASSERT(buf != ODP_BUFFER_INVALID); + + if (buf == ODP_BUFFER_INVALID) + return -1; + + data = odp_buffer_addr(buf); + *data = i; + ev = odp_buffer_to_event(buf); + CU_ASSERT(odp_queue_enq(dst_queue, ev) == 0); + } + + /* Wait until both threads are ready */ + odp_barrier_wait(&globals->pair.barrier); + events = 0; + retry = 0; + max_retry = 0; + i = 0; + while (events < 10000 && retry < 300) { + ev = odp_queue_deq(src_queue); + if (ev == ODP_EVENT_INVALID) { + retry++; + /* Slow down polling period after 100 retries. This + * gives time for the other thread to answer, if it + * was e.g. interrupted by the OS. We give up if + * the source queue stays empty for about 100ms. */ + if (retry > 200) + odp_time_wait_ns(ODP_TIME_MSEC_IN_NS); + else if (retry > 100) + odp_time_wait_ns(ODP_TIME_USEC_IN_NS); + + if (retry > max_retry) + max_retry = retry; + + continue; + } + + events++; + retry = 0; + buf = odp_buffer_from_event(ev); + data = odp_buffer_addr(buf); + CU_ASSERT(*data == i); + i++; + if (i == burst) + i = 0; + + CU_ASSERT(odp_queue_enq(dst_queue, ev) == 0); + } + + passed = (events == 10000); + + if (thread_a) { + globals->pair.passed_a = passed; + if (max_retry > 100) + printf("\n thread_a max_retry %u\n", max_retry); + } else { + globals->pair.passed_b = passed; + if (max_retry > 100) + printf("\n thread_b max_retry %u\n", max_retry); + } + + return 0; +} + +static void test_pair(odp_nonblocking_t nonblocking, + odp_queue_op_mode_t enq_mode, + odp_queue_op_mode_t deq_mode) +{ + odp_queue_param_t param; + odp_queue_t queue; + odp_queue_capability_t capa; + uint32_t max_burst; + odp_pool_t pool; + odp_event_t ev; + odp_shm_t shm; + test_globals_t *globals; + + shm = odp_shm_lookup(GLOBALS_NAME); + CU_ASSERT_FATAL(shm != ODP_SHM_INVALID); + globals = odp_shm_addr(shm); + + CU_ASSERT_FATAL(odp_queue_capability(&capa) == 0); + + max_burst = 2 * BURST_SIZE; + + if (nonblocking == ODP_NONBLOCKING_LF) { + if (capa.plain.lockfree.max_num == 0) { + printf(" NO LOCKFREE QUEUES. Test skipped.\n"); + return; + } + + if (capa.plain.lockfree.max_size < max_burst) + max_burst = capa.plain.lockfree.max_size; + } else { + if (capa.plain.max_size && capa.plain.max_size < max_burst) + max_burst = capa.plain.max_size; + } + + globals->pair.burst = max_burst / 2; + + pool = odp_pool_lookup("msg_pool"); + CU_ASSERT_FATAL(pool != ODP_POOL_INVALID); + globals->pair.pool = pool; + + odp_queue_param_init(¶m); + param.type = ODP_QUEUE_TYPE_PLAIN; + param.nonblocking = nonblocking; + param.size = max_burst; + param.enq_mode = enq_mode; + param.deq_mode = deq_mode; + + queue = odp_queue_create("queue_a", ¶m); + CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); + globals->pair.queue_a = queue; + CU_ASSERT(odp_queue_deq(queue) == ODP_EVENT_INVALID); + + queue = odp_queue_create("queue_b", ¶m); + CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); + globals->pair.queue_b = queue; + CU_ASSERT(odp_queue_deq(queue) == ODP_EVENT_INVALID); + + odp_barrier_init(&globals->pair.barrier, 2); + globals->pair.passed_a = 0; + globals->pair.passed_b = 0; + odp_atomic_init_u32(&globals->pair.counter, 0); + + /* Create one worker thread */ + globals->cu_thr.numthrds = 1; + odp_cunit_thread_create(queue_pair_work_loop, (pthrd_arg *)globals); + + /* Run this thread as the second thread */ + CU_ASSERT(queue_pair_work_loop(globals) == 0); + + /* Wait worker to terminate */ + odp_cunit_thread_exit((pthrd_arg *)globals); + + CU_ASSERT(globals->pair.passed_a); + CU_ASSERT(globals->pair.passed_b); + + while ((ev = dequeue_event(globals->pair.queue_a)) != ODP_EVENT_INVALID) + odp_event_free(ev); + + while ((ev = dequeue_event(globals->pair.queue_b)) != ODP_EVENT_INVALID) + odp_event_free(ev); + + CU_ASSERT(odp_queue_destroy(globals->pair.queue_a) == 0); + CU_ASSERT(odp_queue_destroy(globals->pair.queue_b) == 0); +} + +static void queue_test_pair(void) +{ + test_pair(ODP_BLOCKING, ODP_QUEUE_OP_MT, ODP_QUEUE_OP_MT); +} + +static void queue_test_pair_spmc(void) +{ + test_pair(ODP_BLOCKING, ODP_QUEUE_OP_MT_UNSAFE, ODP_QUEUE_OP_MT); +} + +static void queue_test_pair_mpsc(void) +{ + test_pair(ODP_BLOCKING, ODP_QUEUE_OP_MT, ODP_QUEUE_OP_MT_UNSAFE); +} + +static void queue_test_pair_spsc(void) +{ + test_pair(ODP_BLOCKING, ODP_QUEUE_OP_MT_UNSAFE, ODP_QUEUE_OP_MT_UNSAFE); +} + +static void queue_test_pair_lf_spsc(void) +{ + test_pair(ODP_NONBLOCKING_LF, ODP_QUEUE_OP_MT_UNSAFE, + ODP_QUEUE_OP_MT_UNSAFE); +} + static void queue_test_param(void) { odp_queue_t queue, null_queue; @@ -727,6 +940,11 @@ odp_testinfo_t queue_suite[] = { ODP_TEST_INFO(queue_test_burst_lf_spmc), ODP_TEST_INFO(queue_test_burst_lf_mpsc), ODP_TEST_INFO(queue_test_burst_lf_spsc), + ODP_TEST_INFO(queue_test_pair), + ODP_TEST_INFO(queue_test_pair_spmc), + ODP_TEST_INFO(queue_test_pair_mpsc), + ODP_TEST_INFO(queue_test_pair_spsc), + ODP_TEST_INFO(queue_test_pair_lf_spsc), ODP_TEST_INFO(queue_test_param), ODP_TEST_INFO(queue_test_info), ODP_TEST_INFO(queue_test_mt_plain_block), commit 53f3baf58256c085fa230992eb03c896276fc874 Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Fri Jun 15 13:22:01 2018 +0300 validation: queue: test enq/deq mode combinations Changed the single thread, lock-free queue test to generic single thread burst enq/deq test. Test all combination enq/deq mode combination with blocking and lock-free queues. Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/test/validation/api/queue/queue.c b/test/validation/api/queue/queue.c index 304de021..20408da5 100644 --- a/test/validation/api/queue/queue.c +++ b/test/validation/api/queue/queue.c @@ -224,7 +224,9 @@ static odp_event_t dequeue_event(odp_queue_t queue) return ev; } -static void queue_test_lockfree(void) +static void test_burst(odp_nonblocking_t nonblocking, + odp_queue_op_mode_t enq_mode, + odp_queue_op_mode_t deq_mode) { odp_queue_param_t param; odp_queue_t queue; @@ -237,12 +239,16 @@ static void queue_test_lockfree(void) CU_ASSERT_FATAL(odp_queue_capability(&capa) == 0); - if (capa.plain.lockfree.max_num == 0) { - printf(" NO LOCKFREE QUEUES. Test skipped.\n"); - return; - } + max_burst = capa.plain.max_size; + + if (nonblocking == ODP_NONBLOCKING_LF) { + if (capa.plain.lockfree.max_num == 0) { + printf(" NO LOCKFREE QUEUES. Test skipped.\n"); + return; + } - max_burst = capa.plain.lockfree.max_size; + max_burst = capa.plain.lockfree.max_size; + } if (max_burst == 0 || max_burst > MAX_NUM_EVENT) max_burst = MAX_NUM_EVENT; @@ -252,10 +258,12 @@ static void queue_test_lockfree(void) odp_queue_param_init(¶m); param.type = ODP_QUEUE_TYPE_PLAIN; - param.nonblocking = ODP_NONBLOCKING_LF; + param.nonblocking = nonblocking; param.size = max_burst; + param.enq_mode = enq_mode; + param.deq_mode = deq_mode; - queue = odp_queue_create("lockfree_queue", ¶m); + queue = odp_queue_create("burst test", ¶m); CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); CU_ASSERT(odp_queue_deq(queue) == ODP_EVENT_INVALID); @@ -299,6 +307,48 @@ static void queue_test_lockfree(void) CU_ASSERT(odp_queue_destroy(queue) == 0); } +static void queue_test_burst(void) +{ + test_burst(ODP_BLOCKING, ODP_QUEUE_OP_MT, ODP_QUEUE_OP_MT); +} + +static void queue_test_burst_spmc(void) +{ + test_burst(ODP_BLOCKING, ODP_QUEUE_OP_MT_UNSAFE, ODP_QUEUE_OP_MT); +} + +static void queue_test_burst_mpsc(void) +{ + test_burst(ODP_BLOCKING, ODP_QUEUE_OP_MT, ODP_QUEUE_OP_MT_UNSAFE); +} + +static void queue_test_burst_spsc(void) +{ + test_burst(ODP_BLOCKING, ODP_QUEUE_OP_MT_UNSAFE, + ODP_QUEUE_OP_MT_UNSAFE); +} + +static void queue_test_burst_lf(void) +{ + test_burst(ODP_NONBLOCKING_LF, ODP_QUEUE_OP_MT, ODP_QUEUE_OP_MT); +} + +static void queue_test_burst_lf_spmc(void) +{ + test_burst(ODP_NONBLOCKING_LF, ODP_QUEUE_OP_MT_UNSAFE, ODP_QUEUE_OP_MT); +} + +static void queue_test_burst_lf_mpsc(void) +{ + test_burst(ODP_NONBLOCKING_LF, ODP_QUEUE_OP_MT, ODP_QUEUE_OP_MT_UNSAFE); +} + +static void queue_test_burst_lf_spsc(void) +{ + test_burst(ODP_NONBLOCKING_LF, ODP_QUEUE_OP_MT_UNSAFE, + ODP_QUEUE_OP_MT_UNSAFE); +} + static void queue_test_param(void) { odp_queue_t queue, null_queue; @@ -669,7 +719,14 @@ static void queue_test_mt_plain_nonblock_lf(void) odp_testinfo_t queue_suite[] = { ODP_TEST_INFO(queue_test_capa), ODP_TEST_INFO(queue_test_mode), - ODP_TEST_INFO(queue_test_lockfree), + ODP_TEST_INFO(queue_test_burst), + ODP_TEST_INFO(queue_test_burst_spmc), + ODP_TEST_INFO(queue_test_burst_mpsc), + ODP_TEST_INFO(queue_test_burst_spsc), + ODP_TEST_INFO(queue_test_burst_lf), + ODP_TEST_INFO(queue_test_burst_lf_spmc), + ODP_TEST_INFO(queue_test_burst_lf_mpsc), + ODP_TEST_INFO(queue_test_burst_lf_spsc), ODP_TEST_INFO(queue_test_param), ODP_TEST_INFO(queue_test_info), ODP_TEST_INFO(queue_test_mt_plain_block), commit 7266ca2e44705e550ba7c8c1a71fa373eabd7b99 Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Fri Jun 15 13:19:49 2018 +0300 test: queue_perf: single producer/consumer option Added option to test queues with single producer/consumer mode set. Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/test/performance/odp_queue_perf.c b/test/performance/odp_queue_perf.c index 521b7271..d5ff254d 100644 --- a/test/performance/odp_queue_perf.c +++ b/test/performance/odp_queue_perf.c @@ -18,6 +18,7 @@ typedef struct test_options_t { uint32_t num_event; uint32_t num_round; odp_nonblocking_t nonblock; + int single; } test_options_t; @@ -33,6 +34,7 @@ static void print_usage(void) " -r, --num_round Number of rounds\n" " -l, --lockfree Lockfree queues\n" " -w, --waitfree Waitfree queues\n" + " -s, --single Single producer, single consumer\n" " -h, --help This help\n" "\n"); } @@ -49,16 +51,18 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) {"num_round", required_argument, NULL, 'r'}, {"lockfree", no_argument, NULL, 'l'}, {"waitfree", no_argument, NULL, 'w'}, + {"single", no_argument, NULL, 's'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0} }; - static const char *shortopts = "+q:e:r:lwh"; + static const char *shortopts = "+q:e:r:lwsh"; test_options->num_queue = 1; test_options->num_event = 1; test_options->num_round = 1000; test_options->nonblock = ODP_BLOCKING; + test_options->single = 0; while (1) { opt = getopt_long(argc, argv, shortopts, longopts, &long_index); @@ -82,6 +86,9 @@ static int parse_options(int argc, char *argv[], test_options_t *test_options) case 'w': test_options->nonblock = ODP_NONBLOCKING_WF; break; + case 's': + test_options->single = 1; + break; case 'h': /* fall through */ default: @@ -210,6 +217,11 @@ static int test_queue(test_options_t *test_options) queue_param.nonblocking = nonblock; queue_param.size = num_event; + if (test_options->single) { + queue_param.enq_mode = ODP_QUEUE_OP_MT_UNSAFE; + queue_param.deq_mode = ODP_QUEUE_OP_MT_UNSAFE; + } + for (i = 0; i < num_queue; i++) { queue[i] = odp_queue_create(NULL, &queue_param); commit eb021ca3cba9635b861205b2fc94da2a3cdf37bc Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Fri Jun 15 10:06:38 2018 +0300 linux-gen: queue_spsc: single-producer, single-consumer queue Simple and lock-free implementation of plain queues when there are only single producer and consumer. Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index eca2ad17..1e617cc3 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -182,6 +182,7 @@ __LIB__libodp_linux_la_SOURCES = \ odp_queue_if.c \ odp_queue_lf.c \ odp_queue_scalable.c \ + odp_queue_spsc.c \ odp_random.c \ odp_rwlock.c \ odp_rwlock_recursive.c \ diff --git a/platform/linux-generic/include/odp_queue_internal.h b/platform/linux-generic/include/odp_queue_internal.h index 6cc6ed28..bb74f729 100644 --- a/platform/linux-generic/include/odp_queue_internal.h +++ b/platform/linux-generic/include/odp_queue_internal.h @@ -23,6 +23,7 @@ extern "C" { #include <odp/api/ticketlock.h> #include <odp_config_internal.h> #include <odp_ring_st_internal.h> +#include <odp_ring_spsc_internal.h> #include <odp_queue_lf.h> #define QUEUE_STATUS_FREE 0 @@ -33,7 +34,10 @@ extern "C" { struct queue_entry_s { odp_ticketlock_t ODP_ALIGNED_CACHE lock; - ring_st_t ring_st; + union { + ring_st_t ring_st; + ring_spsc_t ring_spsc; + }; int status; queue_enq_fn_t ODP_ALIGNED_CACHE enqueue; @@ -48,6 +52,7 @@ struct queue_entry_s { odp_pktin_queue_t pktin; odp_pktout_queue_t pktout; void *queue_lf; + int spsc; char name[ODP_QUEUE_NAME_LEN]; }; @@ -91,6 +96,8 @@ static inline odp_queue_t queue_from_index(uint32_t queue_id) return (odp_queue_t)qentry_from_index(queue_id); } +void queue_spsc_init(queue_entry_t *queue, uint32_t queue_size); + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/odp_queue_basic.c b/platform/linux-generic/odp_queue_basic.c index f7715bc5..f592ef6c 100644 --- a/platform/linux-generic/odp_queue_basic.c +++ b/platform/linux-generic/odp_queue_basic.c @@ -308,7 +308,8 @@ static odp_queue_t queue_create(const char *name, return ODP_QUEUE_INVALID; } - if (param->nonblocking == ODP_NONBLOCKING_LF) { + if (!queue->s.spsc && + param->nonblocking == ODP_NONBLOCKING_LF) { queue_lf_func_t *lf_func; lf_func = &queue_glb->queue_lf_func; @@ -421,7 +422,7 @@ static int queue_destroy(odp_queue_t handle) ODP_ABORT("Unexpected queue status\n"); } - if (queue->s.param.nonblocking == ODP_NONBLOCKING_LF) + if (queue->s.queue_lf) queue_lf_destroy(queue->s.queue_lf); UNLOCK(queue); @@ -658,6 +659,7 @@ static int queue_init(queue_entry_t *queue, const char *name, { uint64_t offset; uint32_t queue_size; + int spsc; if (name == NULL) { queue->s.name[0] = 0; @@ -674,11 +676,6 @@ static int queue_init(queue_entry_t *queue, const char *name, queue->s.type = queue->s.param.type; - queue->s.enqueue = queue_int_enq; - queue->s.dequeue = queue_int_deq; - queue->s.enqueue_multi = queue_int_enq_multi; - queue->s.dequeue_multi = queue_int_deq_multi; - queue->s.pktin = PKTIN_INVALID; queue->s.pktout = PKTOUT_INVALID; @@ -698,8 +695,26 @@ static int queue_init(queue_entry_t *queue, const char *name, offset = queue->s.index * (uint64_t)queue_glb->config.max_queue_size; - ring_st_init(&queue->s.ring_st, &queue_glb->ring_data[offset], - queue_size); + /* Single-producer / single-consumer plain queue has simple and + * lock-free implementation */ + spsc = (param->type == ODP_QUEUE_TYPE_PLAIN) && + (param->enq_mode == ODP_QUEUE_OP_MT_UNSAFE) && + (param->deq_mode == ODP_QUEUE_OP_MT_UNSAFE); + + queue->s.spsc = spsc; + queue->s.queue_lf = NULL; + + if (spsc) { + queue_spsc_init(queue, queue_size); + } else { + queue->s.enqueue = queue_int_enq; + queue->s.dequeue = queue_int_deq; + queue->s.enqueue_multi = queue_int_enq_multi; + queue->s.dequeue_multi = queue_int_deq_multi; + + ring_st_init(&queue->s.ring_st, &queue_glb->ring_data[offset], + queue_size); + } return 0; } diff --git a/platform/linux-generic/odp_queue_spsc.c b/platform/linux-generic/odp_queue_spsc.c new file mode 100644 index 00000000..f8b04ca2 --- /dev/null +++ b/platform/linux-generic/odp_queue_spsc.c @@ -0,0 +1,131 @@ +/* Copyright (c) 2018, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ +#include <string.h> +#include <stdio.h> + +#include <odp_queue_internal.h> +#include <odp_pool_internal.h> + +#include "config.h" +#include <odp_debug_internal.h> + +static inline void buffer_index_from_buf(uint32_t buffer_index[], + odp_buffer_hdr_t *buf_hdr[], int num) +{ + int i; + + for (i = 0; i < num; i++) + buffer_index[i] = buf_hdr[i]->index.u32; +} + +static inline void buffer_index_to_buf(odp_buffer_hdr_t *buf_hdr[], + uint32_t buffer_index[], int num) +{ + int i; + + for (i = 0; i < num; i++) { + buf_hdr[i] = buf_hdr_from_index_u32(buffer_index[i]); + odp_prefetch(buf_hdr[i]); + } +} + +static inline int spsc_enq_multi(void *q_int, odp_buffer_hdr_t *buf_hdr[], + int num) +{ + queue_entry_t *queue; + ring_spsc_t *ring_spsc; + uint32_t buf_idx[num]; + + queue = q_int; + ring_spsc = &queue->s.ring_spsc; + + buffer_index_from_buf(buf_idx, buf_hdr, num); + + if (odp_unlikely(queue->s.status < QUEUE_STATUS_READY)) { + ODP_ERR("Bad queue status\n"); + return -1; + } + + return ring_spsc_enq_multi(ring_spsc, buf_idx, num); +} + +static inline int spsc_deq_multi(void *q_int, odp_buffer_hdr_t *buf_hdr[], + int num) +{ + queue_entry_t *queue; + int num_deq; + ring_spsc_t *ring_spsc; + uint32_t buf_idx[num]; + + queue = q_int; + ring_spsc = &queue->s.ring_spsc; + + if (odp_unlikely(queue->s.status < QUEUE_STATUS_READY)) { + /* Bad queue, or queue has been destroyed. */ + return -1; + } + + num_deq = ring_spsc_deq_multi(ring_spsc, buf_idx, num); + + if (num_deq == 0) + return 0; + + buffer_index_to_buf(buf_hdr, buf_idx, num_deq); + + return num_deq; +} + +static int queue_spsc_enq_multi(void *q_int, odp_buffer_hdr_t *buf_hdr[], + int num) +{ + return spsc_enq_multi(q_int, buf_hdr, num); +} + +static int queue_spsc_enq(void *q_int, odp_buffer_hdr_t *buf_hdr) +{ + int ret; + + ret = spsc_enq_multi(q_int, &buf_hdr, 1); + + if (ret == 1) + return 0; + else + return -1; +} + +static int queue_spsc_deq_multi(void *q_int, odp_buffer_hdr_t *buf_hdr[], + int num) +{ + return spsc_deq_multi(q_int, buf_hdr, num); +} + +static odp_buffer_hdr_t *queue_spsc_deq(void *q_int) +{ + odp_buffer_hdr_t *buf_hdr = NULL; + int ret; + + ret = spsc_deq_multi(q_int, &buf_hdr, 1); + + if (ret == 1) + return buf_hdr; + else + return NULL; +} + +void queue_spsc_init(queue_entry_t *queue, uint32_t queue_size) +{ + uint64_t offset; + + queue->s.enqueue = queue_spsc_enq; + queue->s.dequeue = queue_spsc_deq; + queue->s.enqueue_multi = queue_spsc_enq_multi; + queue->s.dequeue_multi = queue_spsc_deq_multi; + + offset = queue->s.index * (uint64_t)queue_glb->config.max_queue_size; + + ring_spsc_init(&queue->s.ring_spsc, &queue_glb->ring_data[offset], + queue_size); +} commit f8136babc5601068ac0f3ab30414a5cbd99388c3 Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Thu Jun 14 13:51:39 2018 +0300 linux-gen: ring_spsc: single-producer, single-consumer ring This ring can be used to implement (lock-free) queues when there is only single (concurrent) producer and consumer. SP/SC limitation enables very simple synchronization and thus good performance. Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 6ccc284f..eca2ad17 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -127,6 +127,7 @@ noinst_HEADERS = \ include/odp_queue_lf.h \ include/odp_queue_scalable_internal.h \ include/odp_ring_internal.h \ + include/odp_ring_spsc_internal.h \ include/odp_ring_st_internal.h \ include/odp_schedule_if.h \ include/odp_schedule_scalable_config.h \ diff --git a/platform/linux-generic/include/odp_ring_spsc_internal.h b/platform/linux-generic/include/odp_ring_spsc_internal.h new file mode 100644 index 00000000..e38bda1d --- /dev/null +++ b/platform/linux-generic/include/odp_ring_spsc_internal.h @@ -0,0 +1,124 @@ +/* Copyright (c) 2018, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_RING_SPSC_INTERNAL_H_ +#define ODP_RING_SPSC_INTERNAL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <stdint.h> + +#include <odp/api/atomic.h> +#include <odp/api/plat/atomic_inlines.h> + +/* Lock-free ring for single-producer / single-consumer usage. + * + * Thread doing an operation may be different each time, but the same operation + * (enq- or dequeue) must not be called concurrently. The next thread may call + * the same operation only when it's sure that the previous thread have returned + * from the call, or will never return back to finish the call when interrupted + * during the call. + * + * Enqueue and dequeue operations can be done concurrently. + */ +typedef struct { + odp_atomic_u32_t head; + odp_atomic_u32_t tail; + uint32_t mask; + uint32_t *data; + +} ring_spsc_t; + +/* Initialize ring. Ring size must be a power of two. */ +static inline void ring_spsc_init(ring_spsc_t *ring, uint32_t *data, + uint32_t size) +{ + odp_atomic_init_u32(&ring->head, 0); + odp_atomic_init_u32(&ring->tail, 0); + ring->mask = size - 1; + ring->data = data; +} + +/* Dequeue data from the ring head. Max_num is smaller than ring size.*/ +static inline uint32_t ring_spsc_deq_multi(ring_spsc_t *ring, uint32_t data[], + uint32_t max_num) +{ + uint32_t head, tail, mask, idx; + uint32_t num, i; + + tail = odp_atomic_load_acq_u32(&ring->tail); + head = odp_atomic_load_u32(&ring->head); + mask = ring->mask; + num = tail - head; + + /* Empty */ + if (num == 0) + return 0; + + if (num > max_num) + num = max_num; + + idx = head & mask; + + for (i = 0; i < num; i++) { + data[i] = ring->data[idx]; + idx = (idx + 1) & mask; + } + + odp_atomic_store_rel_u32(&ring->head, head + num); + + return num; +} + +/* Enqueue data into the ring tail. Num_data is smaller than ring size. */ +static inline uint32_t ring_spsc_enq_multi(ring_spsc_t *ring, + const uint32_t data[], + uint32_t num_data) +{ + uint32_t head, tail, mask, size, idx; + uint32_t num, i; + + head = odp_atomic_load_acq_u32(&ring->head); + tail = odp_atomic_load_u32(&ring->tail); + mask = ring->mask; + size = mask + 1; + num = size - (tail - head); + + /* Full */ + if (num == 0) + return 0; + + if (num > num_data) + num = num_data; + + idx = tail & mask; + + for (i = 0; i < num; i++) { + ring->data[idx] = data[i]; + idx = (idx + 1) & mask; + } + + odp_atomic_store_rel_u32(&ring->tail, tail + num); + + return num; +} + +/* Check if ring is empty */ +static inline int ring_spsc_is_empty(ring_spsc_t *ring) +{ + uint32_t head = odp_atomic_load_u32(&ring->head); + uint32_t tail = odp_atomic_load_u32(&ring->tail); + + return head == tail; +} + +#ifdef __cplusplus +} +#endif + +#endif ----------------------------------------------------------------------- Summary of changes: platform/linux-generic/Makefile.am | 2 + .../linux-generic/include/odp_queue_internal.h | 9 +- .../linux-generic/include/odp_ring_spsc_internal.h | 124 +++++++++ platform/linux-generic/odp_queue_basic.c | 33 ++- platform/linux-generic/odp_queue_spsc.c | 131 +++++++++ test/performance/odp_queue_perf.c | 14 +- test/validation/api/queue/queue.c | 293 ++++++++++++++++++++- 7 files changed, 586 insertions(+), 20 deletions(-) create mode 100644 platform/linux-generic/include/odp_ring_spsc_internal.h create mode 100644 platform/linux-generic/odp_queue_spsc.c hooks/post-receive --
8 years, 2 months
1
0
0
0
[COMMIT] branch master updated. v1.19.0.1_tigermoth-86-ga01d1734
by git@git-us.linaro.org
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "". The branch, master has been updated via a01d17348d6c34457a415935e702a24257adcf8a (commit) from 3e3f0f51da0af53d6161ffa270e1b1c13c88e3e4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a01d17348d6c34457a415935e702a24257adcf8a Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Fri Jun 15 10:41:54 2018 +0300 example: timer_accuracy: convert full nsec time to ticks Calculate timeout values in nsec instead of ticks to avoid (accumulating) rounding error caused by nsec to tick conversion. Fixes bug
https://bugs.linaro.org/show_bug.cgi?id=3787
, timeouts are received consistently with different resolution values. Suggested-by: Josep Puigdemont <josep.puigdemont(a)linaro.org> Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/example/timer/odp_timer_accuracy.c b/example/timer/odp_timer_accuracy.c index f1a088cb..3b0d7e38 100644 --- a/example/timer/odp_timer_accuracy.c +++ b/example/timer/odp_timer_accuracy.c @@ -111,8 +111,8 @@ 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 tick, first_tick, period_tick, offset_tick; - uint64_t period_ns, res_ns, first_ns, res_capa; + uint64_t tick, start_tick; + uint64_t period_ns, res_ns, start_ns, time_ns, res_capa; odp_event_t event; odp_timeout_t timeout; odp_timer_set_t ret; @@ -204,9 +204,6 @@ static int start_timers(test_global_t *test_global) odp_timer_pool_start(); test_global->timer_pool = timer_pool; - first_tick = 0; - offset_tick = odp_timer_ns_to_tick(timer_pool, START_OFFSET_NS); - period_tick = odp_timer_ns_to_tick(timer_pool, period_ns); for (i = 0; i < num; i++) { timer = odp_timer_alloc(timer_pool, queue, NULL); @@ -219,6 +216,8 @@ static int start_timers(test_global_t *test_global) test_global->timer[i] = timer; } + start_tick = 0; + for (i = 0; i < num; i++) { timer = test_global->timer[i]; @@ -231,13 +230,14 @@ static int start_timers(test_global_t *test_global) event = odp_timeout_to_event(timeout); if (i == 0) { - first_tick = odp_timer_current_tick(timer_pool); + start_tick = odp_timer_current_tick(timer_pool); time = odp_time_local(); - first_ns = odp_time_to_ns(time); - test_global->first_ns = first_ns + START_OFFSET_NS; + start_ns = odp_time_to_ns(time); + test_global->first_ns = start_ns + START_OFFSET_NS; } - tick = first_tick + offset_tick + (i * period_tick); + time_ns = test_global->first_ns + (i * period_ns); + tick = start_tick + odp_timer_ns_to_tick(timer_pool, time_ns); ret = odp_timer_set_abs(timer, tick, &event); if (ret != ODP_TIMER_SUCCESS) { ----------------------------------------------------------------------- Summary of changes: example/timer/odp_timer_accuracy.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) hooks/post-receive --
8 years, 2 months
1
0
0
0
[COMMIT] branch master updated. v1.19.0.1_tigermoth-85-g3e3f0f51
by git@git-us.linaro.org
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "". The branch, master has been updated via 3e3f0f51da0af53d6161ffa270e1b1c13c88e3e4 (commit) from 61989fee80f613970445e9658979a7b9f58fe9fb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3e3f0f51da0af53d6161ffa270e1b1c13c88e3e4 Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Wed Jun 13 13:12:50 2018 +0300 linux-gen: hash: table based crc32 implementation Remove dependency to zlib and use own table based implementation of crc32. The table was generated with odp_hash_crc_gen64() code (printed the table it generates internally). Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/DEPENDENCIES b/DEPENDENCIES index 0b0810e8..48f5a839 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -19,7 +19,7 @@ Prerequisites for building the OpenDataPlane (ODP) API 3. Required packages - Libraries currently required to link: openssl, libatomic, libconfig, zlib + Libraries currently required to link: openssl, libatomic, libconfig 3.1 OpenSSL native compile diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 6fb0fb32..6ccc284f 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -328,7 +328,6 @@ __LIB__libodp_linux_la_LIBADD += $(LIBCONFIG_LIBS) __LIB__libodp_linux_la_LIBADD += $(DPDK_LIBS_LIBODP) __LIB__libodp_linux_la_LIBADD += $(PTHREAD_LIBS) __LIB__libodp_linux_la_LIBADD += $(TIMER_LIBS) -__LIB__libodp_linux_la_LIBADD += $(ZLIB_LIBS) if HAVE_PCAP __LIB__libodp_linux_la_LIBADD += $(PCAP_LIBS) diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4 index 155dea21..951704ed 100644 --- a/platform/linux-generic/m4/configure.m4 +++ b/platform/linux-generic/m4/configure.m4 @@ -11,7 +11,6 @@ m4_include([platform/linux-generic/m4/odp_pcap.m4]) m4_include([platform/linux-generic/m4/odp_pcapng.m4]) m4_include([platform/linux-generic/m4/odp_netmap.m4]) m4_include([platform/linux-generic/m4/odp_dpdk.m4]) -m4_include([platform/linux-generic/m4/odp_zlib.m4]) ODP_SCHEDULER m4_include([platform/linux-generic/m4/performance.m4]) diff --git a/platform/linux-generic/m4/odp_zlib.m4 b/platform/linux-generic/m4/odp_zlib.m4 deleted file mode 100644 index cde9df1a..00000000 --- a/platform/linux-generic/m4/odp_zlib.m4 +++ /dev/null @@ -1,10 +0,0 @@ -######################################################################### -# Check for libz availability -######################################################################### - -AC_CHECK_HEADERS([zlib.h]) - -ZLIB_LIBS="-lz" - -AC_SUBST([ZLIB_LIBS]) - diff --git a/platform/linux-generic/odp_hash_crc32.c b/platform/linux-generic/odp_hash_crc32.c index 27c06db1..4f741fe4 100644 --- a/platform/linux-generic/odp_hash_crc32.c +++ b/platform/linux-generic/odp_hash_crc32.c @@ -5,17 +5,88 @@ */ #include <stdint.h> -#include <zlib.h> #include <odp/api/hash.h> +#include <odp/api/align.h> -uint32_t odp_hash_crc32(const void *data, uint32_t data_len, uint32_t init_val) +/* Table generated with odp_hash_crc_gen64() */ +static const uint32_t ODP_ALIGNED_CACHE crc32_table[256] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d +}; + +uint32_t odp_hash_crc32(const void *data_ptr, uint32_t data_len, + uint32_t init_val) { - uLong crc; + uint32_t i, crc; + const uint8_t *byte = data_ptr; + + crc = init_val; - /* Zlib function XORs input and output crc values with all ones. - * Cancel out XORing as ODP API does not specify it. */ - crc = crc32((uLong)(init_val ^ 0xffffffff), data, data_len); + for (i = 0; i < data_len; i++) + crc = crc32_table[(crc ^ byte[i]) & 0xff] ^ (crc >> 8); - return crc ^ 0xffffffff; + return crc; } ----------------------------------------------------------------------- Summary of changes: DEPENDENCIES | 2 +- platform/linux-generic/Makefile.am | 1 - platform/linux-generic/m4/configure.m4 | 1 - platform/linux-generic/m4/odp_zlib.m4 | 10 ---- platform/linux-generic/odp_hash_crc32.c | 85 ++++++++++++++++++++++++++++++--- 5 files changed, 79 insertions(+), 20 deletions(-) delete mode 100644 platform/linux-generic/m4/odp_zlib.m4 hooks/post-receive --
8 years, 2 months
1
0
0
0
[COMMIT] branch master updated. v1.19.0.1_tigermoth-84-g61989fee
by git@git-us.linaro.org
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "". The branch, master has been updated via 61989fee80f613970445e9658979a7b9f58fe9fb (commit) via 30114714f7740b3ee309e0be05e679c7e03816ba (commit) from 40ac22bb63526e9a935d804513204a85a665d13a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 61989fee80f613970445e9658979a7b9f58fe9fb Author: Bogdan Pricope <bogdan.pricope(a)linaro.org> Date: Fri Jun 8 16:44:49 2018 +0300 linux-gen: pktio: move pktio socket stats to a new file Cleanup pktio code by moving socket stats functions to a new file. Signed-off-by: Bogdan Pricope <bogdan.pricope(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index b730a92e..6fb0fb32 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -113,6 +113,8 @@ noinst_HEADERS = \ include/odp_packet_io_ring_internal.h \ include/odp_packet_socket.h \ include/odp_socket_common.h \ + include/odp_packet_io_stats_common.h \ + include/odp_packet_io_stats.h \ include/odp_sysfs_stats.h \ include/odp_ethtool_stats.h \ include/odp_ethtool_rss.h \ @@ -204,6 +206,7 @@ __LIB__libodp_linux_la_SOURCES = \ odp_weak.c \ pktio/stats/ethtool_stats.c \ pktio/stats/sysfs_stats.c \ + pktio/stats/packet_io_stats.c \ pktio/dpdk.c \ pktio/dpdk_parse.c \ pktio/socket_common.c \ diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 776a8442..d2446d19 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -26,6 +26,7 @@ extern "C" { #include <odp_align_internal.h> #include <odp_debug_internal.h> #include <odp_packet_io_ring_internal.h> +#include <odp_packet_io_stats_common.h> #include <odp_queue_if.h> #include <odp_config_internal.h> @@ -89,11 +90,7 @@ struct pktio_entry { classifier_t cls; /**< classifier linked with this pktio*/ odp_pktio_stats_t stats; /**< statistic counters for pktio */ odp_proto_chksums_t in_chksums; /**< Checksums validation settings */ - enum { - STATS_SYSFS = 0, - STATS_ETHTOOL, - STATS_UNSUPPORTED - } stats_type; + pktio_stats_type_t stats_type; char name[PKTIO_NAME_LEN]; /**< name of pktio provided to pktio_open() */ @@ -221,11 +218,6 @@ extern const pktio_if_ops_t null_pktio_ops; extern const pktio_if_ops_t ipc_pktio_ops; extern const pktio_if_ops_t * const pktio_if_ops[]; -int sock_stats_fd(pktio_entry_t *pktio_entry, - odp_pktio_stats_t *stats, - int fd); -int sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd); - /** * Try interrupt-driven receive * diff --git a/platform/linux-generic/include/odp_packet_io_stats.h b/platform/linux-generic/include/odp_packet_io_stats.h new file mode 100644 index 00000000..4ed46e0a --- /dev/null +++ b/platform/linux-generic/include/odp_packet_io_stats.h @@ -0,0 +1,30 @@ +/* Copyright (c) 2018, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_PACKET_IO_STATS_H_ +#define ODP_PACKET_IO_STATS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/api/std_types.h> +#include <odp/api/packet_io.h> +#include <odp/api/packet_io_stats.h> +#include <odp_packet_io_internal.h> +#include <odp_packet_io_stats_common.h> + +int sock_stats_fd(pktio_entry_t *pktio_entry, + odp_pktio_stats_t *stats, + int fd); +int sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd); + +pktio_stats_type_t sock_stats_type_fd(pktio_entry_t *pktio_entry, int fd); + +#ifdef __cplusplus +} +#endif +#endif /* ODP_PACKET_IO_STATS_H_ */ diff --git a/platform/linux-generic/include/odp_packet_io_stats_common.h b/platform/linux-generic/include/odp_packet_io_stats_common.h new file mode 100644 index 00000000..19bd7c44 --- /dev/null +++ b/platform/linux-generic/include/odp_packet_io_stats_common.h @@ -0,0 +1,23 @@ +/* Copyright (c) 2018, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_PACKET_IO_STATS_COMMON_H_ +#define ODP_PACKET_IO_STATS_COMMON_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + STATS_SYSFS = 0, + STATS_ETHTOOL, + STATS_UNSUPPORTED +} pktio_stats_type_t; + +#ifdef __cplusplus +} +#endif +#endif /* ODP_PACKET_IO_STATS_COMMON_H_ */ diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c index 6333847d..0da2b7af 100644 --- a/platform/linux-generic/pktio/netmap.c +++ b/platform/linux-generic/pktio/netmap.c @@ -16,6 +16,7 @@ #include <odp/api/plat/time_inlines.h> #include <odp_packet_io_internal.h> +#include <odp_packet_io_stats.h> #include <odp_ethtool_stats.h> #include <odp_ethtool_rss.h> #include <odp_socket_common.h> diff --git a/platform/linux-generic/pktio/pktio_common.c b/platform/linux-generic/pktio/pktio_common.c index ca297fd5..f0abadd1 100644 --- a/platform/linux-generic/pktio/pktio_common.c +++ b/platform/linux-generic/pktio/pktio_common.c @@ -8,83 +8,8 @@ #include "config.h" #include <odp_packet_io_internal.h> -#include <odp_ethtool_stats.h> -#include <odp_sysfs_stats.h> -#include <odp_classification_internal.h> #include <errno.h> -int sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd) -{ - int err = 0; - odp_pktio_stats_t cur_stats; - - if (pktio_entry->s.stats_type == STATS_UNSUPPORTED) { - memset(&pktio_entry->s.stats, 0, - sizeof(odp_pktio_stats_t)); - return 0; - } - - memset(&cur_stats, 0, sizeof(odp_pktio_stats_t)); - - if (pktio_entry->s.stats_type == STATS_ETHTOOL) { - (void)ethtool_stats_get_fd(fd, - pktio_entry->s.name, - &cur_stats); - } else if (pktio_entry->s.stats_type == STATS_SYSFS) { - err = sysfs_stats(pktio_entry, &cur_stats); - if (err != 0) - ODP_ERR("stats error\n"); - } - - if (err == 0) - memcpy(&pktio_entry->s.stats, &cur_stats, - sizeof(odp_pktio_stats_t)); - - return err; -} - -int sock_stats_fd(pktio_entry_t *pktio_entry, - odp_pktio_stats_t *stats, - int fd) -{ - odp_pktio_stats_t cur_stats; - int ret = 0; - - if (pktio_entry->s.stats_type == STATS_UNSUPPORTED) - return 0; - - memset(&cur_stats, 0, sizeof(odp_pktio_stats_t)); - if (pktio_entry->s.stats_type == STATS_ETHTOOL) { - (void)ethtool_stats_get_fd(fd, - pktio_entry->s.name, - &cur_stats); - } else if (pktio_entry->s.stats_type == STATS_SYSFS) { - sysfs_stats(pktio_entry, &cur_stats); - } - - stats->in_octets = cur_stats.in_octets - - pktio_entry->s.stats.in_octets; - stats->in_ucast_pkts = cur_stats.in_ucast_pkts - - pktio_entry->s.stats.in_ucast_pkts; - stats->in_discards = cur_stats.in_discards - - pktio_entry->s.stats.in_discards; - stats->in_errors = cur_stats.in_errors - - pktio_entry->s.stats.in_errors; - stats->in_unknown_protos = cur_stats.in_unknown_protos - - pktio_entry->s.stats.in_unknown_protos; - - stats->out_octets = cur_stats.out_octets - - pktio_entry->s.stats.out_octets; - stats->out_ucast_pkts = cur_stats.out_ucast_pkts - - pktio_entry->s.stats.out_ucast_pkts; - stats->out_discards = cur_stats.out_discards - - pktio_entry->s.stats.out_discards; - stats->out_errors = cur_stats.out_errors - - pktio_entry->s.stats.out_errors; - - return ret; -} - static int sock_recv_mq_tmo_select(pktio_entry_t * const *entry, const int index[], unsigned num_q, unsigned *from, diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index 97a063c7..cee97f2c 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -39,8 +39,7 @@ #include <odp_socket_common.h> #include <odp_packet_internal.h> #include <odp_packet_io_internal.h> -#include <odp_ethtool_stats.h> -#include <odp_sysfs_stats.h> +#include <odp_packet_io_stats.h> #include <odp_align_internal.h> #include <odp_debug_internal.h> #include <odp_errno_define.h> @@ -148,7 +147,6 @@ static int sock_setup_pkt(pktio_entry_t *pktio_entry, const char *netdev, struct sockaddr_ll sa_ll; char shm_name[ODP_SHM_NAME_LEN]; pkt_sock_t *pkt_sock = pkt_priv(pktio_entry); - odp_pktio_stats_t cur_stats; /* Init pktio entry */ memset(pkt_sock, 0, sizeof(*pkt_sock)); @@ -200,21 +198,10 @@ static int sock_setup_pkt(pktio_entry_t *pktio_entry, const char *netdev, goto error; } - err = ethtool_stats_get_fd(pkt_priv(pktio_entry)->sockfd, - pktio_entry->s.name, - &cur_stats); - if (err != 0) { - err = sysfs_stats(pktio_entry, &cur_stats); - if (err != 0) { - pktio_entry->s.stats_type = STATS_UNSUPPORTED; - ODP_DBG("pktio: %s unsupported stats\n", - pktio_entry->s.name); - } else { - pktio_entry->s.stats_type = STATS_SYSFS; - } - } else { - pktio_entry->s.stats_type = STATS_ETHTOOL; - } + pktio_entry->s.stats_type = sock_stats_type_fd(pktio_entry, + pkt_sock->sockfd); + if (pktio_entry->s.stats_type == STATS_UNSUPPORTED) + ODP_DBG("pktio: %s unsupported stats\n", pktio_entry->s.name); err = sock_stats_reset(pktio_entry); if (err != 0) diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c index 6718eb9e..459c6552 100644 --- a/platform/linux-generic/pktio/socket_mmap.c +++ b/platform/linux-generic/pktio/socket_mmap.c @@ -31,8 +31,7 @@ #include <odp_socket_common.h> #include <odp_packet_internal.h> #include <odp_packet_io_internal.h> -#include <odp_ethtool_stats.h> -#include <odp_sysfs_stats.h> +#include <odp_packet_io_stats.h> #include <odp_debug_internal.h> #include <odp_errno_define.h> #include <odp_classification_datamodel.h> @@ -587,7 +586,6 @@ static int sock_mmap_open(odp_pktio_t id ODP_UNUSED, { int if_idx; int ret = 0; - odp_pktio_stats_t cur_stats; if (disable_pktio) return -1; @@ -651,21 +649,10 @@ static int sock_mmap_open(odp_pktio_t id ODP_UNUSED, goto error; } - ret = ethtool_stats_get_fd(pkt_priv(pktio_entry)->sockfd, - pktio_entry->s.name, - &cur_stats); - if (ret != 0) { - ret = sysfs_stats(pktio_entry, &cur_stats); - if (ret != 0) { - pktio_entry->s.stats_type = STATS_UNSUPPORTED; - ODP_DBG("pktio: %s unsupported stats\n", - pktio_entry->s.name); - } else { - pktio_entry->s.stats_type = STATS_SYSFS; - } - } else { - pktio_entry->s.stats_type = STATS_ETHTOOL; - } + pktio_entry->s.stats_type = sock_stats_type_fd(pktio_entry, + pkt_sock->sockfd); + if (pktio_entry->s.stats_type == STATS_UNSUPPORTED) + ODP_DBG("pktio: %s unsupported stats\n", pktio_entry->s.name); ret = sock_stats_reset_fd(pktio_entry, pkt_priv(pktio_entry)->sockfd); diff --git a/platform/linux-generic/pktio/stats/packet_io_stats.c b/platform/linux-generic/pktio/stats/packet_io_stats.c new file mode 100644 index 00000000..be87b519 --- /dev/null +++ b/platform/linux-generic/pktio/stats/packet_io_stats.c @@ -0,0 +1,97 @@ +/* Copyright (c) 2014-2018, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "config.h" + +#include <string.h> +#include <odp_packet_io_stats.h> +#include <odp_ethtool_stats.h> +#include <odp_sysfs_stats.h> + +int sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd) +{ + int err = 0; + odp_pktio_stats_t cur_stats; + + if (pktio_entry->s.stats_type == STATS_UNSUPPORTED) { + memset(&pktio_entry->s.stats, 0, + sizeof(odp_pktio_stats_t)); + return 0; + } + + memset(&cur_stats, 0, sizeof(odp_pktio_stats_t)); + + if (pktio_entry->s.stats_type == STATS_ETHTOOL) { + (void)ethtool_stats_get_fd(fd, + pktio_entry->s.name, + &cur_stats); + } else if (pktio_entry->s.stats_type == STATS_SYSFS) { + err = sysfs_stats(pktio_entry, &cur_stats); + if (err != 0) + ODP_ERR("stats error\n"); + } + + if (err == 0) + memcpy(&pktio_entry->s.stats, &cur_stats, + sizeof(odp_pktio_stats_t)); + + return err; +} + +int sock_stats_fd(pktio_entry_t *pktio_entry, + odp_pktio_stats_t *stats, + int fd) +{ + odp_pktio_stats_t cur_stats; + int ret = 0; + + if (pktio_entry->s.stats_type == STATS_UNSUPPORTED) + return 0; + + memset(&cur_stats, 0, sizeof(odp_pktio_stats_t)); + if (pktio_entry->s.stats_type == STATS_ETHTOOL) { + (void)ethtool_stats_get_fd(fd, + pktio_entry->s.name, + &cur_stats); + } else if (pktio_entry->s.stats_type == STATS_SYSFS) { + sysfs_stats(pktio_entry, &cur_stats); + } + + stats->in_octets = cur_stats.in_octets - + pktio_entry->s.stats.in_octets; + stats->in_ucast_pkts = cur_stats.in_ucast_pkts - + pktio_entry->s.stats.in_ucast_pkts; + stats->in_discards = cur_stats.in_discards - + pktio_entry->s.stats.in_discards; + stats->in_errors = cur_stats.in_errors - + pktio_entry->s.stats.in_errors; + stats->in_unknown_protos = cur_stats.in_unknown_protos - + pktio_entry->s.stats.in_unknown_protos; + + stats->out_octets = cur_stats.out_octets - + pktio_entry->s.stats.out_octets; + stats->out_ucast_pkts = cur_stats.out_ucast_pkts - + pktio_entry->s.stats.out_ucast_pkts; + stats->out_discards = cur_stats.out_discards - + pktio_entry->s.stats.out_discards; + stats->out_errors = cur_stats.out_errors - + pktio_entry->s.stats.out_errors; + + return ret; +} + +pktio_stats_type_t sock_stats_type_fd(pktio_entry_t *pktio_entry, int fd) +{ + odp_pktio_stats_t cur_stats; + + if (!ethtool_stats_get_fd(fd, pktio_entry->s.name, &cur_stats)) + return STATS_ETHTOOL; + + if (!sysfs_stats(pktio_entry, &cur_stats)) + return STATS_SYSFS; + + return STATS_UNSUPPORTED; +} commit 30114714f7740b3ee309e0be05e679c7e03816ba Author: Bogdan Pricope <bogdan.pricope(a)linaro.org> Date: Thu Jun 7 15:28:00 2018 +0300 linux-gen: pktio: move ethtool and sysfs stats files to new folder Cleanup code structure by moving stats related files to new folder and creating header file for sysfs stats. Signed-off-by: Bogdan Pricope <bogdan.pricope(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index dae6e5bb..b730a92e 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -113,6 +113,7 @@ noinst_HEADERS = \ include/odp_packet_io_ring_internal.h \ include/odp_packet_socket.h \ include/odp_socket_common.h \ + include/odp_sysfs_stats.h \ include/odp_ethtool_stats.h \ include/odp_ethtool_rss.h \ include/odp_pcapng.h \ @@ -201,10 +202,11 @@ __LIB__libodp_linux_la_SOURCES = \ odp_traffic_mngr.c \ odp_version.c \ odp_weak.c \ + pktio/stats/ethtool_stats.c \ + pktio/stats/sysfs_stats.c \ pktio/dpdk.c \ pktio/dpdk_parse.c \ pktio/socket_common.c \ - pktio/ethtool_stats.c \ pktio/ethtool_rss.c \ pktio/io_ops.c \ pktio/ipc.c \ @@ -215,7 +217,6 @@ __LIB__libodp_linux_la_SOURCES = \ pktio/ring.c \ pktio/socket.c \ pktio/socket_mmap.c \ - pktio/sysfs.c \ pktio/tap.c if ODP_ABI_COMPAT __LIB__libodp_linux_la_SOURCES += \ diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index cec2d2d6..776a8442 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -221,8 +221,6 @@ extern const pktio_if_ops_t null_pktio_ops; extern const pktio_if_ops_t ipc_pktio_ops; extern const pktio_if_ops_t * const pktio_if_ops[]; -int sysfs_stats(pktio_entry_t *pktio_entry, - odp_pktio_stats_t *stats); int sock_stats_fd(pktio_entry_t *pktio_entry, odp_pktio_stats_t *stats, int fd); diff --git a/platform/linux-generic/include/odp_sysfs_stats.h b/platform/linux-generic/include/odp_sysfs_stats.h new file mode 100644 index 00000000..bf9f4f79 --- /dev/null +++ b/platform/linux-generic/include/odp_sysfs_stats.h @@ -0,0 +1,23 @@ +/* Copyright (c) 2018, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_SYSFS_STATS_H_ +#define ODP_SYSFS_STATS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/api/packet_io_stats.h> +#include <odp_packet_io_internal.h> + +int sysfs_stats(pktio_entry_t *pktio_entry, + odp_pktio_stats_t *stats); + +#ifdef __cplusplus +} +#endif +#endif /* ODP_SYSFS_STATS_H_ */ diff --git a/platform/linux-generic/pktio/pktio_common.c b/platform/linux-generic/pktio/pktio_common.c index 218196b4..ca297fd5 100644 --- a/platform/linux-generic/pktio/pktio_common.c +++ b/platform/linux-generic/pktio/pktio_common.c @@ -9,6 +9,7 @@ #include <odp_packet_io_internal.h> #include <odp_ethtool_stats.h> +#include <odp_sysfs_stats.h> #include <odp_classification_internal.h> #include <errno.h> diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index 9422d85b..97a063c7 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -40,6 +40,7 @@ #include <odp_packet_internal.h> #include <odp_packet_io_internal.h> #include <odp_ethtool_stats.h> +#include <odp_sysfs_stats.h> #include <odp_align_internal.h> #include <odp_debug_internal.h> #include <odp_errno_define.h> diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c index aedcceae..6718eb9e 100644 --- a/platform/linux-generic/pktio/socket_mmap.c +++ b/platform/linux-generic/pktio/socket_mmap.c @@ -32,6 +32,7 @@ #include <odp_packet_internal.h> #include <odp_packet_io_internal.h> #include <odp_ethtool_stats.h> +#include <odp_sysfs_stats.h> #include <odp_debug_internal.h> #include <odp_errno_define.h> #include <odp_classification_datamodel.h> diff --git a/platform/linux-generic/pktio/ethtool_stats.c b/platform/linux-generic/pktio/stats/ethtool_stats.c similarity index 100% rename from platform/linux-generic/pktio/ethtool_stats.c rename to platform/linux-generic/pktio/stats/ethtool_stats.c diff --git a/platform/linux-generic/pktio/sysfs.c b/platform/linux-generic/pktio/stats/sysfs_stats.c similarity index 98% rename from platform/linux-generic/pktio/sysfs.c rename to platform/linux-generic/pktio/stats/sysfs_stats.c index c85a88e5..e5fa5544 100644 --- a/platform/linux-generic/pktio/sysfs.c +++ b/platform/linux-generic/pktio/stats/sysfs_stats.c @@ -7,7 +7,7 @@ #include "config.h" #include <odp_api.h> -#include <odp_packet_io_internal.h> +#include <odp_sysfs_stats.h> #include <odp_errno_define.h> #include <errno.h> #include <string.h> ----------------------------------------------------------------------- Summary of changes: platform/linux-generic/Makefile.am | 8 +- .../linux-generic/include/odp_packet_io_internal.h | 14 +--- .../linux-generic/include/odp_packet_io_stats.h | 30 +++++++ .../include/odp_packet_io_stats_common.h | 23 +++++ platform/linux-generic/include/odp_sysfs_stats.h | 23 +++++ platform/linux-generic/pktio/netmap.c | 1 + platform/linux-generic/pktio/pktio_common.c | 74 ----------------- platform/linux-generic/pktio/socket.c | 22 ++--- platform/linux-generic/pktio/socket_mmap.c | 22 ++--- .../pktio/{ => stats}/ethtool_stats.c | 0 .../linux-generic/pktio/stats/packet_io_stats.c | 97 ++++++++++++++++++++++ .../pktio/{sysfs.c => stats/sysfs_stats.c} | 2 +- 12 files changed, 193 insertions(+), 123 deletions(-) create mode 100644 platform/linux-generic/include/odp_packet_io_stats.h create mode 100644 platform/linux-generic/include/odp_packet_io_stats_common.h create mode 100644 platform/linux-generic/include/odp_sysfs_stats.h rename platform/linux-generic/pktio/{ => stats}/ethtool_stats.c (100%) create mode 100644 platform/linux-generic/pktio/stats/packet_io_stats.c rename platform/linux-generic/pktio/{sysfs.c => stats/sysfs_stats.c} (98%) hooks/post-receive --
8 years, 2 months
1
0
0
0
[COMMIT] branch master updated. v1.19.0.1_tigermoth-82-g40ac22bb
by git@git-us.linaro.org
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "". The branch, master has been updated via 40ac22bb63526e9a935d804513204a85a665d13a (commit) via 3239dd418ff3f02924fa71c0b805e709b6b6db63 (commit) via bfc31d006406481c26aa851257d643d480507e2c (commit) from 273fc3e2e0c92bbf22019ea7d686b061d640da78 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 40ac22bb63526e9a935d804513204a85a665d13a Author: Matias Elo <matias.elo(a)nokia.com> Date: Wed May 23 16:15:54 2018 +0300 test: scheduling: use queue capability Running the application would fail on systems with less than NUM_PRIOS * QUEUES_PER_PRIO scheduled queues. Use odp_queue_capability() and adjust number of queues per priority accordingly. Signed-off-by: Matias Elo <matias.elo(a)nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index 8dd86c3c..d2fbf894 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -68,6 +68,7 @@ typedef struct { odp_spinlock_t lock; odp_pool_t pool; int first_thr; + int queues_per_prio; test_args_t args; odp_queue_t queue[NUM_PRIOS][QUEUES_PER_PRIO]; queue_context_t queue_ctx[NUM_PRIOS][QUEUES_PER_PRIO]; @@ -85,7 +86,7 @@ static void print_stats(int prio, test_globals_t *globals) printf("\nQueue fairness\n-----+--------\n"); - for (j = 0; j < QUEUES_PER_PRIO;) { + for (j = 0; j < globals->queues_per_prio;) { printf(" %2i | ", j); for (k = 0; k < STATS_PER_LINE - 1; k++) { @@ -432,7 +433,7 @@ static int test_schedule_many(const char *str, int thr, uint32_t i; uint32_t tot; - if (enqueue_events(thr, prio, QUEUES_PER_PRIO, 1, globals)) + if (enqueue_events(thr, prio, globals->queues_per_prio, 1, globals)) return -1; /* Start sched-enq loop */ @@ -503,7 +504,8 @@ static int test_schedule_multi(const char *str, int thr, int num; uint32_t tot = 0; - if (enqueue_events(thr, prio, QUEUES_PER_PRIO, MULTI_BUFS_MAX, globals)) + if (enqueue_events(thr, prio, globals->queues_per_prio, MULTI_BUFS_MAX, + globals)) return -1; /* Start sched-enq loop */ @@ -808,6 +810,8 @@ int main(int argc, char *argv[]) int ret = 0; odp_instance_t instance; odph_odpthread_params_t thr_params; + odp_queue_capability_t capa; + uint32_t num_queues; printf("\nODP example starts\n\n"); @@ -879,6 +883,27 @@ int main(int argc, char *argv[]) globals->pool = pool; + if (odp_queue_capability(&capa)) { + LOG_ERR("Fetching queue capabilities failed.\n"); + return -1; + } + + globals->queues_per_prio = QUEUES_PER_PRIO; + num_queues = globals->queues_per_prio * NUM_PRIOS; + if (num_queues > capa.sched.max_num) + globals->queues_per_prio = capa.sched.max_num / NUM_PRIOS; + + /* One plain queue is also used */ + num_queues = (globals->queues_per_prio * NUM_PRIOS) + 1; + if (num_queues > capa.max_queues) + globals->queues_per_prio--; + + if (globals->queues_per_prio <= 0) { + LOG_ERR("Not enough queues. At least 1 plain and %d scheduled " + "queues required.\n", NUM_PRIOS); + return -1; + } + /* * Create a queue for plain queue test */ @@ -890,7 +915,7 @@ int main(int argc, char *argv[]) } /* - * Create queues for schedule test. QUEUES_PER_PRIO per priority. + * Create queues for schedule test. */ for (i = 0; i < NUM_PRIOS; i++) { char name[] = "sched_XX_YY"; @@ -912,7 +937,7 @@ int main(int argc, char *argv[]) param.sched.sync = ODP_SCHED_SYNC_ATOMIC; param.sched.group = ODP_SCHED_GROUP_ALL; - for (j = 0; j < QUEUES_PER_PRIO; j++) { + for (j = 0; j < globals->queues_per_prio; j++) { name[9] = '0' + j / 10; name[10] = '0' + j - 10 * (j / 10); @@ -962,7 +987,7 @@ int main(int argc, char *argv[]) for (i = 0; i < NUM_PRIOS; i++) { odp_queue_t queue; - for (j = 0; j < QUEUES_PER_PRIO; j++) { + for (j = 0; j < globals->queues_per_prio; j++) { queue = globals->queue[i][j]; ret += odp_queue_destroy(queue); } commit 3239dd418ff3f02924fa71c0b805e709b6b6db63 Author: Matias Elo <matias.elo(a)nokia.com> Date: Thu May 24 11:53:17 2018 +0300 validation: sched: adjust number of used queues based on capability Scale down the number of test queues per priority based on odp_queue_capability. Signed-off-by: Matias Elo <matias.elo(a)nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c index f1b61dfd..2e44d324 100644 --- a/test/validation/api/scheduler/scheduler.c +++ b/test/validation/api/scheduler/scheduler.c @@ -27,8 +27,6 @@ #define SHM_THR_ARGS_NAME "shm_thr_args" #define ONE_Q 1 -#define MANY_QS QUEUES_PER_PRIO - #define ONE_PRIO 1 #define SCHD_ONE 0 @@ -57,6 +55,9 @@ typedef struct { odp_barrier_t barrier; int buf_count; int buf_count_cpy; + int queues_per_prio; + odp_pool_t pool; + odp_pool_t queue_ctx_pool; uint32_t max_sched_queue_size; odp_ticketlock_t lock; odp_spinlock_t atomic_lock; @@ -96,8 +97,7 @@ typedef struct { uint64_t seqno; } chaos_buf; -odp_pool_t pool; -odp_pool_t queue_ctx_pool; +static test_globals_t *globals; static int drain_queues(void) { @@ -1103,19 +1103,22 @@ static void scheduler_test_mq_1t_n(void) { /* Only one priority involved in these tests, but use the same number of queues the more general case uses */ - schedule_common(ODP_SCHED_SYNC_PARALLEL, MANY_QS, ONE_PRIO, SCHD_ONE); + schedule_common(ODP_SCHED_SYNC_PARALLEL, globals->queues_per_prio, + ONE_PRIO, SCHD_ONE); } /* Many queues 1 thread ODP_SCHED_SYNC_ATOMIC */ static void scheduler_test_mq_1t_a(void) { - schedule_common(ODP_SCHED_SYNC_ATOMIC, MANY_QS, ONE_PRIO, SCHD_ONE); + schedule_common(ODP_SCHED_SYNC_ATOMIC, globals->queues_per_prio, + ONE_PRIO, SCHD_ONE); } /* Many queues 1 thread ODP_SCHED_SYNC_ORDERED */ static void scheduler_test_mq_1t_o(void) { - schedule_common(ODP_SCHED_SYNC_ORDERED, MANY_QS, ONE_PRIO, SCHD_ONE); + schedule_common(ODP_SCHED_SYNC_ORDERED, globals->queues_per_prio, + ONE_PRIO, SCHD_ONE); } /* Many queues 1 thread check priority ODP_SCHED_SYNC_PARALLEL */ @@ -1123,7 +1126,8 @@ static void scheduler_test_mq_1t_prio_n(void) { int prio = odp_schedule_num_prio(); - schedule_common(ODP_SCHED_SYNC_PARALLEL, MANY_QS, prio, SCHD_ONE); + schedule_common(ODP_SCHED_SYNC_PARALLEL, globals->queues_per_prio, prio, + SCHD_ONE); } /* Many queues 1 thread check priority ODP_SCHED_SYNC_ATOMIC */ @@ -1131,7 +1135,8 @@ static void scheduler_test_mq_1t_prio_a(void) { int prio = odp_schedule_num_prio(); - schedule_common(ODP_SCHED_SYNC_ATOMIC, MANY_QS, prio, SCHD_ONE); + schedule_common(ODP_SCHED_SYNC_ATOMIC, globals->queues_per_prio, prio, + SCHD_ONE); } /* Many queues 1 thread check priority ODP_SCHED_SYNC_ORDERED */ @@ -1139,7 +1144,8 @@ static void scheduler_test_mq_1t_prio_o(void) { int prio = odp_schedule_num_prio(); - schedule_common(ODP_SCHED_SYNC_ORDERED, MANY_QS, prio, SCHD_ONE); + schedule_common(ODP_SCHED_SYNC_ORDERED, globals->queues_per_prio, prio, + SCHD_ONE); } /* Many queues many threads check priority ODP_SCHED_SYNC_PARALLEL */ @@ -1147,8 +1153,8 @@ static void scheduler_test_mq_mt_prio_n(void) { int prio = odp_schedule_num_prio(); - parallel_execute(ODP_SCHED_SYNC_PARALLEL, MANY_QS, prio, SCHD_ONE, - DISABLE_EXCL_ATOMIC); + parallel_execute(ODP_SCHED_SYNC_PARALLEL, globals->queues_per_prio, + prio, SCHD_ONE, DISABLE_EXCL_ATOMIC); } /* Many queues many threads check priority ODP_SCHED_SYNC_ATOMIC */ @@ -1156,8 +1162,8 @@ static void scheduler_test_mq_mt_prio_a(void) { int prio = odp_schedule_num_prio(); - parallel_execute(ODP_SCHED_SYNC_ATOMIC, MANY_QS, prio, SCHD_ONE, - DISABLE_EXCL_ATOMIC); + parallel_execute(ODP_SCHED_SYNC_ATOMIC, globals->queues_per_prio, prio, + SCHD_ONE, DISABLE_EXCL_ATOMIC); } /* Many queues many threads check priority ODP_SCHED_SYNC_ORDERED */ @@ -1165,8 +1171,8 @@ static void scheduler_test_mq_mt_prio_o(void) { int prio = odp_schedule_num_prio(); - parallel_execute(ODP_SCHED_SYNC_ORDERED, MANY_QS, prio, SCHD_ONE, - DISABLE_EXCL_ATOMIC); + parallel_execute(ODP_SCHED_SYNC_ORDERED, globals->queues_per_prio, prio, + SCHD_ONE, DISABLE_EXCL_ATOMIC); } /* 1 queue many threads check exclusive access on ATOMIC queues */ @@ -1199,19 +1205,22 @@ static void scheduler_test_multi_mq_1t_n(void) { /* Only one priority involved in these tests, but use the same number of queues the more general case uses */ - schedule_common(ODP_SCHED_SYNC_PARALLEL, MANY_QS, ONE_PRIO, SCHD_MULTI); + schedule_common(ODP_SCHED_SYNC_PARALLEL, globals->queues_per_prio, + ONE_PRIO, SCHD_MULTI); } /* Many queues 1 thread ODP_SCHED_SYNC_ATOMIC multi */ static void scheduler_test_multi_mq_1t_a(void) { - schedule_common(ODP_SCHED_SYNC_ATOMIC, MANY_QS, ONE_PRIO, SCHD_MULTI); + schedule_common(ODP_SCHED_SYNC_ATOMIC, globals->queues_per_prio, + ONE_PRIO, SCHD_MULTI); } /* Many queues 1 thread ODP_SCHED_SYNC_ORDERED multi */ static void scheduler_test_multi_mq_1t_o(void) { - schedule_common(ODP_SCHED_SYNC_ORDERED, MANY_QS, ONE_PRIO, SCHD_MULTI); + schedule_common(ODP_SCHED_SYNC_ORDERED, globals->queues_per_prio, + ONE_PRIO, SCHD_MULTI); } /* Many queues 1 thread check priority ODP_SCHED_SYNC_PARALLEL multi */ @@ -1219,7 +1228,8 @@ static void scheduler_test_multi_mq_1t_prio_n(void) { int prio = odp_schedule_num_prio(); - schedule_common(ODP_SCHED_SYNC_PARALLEL, MANY_QS, prio, SCHD_MULTI); + schedule_common(ODP_SCHED_SYNC_PARALLEL, globals->queues_per_prio, prio, + SCHD_MULTI); } /* Many queues 1 thread check priority ODP_SCHED_SYNC_ATOMIC multi */ @@ -1227,7 +1237,8 @@ static void scheduler_test_multi_mq_1t_prio_a(void) { int prio = odp_schedule_num_prio(); - schedule_common(ODP_SCHED_SYNC_ATOMIC, MANY_QS, prio, SCHD_MULTI); + schedule_common(ODP_SCHED_SYNC_ATOMIC, globals->queues_per_prio, prio, + SCHD_MULTI); } /* Many queues 1 thread check priority ODP_SCHED_SYNC_ORDERED multi */ @@ -1235,7 +1246,8 @@ static void scheduler_test_multi_mq_1t_prio_o(void) { int prio = odp_schedule_num_prio(); - schedule_common(ODP_SCHED_SYNC_ORDERED, MANY_QS, prio, SCHD_MULTI); + schedule_common(ODP_SCHED_SYNC_ORDERED, globals->queues_per_prio, prio, + SCHD_MULTI); } /* Many queues many threads check priority ODP_SCHED_SYNC_PARALLEL multi */ @@ -1243,7 +1255,8 @@ static void scheduler_test_multi_mq_mt_prio_n(void) { int prio = odp_schedule_num_prio(); - parallel_execute(ODP_SCHED_SYNC_PARALLEL, MANY_QS, prio, SCHD_MULTI, 0); + parallel_execute(ODP_SCHED_SYNC_PARALLEL, globals->queues_per_prio, + prio, SCHD_MULTI, 0); } /* Many queues many threads check priority ODP_SCHED_SYNC_ATOMIC multi */ @@ -1251,7 +1264,8 @@ static void scheduler_test_multi_mq_mt_prio_a(void) { int prio = odp_schedule_num_prio(); - parallel_execute(ODP_SCHED_SYNC_ATOMIC, MANY_QS, prio, SCHD_MULTI, 0); + parallel_execute(ODP_SCHED_SYNC_ATOMIC, globals->queues_per_prio, prio, + SCHD_MULTI, 0); } /* Many queues many threads check priority ODP_SCHED_SYNC_ORDERED multi */ @@ -1259,7 +1273,8 @@ static void scheduler_test_multi_mq_mt_prio_o(void) { int prio = odp_schedule_num_prio(); - parallel_execute(ODP_SCHED_SYNC_ORDERED, MANY_QS, prio, SCHD_MULTI, 0); + parallel_execute(ODP_SCHED_SYNC_ORDERED, globals->queues_per_prio, prio, + SCHD_MULTI, 0); } /* 1 queue many threads check exclusive access on ATOMIC queues multi */ @@ -1275,6 +1290,7 @@ static void scheduler_test_pause_resume(void) odp_buffer_t buf; odp_event_t ev; odp_queue_t from; + odp_pool_t pool; int i; int local_bufs = 0; int ret; @@ -1341,6 +1357,7 @@ static void scheduler_test_ordered_lock(void) odp_buffer_t buf; odp_event_t ev; odp_queue_t from; + odp_pool_t pool; int i; int ret; uint32_t lock_count; @@ -1408,11 +1425,16 @@ static int create_queues(test_globals_t *globals) { int i, j, prios, rc; odp_queue_capability_t capa; + odp_pool_t queue_ctx_pool; odp_pool_param_t params; odp_buffer_t queue_ctx_buf; queue_context *qctx, *pqctx; uint32_t ndx; odp_queue_param_t p; + unsigned int num_sched; + unsigned int num_plain; + int queues_per_prio; + int sched_types; if (odp_queue_capability(&capa) < 0) { printf("Queue capability query failed\n"); @@ -1433,9 +1455,31 @@ static int create_queues(test_globals_t *globals) } prios = odp_schedule_num_prio(); + + /* Adjust 'queues_per_prio' until all required queues can be created */ + sched_types = 3; + queues_per_prio = QUEUES_PER_PRIO; + num_sched = (prios * queues_per_prio * sched_types) + CHAOS_NUM_QUEUES; + num_plain = (prios * queues_per_prio); + while ((num_sched > capa.sched.max_num || + num_plain > capa.plain.max_num || + num_sched + num_plain > capa.max_queues) && queues_per_prio) { + queues_per_prio--; + num_sched = (prios * queues_per_prio * sched_types) + + CHAOS_NUM_QUEUES; + num_plain = (prios * queues_per_prio); + } + if (!queues_per_prio) { + printf("Not enough queues. At least %d scheduled queues and " + "%d plain queus required.\n", + ((prios * sched_types) + CHAOS_NUM_QUEUES), prios); + return -1; + } + globals->queues_per_prio = queues_per_prio; + odp_pool_param_init(¶ms); params.buf.size = sizeof(queue_context); - params.buf.num = prios * QUEUES_PER_PRIO * 2; + params.buf.num = prios * queues_per_prio * 2; params.type = ODP_POOL_BUFFER; queue_ctx_pool = odp_pool_create(QUEUE_CTX_POOL_NAME, ¶ms); @@ -1444,13 +1488,14 @@ static int create_queues(test_globals_t *globals) printf("Pool creation failed (queue ctx).\n"); return -1; } + globals->queue_ctx_pool = queue_ctx_pool; for (i = 0; i < prios; i++) { odp_queue_param_init(&p); p.type = ODP_QUEUE_TYPE_SCHED; p.sched.prio = i; - for (j = 0; j < QUEUES_PER_PRIO; j++) { + for (j = 0; j < queues_per_prio; j++) { /* Per sched sync type */ char name[32]; odp_queue_t q, pq; @@ -1554,7 +1599,6 @@ static int scheduler_suite_init(void) odp_cpumask_t mask; odp_shm_t shm; odp_pool_t pool; - test_globals_t *globals; thread_args_t *args; odp_pool_param_t params; @@ -1632,7 +1676,7 @@ static int destroy_queues(void) prios = odp_schedule_num_prio(); for (i = 0; i < prios; i++) { - for (j = 0; j < QUEUES_PER_PRIO; j++) { + for (j = 0; j < globals->queues_per_prio; j++) { char name[32]; snprintf(name, sizeof(name), "sched_%d_%d_n", i, j); @@ -1653,7 +1697,7 @@ static int destroy_queues(void) } } - if (odp_pool_destroy(queue_ctx_pool) != 0) { + if (odp_pool_destroy(globals->queue_ctx_pool) != 0) { fprintf(stderr, "error: failed to destroy queue ctx pool\n"); return -1; } commit bfc31d006406481c26aa851257d643d480507e2c Author: Matias Elo <matias.elo(a)nokia.com> Date: Fri May 18 10:35:26 2018 +0300 validation: queue: enable passing tests without ordered locks Supporting ordered locks is not mandatory. Signed-off-by: Matias Elo <matias.elo(a)nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/test/validation/api/queue/queue.c b/test/validation/api/queue/queue.c index d09586a8..304de021 100644 --- a/test/validation/api/queue/queue.c +++ b/test/validation/api/queue/queue.c @@ -122,7 +122,6 @@ static void queue_test_capa(void) CU_ASSERT(odp_queue_capability(&capa) == 0); CU_ASSERT(capa.max_queues != 0); - CU_ASSERT(capa.max_ordered_locks != 0); CU_ASSERT(capa.max_sched_groups != 0); CU_ASSERT(capa.sched_prios != 0); CU_ASSERT(capa.plain.max_num != 0); @@ -432,10 +431,9 @@ static void queue_test_info(void) param.sched.prio = ODP_SCHED_PRIO_NORMAL; param.sched.sync = ODP_SCHED_SYNC_ORDERED; param.sched.group = ODP_SCHED_GROUP_ALL; - if (capability.max_ordered_locks) - param.sched.lock_count = 1; - else - param.sched.lock_count = 0; + param.sched.lock_count = capability.max_ordered_locks; + if (param.sched.lock_count == 0) + printf("\n Ordered locks NOT supported\n"); param.context = q_order_ctx; q_order = odp_queue_create(nq_order, ¶m); CU_ASSERT(ODP_QUEUE_INVALID != q_order); @@ -461,7 +459,7 @@ static void queue_test_info(void) CU_ASSERT(info.param.sched.sync == odp_queue_sched_type(q_order)); CU_ASSERT(info.param.sched.group == odp_queue_sched_group(q_order)); ret = odp_queue_lock_count(q_order); - CU_ASSERT(ret > 0); + CU_ASSERT(ret == param.sched.lock_count); lock_count = ret; CU_ASSERT(info.param.sched.lock_count == lock_count); ----------------------------------------------------------------------- Summary of changes: test/performance/odp_scheduling.c | 37 +++++++++-- test/validation/api/queue/queue.c | 10 ++- test/validation/api/scheduler/scheduler.c | 104 +++++++++++++++++++++--------- 3 files changed, 109 insertions(+), 42 deletions(-) hooks/post-receive --
8 years, 2 months
1
0
0
0
[COMMIT] branch master updated. v1.19.0.1_tigermoth-79-g273fc3e2
by git@git-us.linaro.org
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "". The branch, master has been updated via 273fc3e2e0c92bbf22019ea7d686b061d640da78 (commit) via ff723f791449a5ba156a997459844b4be2e2ab82 (commit) via 3daf62015014e70b09ea6fc59d20a5facff4fe6d (commit) via bc2ca16611bdaac49e2ec22ecebe6ba67dd73812 (commit) via d511479f529fa71e76ff0d2941585f7467276982 (commit) via dc3746ac97c0dbb8e7b85de909c7356cc05ee8b9 (commit) via 4a6e7f9c28fe9ad0f90bbfd6d45bcd65b14d15e7 (commit) via ff0e06546eb8fb49f495c819efec984b70d29102 (commit) from 3c449bd75224b543de394bf6444c09cfbc6e104f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 273fc3e2e0c92bbf22019ea7d686b061d640da78 Author: Maxim Uvarov <maxim.uvarov(a)linaro.org> Date: Tue Jun 5 14:55:12 2018 +0300 example: l2fwd_simple remove predefined sleep Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Reviewed-by: Josep Puigdemont <josep.puigdemont(a)linaro.org> diff --git a/example/l2fwd_simple/l2fwd_simple_run.sh b/example/l2fwd_simple/l2fwd_simple_run.sh index 18acb357..3d1b4130 100755 --- a/example/l2fwd_simple/l2fwd_simple_run.sh +++ b/example/l2fwd_simple/l2fwd_simple_run.sh @@ -10,11 +10,7 @@ PCAP_IN=`find . ${TEST_DIR} $(dirname $0) -name udp64.pcap -print -quit` echo "using PCAP_IN = ${PCAP_IN}" ./odp_l2fwd_simple${EXEEXT} pcap:in=${PCAP_IN} pcap:out=pcapout.pcap \ - 02:00:00:00:00:01 02:00:00:00:00:02 & - -sleep 2 -kill -s SIGINT $! -wait $! + 02:00:00:00:00:01 02:00:00:00:00:02 -t 2 STATUS=$? if [ "$STATUS" -ne 0 ]; then @@ -30,15 +26,11 @@ fi rm -f pcapout.pcap ./odp_l2fwd_simple${EXEEXT} null:0 null:1 \ - 02:00:00:00:00:01 02:00:00:00:00:02 & - -sleep 2 -kill -s SIGINT $! -wait $! + 02:00:00:00:00:01 02:00:00:00:00:02 -t 2 STATUS=$? -if [ "$STATUS" -ne 255 ]; then - echo "Error: status was: $STATUS, expected 255" +if [ "$STATUS" -ne 0 ]; then + echo "Error: status was: $STATUS, expected 0" exit 1 fi diff --git a/example/l2fwd_simple/odp_l2fwd_simple.c b/example/l2fwd_simple/odp_l2fwd_simple.c index 8fca7307..fcdd8183 100644 --- a/example/l2fwd_simple/odp_l2fwd_simple.c +++ b/example/l2fwd_simple/odp_l2fwd_simple.c @@ -18,7 +18,7 @@ #define MAX_WORKERS 1 static int exit_thr; -static int g_ret; +static int wait_sec; struct { odp_pktio_t if0, if1; @@ -87,7 +87,6 @@ static int run_worker(void *arg ODP_UNUSED) { odp_packet_t pkt_tbl[MAX_PKT_BURST]; int pkts, sent, tx_drops, i; - int total_pkts = 0; uint64_t wait_time = odp_pktin_wait_time(ODP_TIME_SEC_IN_NS); if (odp_pktio_start(global.if0)) { @@ -106,8 +105,13 @@ static int run_worker(void *arg ODP_UNUSED) pkts = odp_pktin_recv_tmo(global.if0in, pkt_tbl, MAX_PKT_BURST, wait_time); - if (odp_unlikely(pkts <= 0)) + if (odp_unlikely(pkts <= 0)) { + if (wait_sec > 0) + if (!(--wait_sec)) + break; continue; + } + for (i = 0; i < pkts; i++) { odp_packet_t pkt = pkt_tbl[i]; odph_ethhdr_t *eth; @@ -123,15 +127,11 @@ static int run_worker(void *arg ODP_UNUSED) sent = odp_pktout_send(global.if1out, pkt_tbl, pkts); if (sent < 0) sent = 0; - total_pkts += sent; tx_drops = pkts - sent; if (odp_unlikely(tx_drops)) odp_packet_free_multi(&pkt_tbl[sent], tx_drops); } - if (total_pkts < 10) - g_ret = -1; - return 0; } @@ -149,17 +149,22 @@ int main(int argc, char **argv) /* let helper collect its own arguments (e.g. --odph_proc) */ argc = odph_parse_options(argc, argv); - if (argc != 5 || + if (argc > 7 || odph_eth_addr_parse(&global.dst, argv[3]) != 0 || odph_eth_addr_parse(&global.src, argv[4]) != 0) { printf("Usage: odp_l2fwd_simple eth0 eth1 01:02:03:04:05:06" - " 07:08:09:0a:0b:0c\n"); + " 07:08:09:0a:0b:0c [-t sec]\n"); printf("Where eth0 and eth1 are the used interfaces" " (must have 2 of them)\n"); printf("And the hexadecimal numbers are destination MAC address" " and source MAC address\n"); exit(1); } + if (argc == 7 && !strncmp(argv[5], "-t", 2)) + wait_sec = atoi(argv[6]); + + if (wait_sec) + printf("running test for %d sec\n", wait_sec); if (odp_init_global(&instance, NULL, NULL)) { printf("Error: ODP global init failed.\n"); @@ -233,5 +238,5 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } - return g_ret; + return 0; } commit ff723f791449a5ba156a997459844b4be2e2ab82 Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Fri Jun 8 10:25:32 2018 +0300 linux-gen: hash: rename hash.c to hash_crc32c.c This file contains tabled implementation of crc32c. Crc32 and crc32c implementations do not share anything, and have different dependencies. Crc32 is implemented in file odp_hash_crc32.c. Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index f2e58628..dae6e5bb 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -157,8 +157,8 @@ __LIB__libodp_linux_la_SOURCES = \ odp_errno.c \ odp_event.c \ odp_fdserver.c \ - odp_hash.c \ odp_hash_crc32.c \ + odp_hash_crc32c.c \ odp_impl.c \ odp_init.c \ odp_ipsec.c \ diff --git a/platform/linux-generic/odp_hash.c b/platform/linux-generic/odp_hash_crc32c.c similarity index 100% rename from platform/linux-generic/odp_hash.c rename to platform/linux-generic/odp_hash_crc32c.c commit 3daf62015014e70b09ea6fc59d20a5facff4fe6d Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Thu Jun 7 16:50:42 2018 +0300 validation: hash: add crc32 test case Added test vectors for crc32. Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/test/validation/api/hash/hash.c b/test/validation/api/hash/hash.c index 7bb32f18..080201af 100644 --- a/test/validation/api/hash/hash.c +++ b/test/validation/api/hash/hash.c @@ -11,6 +11,8 @@ #define CRC32C_INIT 0xffffffff #define CRC32C_XOR 0xffffffff +#define CRC32_INIT 0xffffffff +#define CRC32_XOR 0xffffffff typedef struct hash_test_vector_t { const uint8_t *data; @@ -144,6 +146,65 @@ static const hash_test_vector_t crc32c_test_vector[] = { } }; +static const hash_test_vector_t crc32_test_vector[] = { + { .data = test_data_0, + .len = sizeof(test_data_0), + .result.u8 = {0xad, 0x55, 0x0a, 0x19} + }, + { .data = test_data_1, + .len = sizeof(test_data_1), + .result.u8 = {0x0b, 0xab, 0x6c, 0xff} + }, + { .data = test_data_2, + .len = sizeof(test_data_2), + .result.u8 = {0x8a, 0x7e, 0x26, 0x91} + }, + { .data = test_data_3, + .len = sizeof(test_data_3), + .result.u8 = {0x72, 0xef, 0xb0, 0x9a} + }, + { .data = test_data_4, + .len = sizeof(test_data_4), + .result.u8 = {0x12, 0x74, 0xe1, 0x51} + }, + { .data = test_data_5, + .len = sizeof(test_data_5) - 1, + .result.u8 = {0x11, 0xcd, 0x82, 0xed} + }, + { .data = test_data_6, + .len = sizeof(test_data_6) - 1, + .result.u8 = {0x50, 0x2a, 0xef, 0xae} + }, + { .data = test_data_7, + .len = sizeof(test_data_7) - 1, + .result.u8 = {0xe9, 0x25, 0x90, 0x51} + }, + { .data = test_data_8, + .len = sizeof(test_data_8) - 1, + .result.u8 = {0x43, 0xbe, 0xb7, 0xe8} + }, + { .data = test_data_9, + .len = sizeof(test_data_9) - 1, + .result.u8 = {0x6d, 0x48, 0x83, 0x9e} + }, + { .data = test_data_10, + .len = sizeof(test_data_10) - 1, + .result.u8 = {0xc2, 0x41, 0x24, 0x35} + }, + { .data = test_data_11, + .len = sizeof(test_data_11) - 1, + .result.u8 = {0xa6, 0x6a, 0x2a, 0x31} + }, + { .data = test_data_12, + .len = sizeof(test_data_12) - 1, + .result.u8 = {0xcd, 0x2a, 0x91, 0xde} + }, + { .data = test_data_13, + .len = sizeof(test_data_13) - 1, + .result.u8 = {0x26, 0x39, 0xf4, 0xcb} + } +}; + static void hash_test_crc32c(void) { uint32_t ret, result; @@ -160,8 +221,25 @@ static void hash_test_crc32c(void) } } +static void hash_test_crc32(void) +{ + uint32_t ret, result; + int i; + int num = sizeof(crc32_test_vector) / sizeof(hash_test_vector_t); + + for (i = 0; i < num; i++) { + ret = odp_hash_crc32(crc32_test_vector[i].data, + crc32_test_vector[i].len, + CRC32_INIT); + + result = CRC32_XOR ^ ret; + CU_ASSERT(result == crc32_test_vector[i].result.u32); + } +} + odp_testinfo_t hash_suite[] = { ODP_TEST_INFO(hash_test_crc32c), + ODP_TEST_INFO(hash_test_crc32), ODP_TEST_INFO_NULL, }; commit bc2ca16611bdaac49e2ec22ecebe6ba67dd73812 Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Thu Jun 7 14:10:44 2018 +0300 linux-gen: hash_crc32: crc32 implementation with zlib Implement crc32 function with zlib. Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/DEPENDENCIES b/DEPENDENCIES index 48f5a839..0b0810e8 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -19,7 +19,7 @@ Prerequisites for building the OpenDataPlane (ODP) API 3. Required packages - Libraries currently required to link: openssl, libatomic, libconfig + Libraries currently required to link: openssl, libatomic, libconfig, zlib 3.1 OpenSSL native compile diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 07c88f85..f2e58628 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -158,6 +158,7 @@ __LIB__libodp_linux_la_SOURCES = \ odp_event.c \ odp_fdserver.c \ odp_hash.c \ + odp_hash_crc32.c \ odp_impl.c \ odp_init.c \ odp_ipsec.c \ @@ -323,6 +324,7 @@ __LIB__libodp_linux_la_LIBADD += $(LIBCONFIG_LIBS) __LIB__libodp_linux_la_LIBADD += $(DPDK_LIBS_LIBODP) __LIB__libodp_linux_la_LIBADD += $(PTHREAD_LIBS) __LIB__libodp_linux_la_LIBADD += $(TIMER_LIBS) +__LIB__libodp_linux_la_LIBADD += $(ZLIB_LIBS) if HAVE_PCAP __LIB__libodp_linux_la_LIBADD += $(PCAP_LIBS) diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4 index 951704ed..155dea21 100644 --- a/platform/linux-generic/m4/configure.m4 +++ b/platform/linux-generic/m4/configure.m4 @@ -11,6 +11,7 @@ m4_include([platform/linux-generic/m4/odp_pcap.m4]) m4_include([platform/linux-generic/m4/odp_pcapng.m4]) m4_include([platform/linux-generic/m4/odp_netmap.m4]) m4_include([platform/linux-generic/m4/odp_dpdk.m4]) +m4_include([platform/linux-generic/m4/odp_zlib.m4]) ODP_SCHEDULER m4_include([platform/linux-generic/m4/performance.m4]) diff --git a/platform/linux-generic/m4/odp_zlib.m4 b/platform/linux-generic/m4/odp_zlib.m4 new file mode 100644 index 00000000..cde9df1a --- /dev/null +++ b/platform/linux-generic/m4/odp_zlib.m4 @@ -0,0 +1,10 @@ +######################################################################### +# Check for libz availability +######################################################################### + +AC_CHECK_HEADERS([zlib.h]) + +ZLIB_LIBS="-lz" + +AC_SUBST([ZLIB_LIBS]) + diff --git a/platform/linux-generic/odp_hash_crc32.c b/platform/linux-generic/odp_hash_crc32.c new file mode 100644 index 00000000..27c06db1 --- /dev/null +++ b/platform/linux-generic/odp_hash_crc32.c @@ -0,0 +1,21 @@ +/* Copyright (c) 2018, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <stdint.h> +#include <zlib.h> + +#include <odp/api/hash.h> + +uint32_t odp_hash_crc32(const void *data, uint32_t data_len, uint32_t init_val) +{ + uLong crc; + + /* Zlib function XORs input and output crc values with all ones. + * Cancel out XORing as ODP API does not specify it. */ + crc = crc32((uLong)(init_val ^ 0xffffffff), data, data_len); + + return crc ^ 0xffffffff; +} commit d511479f529fa71e76ff0d2941585f7467276982 Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Thu Jun 7 12:00:50 2018 +0300 validation: hash: odd length crc32c test vectors Added test cases for odd data lengths. Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/test/validation/api/hash/hash.c b/test/validation/api/hash/hash.c index a19e3390..7bb32f18 100644 --- a/test/validation/api/hash/hash.c +++ b/test/validation/api/hash/hash.c @@ -72,6 +72,19 @@ static const uint8_t test_data_6[] = "abcdefgh"; static const uint8_t test_data_7[] = "The quick brown fox jumps over the lazy dog."; +static const uint8_t test_data_8[] = "a"; + +static const uint8_t test_data_9[] = "ab"; + +static const uint8_t test_data_10[] = "abc"; + +static const uint8_t test_data_11[] = "abcdefg"; + +static const uint8_t test_data_12[] = "The five boxing wizards jump quickly."; + +/* String of the common "check" value. */ +static const uint8_t test_data_13[] = "123456789"; + static const hash_test_vector_t crc32c_test_vector[] = { { .data = test_data_0, .len = sizeof(test_data_0), @@ -104,6 +117,30 @@ static const hash_test_vector_t crc32c_test_vector[] = { { .data = test_data_7, .len = sizeof(test_data_7) - 1, .result.u8 = {0xb3, 0x97, 0x00, 0x19} + }, + { .data = test_data_8, + .len = sizeof(test_data_8) - 1, + .result.u8 = {0x30, 0x43, 0xd0, 0xc1} + }, + { .data = test_data_9, + .len = sizeof(test_data_9) - 1, + .result.u8 = {0x36, 0x29, 0xa2, 0xe2} + }, + { .data = test_data_10, + .len = sizeof(test_data_10) - 1, + .result.u8 = {0xb7, 0x3f, 0x4b, 0x36} + }, + { .data = test_data_11, + .len = sizeof(test_data_11) - 1, + .result.u8 = {0x41, 0xf4, 0x27, 0xe6} + }, + { .data = test_data_12, + .len = sizeof(test_data_12) - 1, + .result.u8 = {0x9a, 0x05, 0xd3, 0xde} + }, + { .data = test_data_13, + .len = sizeof(test_data_13) - 1, + .result.u8 = {0x83, 0x92, 0x06, 0xe3} } }; commit dc3746ac97c0dbb8e7b85de909c7356cc05ee8b9 Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Thu Jun 7 11:20:17 2018 +0300 linux-gen: hash: crc32c table format update Table content should be the same as before. It is just copied from DPDK again. This time rows are not aligned against the 80 char limit of checkpatch. This enables easy table content comparison against DPDK. Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/platform/linux-generic/odp_hash.c b/platform/linux-generic/odp_hash.c index 93738e98..9e3e7d8f 100644 --- a/platform/linux-generic/odp_hash.c +++ b/platform/linux-generic/odp_hash.c @@ -45,364 +45,276 @@ #include <stddef.h> static const uint32_t crc32c_tables[8][256] = {{ - 0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, 0xC79A971F, 0x35F1141C, - 0x26A1E7E8, 0xD4CA64EB, 0x8AD958CF, 0x78B2DBCC, 0x6BE22838, 0x9989AB3B, - 0x4D43CFD0, 0xBF284CD3, 0xAC78BF27, 0x5E133C24, 0x105EC76F, 0xE235446C, - 0xF165B798, 0x030E349B, 0xD7C45070, 0x25AFD373, 0x36FF2087, 0xC494A384, - 0x9A879FA0, 0x68EC1CA3, 0x7BBCEF57, 0x89D76C54, 0x5D1D08BF, 0xAF768BBC, - 0xBC267848, 0x4E4DFB4B, 0x20BD8EDE, 0xD2D60DDD, 0xC186FE29, 0x33ED7D2A, - 0xE72719C1, 0x154C9AC2, 0x061C6936, 0xF477EA35, 0xAA64D611, 0x580F5512, - 0x4B5FA6E6, 0xB93425E5, 0x6DFE410E, 0x9F95C20D, 0x8CC531F9, 0x7EAEB2FA, - 0x30E349B1, 0xC288CAB2, 0xD1D83946, 0x23B3BA45, 0xF779DEAE, 0x05125DAD, - 0x1642AE59, 0xE4292D5A, 0xBA3A117E, 0x4851927D, 0x5B016189, 0xA96AE28A, - 0x7DA08661, 0x8FCB0562, 0x9C9BF696, 0x6EF07595, 0x417B1DBC, 0xB3109EBF, - 0xA0406D4B, 0x522BEE48, 0x86E18AA3, 0x748A09A0, 0x67DAFA54, 0x95B17957, - 0xCBA24573, 0x39C9C670, 0x2A993584, 0xD8F2B687, 0x0C38D26C, 0xFE53516F, - 0xED03A29B, 0x1F682198, 0x5125DAD3, 0xA34E59D0, 0xB01EAA24, 0x42752927, - 0x96BF4DCC, 0x64D4CECF, 0x77843D3B, 0x85EFBE38, 0xDBFC821C, 0x2997011F, - 0x3AC7F2EB, 0xC8AC71E8, 0x1C661503, 0xEE0D9600, 0xFD5D65F4, 0x0F36E6F7, - 0x61C69362, 0x93AD1061, 0x80FDE395, 0x72966096, 0xA65C047D, 0x5437877E, - 0x4767748A, 0xB50CF789, 0xEB1FCBAD, 0x197448AE, 0x0A24BB5A, 0xF84F3859, - 0x2C855CB2, 0xDEEEDFB1, 0xCDBE2C45, 0x3FD5AF46, 0x7198540D, 0x83F3D70E, - 0x90A324FA, 0x62C8A7F9, 0xB602C312, 0x44694011, 0x5739B3E5, 0xA55230E6, - 0xFB410CC2, 0x092A8FC1, 0x1A7A7C35, 0xE811FF36, 0x3CDB9BDD, 0xCEB018DE, - 0xDDE0EB2A, 0x2F8B6829, 0x82F63B78, 0x709DB87B, 0x63CD4B8F, 0x91A6C88C, - 0x456CAC67, 0xB7072F64, 0xA457DC90, 0x563C5F93, 0x082F63B7, 0xFA44E0B4, - 0xE9141340, 0x1B7F9043, 0xCFB5F4A8, 0x3DDE77AB, 0x2E8E845F, 0xDCE5075C, - 0x92A8FC17, 0x60C37F14, 0x73938CE0, 0x81F80FE3, 0x55326B08, 0xA759E80B, - 0xB4091BFF, 0x466298FC, 0x1871A4D8, 0xEA1A27DB, 0xF94AD42F, 0x0B21572C, - 0xDFEB33C7, 0x2D80B0C4, 0x3ED04330, 0xCCBBC033, 0xA24BB5A6, 0x502036A5, - 0x4370C551, 0xB11B4652, 0x65D122B9, 0x97BAA1BA, 0x84EA524E, 0x7681D14D, - 0x2892ED69, 0xDAF96E6A, 0xC9A99D9E, 0x3BC21E9D, 0xEF087A76, 0x1D63F975, - 0x0E330A81, 0xFC588982, 0xB21572C9, 0x407EF1CA, 0x532E023E, 0xA145813D, - 0x758FE5D6, 0x87E466D5, 0x94B49521, 0x66DF1622, 0x38CC2A06, 0xCAA7A905, - 0xD9F75AF1, 0x2B9CD9F2, 0xFF56BD19, 0x0D3D3E1A, 0x1E6DCDEE, 0xEC064EED, - 0xC38D26C4, 0x31E6A5C7, 0x22B65633, 0xD0DDD530, 0x0417B1DB, 0xF67C32D8, - 0xE52CC12C, 0x1747422F, 0x49547E0B, 0xBB3FFD08, 0xA86F0EFC, 0x5A048DFF, - 0x8ECEE914, 0x7CA56A17, 0x6FF599E3, 0x9D9E1AE0, 0xD3D3E1AB, 0x21B862A8, - 0x32E8915C, 0xC083125F, 0x144976B4, 0xE622F5B7, 0xF5720643, 0x07198540, - 0x590AB964, 0xAB613A67, 0xB831C993, 0x4A5A4A90, 0x9E902E7B, 0x6CFBAD78, - 0x7FAB5E8C, 0x8DC0DD8F, 0xE330A81A, 0x115B2B19, 0x020BD8ED, 0xF0605BEE, - 0x24AA3F05, 0xD6C1BC06, 0xC5914FF2, 0x37FACCF1, 0x69E9F0D5, 0x9B8273D6, - 0x88D28022, 0x7AB90321, 0xAE7367CA, 0x5C18E4C9, 0x4F48173D, 0xBD23943E, - 0xF36E6F75, 0x0105EC76, 0x12551F82, 0xE03E9C81, 0x34F4F86A, 0xC69F7B69, - 0xD5CF889D, 0x27A40B9E, 0x79B737BA, 0x8BDCB4B9, 0x988C474D, 0x6AE7C44E, - 0xBE2DA0A5, 0x4C4623A6, 0x5F16D052, 0xAD7D5351, + 0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, 0xC79A971F, 0x35F1141C, 0x26A1E7E8, 0xD4CA64EB, + 0x8AD958CF, 0x78B2DBCC, 0x6BE22838, 0x9989AB3B, 0x4D43CFD0, 0xBF284CD3, 0xAC78BF27, 0x5E133C24, + 0x105EC76F, 0xE235446C, 0xF165B798, 0x030E349B, 0xD7C45070, 0x25AFD373, 0x36FF2087, 0xC494A384, + 0x9A879FA0, 0x68EC1CA3, 0x7BBCEF57, 0x89D76C54, 0x5D1D08BF, 0xAF768BBC, 0xBC267848, 0x4E4DFB4B, + 0x20BD8EDE, 0xD2D60DDD, 0xC186FE29, 0x33ED7D2A, 0xE72719C1, 0x154C9AC2, 0x061C6936, 0xF477EA35, + 0xAA64D611, 0x580F5512, 0x4B5FA6E6, 0xB93425E5, 0x6DFE410E, 0x9F95C20D, 0x8CC531F9, 0x7EAEB2FA, + 0x30E349B1, 0xC288CAB2, 0xD1D83946, 0x23B3BA45, 0xF779DEAE, 0x05125DAD, 0x1642AE59, 0xE4292D5A, + 0xBA3A117E, 0x4851927D, 0x5B016189, 0xA96AE28A, 0x7DA08661, 0x8FCB0562, 0x9C9BF696, 0x6EF07595, + 0x417B1DBC, 0xB3109EBF, 0xA0406D4B, 0x522BEE48, 0x86E18AA3, 0x748A09A0, 0x67DAFA54, 0x95B17957, + 0xCBA24573, 0x39C9C670, 0x2A993584, 0xD8F2B687, 0x0C38D26C, 0xFE53516F, 0xED03A29B, 0x1F682198, + 0x5125DAD3, 0xA34E59D0, 0xB01EAA24, 0x42752927, 0x96BF4DCC, 0x64D4CECF, 0x77843D3B, 0x85EFBE38, + 0xDBFC821C, 0x2997011F, 0x3AC7F2EB, 0xC8AC71E8, 0x1C661503, 0xEE0D9600, 0xFD5D65F4, 0x0F36E6F7, + 0x61C69362, 0x93AD1061, 0x80FDE395, 0x72966096, 0xA65C047D, 0x5437877E, 0x4767748A, 0xB50CF789, + 0xEB1FCBAD, 0x197448AE, 0x0A24BB5A, 0xF84F3859, 0x2C855CB2, 0xDEEEDFB1, 0xCDBE2C45, 0x3FD5AF46, + 0x7198540D, 0x83F3D70E, 0x90A324FA, 0x62C8A7F9, 0xB602C312, 0x44694011, 0x5739B3E5, 0xA55230E6, + 0xFB410CC2, 0x092A8FC1, 0x1A7A7C35, 0xE811FF36, 0x3CDB9BDD, 0xCEB018DE, 0xDDE0EB2A, 0x2F8B6829, + 0x82F63B78, 0x709DB87B, 0x63CD4B8F, 0x91A6C88C, 0x456CAC67, 0xB7072F64, 0xA457DC90, 0x563C5F93, + 0x082F63B7, 0xFA44E0B4, 0xE9141340, 0x1B7F9043, 0xCFB5F4A8, 0x3DDE77AB, 0x2E8E845F, 0xDCE5075C, + 0x92A8FC17, 0x60C37F14, 0x73938CE0, 0x81F80FE3, 0x55326B08, 0xA759E80B, 0xB4091BFF, 0x466298FC, + 0x1871A4D8, 0xEA1A27DB, 0xF94AD42F, 0x0B21572C, 0xDFEB33C7, 0x2D80B0C4, 0x3ED04330, 0xCCBBC033, + 0xA24BB5A6, 0x502036A5, 0x4370C551, 0xB11B4652, 0x65D122B9, 0x97BAA1BA, 0x84EA524E, 0x7681D14D, + 0x2892ED69, 0xDAF96E6A, 0xC9A99D9E, 0x3BC21E9D, 0xEF087A76, 0x1D63F975, 0x0E330A81, 0xFC588982, + 0xB21572C9, 0x407EF1CA, 0x532E023E, 0xA145813D, 0x758FE5D6, 0x87E466D5, 0x94B49521, 0x66DF1622, + 0x38CC2A06, 0xCAA7A905, 0xD9F75AF1, 0x2B9CD9F2, 0xFF56BD19, 0x0D3D3E1A, 0x1E6DCDEE, 0xEC064EED, + 0xC38D26C4, 0x31E6A5C7, 0x22B65633, 0xD0DDD530, 0x0417B1DB, 0xF67C32D8, 0xE52CC12C, 0x1747422F, + 0x49547E0B, 0xBB3FFD08, 0xA86F0EFC, 0x5A048DFF, 0x8ECEE914, 0x7CA56A17, 0x6FF599E3, 0x9D9E1AE0, + 0xD3D3E1AB, 0x21B862A8, 0x32E8915C, 0xC083125F, 0x144976B4, 0xE622F5B7, 0xF5720643, 0x07198540, + 0x590AB964, 0xAB613A67, 0xB831C993, 0x4A5A4A90, 0x9E902E7B, 0x6CFBAD78, 0x7FAB5E8C, 0x8DC0DD8F, + 0xE330A81A, 0x115B2B19, 0x020BD8ED, 0xF0605BEE, 0x24AA3F05, 0xD6C1BC06, 0xC5914FF2, 0x37FACCF1, + 0x69E9F0D5, 0x9B8273D6, 0x88D28022, 0x7AB90321, 0xAE7367CA, 0x5C18E4C9, 0x4F48173D, 0xBD23943E, + 0xF36E6F75, 0x0105EC76, 0x12551F82, 0xE03E9C81, 0x34F4F86A, 0xC69F7B69, 0xD5CF889D, 0x27A40B9E, + 0x79B737BA, 0x8BDCB4B9, 0x988C474D, 0x6AE7C44E, 0xBE2DA0A5, 0x4C4623A6, 0x5F16D052, 0xAD7D5351 }, { - 0x00000000, 0x13A29877, 0x274530EE, 0x34E7A899, 0x4E8A61DC, 0x5D28F9AB, - 0x69CF5132, 0x7A6DC945, 0x9D14C3B8, 0x8EB65BCF, 0xBA51F356, 0xA9F36B21, - 0xD39EA264, 0xC03C3A13, 0xF4DB928A, 0xE7790AFD, 0x3FC5F181, 0x2C6769F6, - 0x1880C16F, 0x0B225918, 0x714F905D, 0x62ED082A, 0x560AA0B3, 0x45A838C4, - 0xA2D13239, 0xB173AA4E, 0x859402D7, 0x96369AA0, 0xEC5B53E5, 0xFFF9CB92, - 0xCB1E630B, 0xD8BCFB7C, 0x7F8BE302, 0x6C297B75, 0x58CED3EC, 0x4B6C4B9B, - 0x310182DE, 0x22A31AA9, 0x1644B230, 0x05E62A47, 0xE29F20BA, 0xF13DB8CD, - 0xC5DA1054, 0xD6788823, 0xAC154166, 0xBFB7D911, 0x8B507188, 0x98F2E9FF, - 0x404E1283, 0x53EC8AF4, 0x670B226D, 0x74A9BA1A, 0x0EC4735F, 0x1D66EB28, - 0x298143B1, 0x3A23DBC6, 0xDD5AD13B, 0xCEF8494C, 0xFA1FE1D5, 0xE9BD79A2, - 0x93D0B0E7, 0x80722890, 0xB4958009, 0xA737187E, 0xFF17C604, 0xECB55E73, - 0xD852F6EA, 0xCBF06E9D, 0xB19DA7D8, 0xA23F3FAF, 0x96D89736, 0x857A0F41, - 0x620305BC, 0x71A19DCB, 0x45463552, 0x56E4AD25, 0x2C896460, 0x3F2BFC17, - 0x0BCC548E, 0x186ECCF9, 0xC0D23785, 0xD370AFF2, 0xE797076B, 0xF4359F1C, - 0x8E585659, 0x9DFACE2E, 0xA91D66B7, 0xBABFFEC0, 0x5DC6F43D, 0x4E646C4A, - 0x7A83C4D3, 0x69215CA4, 0x134C95E1, 0x00EE0D96, 0x3409A50F, 0x27AB3D78, - 0x809C2506, 0x933EBD71, 0xA7D915E8, 0xB47B8D9F, 0xCE1644DA, 0xDDB4DCAD, - 0xE9537434, 0xFAF1EC43, 0x1D88E6BE, 0x0E2A7EC9, 0x3ACDD650, 0x296F4E27, - 0x53028762, 0x40A01F15, 0x7447B78C, 0x67E52FFB, 0xBF59D487, 0xACFB4CF0, - 0x981CE469, 0x8BBE7C1E, 0xF1D3B55B, 0xE2712D2C, 0xD69685B5, 0xC5341DC2, - 0x224D173F, 0x31EF8F48, 0x050827D1, 0x16AABFA6, 0x6CC776E3, 0x7F65EE94, - 0x4B82460D, 0x5820DE7A, 0xFBC3FAF9, 0xE861628E, 0xDC86CA17, 0xCF245260, - 0xB5499B25, 0xA6EB0352, 0x920CABCB, 0x81AE33BC, 0x66D73941, 0x7575A136, - 0x419209AF, 0x523091D8, 0x285D589D, 0x3BFFC0EA, 0x0F186873, 0x1CBAF004, - 0xC4060B78, 0xD7A4930F, 0xE3433B96, 0xF0E1A3E1, 0x8A8C6AA4, 0x992EF2D3, - 0xADC95A4A, 0xBE6BC23D, 0x5912C8C0, 0x4AB050B7, 0x7E57F82E, 0x6DF56059, - 0x1798A91C, 0x043A316B, 0x30DD99F2, 0x237F0185, 0x844819FB, 0x97EA818C, - 0xA30D2915, 0xB0AFB162, 0xCAC27827, 0xD960E050, 0xED8748C9, 0xFE25D0BE, - 0x195CDA43, 0x0AFE4234, 0x3E19EAAD, 0x2DBB72DA, 0x57D6BB9F, 0x447423E8, - 0x70938B71, 0x63311306, 0xBB8DE87A, 0xA82F700D, 0x9CC8D894, 0x8F6A40E3, - 0xF50789A6, 0xE6A511D1, 0xD242B948, 0xC1E0213F, 0x26992BC2, 0x353BB3B5, - 0x01DC1B2C, 0x127E835B, 0x68134A1E, 0x7BB1D269, 0x4F567AF0, 0x5CF4E287, - 0x04D43CFD, 0x1776A48A, 0x23910C13, 0x30339464, 0x4A5E5D21, 0x59FCC556, - 0x6D1B6DCF, 0x7EB9F5B8, 0x99C0FF45, 0x8A626732, 0xBE85CFAB, 0xAD2757DC, - 0xD74A9E99, 0xC4E806EE, 0xF00FAE77, 0xE3AD3600, 0x3B11CD7C, 0x28B3550B, - 0x1C54FD92, 0x0FF665E5, 0x759BACA0, 0x663934D7, 0x52DE9C4E, 0x417C0439, - 0xA6050EC4, 0xB5A796B3, 0x81403E2A, 0x92E2A65D, 0xE88F6F18, 0xFB2DF76F, - 0xCFCA5FF6, 0xDC68C781, 0x7B5FDFFF, 0x68FD4788, 0x5C1AEF11, 0x4FB87766, - 0x35D5BE23, 0x26772654, 0x12908ECD, 0x013216BA, 0xE64B1C47, 0xF5E98430, - 0xC10E2CA9, 0xD2ACB4DE, 0xA8C17D9B, 0xBB63E5EC, 0x8F844D75, 0x9C26D502, - 0x449A2E7E, 0x5738B609, 0x63DF1E90, 0x707D86E7, 0x0A104FA2, 0x19B2D7D5, - 0x2D557F4C, 0x3EF7E73B, 0xD98EEDC6, 0xCA2C75B1, 0xFECBDD28, 0xED69455F, - 0x97048C1A, 0x84A6146D, 0xB041BCF4, 0xA3E32483, + 0x00000000, 0x13A29877, 0x274530EE, 0x34E7A899, 0x4E8A61DC, 0x5D28F9AB, 0x69CF5132, 0x7A6DC945, + 0x9D14C3B8, 0x8EB65BCF, 0xBA51F356, 0xA9F36B21, 0xD39EA264, 0xC03C3A13, 0xF4DB928A, 0xE7790AFD, + 0x3FC5F181, 0x2C6769F6, 0x1880C16F, 0x0B225918, 0x714F905D, 0x62ED082A, 0x560AA0B3, 0x45A838C4, + 0xA2D13239, 0xB173AA4E, 0x859402D7, 0x96369AA0, 0xEC5B53E5, 0xFFF9CB92, 0xCB1E630B, 0xD8BCFB7C, + 0x7F8BE302, 0x6C297B75, 0x58CED3EC, 0x4B6C4B9B, 0x310182DE, 0x22A31AA9, 0x1644B230, 0x05E62A47, + 0xE29F20BA, 0xF13DB8CD, 0xC5DA1054, 0xD6788823, 0xAC154166, 0xBFB7D911, 0x8B507188, 0x98F2E9FF, + 0x404E1283, 0x53EC8AF4, 0x670B226D, 0x74A9BA1A, 0x0EC4735F, 0x1D66EB28, 0x298143B1, 0x3A23DBC6, + 0xDD5AD13B, 0xCEF8494C, 0xFA1FE1D5, 0xE9BD79A2, 0x93D0B0E7, 0x80722890, 0xB4958009, 0xA737187E, + 0xFF17C604, 0xECB55E73, 0xD852F6EA, 0xCBF06E9D, 0xB19DA7D8, 0xA23F3FAF, 0x96D89736, 0x857A0F41, + 0x620305BC, 0x71A19DCB, 0x45463552, 0x56E4AD25, 0x2C896460, 0x3F2BFC17, 0x0BCC548E, 0x186ECCF9, + 0xC0D23785, 0xD370AFF2, 0xE797076B, 0xF4359F1C, 0x8E585659, 0x9DFACE2E, 0xA91D66B7, 0xBABFFEC0, + 0x5DC6F43D, 0x4E646C4A, 0x7A83C4D3, 0x69215CA4, 0x134C95E1, 0x00EE0D96, 0x3409A50F, 0x27AB3D78, + 0x809C2506, 0x933EBD71, 0xA7D915E8, 0xB47B8D9F, 0xCE1644DA, 0xDDB4DCAD, 0xE9537434, 0xFAF1EC43, + 0x1D88E6BE, 0x0E2A7EC9, 0x3ACDD650, 0x296F4E27, 0x53028762, 0x40A01F15, 0x7447B78C, 0x67E52FFB, + 0xBF59D487, 0xACFB4CF0, 0x981CE469, 0x8BBE7C1E, 0xF1D3B55B, 0xE2712D2C, 0xD69685B5, 0xC5341DC2, + 0x224D173F, 0x31EF8F48, 0x050827D1, 0x16AABFA6, 0x6CC776E3, 0x7F65EE94, 0x4B82460D, 0x5820DE7A, + 0xFBC3FAF9, 0xE861628E, 0xDC86CA17, 0xCF245260, 0xB5499B25, 0xA6EB0352, 0x920CABCB, 0x81AE33BC, + 0x66D73941, 0x7575A136, 0x419209AF, 0x523091D8, 0x285D589D, 0x3BFFC0EA, 0x0F186873, 0x1CBAF004, + 0xC4060B78, 0xD7A4930F, 0xE3433B96, 0xF0E1A3E1, 0x8A8C6AA4, 0x992EF2D3, 0xADC95A4A, 0xBE6BC23D, + 0x5912C8C0, 0x4AB050B7, 0x7E57F82E, 0x6DF56059, 0x1798A91C, 0x043A316B, 0x30DD99F2, 0x237F0185, + 0x844819FB, 0x97EA818C, 0xA30D2915, 0xB0AFB162, 0xCAC27827, 0xD960E050, 0xED8748C9, 0xFE25D0BE, + 0x195CDA43, 0x0AFE4234, 0x3E19EAAD, 0x2DBB72DA, 0x57D6BB9F, 0x447423E8, 0x70938B71, 0x63311306, + 0xBB8DE87A, 0xA82F700D, 0x9CC8D894, 0x8F6A40E3, 0xF50789A6, 0xE6A511D1, 0xD242B948, 0xC1E0213F, + 0x26992BC2, 0x353BB3B5, 0x01DC1B2C, 0x127E835B, 0x68134A1E, 0x7BB1D269, 0x4F567AF0, 0x5CF4E287, + 0x04D43CFD, 0x1776A48A, 0x23910C13, 0x30339464, 0x4A5E5D21, 0x59FCC556, 0x6D1B6DCF, 0x7EB9F5B8, + 0x99C0FF45, 0x8A626732, 0xBE85CFAB, 0xAD2757DC, 0xD74A9E99, 0xC4E806EE, 0xF00FAE77, 0xE3AD3600, + 0x3B11CD7C, 0x28B3550B, 0x1C54FD92, 0x0FF665E5, 0x759BACA0, 0x663934D7, 0x52DE9C4E, 0x417C0439, + 0xA6050EC4, 0xB5A796B3, 0x81403E2A, 0x92E2A65D, 0xE88F6F18, 0xFB2DF76F, 0xCFCA5FF6, 0xDC68C781, + 0x7B5FDFFF, 0x68FD4788, 0x5C1AEF11, 0x4FB87766, 0x35D5BE23, 0x26772654, 0x12908ECD, 0x013216BA, + 0xE64B1C47, 0xF5E98430, 0xC10E2CA9, 0xD2ACB4DE, 0xA8C17D9B, 0xBB63E5EC, 0x8F844D75, 0x9C26D502, + 0x449A2E7E, 0x5738B609, 0x63DF1E90, 0x707D86E7, 0x0A104FA2, 0x19B2D7D5, 0x2D557F4C, 0x3EF7E73B, + 0xD98EEDC6, 0xCA2C75B1, 0xFECBDD28, 0xED69455F, 0x97048C1A, 0x84A6146D, 0xB041BCF4, 0xA3E32483 }, { - 0x00000000, 0xA541927E, 0x4F6F520D, 0xEA2EC073, 0x9EDEA41A, 0x3B9F3664, - 0xD1B1F617, 0x74F06469, 0x38513EC5, 0x9D10ACBB, 0x773E6CC8, 0xD27FFEB6, - 0xA68F9ADF, 0x03CE08A1, 0xE9E0C8D2, 0x4CA15AAC, 0x70A27D8A, 0xD5E3EFF4, - 0x3FCD2F87, 0x9A8CBDF9, 0xEE7CD990, 0x4B3D4BEE, 0xA1138B9D, 0x045219E3, - 0x48F3434F, 0xEDB2D131, 0x079C1142, 0xA2DD833C, 0xD62DE755, 0x736C752B, - 0x9942B558, 0x3C032726, 0xE144FB14, 0x4405696A, 0xAE2BA919, 0x0B6A3B67, - 0x7F9A5F0E, 0xDADBCD70, 0x30F50D03, 0x95B49F7D, 0xD915C5D1, 0x7C5457AF, - 0x967A97DC, 0x333B05A2, 0x47CB61CB, 0xE28AF3B5, 0x08A433C6, 0xADE5A1B8, - 0x91E6869E, 0x34A714E0, 0xDE89D493, 0x7BC846ED, 0x0F382284, 0xAA79B0FA, - 0x40577089, 0xE516E2F7, 0xA9B7B85B, 0x0CF62A25, 0xE6D8EA56, 0x43997828, - 0x37691C41, 0x92288E3F, 0x78064E4C, 0xDD47DC32, 0xC76580D9, 0x622412A7, - 0x880AD2D4, 0x2D4B40AA, 0x59BB24C3, 0xFCFAB6BD, 0x16D476CE, 0xB395E4B0, - 0xFF34BE1C, 0x5A752C62, 0xB05BEC11, 0x151A7E6F, 0x61EA1A06, 0xC4AB8878, - 0x2E85480B, 0x8BC4DA75, 0xB7C7FD53, 0x12866F2D, 0xF8A8AF5E, 0x5DE93D20, - 0x29195949, 0x8C58CB37, 0x66760B44, 0xC337993A, 0x8F96C396, 0x2AD751E8, - 0xC0F9919B, 0x65B803E5, 0x1148678C, 0xB409F5F2, 0x5E273581, 0xFB66A7FF, - 0x26217BCD, 0x8360E9B3, 0x694E29C0, 0xCC0FBBBE, 0xB8FFDFD7, 0x1DBE4DA9, - 0xF7908DDA, 0x52D11FA4, 0x1E704508, 0xBB31D776, 0x511F1705, 0xF45E857B, - 0x80AEE112, 0x25EF736C, 0xCFC1B31F, 0x6A802161, 0x56830647, 0xF3C29439, - 0x19EC544A, 0xBCADC634, 0xC85DA25D, 0x6D1C3023, 0x8732F050, 0x2273622E, - 0x6ED23882, 0xCB93AAFC, 0x21BD6A8F, 0x84FCF8F1, 0xF00C9C98, 0x554D0EE6, - 0xBF63CE95, 0x1A225CEB, 0x8B277743, 0x2E66E53D, 0xC448254E, 0x6109B730, - 0x15F9D359, 0xB0B84127, 0x5A968154, 0xFFD7132A, 0xB3764986, 0x1637DBF8, - 0xFC191B8B, 0x595889F5, 0x2DA8ED9C, 0x88E97FE2, 0x62C7BF91, 0xC7862DEF, - 0xFB850AC9, 0x5EC498B7, 0xB4EA58C4, 0x11ABCABA, 0x655BAED3, 0xC01A3CAD, - 0x2A34FCDE, 0x8F756EA0, 0xC3D4340C, 0x6695A672, 0x8CBB6601, 0x29FAF47F, - 0x5D0A9016, 0xF84B0268, 0x1265C21B, 0xB7245065, 0x6A638C57, 0xCF221E29, - 0x250CDE5A, 0x804D4C24, 0xF4BD284D, 0x51FCBA33, 0xBBD27A40, 0x1E93E83E, - 0x5232B292, 0xF77320EC, 0x1D5DE09F, 0xB81C72E1, 0xCCEC1688, 0x69AD84F6, - 0x83834485, 0x26C2D6FB, 0x1AC1F1DD, 0xBF8063A3, 0x55AEA3D0, 0xF0EF31AE, - 0x841F55C7, 0x215EC7B9, 0xCB7007CA, 0x6E3195B4, 0x2290CF18, 0x87D15D66, - 0x6DFF9D15, 0xC8BE0F6B, 0xBC4E6B02, 0x190FF97C, 0xF321390F, 0x5660AB71, - 0x4C42F79A, 0xE90365E4, 0x032DA597, 0xA66C37E9, 0xD29C5380, 0x77DDC1FE, - 0x9DF3018D, 0x38B293F3, 0x7413C95F, 0xD1525B21, 0x3B7C9B52, 0x9E3D092C, - 0xEACD6D45, 0x4F8CFF3B, 0xA5A23F48, 0x00E3AD36, 0x3CE08A10, 0x99A1186E, - 0x738FD81D, 0xD6CE4A63, 0xA23E2E0A, 0x077FBC74, 0xED517C07, 0x4810EE79, - 0x04B1B4D5, 0xA1F026AB, 0x4BDEE6D8, 0xEE9F74A6, 0x9A6F10CF, 0x3F2E82B1, - 0xD50042C2, 0x7041D0BC, 0xAD060C8E, 0x08479EF0, 0xE2695E83, 0x4728CCFD, - 0x33D8A894, 0x96993AEA, 0x7CB7FA99, 0xD9F668E7, 0x9557324B, 0x3016A035, - 0xDA386046, 0x7F79F238, 0x0B899651, 0xAEC8042F, 0x44E6C45C, 0xE1A75622, - 0xDDA47104, 0x78E5E37A, 0x92CB2309, 0x378AB177, 0x437AD51E, 0xE63B4760, - 0x0C158713, 0xA954156D, 0xE5F54FC1, 0x40B4DDBF, 0xAA9A1DCC, 0x0FDB8FB2, - 0x7B2BEBDB, 0xDE6A79A5, 0x3444B9D6, 0x91052BA8, + 0x00000000, 0xA541927E, 0x4F6F520D, 0xEA2EC073, 0x9EDEA41A, 0x3B9F3664, 0xD1B1F617, 0x74F06469, + 0x38513EC5, 0x9D10ACBB, 0x773E6CC8, 0xD27FFEB6, 0xA68F9ADF, 0x03CE08A1, 0xE9E0C8D2, 0x4CA15AAC, + 0x70A27D8A, 0xD5E3EFF4, 0x3FCD2F87, 0x9A8CBDF9, 0xEE7CD990, 0x4B3D4BEE, 0xA1138B9D, 0x045219E3, + 0x48F3434F, 0xEDB2D131, 0x079C1142, 0xA2DD833C, 0xD62DE755, 0x736C752B, 0x9942B558, 0x3C032726, + 0xE144FB14, 0x4405696A, 0xAE2BA919, 0x0B6A3B67, 0x7F9A5F0E, 0xDADBCD70, 0x30F50D03, 0x95B49F7D, + 0xD915C5D1, 0x7C5457AF, 0x967A97DC, 0x333B05A2, 0x47CB61CB, 0xE28AF3B5, 0x08A433C6, 0xADE5A1B8, + 0x91E6869E, 0x34A714E0, 0xDE89D493, 0x7BC846ED, 0x0F382284, 0xAA79B0FA, 0x40577089, 0xE516E2F7, + 0xA9B7B85B, 0x0CF62A25, 0xE6D8EA56, 0x43997828, 0x37691C41, 0x92288E3F, 0x78064E4C, 0xDD47DC32, + 0xC76580D9, 0x622412A7, 0x880AD2D4, 0x2D4B40AA, 0x59BB24C3, 0xFCFAB6BD, 0x16D476CE, 0xB395E4B0, + 0xFF34BE1C, 0x5A752C62, 0xB05BEC11, 0x151A7E6F, 0x61EA1A06, 0xC4AB8878, 0x2E85480B, 0x8BC4DA75, + 0xB7C7FD53, 0x12866F2D, 0xF8A8AF5E, 0x5DE93D20, 0x29195949, 0x8C58CB37, 0x66760B44, 0xC337993A, + 0x8F96C396, 0x2AD751E8, 0xC0F9919B, 0x65B803E5, 0x1148678C, 0xB409F5F2, 0x5E273581, 0xFB66A7FF, + 0x26217BCD, 0x8360E9B3, 0x694E29C0, 0xCC0FBBBE, 0xB8FFDFD7, 0x1DBE4DA9, 0xF7908DDA, 0x52D11FA4, + 0x1E704508, 0xBB31D776, 0x511F1705, 0xF45E857B, 0x80AEE112, 0x25EF736C, 0xCFC1B31F, 0x6A802161, + 0x56830647, 0xF3C29439, 0x19EC544A, 0xBCADC634, 0xC85DA25D, 0x6D1C3023, 0x8732F050, 0x2273622E, + 0x6ED23882, 0xCB93AAFC, 0x21BD6A8F, 0x84FCF8F1, 0xF00C9C98, 0x554D0EE6, 0xBF63CE95, 0x1A225CEB, + 0x8B277743, 0x2E66E53D, 0xC448254E, 0x6109B730, 0x15F9D359, 0xB0B84127, 0x5A968154, 0xFFD7132A, + 0xB3764986, 0x1637DBF8, 0xFC191B8B, 0x595889F5, 0x2DA8ED9C, 0x88E97FE2, 0x62C7BF91, 0xC7862DEF, + 0xFB850AC9, 0x5EC498B7, 0xB4EA58C4, 0x11ABCABA, 0x655BAED3, 0xC01A3CAD, 0x2A34FCDE, 0x8F756EA0, + 0xC3D4340C, 0x6695A672, 0x8CBB6601, 0x29FAF47F, 0x5D0A9016, 0xF84B0268, 0x1265C21B, 0xB7245065, + 0x6A638C57, 0xCF221E29, 0x250CDE5A, 0x804D4C24, 0xF4BD284D, 0x51FCBA33, 0xBBD27A40, 0x1E93E83E, + 0x5232B292, 0xF77320EC, 0x1D5DE09F, 0xB81C72E1, 0xCCEC1688, 0x69AD84F6, 0x83834485, 0x26C2D6FB, + 0x1AC1F1DD, 0xBF8063A3, 0x55AEA3D0, 0xF0EF31AE, 0x841F55C7, 0x215EC7B9, 0xCB7007CA, 0x6E3195B4, + 0x2290CF18, 0x87D15D66, 0x6DFF9D15, 0xC8BE0F6B, 0xBC4E6B02, 0x190FF97C, 0xF321390F, 0x5660AB71, + 0x4C42F79A, 0xE90365E4, 0x032DA597, 0xA66C37E9, 0xD29C5380, 0x77DDC1FE, 0x9DF3018D, 0x38B293F3, + 0x7413C95F, 0xD1525B21, 0x3B7C9B52, 0x9E3D092C, 0xEACD6D45, 0x4F8CFF3B, 0xA5A23F48, 0x00E3AD36, + 0x3CE08A10, 0x99A1186E, 0x738FD81D, 0xD6CE4A63, 0xA23E2E0A, 0x077FBC74, 0xED517C07, 0x4810EE79, + 0x04B1B4D5, 0xA1F026AB, 0x4BDEE6D8, 0xEE9F74A6, 0x9A6F10CF, 0x3F2E82B1, 0xD50042C2, 0x7041D0BC, + 0xAD060C8E, 0x08479EF0, 0xE2695E83, 0x4728CCFD, 0x33D8A894, 0x96993AEA, 0x7CB7FA99, 0xD9F668E7, + 0x9557324B, 0x3016A035, 0xDA386046, 0x7F79F238, 0x0B899651, 0xAEC8042F, 0x44E6C45C, 0xE1A75622, + 0xDDA47104, 0x78E5E37A, 0x92CB2309, 0x378AB177, 0x437AD51E, 0xE63B4760, 0x0C158713, 0xA954156D, + 0xE5F54FC1, 0x40B4DDBF, 0xAA9A1DCC, 0x0FDB8FB2, 0x7B2BEBDB, 0xDE6A79A5, 0x3444B9D6, 0x91052BA8 }, { - 0x00000000, 0xDD45AAB8, 0xBF672381, 0x62228939, 0x7B2231F3, 0xA6679B4B, - 0xC4451272, 0x1900B8CA, 0xF64463E6, 0x2B01C95E, 0x49234067, 0x9466EADF, - 0x8D665215, 0x5023F8AD, 0x32017194, 0xEF44DB2C, 0xE964B13D, 0x34211B85, - 0x560392BC, 0x8B463804, 0x924680CE, 0x4F032A76, 0x2D21A34F, 0xF06409F7, - 0x1F20D2DB, 0xC2657863, 0xA047F15A, 0x7D025BE2, 0x6402E328, 0xB9474990, - 0xDB65C0A9, 0x06206A11, 0xD725148B, 0x0A60BE33, 0x6842370A, 0xB5079DB2, - 0xAC072578, 0x71428FC0, 0x136006F9, 0xCE25AC41, 0x2161776D, 0xFC24DDD5, - 0x9E0654EC, 0x4343FE54, 0x5A43469E, 0x8706EC26, 0xE524651F, 0x3861CFA7, - 0x3E41A5B6, 0xE3040F0E, 0x81268637, 0x5C632C8F, 0x45639445, 0x98263EFD, - 0xFA04B7C4, 0x27411D7C, 0xC805C650, 0x15406CE8, 0x7762E5D1, 0xAA274F69, - 0xB327F7A3, 0x6E625D1B, 0x0C40D422, 0xD1057E9A, 0xABA65FE7, 0x76E3F55F, - 0x14C17C66, 0xC984D6DE, 0xD0846E14, 0x0DC1C4AC, 0x6FE34D95, 0xB2A6E72D, - 0x5DE23C01, 0x80A796B9, 0xE2851F80, 0x3FC0B538, 0x26C00DF2, 0xFB85A74A, - 0x99A72E73, 0x44E284CB, 0x42C2EEDA, 0x9F874462, 0xFDA5CD5B, 0x20E067E3, - 0x39E0DF29, 0xE4A57591, 0x8687FCA8, 0x5BC25610, 0xB4868D3C, 0x69C32784, - 0x0BE1AEBD, 0xD6A40405, 0xCFA4BCCF, 0x12E11677, 0x70C39F4E, 0xAD8635F6, - 0x7C834B6C, 0xA1C6E1D4, 0xC3E468ED, 0x1EA1C255, 0x07A17A9F, 0xDAE4D027, - 0xB8C6591E, 0x6583F3A6, 0x8AC7288A, 0x57828232, 0x35A00B0B, 0xE8E5A1B3, - 0xF1E51979, 0x2CA0B3C1, 0x4E823AF8, 0x93C79040, 0x95E7FA51, 0x48A250E9, - 0x2A80D9D0, 0xF7C57368, 0xEEC5CBA2, 0x3380611A, 0x51A2E823, 0x8CE7429B, - 0x63A399B7, 0xBEE6330F, 0xDCC4BA36, 0x0181108E, 0x1881A844, 0xC5C402FC, - 0xA7E68BC5, 0x7AA3217D, 0x52A0C93F, 0x8FE56387, 0xEDC7EABE, 0x30824006, - 0x2982F8CC, 0xF4C75274, 0x96E5DB4D, 0x4BA071F5, 0xA4E4AAD9, 0x79A10061, - 0x1B838958, 0xC6C623E0, 0xDFC69B2A, 0x02833192, 0x60A1B8AB, 0xBDE41213, - 0xBBC47802, 0x6681D2BA, 0x04A35B83, 0xD9E6F13B, 0xC0E649F1, 0x1DA3E349, - 0x7F816A70, 0xA2C4C0C8, 0x4D801BE4, 0x90C5B15C, 0xF2E73865, 0x2FA292DD, - 0x36A22A17, 0xEBE780AF, 0x89C50996, 0x5480A32E, 0x8585DDB4, 0x58C0770C, - 0x3AE2FE35, 0xE7A7548D, 0xFEA7EC47, 0x23E246FF, 0x41C0CFC6, 0x9C85657E, - 0x73C1BE52, 0xAE8414EA, 0xCCA69DD3, 0x11E3376B, 0x08E38FA1, 0xD5A62519, - 0xB784AC20, 0x6AC10698, 0x6CE16C89, 0xB1A4C631, 0xD3864F08, 0x0EC3E5B0, - 0x17C35D7A, 0xCA86F7C2, 0xA8A47EFB, 0x75E1D443, 0x9AA50F6F, 0x47E0A5D7, - 0x25C22CEE, 0xF8878656, 0xE1873E9C, 0x3CC29424, 0x5EE01D1D, 0x83A5B7A5, - 0xF90696D8, 0x24433C60, 0x4661B559, 0x9B241FE1, 0x8224A72B, 0x5F610D93, - 0x3D4384AA, 0xE0062E12, 0x0F42F53E, 0xD2075F86, 0xB025D6BF, 0x6D607C07, - 0x7460C4CD, 0xA9256E75, 0xCB07E74C, 0x16424DF4, 0x106227E5, 0xCD278D5D, - 0xAF050464, 0x7240AEDC, 0x6B401616, 0xB605BCAE, 0xD4273597, 0x09629F2F, - 0xE6264403, 0x3B63EEBB, 0x59416782, 0x8404CD3A, 0x9D0475F0, 0x4041DF48, - 0x22635671, 0xFF26FCC9, 0x2E238253, 0xF36628EB, 0x9144A1D2, 0x4C010B6A, - 0x5501B3A0, 0x88441918, 0xEA669021, 0x37233A99, 0xD867E1B5, 0x05224B0D, - 0x6700C234, 0xBA45688C, 0xA345D046, 0x7E007AFE, 0x1C22F3C7, 0xC167597F, - 0xC747336E, 0x1A0299D6, 0x782010EF, 0xA565BA57, 0xBC65029D, 0x6120A825, - 0x0302211C, 0xDE478BA4, 0x31035088, 0xEC46FA30, 0x8E647309, 0x5321D9B1, - 0x4A21617B, 0x9764CBC3, 0xF54642FA, 0x2803E842, + 0x00000000, 0xDD45AAB8, 0xBF672381, 0x62228939, 0x7B2231F3, 0xA6679B4B, 0xC4451272, 0x1900B8CA, + 0xF64463E6, 0x2B01C95E, 0x49234067, 0x9466EADF, 0x8D665215, 0x5023F8AD, 0x32017194, 0xEF44DB2C, + 0xE964B13D, 0x34211B85, 0x560392BC, 0x8B463804, 0x924680CE, 0x4F032A76, 0x2D21A34F, 0xF06409F7, + 0x1F20D2DB, 0xC2657863, 0xA047F15A, 0x7D025BE2, 0x6402E328, 0xB9474990, 0xDB65C0A9, 0x06206A11, + 0xD725148B, 0x0A60BE33, 0x6842370A, 0xB5079DB2, 0xAC072578, 0x71428FC0, 0x136006F9, 0xCE25AC41, + 0x2161776D, 0xFC24DDD5, 0x9E0654EC, 0x4343FE54, 0x5A43469E, 0x8706EC26, 0xE524651F, 0x3861CFA7, + 0x3E41A5B6, 0xE3040F0E, 0x81268637, 0x5C632C8F, 0x45639445, 0x98263EFD, 0xFA04B7C4, 0x27411D7C, + 0xC805C650, 0x15406CE8, 0x7762E5D1, 0xAA274F69, 0xB327F7A3, 0x6E625D1B, 0x0C40D422, 0xD1057E9A, + 0xABA65FE7, 0x76E3F55F, 0x14C17C66, 0xC984D6DE, 0xD0846E14, 0x0DC1C4AC, 0x6FE34D95, 0xB2A6E72D, + 0x5DE23C01, 0x80A796B9, 0xE2851F80, 0x3FC0B538, 0x26C00DF2, 0xFB85A74A, 0x99A72E73, 0x44E284CB, + 0x42C2EEDA, 0x9F874462, 0xFDA5CD5B, 0x20E067E3, 0x39E0DF29, 0xE4A57591, 0x8687FCA8, 0x5BC25610, + 0xB4868D3C, 0x69C32784, 0x0BE1AEBD, 0xD6A40405, 0xCFA4BCCF, 0x12E11677, 0x70C39F4E, 0xAD8635F6, + 0x7C834B6C, 0xA1C6E1D4, 0xC3E468ED, 0x1EA1C255, 0x07A17A9F, 0xDAE4D027, 0xB8C6591E, 0x6583F3A6, + 0x8AC7288A, 0x57828232, 0x35A00B0B, 0xE8E5A1B3, 0xF1E51979, 0x2CA0B3C1, 0x4E823AF8, 0x93C79040, + 0x95E7FA51, 0x48A250E9, 0x2A80D9D0, 0xF7C57368, 0xEEC5CBA2, 0x3380611A, 0x51A2E823, 0x8CE7429B, + 0x63A399B7, 0xBEE6330F, 0xDCC4BA36, 0x0181108E, 0x1881A844, 0xC5C402FC, 0xA7E68BC5, 0x7AA3217D, + 0x52A0C93F, 0x8FE56387, 0xEDC7EABE, 0x30824006, 0x2982F8CC, 0xF4C75274, 0x96E5DB4D, 0x4BA071F5, + 0xA4E4AAD9, 0x79A10061, 0x1B838958, 0xC6C623E0, 0xDFC69B2A, 0x02833192, 0x60A1B8AB, 0xBDE41213, + 0xBBC47802, 0x6681D2BA, 0x04A35B83, 0xD9E6F13B, 0xC0E649F1, 0x1DA3E349, 0x7F816A70, 0xA2C4C0C8, + 0x4D801BE4, 0x90C5B15C, 0xF2E73865, 0x2FA292DD, 0x36A22A17, 0xEBE780AF, 0x89C50996, 0x5480A32E, + 0x8585DDB4, 0x58C0770C, 0x3AE2FE35, 0xE7A7548D, 0xFEA7EC47, 0x23E246FF, 0x41C0CFC6, 0x9C85657E, + 0x73C1BE52, 0xAE8414EA, 0xCCA69DD3, 0x11E3376B, 0x08E38FA1, 0xD5A62519, 0xB784AC20, 0x6AC10698, + 0x6CE16C89, 0xB1A4C631, 0xD3864F08, 0x0EC3E5B0, 0x17C35D7A, 0xCA86F7C2, 0xA8A47EFB, 0x75E1D443, + 0x9AA50F6F, 0x47E0A5D7, 0x25C22CEE, 0xF8878656, 0xE1873E9C, 0x3CC29424, 0x5EE01D1D, 0x83A5B7A5, + 0xF90696D8, 0x24433C60, 0x4661B559, 0x9B241FE1, 0x8224A72B, 0x5F610D93, 0x3D4384AA, 0xE0062E12, + 0x0F42F53E, 0xD2075F86, 0xB025D6BF, 0x6D607C07, 0x7460C4CD, 0xA9256E75, 0xCB07E74C, 0x16424DF4, + 0x106227E5, 0xCD278D5D, 0xAF050464, 0x7240AEDC, 0x6B401616, 0xB605BCAE, 0xD4273597, 0x09629F2F, + 0xE6264403, 0x3B63EEBB, 0x59416782, 0x8404CD3A, 0x9D0475F0, 0x4041DF48, 0x22635671, 0xFF26FCC9, + 0x2E238253, 0xF36628EB, 0x9144A1D2, 0x4C010B6A, 0x5501B3A0, 0x88441918, 0xEA669021, 0x37233A99, + 0xD867E1B5, 0x05224B0D, 0x6700C234, 0xBA45688C, 0xA345D046, 0x7E007AFE, 0x1C22F3C7, 0xC167597F, + 0xC747336E, 0x1A0299D6, 0x782010EF, 0xA565BA57, 0xBC65029D, 0x6120A825, 0x0302211C, 0xDE478BA4, + 0x31035088, 0xEC46FA30, 0x8E647309, 0x5321D9B1, 0x4A21617B, 0x9764CBC3, 0xF54642FA, 0x2803E842 }, { - 0x00000000, 0x38116FAC, 0x7022DF58, 0x4833B0F4, 0xE045BEB0, 0xD854D11C, - 0x906761E8, 0xA8760E44, 0xC5670B91, 0xFD76643D, 0xB545D4C9, 0x8D54BB65, - 0x2522B521, 0x1D33DA8D, 0x55006A79, 0x6D1105D5, 0x8F2261D3, 0xB7330E7F, - 0xFF00BE8B, 0xC711D127, 0x6F67DF63, 0x5776B0CF, 0x1F45003B, 0x27546F97, - 0x4A456A42, 0x725405EE, 0x3A67B51A, 0x0276DAB6, 0xAA00D4F2, 0x9211BB5E, - 0xDA220BAA, 0xE2336406, 0x1BA8B557, 0x23B9DAFB, 0x6B8A6A0F, 0x539B05A3, - 0xFBED0BE7, 0xC3FC644B, 0x8BCFD4BF, 0xB3DEBB13, 0xDECFBEC6, 0xE6DED16A, - 0xAEED619E, 0x96FC0E32, 0x3E8A0076, 0x069B6FDA, 0x4EA8DF2E, 0x76B9B082, - 0x948AD484, 0xAC9BBB28, 0xE4A80BDC, 0xDCB96470, 0x74CF6A34, 0x4CDE0598, - 0x04EDB56C, 0x3CFCDAC0, 0x51EDDF15, 0x69FCB0B9, 0x21CF004D, 0x19DE6FE1, - 0xB1A861A5, 0x89B90E09, 0xC18ABEFD, 0xF99BD151, 0x37516AAE, 0x0F400502, - 0x4773B5F6, 0x7F62DA5A, 0xD714D41E, 0xEF05BBB2, 0xA7360B46, 0x9F2764EA, - 0xF236613F, 0xCA270E93, 0x8214BE67, 0xBA05D1CB, 0x1273DF8F, 0x2A62B023, - 0x625100D7, 0x5A406F7B, 0xB8730B7D, 0x806264D1, 0xC851D425, 0xF040BB89, - 0x5836B5CD, 0x6027DA61, 0x28146A95, 0x10050539, 0x7D1400EC, 0x45056F40, - 0x0D36DFB4, 0x3527B018, 0x9D51BE5C, 0xA540D1F0, 0xED736104, 0xD5620EA8, - 0x2CF9DFF9, 0x14E8B055, 0x5CDB00A1, 0x64CA6F0D, 0xCCBC6149, 0xF4AD0EE5, - 0xBC9EBE11, 0x848FD1BD, 0xE99ED468, 0xD18FBBC4, 0x99BC0B30, 0xA1AD649C, - 0x09DB6AD8, 0x31CA0574, 0x79F9B580, 0x41E8DA2C, 0xA3DBBE2A, 0x9BCAD186, - 0xD3F96172, 0xEBE80EDE, 0x439E009A, 0x7B8F6F36, 0x33BCDFC2, 0x0BADB06E, - 0x66BCB5BB, 0x5EADDA17, 0x169E6AE3, 0x2E8F054F, 0x86F90B0B, 0xBEE864A7, - 0xF6DBD453, 0xCECABBFF, 0x6EA2D55C, 0x56B3BAF0, 0x1E800A04, 0x269165A8, - 0x8EE76BEC, 0xB6F60440, 0xFEC5B4B4, 0xC6D4DB18, 0xABC5DECD, 0x93D4B161, - 0xDBE70195, 0xE3F66E39, 0x4B80607D, 0x73910FD1, 0x3BA2BF25, 0x03B3D089, - 0xE180B48F, 0xD991DB23, 0x91A26BD7, 0xA9B3047B, 0x01C50A3F, 0x39D46593, - 0x71E7D567, 0x49F6BACB, 0x24E7BF1E, 0x1CF6D0B2, 0x54C56046, 0x6CD40FEA, - 0xC4A201AE, 0xFCB36E02, 0xB480DEF6, 0x8C91B15A, 0x750A600B, 0x4D1B0FA7, - 0x0528BF53, 0x3D39D0FF, 0x954FDEBB, 0xAD5EB117, 0xE56D01E3, 0xDD7C6E4F, - 0xB06D6B9A, 0x887C0436, 0xC04FB4C2, 0xF85EDB6E, 0x5028D52A, 0x6839BA86, - 0x200A0A72, 0x181B65DE, 0xFA2801D8, 0xC2396E74, 0x8A0ADE80, 0xB21BB12C, - 0x1A6DBF68, 0x227CD0C4, 0x6A4F6030, 0x525E0F9C, 0x3F4F0A49, 0x075E65E5, - 0x4F6DD511, 0x777CBABD, 0xDF0AB4F9, 0xE71BDB55, 0xAF286BA1, 0x9739040D, - 0x59F3BFF2, 0x61E2D05E, 0x29D160AA, 0x11C00F06, 0xB9B60142, 0x81A76EEE, - 0xC994DE1A, 0xF185B1B6, 0x9C94B463, 0xA485DBCF, 0xECB66B3B, 0xD4A70497, - 0x7CD10AD3, 0x44C0657F, 0x0CF3D58B, 0x34E2BA27, 0xD6D1DE21, 0xEEC0B18D, - 0xA6F30179, 0x9EE26ED5, 0x36946091, 0x0E850F3D, 0x46B6BFC9, 0x7EA7D065, - 0x13B6D5B0, 0x2BA7BA1C, 0x63940AE8, 0x5B856544, 0xF3F36B00, 0xCBE204AC, - 0x83D1B458, 0xBBC0DBF4, 0x425B0AA5, 0x7A4A6509, 0x3279D5FD, 0x0A68BA51, - 0xA21EB415, 0x9A0FDBB9, 0xD23C6B4D, 0xEA2D04E1, 0x873C0134, 0xBF2D6E98, - 0xF71EDE6C, 0xCF0FB1C0, 0x6779BF84, 0x5F68D028, 0x175B60DC, 0x2F4A0F70, - 0xCD796B76, 0xF56804DA, 0xBD5BB42E, 0x854ADB82, 0x2D3CD5C6, 0x152DBA6A, - 0x5D1E0A9E, 0x650F6532, 0x081E60E7, 0x300F0F4B, 0x783CBFBF, 0x402DD013, - 0xE85BDE57, 0xD04AB1FB, 0x9879010F, 0xA0686EA3, + 0x00000000, 0x38116FAC, 0x7022DF58, 0x4833B0F4, 0xE045BEB0, 0xD854D11C, 0x906761E8, 0xA8760E44, + 0xC5670B91, 0xFD76643D, 0xB545D4C9, 0x8D54BB65, 0x2522B521, 0x1D33DA8D, 0x55006A79, 0x6D1105D5, + 0x8F2261D3, 0xB7330E7F, 0xFF00BE8B, 0xC711D127, 0x6F67DF63, 0x5776B0CF, 0x1F45003B, 0x27546F97, + 0x4A456A42, 0x725405EE, 0x3A67B51A, 0x0276DAB6, 0xAA00D4F2, 0x9211BB5E, 0xDA220BAA, 0xE2336406, + 0x1BA8B557, 0x23B9DAFB, 0x6B8A6A0F, 0x539B05A3, 0xFBED0BE7, 0xC3FC644B, 0x8BCFD4BF, 0xB3DEBB13, + 0xDECFBEC6, 0xE6DED16A, 0xAEED619E, 0x96FC0E32, 0x3E8A0076, 0x069B6FDA, 0x4EA8DF2E, 0x76B9B082, + 0x948AD484, 0xAC9BBB28, 0xE4A80BDC, 0xDCB96470, 0x74CF6A34, 0x4CDE0598, 0x04EDB56C, 0x3CFCDAC0, + 0x51EDDF15, 0x69FCB0B9, 0x21CF004D, 0x19DE6FE1, 0xB1A861A5, 0x89B90E09, 0xC18ABEFD, 0xF99BD151, + 0x37516AAE, 0x0F400502, 0x4773B5F6, 0x7F62DA5A, 0xD714D41E, 0xEF05BBB2, 0xA7360B46, 0x9F2764EA, + 0xF236613F, 0xCA270E93, 0x8214BE67, 0xBA05D1CB, 0x1273DF8F, 0x2A62B023, 0x625100D7, 0x5A406F7B, + 0xB8730B7D, 0x806264D1, 0xC851D425, 0xF040BB89, 0x5836B5CD, 0x6027DA61, 0x28146A95, 0x10050539, + 0x7D1400EC, 0x45056F40, 0x0D36DFB4, 0x3527B018, 0x9D51BE5C, 0xA540D1F0, 0xED736104, 0xD5620EA8, + 0x2CF9DFF9, 0x14E8B055, 0x5CDB00A1, 0x64CA6F0D, 0xCCBC6149, 0xF4AD0EE5, 0xBC9EBE11, 0x848FD1BD, + 0xE99ED468, 0xD18FBBC4, 0x99BC0B30, 0xA1AD649C, 0x09DB6AD8, 0x31CA0574, 0x79F9B580, 0x41E8DA2C, + 0xA3DBBE2A, 0x9BCAD186, 0xD3F96172, 0xEBE80EDE, 0x439E009A, 0x7B8F6F36, 0x33BCDFC2, 0x0BADB06E, + 0x66BCB5BB, 0x5EADDA17, 0x169E6AE3, 0x2E8F054F, 0x86F90B0B, 0xBEE864A7, 0xF6DBD453, 0xCECABBFF, + 0x6EA2D55C, 0x56B3BAF0, 0x1E800A04, 0x269165A8, 0x8EE76BEC, 0xB6F60440, 0xFEC5B4B4, 0xC6D4DB18, + 0xABC5DECD, 0x93D4B161, 0xDBE70195, 0xE3F66E39, 0x4B80607D, 0x73910FD1, 0x3BA2BF25, 0x03B3D089, + 0xE180B48F, 0xD991DB23, 0x91A26BD7, 0xA9B3047B, 0x01C50A3F, 0x39D46593, 0x71E7D567, 0x49F6BACB, + 0x24E7BF1E, 0x1CF6D0B2, 0x54C56046, 0x6CD40FEA, 0xC4A201AE, 0xFCB36E02, 0xB480DEF6, 0x8C91B15A, + 0x750A600B, 0x4D1B0FA7, 0x0528BF53, 0x3D39D0FF, 0x954FDEBB, 0xAD5EB117, 0xE56D01E3, 0xDD7C6E4F, + 0xB06D6B9A, 0x887C0436, 0xC04FB4C2, 0xF85EDB6E, 0x5028D52A, 0x6839BA86, 0x200A0A72, 0x181B65DE, + 0xFA2801D8, 0xC2396E74, 0x8A0ADE80, 0xB21BB12C, 0x1A6DBF68, 0x227CD0C4, 0x6A4F6030, 0x525E0F9C, + 0x3F4F0A49, 0x075E65E5, 0x4F6DD511, 0x777CBABD, 0xDF0AB4F9, 0xE71BDB55, 0xAF286BA1, 0x9739040D, + 0x59F3BFF2, 0x61E2D05E, 0x29D160AA, 0x11C00F06, 0xB9B60142, 0x81A76EEE, 0xC994DE1A, 0xF185B1B6, + 0x9C94B463, 0xA485DBCF, 0xECB66B3B, 0xD4A70497, 0x7CD10AD3, 0x44C0657F, 0x0CF3D58B, 0x34E2BA27, + 0xD6D1DE21, 0xEEC0B18D, 0xA6F30179, 0x9EE26ED5, 0x36946091, 0x0E850F3D, 0x46B6BFC9, 0x7EA7D065, + 0x13B6D5B0, 0x2BA7BA1C, 0x63940AE8, 0x5B856544, 0xF3F36B00, 0xCBE204AC, 0x83D1B458, 0xBBC0DBF4, + 0x425B0AA5, 0x7A4A6509, 0x3279D5FD, 0x0A68BA51, 0xA21EB415, 0x9A0FDBB9, 0xD23C6B4D, 0xEA2D04E1, + 0x873C0134, 0xBF2D6E98, 0xF71EDE6C, 0xCF0FB1C0, 0x6779BF84, 0x5F68D028, 0x175B60DC, 0x2F4A0F70, + 0xCD796B76, 0xF56804DA, 0xBD5BB42E, 0x854ADB82, 0x2D3CD5C6, 0x152DBA6A, 0x5D1E0A9E, 0x650F6532, + 0x081E60E7, 0x300F0F4B, 0x783CBFBF, 0x402DD013, 0xE85BDE57, 0xD04AB1FB, 0x9879010F, 0xA0686EA3 }, { - 0x00000000, 0xEF306B19, 0xDB8CA0C3, 0x34BCCBDA, 0xB2F53777, 0x5DC55C6E, - 0x697997B4, 0x8649FCAD, 0x6006181F, 0x8F367306, 0xBB8AB8DC, 0x54BAD3C5, - 0xD2F32F68, 0x3DC34471, 0x097F8FAB, 0xE64FE4B2, 0xC00C303E, 0x2F3C5B27, - 0x1B8090FD, 0xF4B0FBE4, 0x72F90749, 0x9DC96C50, 0xA975A78A, 0x4645CC93, - 0xA00A2821, 0x4F3A4338, 0x7B8688E2, 0x94B6E3FB, 0x12FF1F56, 0xFDCF744F, - 0xC973BF95, 0x2643D48C, 0x85F4168D, 0x6AC47D94, 0x5E78B64E, 0xB148DD57, - 0x370121FA, 0xD8314AE3, 0xEC8D8139, 0x03BDEA20, 0xE5F20E92, 0x0AC2658B, - 0x3E7EAE51, 0xD14EC548, 0x570739E5, 0xB83752FC, 0x8C8B9926, 0x63BBF23F, - 0x45F826B3, 0xAAC84DAA, 0x9E748670, 0x7144ED69, 0xF70D11C4, 0x183D7ADD, - 0x2C81B107, 0xC3B1DA1E, 0x25FE3EAC, 0xCACE55B5, 0xFE729E6F, 0x1142F576, - 0x970B09DB, 0x783B62C2, 0x4C87A918, 0xA3B7C201, 0x0E045BEB, 0xE13430F2, - 0xD588FB28, 0x3AB89031, 0xBCF16C9C, 0x53C10785, 0x677DCC5F, 0x884DA746, - 0x6E0243F4, 0x813228ED, 0xB58EE337, 0x5ABE882E, 0xDCF77483, 0x33C71F9A, - 0x077BD440, 0xE84BBF59, 0xCE086BD5, 0x213800CC, 0x1584CB16, 0xFAB4A00F, - 0x7CFD5CA2, 0x93CD37BB, 0xA771FC61, 0x48419778, 0xAE0E73CA, 0x413E18D3, - 0x7582D309, 0x9AB2B810, 0x1CFB44BD, 0xF3CB2FA4, 0xC777E47E, 0x28478F67, - 0x8BF04D66, 0x64C0267F, 0x507CEDA5, 0xBF4C86BC, 0x39057A11, 0xD6351108, - 0xE289DAD2, 0x0DB9B1CB, 0xEBF65579, 0x04C63E60, 0x307AF5BA, 0xDF4A9EA3, - 0x5903620E, 0xB6330917, 0x828FC2CD, 0x6DBFA9D4, 0x4BFC7D58, 0xA4CC1641, - 0x9070DD9B, 0x7F40B682, 0xF9094A2F, 0x16392136, 0x2285EAEC, 0xCDB581F5, - 0x2BFA6547, 0xC4CA0E5E, 0xF076C584, 0x1F46AE9D, 0x990F5230, 0x763F3929, - 0x4283F2F3, 0xADB399EA, 0x1C08B7D6, 0xF338DCCF, 0xC7841715, 0x28B47C0C, - 0xAEFD80A1, 0x41CDEBB8, 0x75712062, 0x9A414B7B, 0x7C0EAFC9, 0x933EC4D0, - 0xA7820F0A, 0x48B26413, 0xCEFB98BE, 0x21CBF3A7, 0x1577387D, 0xFA475364, - 0xDC0487E8, 0x3334ECF1, 0x0788272B, 0xE8B84C32, 0x6EF1B09F, 0x81C1DB86, - 0xB57D105C, 0x5A4D7B45, 0xBC029FF7, 0x5332F4EE, 0x678E3F34, 0x88BE542D, - 0x0EF7A880, 0xE1C7C399, 0xD57B0843, 0x3A4B635A, 0x99FCA15B, 0x76CCCA42, - 0x42700198, 0xAD406A81, 0x2B09962C, 0xC439FD35, 0xF08536EF, 0x1FB55DF6, - 0xF9FAB944, 0x16CAD25D, 0x22761987, 0xCD46729E, 0x4B0F8E33, 0xA43FE52A, - 0x90832EF0, 0x7FB345E9, 0x59F09165, 0xB6C0FA7C, 0x827C31A6, 0x6D4C5ABF, - 0xEB05A612, 0x0435CD0B, 0x308906D1, 0xDFB96DC8, 0x39F6897A, 0xD6C6E263, - 0xE27A29B9, 0x0D4A42A0, 0x8B03BE0D, 0x6433D514, 0x508F1ECE, 0xBFBF75D7, - 0x120CEC3D, 0xFD3C8724, 0xC9804CFE, 0x26B027E7, 0xA0F9DB4A, 0x4FC9B053, - 0x7B757B89, 0x94451090, 0x720AF422, 0x9D3A9F3B, 0xA98654E1, 0x46B63FF8, - 0xC0FFC355, 0x2FCFA84C, 0x1B736396, 0xF443088F, 0xD200DC03, 0x3D30B71A, - 0x098C7CC0, 0xE6BC17D9, 0x60F5EB74, 0x8FC5806D, 0xBB794BB7, 0x544920AE, - 0xB206C41C, 0x5D36AF05, 0x698A64DF, 0x86BA0FC6, 0x00F3F36B, 0xEFC39872, - 0xDB7F53A8, 0x344F38B1, 0x97F8FAB0, 0x78C891A9, 0x4C745A73, 0xA344316A, - 0x250DCDC7, 0xCA3DA6DE, 0xFE816D04, 0x11B1061D, 0xF7FEE2AF, 0x18CE89B6, - 0x2C72426C, 0xC3422975, 0x450BD5D8, 0xAA3BBEC1, 0x9E87751B, 0x71B71E02, - 0x57F4CA8E, 0xB8C4A197, 0x8C786A4D, 0x63480154, 0xE501FDF9, 0x0A3196E0, - 0x3E8D5D3A, 0xD1BD3623, 0x37F2D291, 0xD8C2B988, 0xEC7E7252, 0x034E194B, - 0x8507E5E6, 0x6A378EFF, 0x5E8B4525, 0xB1BB2E3C, + 0x00000000, 0xEF306B19, 0xDB8CA0C3, 0x34BCCBDA, 0xB2F53777, 0x5DC55C6E, 0x697997B4, 0x8649FCAD, + 0x6006181F, 0x8F367306, 0xBB8AB8DC, 0x54BAD3C5, 0xD2F32F68, 0x3DC34471, 0x097F8FAB, 0xE64FE4B2, + 0xC00C303E, 0x2F3C5B27, 0x1B8090FD, 0xF4B0FBE4, 0x72F90749, 0x9DC96C50, 0xA975A78A, 0x4645CC93, + 0xA00A2821, 0x4F3A4338, 0x7B8688E2, 0x94B6E3FB, 0x12FF1F56, 0xFDCF744F, 0xC973BF95, 0x2643D48C, + 0x85F4168D, 0x6AC47D94, 0x5E78B64E, 0xB148DD57, 0x370121FA, 0xD8314AE3, 0xEC8D8139, 0x03BDEA20, + 0xE5F20E92, 0x0AC2658B, 0x3E7EAE51, 0xD14EC548, 0x570739E5, 0xB83752FC, 0x8C8B9926, 0x63BBF23F, + 0x45F826B3, 0xAAC84DAA, 0x9E748670, 0x7144ED69, 0xF70D11C4, 0x183D7ADD, 0x2C81B107, 0xC3B1DA1E, + 0x25FE3EAC, 0xCACE55B5, 0xFE729E6F, 0x1142F576, 0x970B09DB, 0x783B62C2, 0x4C87A918, 0xA3B7C201, + 0x0E045BEB, 0xE13430F2, 0xD588FB28, 0x3AB89031, 0xBCF16C9C, 0x53C10785, 0x677DCC5F, 0x884DA746, + 0x6E0243F4, 0x813228ED, 0xB58EE337, 0x5ABE882E, 0xDCF77483, 0x33C71F9A, 0x077BD440, 0xE84BBF59, + 0xCE086BD5, 0x213800CC, 0x1584CB16, 0xFAB4A00F, 0x7CFD5CA2, 0x93CD37BB, 0xA771FC61, 0x48419778, + 0xAE0E73CA, 0x413E18D3, 0x7582D309, 0x9AB2B810, 0x1CFB44BD, 0xF3CB2FA4, 0xC777E47E, 0x28478F67, + 0x8BF04D66, 0x64C0267F, 0x507CEDA5, 0xBF4C86BC, 0x39057A11, 0xD6351108, 0xE289DAD2, 0x0DB9B1CB, + 0xEBF65579, 0x04C63E60, 0x307AF5BA, 0xDF4A9EA3, 0x5903620E, 0xB6330917, 0x828FC2CD, 0x6DBFA9D4, + 0x4BFC7D58, 0xA4CC1641, 0x9070DD9B, 0x7F40B682, 0xF9094A2F, 0x16392136, 0x2285EAEC, 0xCDB581F5, + 0x2BFA6547, 0xC4CA0E5E, 0xF076C584, 0x1F46AE9D, 0x990F5230, 0x763F3929, 0x4283F2F3, 0xADB399EA, + 0x1C08B7D6, 0xF338DCCF, 0xC7841715, 0x28B47C0C, 0xAEFD80A1, 0x41CDEBB8, 0x75712062, 0x9A414B7B, + 0x7C0EAFC9, 0x933EC4D0, 0xA7820F0A, 0x48B26413, 0xCEFB98BE, 0x21CBF3A7, 0x1577387D, 0xFA475364, + 0xDC0487E8, 0x3334ECF1, 0x0788272B, 0xE8B84C32, 0x6EF1B09F, 0x81C1DB86, 0xB57D105C, 0x5A4D7B45, + 0xBC029FF7, 0x5332F4EE, 0x678E3F34, 0x88BE542D, 0x0EF7A880, 0xE1C7C399, 0xD57B0843, 0x3A4B635A, + 0x99FCA15B, 0x76CCCA42, 0x42700198, 0xAD406A81, 0x2B09962C, 0xC439FD35, 0xF08536EF, 0x1FB55DF6, + 0xF9FAB944, 0x16CAD25D, 0x22761987, 0xCD46729E, 0x4B0F8E33, 0xA43FE52A, 0x90832EF0, 0x7FB345E9, + 0x59F09165, 0xB6C0FA7C, 0x827C31A6, 0x6D4C5ABF, 0xEB05A612, 0x0435CD0B, 0x308906D1, 0xDFB96DC8, + 0x39F6897A, 0xD6C6E263, 0xE27A29B9, 0x0D4A42A0, 0x8B03BE0D, 0x6433D514, 0x508F1ECE, 0xBFBF75D7, + 0x120CEC3D, 0xFD3C8724, 0xC9804CFE, 0x26B027E7, 0xA0F9DB4A, 0x4FC9B053, 0x7B757B89, 0x94451090, + 0x720AF422, 0x9D3A9F3B, 0xA98654E1, 0x46B63FF8, 0xC0FFC355, 0x2FCFA84C, 0x1B736396, 0xF443088F, + 0xD200DC03, 0x3D30B71A, 0x098C7CC0, 0xE6BC17D9, 0x60F5EB74, 0x8FC5806D, 0xBB794BB7, 0x544920AE, + 0xB206C41C, 0x5D36AF05, 0x698A64DF, 0x86BA0FC6, 0x00F3F36B, 0xEFC39872, 0xDB7F53A8, 0x344F38B1, + 0x97F8FAB0, 0x78C891A9, 0x4C745A73, 0xA344316A, 0x250DCDC7, 0xCA3DA6DE, 0xFE816D04, 0x11B1061D, + 0xF7FEE2AF, 0x18CE89B6, 0x2C72426C, 0xC3422975, 0x450BD5D8, 0xAA3BBEC1, 0x9E87751B, 0x71B71E02, + 0x57F4CA8E, 0xB8C4A197, 0x8C786A4D, 0x63480154, 0xE501FDF9, 0x0A3196E0, 0x3E8D5D3A, 0xD1BD3623, + 0x37F2D291, 0xD8C2B988, 0xEC7E7252, 0x034E194B, 0x8507E5E6, 0x6A378EFF, 0x5E8B4525, 0xB1BB2E3C }, { - 0x00000000, 0x68032CC8, 0xD0065990, 0xB8057558, 0xA5E0C5D1, 0xCDE3E919, - 0x75E69C41, 0x1DE5B089, 0x4E2DFD53, 0x262ED19B, 0x9E2BA4C3, 0xF628880B, - 0xEBCD3882, 0x83CE144A, 0x3BCB6112, 0x53C84DDA, 0x9C5BFAA6, 0xF458D66E, - 0x4C5DA336, 0x245E8FFE, 0x39BB3F77, 0x51B813BF, 0xE9BD66E7, 0x81BE4A2F, - 0xD27607F5, 0xBA752B3D, 0x02705E65, 0x6A7372AD, 0x7796C224, 0x1F95EEEC, - 0xA7909BB4, 0xCF93B77C, 0x3D5B83BD, 0x5558AF75, 0xED5DDA2D, 0x855EF6E5, - 0x98BB466C, 0xF0B86AA4, 0x48BD1FFC, 0x20BE3334, 0x73767EEE, 0x1B755226, - 0xA370277E, 0xCB730BB6, 0xD696BB3F, 0xBE9597F7, 0x0690E2AF, 0x6E93CE67, - 0xA100791B, 0xC90355D3, 0x7106208B, 0x19050C43, 0x04E0BCCA, 0x6CE39002, - 0xD4E6E55A, 0xBCE5C992, 0xEF2D8448, 0x872EA880, 0x3F2BDDD8, 0x5728F110, - 0x4ACD4199, 0x22CE6D51, 0x9ACB1809, 0xF2C834C1, 0x7AB7077A, 0x12B42BB2, - 0xAAB15EEA, 0xC2B27222, 0xDF57C2AB, 0xB754EE63, 0x0F519B3B, 0x6752B7F3, - 0x349AFA29, 0x5C99D6E1, 0xE49CA3B9, 0x8C9F8F71, 0x917A3FF8, 0xF9791330, - 0x417C6668, 0x297F4AA0, 0xE6ECFDDC, 0x8EEFD114, 0x36EAA44C, 0x5EE98884, - 0x430C380D, 0x2B0F14C5, 0x930A619D, 0xFB094D55, 0xA8C1008F, 0xC0C22C47, - 0x78C7591F, 0x10C475D7, 0x0D21C55E, 0x6522E996, 0xDD279CCE, 0xB524B006, - 0x47EC84C7, 0x2FEFA80F, 0x97EADD57, 0xFFE9F19F, 0xE20C4116, 0x8A0F6DDE, - 0x320A1886, 0x5A09344E, 0x09C17994, 0x61C2555C, 0xD9C72004, 0xB1C40CCC, - 0xAC21BC45, 0xC422908D, 0x7C27E5D5, 0x1424C91D, 0xDBB77E61, 0xB3B452A9, - 0x0BB127F1, 0x63B20B39, 0x7E57BBB0, 0x16549778, 0xAE51E220, 0xC652CEE8, - 0x959A8332, 0xFD99AFFA, 0x459CDAA2, 0x2D9FF66A, 0x307A46E3, 0x58796A2B, - 0xE07C1F73, 0x887F33BB, 0xF56E0EF4, 0x9D6D223C, 0x25685764, 0x4D6B7BAC, - 0x508ECB25, 0x388DE7ED, 0x808892B5, 0xE88BBE7D, 0xBB43F3A7, 0xD340DF6F, - 0x6B45AA37, 0x034686FF, 0x1EA33676, 0x76A01ABE, 0xCEA56FE6, 0xA6A6432E, - 0x6935F452, 0x0136D89A, 0xB933ADC2, 0xD130810A, 0xCCD53183, 0xA4D61D4B, - 0x1CD36813, 0x74D044DB, 0x27180901, 0x4F1B25C9, 0xF71E5091, 0x9F1D7C59, - 0x82F8CCD0, 0xEAFBE018, 0x52FE9540, 0x3AFDB988, 0xC8358D49, 0xA036A181, - 0x1833D4D9, 0x7030F811, 0x6DD54898, 0x05D66450, 0xBDD31108, 0xD5D03DC0, - 0x8618701A, 0xEE1B5CD2, 0x561E298A, 0x3E1D0542, 0x23F8B5CB, 0x4BFB9903, - 0xF3FEEC5B, 0x9BFDC093, 0x546E77EF, 0x3C6D5B27, 0x84682E7F, 0xEC6B02B7, - 0xF18EB23E, 0x998D9EF6, 0x2188EBAE, 0x498BC766, 0x1A438ABC, 0x7240A674, - 0xCA45D32C, 0xA246FFE4, 0xBFA34F6D, 0xD7A063A5, 0x6FA516FD, 0x07A63A35, - 0x8FD9098E, 0xE7DA2546, 0x5FDF501E, 0x37DC7CD6, 0x2A39CC5F, 0x423AE097, - 0xFA3F95CF, 0x923CB907, 0xC1F4F4DD, 0xA9F7D815, 0x11F2AD4D, 0x79F18185, - 0x6414310C, 0x0C171DC4, 0xB412689C, 0xDC114454, 0x1382F328, 0x7B81DFE0, - 0xC384AAB8, 0xAB878670, 0xB66236F9, 0xDE611A31, 0x66646F69, 0x0E6743A1, - 0x5DAF0E7B, 0x35AC22B3, 0x8DA957EB, 0xE5AA7B23, 0xF84FCBAA, 0x904CE762, - 0x2849923A, 0x404ABEF2, 0xB2828A33, 0xDA81A6FB, 0x6284D3A3, 0x0A87FF6B, - 0x17624FE2, 0x7F61632A, 0xC7641672, 0xAF673ABA, 0xFCAF7760, 0x94AC5BA8, - 0x2CA92EF0, 0x44AA0238, 0x594FB2B1, 0x314C9E79, 0x8949EB21, 0xE14AC7E9, - 0x2ED97095, 0x46DA5C5D, 0xFEDF2905, 0x96DC05CD, 0x8B39B544, 0xE33A998C, - 0x5B3FECD4, 0x333CC01C, 0x60F48DC6, 0x08F7A10E, 0xB0F2D456, 0xD8F1F89E, - 0xC5144817, 0xAD1764DF, 0x15121187, 0x7D113D4F, + 0x00000000, 0x68032CC8, 0xD0065990, 0xB8057558, 0xA5E0C5D1, 0xCDE3E919, 0x75E69C41, 0x1DE5B089, + 0x4E2DFD53, 0x262ED19B, 0x9E2BA4C3, 0xF628880B, 0xEBCD3882, 0x83CE144A, 0x3BCB6112, 0x53C84DDA, + 0x9C5BFAA6, 0xF458D66E, 0x4C5DA336, 0x245E8FFE, 0x39BB3F77, 0x51B813BF, 0xE9BD66E7, 0x81BE4A2F, + 0xD27607F5, 0xBA752B3D, 0x02705E65, 0x6A7372AD, 0x7796C224, 0x1F95EEEC, 0xA7909BB4, 0xCF93B77C, + 0x3D5B83BD, 0x5558AF75, 0xED5DDA2D, 0x855EF6E5, 0x98BB466C, 0xF0B86AA4, 0x48BD1FFC, 0x20BE3334, + 0x73767EEE, 0x1B755226, 0xA370277E, 0xCB730BB6, 0xD696BB3F, 0xBE9597F7, 0x0690E2AF, 0x6E93CE67, + 0xA100791B, 0xC90355D3, 0x7106208B, 0x19050C43, 0x04E0BCCA, 0x6CE39002, 0xD4E6E55A, 0xBCE5C992, + 0xEF2D8448, 0x872EA880, 0x3F2BDDD8, 0x5728F110, 0x4ACD4199, 0x22CE6D51, 0x9ACB1809, 0xF2C834C1, + 0x7AB7077A, 0x12B42BB2, 0xAAB15EEA, 0xC2B27222, 0xDF57C2AB, 0xB754EE63, 0x0F519B3B, 0x6752B7F3, + 0x349AFA29, 0x5C99D6E1, 0xE49CA3B9, 0x8C9F8F71, 0x917A3FF8, 0xF9791330, 0x417C6668, 0x297F4AA0, + 0xE6ECFDDC, 0x8EEFD114, 0x36EAA44C, 0x5EE98884, 0x430C380D, 0x2B0F14C5, 0x930A619D, 0xFB094D55, + 0xA8C1008F, 0xC0C22C47, 0x78C7591F, 0x10C475D7, 0x0D21C55E, 0x6522E996, 0xDD279CCE, 0xB524B006, + 0x47EC84C7, 0x2FEFA80F, 0x97EADD57, 0xFFE9F19F, 0xE20C4116, 0x8A0F6DDE, 0x320A1886, 0x5A09344E, + 0x09C17994, 0x61C2555C, 0xD9C72004, 0xB1C40CCC, 0xAC21BC45, 0xC422908D, 0x7C27E5D5, 0x1424C91D, + 0xDBB77E61, 0xB3B452A9, 0x0BB127F1, 0x63B20B39, 0x7E57BBB0, 0x16549778, 0xAE51E220, 0xC652CEE8, + 0x959A8332, 0xFD99AFFA, 0x459CDAA2, 0x2D9FF66A, 0x307A46E3, 0x58796A2B, 0xE07C1F73, 0x887F33BB, + 0xF56E0EF4, 0x9D6D223C, 0x25685764, 0x4D6B7BAC, 0x508ECB25, 0x388DE7ED, 0x808892B5, 0xE88BBE7D, + 0xBB43F3A7, 0xD340DF6F, 0x6B45AA37, 0x034686FF, 0x1EA33676, 0x76A01ABE, 0xCEA56FE6, 0xA6A6432E, + 0x6935F452, 0x0136D89A, 0xB933ADC2, 0xD130810A, 0xCCD53183, 0xA4D61D4B, 0x1CD36813, 0x74D044DB, + 0x27180901, 0x4F1B25C9, 0xF71E5091, 0x9F1D7C59, 0x82F8CCD0, 0xEAFBE018, 0x52FE9540, 0x3AFDB988, + 0xC8358D49, 0xA036A181, 0x1833D4D9, 0x7030F811, 0x6DD54898, 0x05D66450, 0xBDD31108, 0xD5D03DC0, + 0x8618701A, 0xEE1B5CD2, 0x561E298A, 0x3E1D0542, 0x23F8B5CB, 0x4BFB9903, 0xF3FEEC5B, 0x9BFDC093, + 0x546E77EF, 0x3C6D5B27, 0x84682E7F, 0xEC6B02B7, 0xF18EB23E, 0x998D9EF6, 0x2188EBAE, 0x498BC766, + 0x1A438ABC, 0x7240A674, 0xCA45D32C, 0xA246FFE4, 0xBFA34F6D, 0xD7A063A5, 0x6FA516FD, 0x07A63A35, + 0x8FD9098E, 0xE7DA2546, 0x5FDF501E, 0x37DC7CD6, 0x2A39CC5F, 0x423AE097, 0xFA3F95CF, 0x923CB907, + 0xC1F4F4DD, 0xA9F7D815, 0x11F2AD4D, 0x79F18185, 0x6414310C, 0x0C171DC4, 0xB412689C, 0xDC114454, + 0x1382F328, 0x7B81DFE0, 0xC384AAB8, 0xAB878670, 0xB66236F9, 0xDE611A31, 0x66646F69, 0x0E6743A1, + 0x5DAF0E7B, 0x35AC22B3, 0x8DA957EB, 0xE5AA7B23, 0xF84FCBAA, 0x904CE762, 0x2849923A, 0x404ABEF2, + 0xB2828A33, 0xDA81A6FB, 0x6284D3A3, 0x0A87FF6B, 0x17624FE2, 0x7F61632A, 0xC7641672, 0xAF673ABA, + 0xFCAF7760, 0x94AC5BA8, 0x2CA92EF0, 0x44AA0238, 0x594FB2B1, 0x314C9E79, 0x8949EB21, 0xE14AC7E9, + 0x2ED97095, 0x46DA5C5D, 0xFEDF2905, 0x96DC05CD, 0x8B39B544, 0xE33A998C, 0x5B3FECD4, 0x333CC01C, + 0x60F48DC6, 0x08F7A10E, 0xB0F2D456, 0xD8F1F89E, 0xC5144817, 0xAD1764DF, 0x15121187, 0x7D113D4F }, { - 0x00000000, 0x493C7D27, 0x9278FA4E, 0xDB448769, 0x211D826D, 0x6821FF4A, - 0xB3657823, 0xFA590504, 0x423B04DA, 0x0B0779FD, 0xD043FE94, 0x997F83B3, - 0x632686B7, 0x2A1AFB90, 0xF15E7CF9, 0xB86201DE, 0x847609B4, 0xCD4A7493, - 0x160EF3FA, 0x5F328EDD, 0xA56B8BD9, 0xEC57F6FE, 0x37137197, 0x7E2F0CB0, - 0xC64D0D6E, 0x8F717049, 0x5435F720, 0x1D098A07, 0xE7508F03, 0xAE6CF224, - 0x7528754D, 0x3C14086A, 0x0D006599, 0x443C18BE, 0x9F789FD7, 0xD644E2F0, - 0x2C1DE7F4, 0x65219AD3, 0xBE651DBA, 0xF759609D, 0x4F3B6143, 0x06071C64, - 0xDD439B0D, 0x947FE62A, 0x6E26E32E, 0x271A9E09, 0xFC5E1960, 0xB5626447, - 0x89766C2D, 0xC04A110A, 0x1B0E9663, 0x5232EB44, 0xA86BEE40, 0xE1579367, - 0x3A13140E, 0x732F6929, 0xCB4D68F7, 0x827115D0, 0x593592B9, 0x1009EF9E, - 0xEA50EA9A, 0xA36C97BD, 0x782810D4, 0x31146DF3, 0x1A00CB32, 0x533CB615, - 0x8878317C, 0xC1444C5B, 0x3B1D495F, 0x72213478, 0xA965B311, 0xE059CE36, - 0x583BCFE8, 0x1107B2CF, 0xCA4335A6, 0x837F4881, 0x79264D85, 0x301A30A2, - 0xEB5EB7CB, 0xA262CAEC, 0x9E76C286, 0xD74ABFA1, 0x0C0E38C8, 0x453245EF, - 0xBF6B40EB, 0xF6573DCC, 0x2D13BAA5, 0x642FC782, 0xDC4DC65C, 0x9571BB7B, - 0x4E353C12, 0x07094135, 0xFD504431, 0xB46C3916, 0x6F28BE7F, 0x2614C358, - 0x1700AEAB, 0x5E3CD38C, 0x857854E5, 0xCC4429C2, 0x361D2CC6, 0x7F2151E1, - 0xA465D688, 0xED59ABAF, 0x553BAA71, 0x1C07D756, 0xC743503F, 0x8E7F2D18, - 0x7426281C, 0x3D1A553B, 0xE65ED252, 0xAF62AF75, 0x9376A71F, 0xDA4ADA38, - 0x010E5D51, 0x48322076, 0xB26B2572, 0xFB575855, 0x2013DF3C, 0x692FA21B, - 0xD14DA3C5, 0x9871DEE2, 0x4335598B, 0x0A0924AC, 0xF05021A8, 0xB96C5C8F, - 0x6228DBE6, 0x2B14A6C1, 0x34019664, 0x7D3DEB43, 0xA6796C2A, 0xEF45110D, - 0x151C1409, 0x5C20692E, 0x8764EE47, 0xCE589360, 0x763A92BE, 0x3F06EF99, - 0xE44268F0, 0xAD7E15D7, 0x572710D3, 0x1E1B6DF4, 0xC55FEA9D, 0x8C6397BA, - 0xB0779FD0, 0xF94BE2F7, 0x220F659E, 0x6B3318B9, 0x916A1DBD, 0xD856609A, - 0x0312E7F3, 0x4A2E9AD4, 0xF24C9B0A, 0xBB70E62D, 0x60346144, 0x29081C63, - 0xD3511967, 0x9A6D6440, 0x4129E329, 0x08159E0E, 0x3901F3FD, 0x703D8EDA, - 0xAB7909B3, 0xE2457494, 0x181C7190, 0x51200CB7, 0x8A648BDE, 0xC358F6F9, - 0x7B3AF727, 0x32068A00, 0xE9420D69, 0xA07E704E, 0x5A27754A, 0x131B086D, - 0xC85F8F04, 0x8163F223, 0xBD77FA49, 0xF44B876E, 0x2F0F0007, 0x66337D20, - 0x9C6A7824, 0xD5560503, 0x0E12826A, 0x472EFF4D, 0xFF4CFE93, 0xB67083B4, - 0x6D3404DD, 0x240879FA, 0xDE517CFE, 0x976D01D9, 0x4C2986B0, 0x0515FB97, - 0x2E015D56, 0x673D2071, 0xBC79A718, 0xF545DA3F, 0x0F1CDF3B, 0x4620A21C, - 0x9D642575, 0xD4585852, 0x6C3A598C, 0x250624AB, 0xFE42A3C2, 0xB77EDEE5, - 0x4D27DBE1, 0x041BA6C6, 0xDF5F21AF, 0x96635C88, 0xAA7754E2, 0xE34B29C5, - 0x380FAEAC, 0x7133D38B, 0x8B6AD68F, 0xC256ABA8, 0x19122CC1, 0x502E51E6, - 0xE84C5038, 0xA1702D1F, 0x7A34AA76, 0x3308D751, 0xC951D255, 0x806DAF72, - 0x5B29281B, 0x1215553C, 0x230138CF, 0x6A3D45E8, 0xB179C281, 0xF845BFA6, - 0x021CBAA2, 0x4B20C785, 0x906440EC, 0xD9583DCB, 0x613A3C15, 0x28064132, - 0xF342C65B, 0xBA7EBB7C, 0x4027BE78, 0x091BC35F, 0xD25F4436, 0x9B633911, - 0xA777317B, 0xEE4B4C5C, 0x350FCB35, 0x7C33B612, 0x866AB316, 0xCF56CE31, - 0x14124958, 0x5D2E347F, 0xE54C35A1, 0xAC704886, 0x7734CFEF, 0x3E08B2C8, - 0xC451B7CC, 0x8D6DCAEB, 0x56294D82, 0x1F1530A5, + 0x00000000, 0x493C7D27, 0x9278FA4E, 0xDB448769, 0x211D826D, 0x6821FF4A, 0xB3657823, 0xFA590504, + 0x423B04DA, 0x0B0779FD, 0xD043FE94, 0x997F83B3, 0x632686B7, 0x2A1AFB90, 0xF15E7CF9, 0xB86201DE, + 0x847609B4, 0xCD4A7493, 0x160EF3FA, 0x5F328EDD, 0xA56B8BD9, 0xEC57F6FE, 0x37137197, 0x7E2F0CB0, + 0xC64D0D6E, 0x8F717049, 0x5435F720, 0x1D098A07, 0xE7508F03, 0xAE6CF224, 0x7528754D, 0x3C14086A, + 0x0D006599, 0x443C18BE, 0x9F789FD7, 0xD644E2F0, 0x2C1DE7F4, 0x65219AD3, 0xBE651DBA, 0xF759609D, + 0x4F3B6143, 0x06071C64, 0xDD439B0D, 0x947FE62A, 0x6E26E32E, 0x271A9E09, 0xFC5E1960, 0xB5626447, + 0x89766C2D, 0xC04A110A, 0x1B0E9663, 0x5232EB44, 0xA86BEE40, 0xE1579367, 0x3A13140E, 0x732F6929, + 0xCB4D68F7, 0x827115D0, 0x593592B9, 0x1009EF9E, 0xEA50EA9A, 0xA36C97BD, 0x782810D4, 0x31146DF3, + 0x1A00CB32, 0x533CB615, 0x8878317C, 0xC1444C5B, 0x3B1D495F, 0x72213478, 0xA965B311, 0xE059CE36, + 0x583BCFE8, 0x1107B2CF, 0xCA4335A6, 0x837F4881, 0x79264D85, 0x301A30A2, 0xEB5EB7CB, 0xA262CAEC, + 0x9E76C286, 0xD74ABFA1, 0x0C0E38C8, 0x453245EF, 0xBF6B40EB, 0xF6573DCC, 0x2D13BAA5, 0x642FC782, + 0xDC4DC65C, 0x9571BB7B, 0x4E353C12, 0x07094135, 0xFD504431, 0xB46C3916, 0x6F28BE7F, 0x2614C358, + 0x1700AEAB, 0x5E3CD38C, 0x857854E5, 0xCC4429C2, 0x361D2CC6, 0x7F2151E1, 0xA465D688, 0xED59ABAF, + 0x553BAA71, 0x1C07D756, 0xC743503F, 0x8E7F2D18, 0x7426281C, 0x3D1A553B, 0xE65ED252, 0xAF62AF75, + 0x9376A71F, 0xDA4ADA38, 0x010E5D51, 0x48322076, 0xB26B2572, 0xFB575855, 0x2013DF3C, 0x692FA21B, + 0xD14DA3C5, 0x9871DEE2, 0x4335598B, 0x0A0924AC, 0xF05021A8, 0xB96C5C8F, 0x6228DBE6, 0x2B14A6C1, + 0x34019664, 0x7D3DEB43, 0xA6796C2A, 0xEF45110D, 0x151C1409, 0x5C20692E, 0x8764EE47, 0xCE589360, + 0x763A92BE, 0x3F06EF99, 0xE44268F0, 0xAD7E15D7, 0x572710D3, 0x1E1B6DF4, 0xC55FEA9D, 0x8C6397BA, + 0xB0779FD0, 0xF94BE2F7, 0x220F659E, 0x6B3318B9, 0x916A1DBD, 0xD856609A, 0x0312E7F3, 0x4A2E9AD4, + 0xF24C9B0A, 0xBB70E62D, 0x60346144, 0x29081C63, 0xD3511967, 0x9A6D6440, 0x4129E329, 0x08159E0E, + 0x3901F3FD, 0x703D8EDA, 0xAB7909B3, 0xE2457494, 0x181C7190, 0x51200CB7, 0x8A648BDE, 0xC358F6F9, + 0x7B3AF727, 0x32068A00, 0xE9420D69, 0xA07E704E, 0x5A27754A, 0x131B086D, 0xC85F8F04, 0x8163F223, + 0xBD77FA49, 0xF44B876E, 0x2F0F0007, 0x66337D20, 0x9C6A7824, 0xD5560503, 0x0E12826A, 0x472EFF4D, + 0xFF4CFE93, 0xB67083B4, 0x6D3404DD, 0x240879FA, 0xDE517CFE, 0x976D01D9, 0x4C2986B0, 0x0515FB97, + 0x2E015D56, 0x673D2071, 0xBC79A718, 0xF545DA3F, 0x0F1CDF3B, 0x4620A21C, 0x9D642575, 0xD4585852, + 0x6C3A598C, 0x250624AB, 0xFE42A3C2, 0xB77EDEE5, 0x4D27DBE1, 0x041BA6C6, 0xDF5F21AF, 0x96635C88, + 0xAA7754E2, 0xE34B29C5, 0x380FAEAC, 0x7133D38B, 0x8B6AD68F, 0xC256ABA8, 0x19122CC1, 0x502E51E6, + 0xE84C5038, 0xA1702D1F, 0x7A34AA76, 0x3308D751, 0xC951D255, 0x806DAF72, 0x5B29281B, 0x1215553C, + 0x230138CF, 0x6A3D45E8, 0xB179C281, 0xF845BFA6, 0x021CBAA2, 0x4B20C785, 0x906440EC, 0xD9583DCB, + 0x613A3C15, 0x28064132, 0xF342C65B, 0xBA7EBB7C, 0x4027BE78, 0x091BC35F, 0xD25F4436, 0x9B633911, + 0xA777317B, 0xEE4B4C5C, 0x350FCB35, 0x7C33B612, 0x866AB316, 0xCF56CE31, 0x14124958, 0x5D2E347F, + 0xE54C35A1, 0xAC704886, 0x7734CFEF, 0x3E08B2C8, 0xC451B7CC, 0x8D6DCAEB, 0x56294D82, 0x1F1530A5 } }; #define CRC32_UPD(crc, n) \ commit 4a6e7f9c28fe9ad0f90bbfd6d45bcd65b14d15e7 Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Thu Jun 7 10:35:11 2018 +0300 linux-gen: hash: crc32c support for odd data lengths Only data lengths multiple of 4 bytes were supported. Add support for any data length. Code is updated from current DPDK. Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/platform/linux-generic/odp_hash.c b/platform/linux-generic/odp_hash.c index dd97d246..93738e98 100644 --- a/platform/linux-generic/odp_hash.c +++ b/platform/linux-generic/odp_hash.c @@ -409,6 +409,28 @@ static const uint32_t crc32c_tables[8][256] = {{ (crc32c_tables[(n)][(crc) & 0xff] ^ \ crc32c_tables[(n) - 1][((crc) >> 8) & 0xff]) +static inline uint32_t crc32c_u8(uint8_t data, uint32_t init_val) +{ + uint32_t crc; + + crc = init_val; + crc ^= data; + + return crc32c_tables[0][crc & 0xff] ^ (crc >> 8); +} + +static inline uint32_t crc32c_u16(uint16_t data, uint32_t init_val) +{ + uint32_t crc; + + crc = init_val; + crc ^= data; + + crc = CRC32_UPD(crc, 1) ^ (crc >> 16); + + return crc; +} + static inline uint32_t crc32c_u32(uint32_t data, uint32_t init_val) { uint32_t crc, term1, term2; @@ -425,13 +447,14 @@ static inline uint32_t crc32c_u32(uint32_t data, uint32_t init_val) static inline uint32_t crc32c_u64(uint64_t data, uint32_t init_val) { + uint32_t crc, term1, term2; + union { uint64_t u64; uint32_t u32[2]; } d; - d.u64 = data; - uint32_t crc, term1, term2; + d.u64 = data; crc = init_val; crc ^= d.u32[0]; @@ -449,8 +472,7 @@ static inline uint32_t crc32c_u64(uint64_t data, uint32_t init_val) uint32_t odp_hash_crc32c(const void *data, uint32_t data_len, uint32_t init_val) { - size_t i; - uint64_t temp = 0; + uint32_t i; uintptr_t pd = (uintptr_t)data; for (i = 0; i < data_len / 8; i++) { @@ -458,34 +480,18 @@ uint32_t odp_hash_crc32c(const void *data, uint32_t data_len, pd += 8; } - switch (7 - (data_len & 0x07)) { - case 0: - temp |= (uint64_t)*((const uint8_t *)pd + 6) << 48; - /* Fallthrough */ - case 1: - temp |= (uint64_t)*((const uint8_t *)pd + 5) << 40; - /* Fallthrough */ - case 2: - temp |= (uint64_t)*((const uint8_t *)pd + 4) << 32; - temp |= *(const uint32_t *)pd; - init_val = crc32c_u64(temp, init_val); - break; - case 3: + if (data_len & 0x4) { init_val = crc32c_u32(*(const uint32_t *)pd, init_val); - break; - case 4: - temp |= *((const uint8_t *)pd + 2) << 16; - /* Fallthrough */ - case 5: - temp |= *((const uint8_t *)pd + 1) << 8; - /* Fallthrough */ - case 6: - temp |= *(const uint8_t *)pd; - init_val = crc32c_u32(temp, init_val); - /* Fallthrough */ - default: - break; + pd += 4; } + if (data_len & 0x2) { + init_val = crc32c_u16(*(const uint16_t *)pd, init_val); + pd += 2; + } + + if (data_len & 0x1) + init_val = crc32c_u8(*(const uint8_t *)pd, init_val); + return init_val; } commit ff0e06546eb8fb49f495c819efec984b70d29102 Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Wed Jun 6 16:01:27 2018 +0300 validation: hash: update crc32c test vectors Picked up crc32c test vectors from RFC 7143. Also generated some with an online CRC calculator (
http://crccalc.com
) to add variability to test data length. Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/test/validation/api/hash/hash.c b/test/validation/api/hash/hash.c index f7aa9caf..a19e3390 100644 --- a/test/validation/api/hash/hash.c +++ b/test/validation/api/hash/hash.c @@ -9,23 +9,118 @@ #include <odp_api.h> #include <odp_cunit_common.h> -static void hash_test_crc32c(void) -{ - uint32_t test_value = 0x12345678; - uint32_t ret = odp_hash_crc32c(&test_value, 4, 0); +#define CRC32C_INIT 0xffffffff +#define CRC32C_XOR 0xffffffff - CU_ASSERT(ret == 0xfa745634); +typedef struct hash_test_vector_t { + const uint8_t *data; + uint32_t len; - test_value = 0x87654321; - ret = odp_hash_crc32c(&test_value, 4, 0); + union { + uint32_t u32; + uint8_t u8[4]; + } result; - CU_ASSERT(ret == 0xaca37da7); +} hash_test_vector_t; + +/* + * Test vectors 0-4 from RFC 7143. + */ +static const uint8_t test_data_0[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; - uint32_t test_values[] = {0x12345678, 0x87654321}; +static const uint8_t test_data_1[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff +}; - ret = odp_hash_crc32c(test_values, 8, 0); +static const uint8_t test_data_2[] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f +}; - CU_ASSERT(ret == 0xe6e910b0); +static const uint8_t test_data_3[] = { + 0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, + 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, + 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, + 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 +}; + +static const uint8_t test_data_4[] = { + 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x18, + 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +/* Various length strings. Terminating null character is not included into + * crc calculation. */ +static const uint8_t test_data_5[] = "abcd"; + +static const uint8_t test_data_6[] = "abcdefgh"; + +static const uint8_t test_data_7[] = + "The quick brown fox jumps over the lazy dog."; + +static const hash_test_vector_t crc32c_test_vector[] = { + { .data = test_data_0, + .len = sizeof(test_data_0), + .result.u8 = {0xaa, 0x36, 0x91, 0x8a} + }, + { .data = test_data_1, + .len = sizeof(test_data_1), + .result.u8 = {0x43, 0xab, 0xa8, 0x62} + }, + { .data = test_data_2, + .len = sizeof(test_data_2), + .result.u8 = {0x4e, 0x79, 0xdd, 0x46} + }, + { .data = test_data_3, + .len = sizeof(test_data_3), + .result.u8 = {0x5c, 0xdb, 0x3f, 0x11} + }, + { .data = test_data_4, + .len = sizeof(test_data_4), + .result.u8 = {0x56, 0x3a, 0x96, 0xd9} + }, + { .data = test_data_5, + .len = sizeof(test_data_5) - 1, + .result.u8 = {0x31, 0x0a, 0xc8, 0x92} + }, + { .data = test_data_6, + .len = sizeof(test_data_6) - 1, + .result.u8 = {0xb7, 0x21, 0x94, 0x0a} + }, + { .data = test_data_7, + .len = sizeof(test_data_7) - 1, + .result.u8 = {0xb3, 0x97, 0x00, 0x19} + } +}; + +static void hash_test_crc32c(void) +{ + uint32_t ret, result; + int i; + int num = sizeof(crc32c_test_vector) / sizeof(hash_test_vector_t); + + for (i = 0; i < num; i++) { + ret = odp_hash_crc32c(crc32c_test_vector[i].data, + crc32c_test_vector[i].len, + CRC32C_INIT); + + result = CRC32C_XOR ^ ret; + CU_ASSERT(result == crc32c_test_vector[i].result.u32); + } } odp_testinfo_t hash_suite[] = { ----------------------------------------------------------------------- Summary of changes: DEPENDENCIES | 2 +- example/l2fwd_simple/l2fwd_simple_run.sh | 16 +- example/l2fwd_simple/odp_l2fwd_simple.c | 25 +- platform/linux-generic/Makefile.am | 4 +- platform/linux-generic/m4/configure.m4 | 1 + platform/linux-generic/m4/odp_zlib.m4 | 10 + platform/linux-generic/odp_hash.c | 491 ------------------------------- platform/linux-generic/odp_hash_crc32.c | 21 ++ platform/linux-generic/odp_hash_crc32c.c | 409 +++++++++++++++++++++++++ test/validation/api/hash/hash.c | 230 ++++++++++++++- 10 files changed, 684 insertions(+), 525 deletions(-) create mode 100644 platform/linux-generic/m4/odp_zlib.m4 delete mode 100644 platform/linux-generic/odp_hash.c create mode 100644 platform/linux-generic/odp_hash_crc32.c create mode 100644 platform/linux-generic/odp_hash_crc32c.c hooks/post-receive --
8 years, 2 months
1
0
0
0
[COMMIT] branch master updated. v1.19.0.1_tigermoth-71-g3c449bd7
by git@git-us.linaro.org
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "". The branch, master has been updated via 3c449bd75224b543de394bf6444c09cfbc6e104f (commit) via c3c447c96ab63092461dee2bac607f59a21bf8de (commit) from c7bf6a71fe08f3ba8228eced708c9d05496a825a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3c449bd75224b543de394bf6444c09cfbc6e104f Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Mon Jun 4 17:03:44 2018 +0300 linux-gen: queue_lf: use lock free 128 bit atomics Use 128 bit atomics from arch/aarch64 directory. On ARMv8, GCC built-in atomics does not utilize 128 bit atomic instructions but uses locks instead. All other targets use GGC built-ins (when lock free). Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/platform/linux-generic/odp_queue_lf.c b/platform/linux-generic/odp_queue_lf.c index 1c3c6bc4..e4902a3f 100644 --- a/platform/linux-generic/odp_queue_lf.c +++ b/platform/linux-generic/odp_queue_lf.c @@ -24,14 +24,55 @@ typedef unsigned __int128 u128_t; +static inline void atomic_zero_u128(u128_t *atomic) +{ + __atomic_store_n(atomic, 0, __ATOMIC_RELAXED); +} + +#if defined(__aarch64__) +/* ARMv8 has atomic load-acq/store-rel instructions for a pair of + * 64bit of data. GCC atomic built-in for 128bits does not utilize these + * instructions but uses locks instead. Override GCC built-in for ARMv8. + */ +#include <odp_cpu.h> + +static inline int atomic_cas_rel_u128(u128_t *atomic, u128_t old_val, + u128_t new_val) +{ + return __lockfree_compare_exchange_16((__int128 *)atomic, + (__int128 *)&old_val, + new_val, + 0, + __ATOMIC_RELEASE, + __ATOMIC_RELAXED); +} + +static inline int atomic_cas_acq_u128(u128_t *atomic, u128_t old_val, + u128_t new_val) +{ + return __lockfree_compare_exchange_16((__int128 *)atomic, + (__int128 *)&old_val, + new_val, + 0, + __ATOMIC_ACQUIRE, + __ATOMIC_RELAXED); +} + static inline u128_t atomic_load_u128(u128_t *atomic) { - return __atomic_load_n(atomic, __ATOMIC_RELAXED); + return __lockfree_load_16((__int128 *)atomic, __ATOMIC_RELAXED); } -static inline void atomic_zero_u128(u128_t *atomic) +static inline int atomic_is_lockfree_u128(void) { - __atomic_store_n(atomic, 0, __ATOMIC_RELAXED); + return 1; +} + +#else + +static inline u128_t atomic_load_u128(u128_t *atomic) +{ + return __atomic_load_n(atomic, __ATOMIC_RELAXED); } static inline int atomic_cas_rel_u128(u128_t *atomic, u128_t old_val, @@ -57,6 +98,8 @@ static inline int atomic_is_lockfree_u128(void) return __atomic_is_lock_free(16, NULL); } +#endif + #else /* These definitions enable build in non 128 bit compatible systems. commit c3c447c96ab63092461dee2bac607f59a21bf8de Author: Petri Savolainen <petri.savolainen(a)linaro.org> Date: Mon Jun 4 14:18:12 2018 +0300 linux-gen: queue_lf: wrap is_lock_free function Wrap GCC built-in __atomic_is_lock_free function so that it can be overridden on ARMv8. Signed-off-by: Petri Savolainen <petri.savolainen(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/platform/linux-generic/odp_queue_lf.c b/platform/linux-generic/odp_queue_lf.c index b3cfbdbe..1c3c6bc4 100644 --- a/platform/linux-generic/odp_queue_lf.c +++ b/platform/linux-generic/odp_queue_lf.c @@ -52,6 +52,11 @@ static inline int atomic_cas_acq_u128(u128_t *atomic, u128_t old_val, __ATOMIC_RELAXED); } +static inline int atomic_is_lockfree_u128(void) +{ + return __atomic_is_lock_free(16, NULL); +} + #else /* These definitions enable build in non 128 bit compatible systems. @@ -86,6 +91,11 @@ static inline int atomic_cas_acq_u128(u128_t *atomic, u128_t old_val, return atomic_cas_rel_u128(atomic, old_val, new_val); } +static inline int atomic_is_lockfree_u128(void) +{ + return 0; +} + #endif /* Node in lock-free ring */ @@ -263,12 +273,10 @@ uint32_t queue_lf_init_global(uint32_t *queue_lf_size, queue_lf_func_t *lf_func) { odp_shm_t shm; - bool lockfree = 0; + int lockfree; /* 16 byte lockfree CAS operation is needed. */ -#ifdef __SIZEOF_INT128__ - lockfree = __atomic_is_lock_free(16, NULL); -#endif + lockfree = atomic_is_lockfree_u128(); ODP_DBG("\nLock-free queue init\n"); ODP_DBG(" u128 lock-free: %i\n\n", lockfree); ----------------------------------------------------------------------- Summary of changes: platform/linux-generic/odp_queue_lf.c | 65 +++++++++++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 7 deletions(-) hooks/post-receive --
8 years, 3 months
1
0
0
0
[COMMIT] branch master updated. v1.19.0.1_tigermoth-69-gc7bf6a71
by git@git-us.linaro.org
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "". The branch, master has been updated via c7bf6a71fe08f3ba8228eced708c9d05496a825a (commit) via a832529f5430e0f60fee792a95a35ce7b2bed25d (commit) via 277cbcf414448fb7fd3fa8171a7cb8ffdcb6262b (commit) via 953246794f041282cb1a59ccf47f9bde6c369069 (commit) from 780d15ced4188a38984c656a9fca58fdd5226735 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c7bf6a71fe08f3ba8228eced708c9d05496a825a Author: Bogdan Pricope <bogdan.pricope(a)linaro.org> Date: Tue Jun 5 09:11:44 2018 +0300 linux-gen: pktio: remove odp_packet_socket.h from unrelated files Cleanup pktio code by not including odp_packet_socket.h in unrelated files. Signed-off-by: Bogdan Pricope <bogdan.pricope(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 69a3072d..cec2d2d6 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -30,10 +30,11 @@ extern "C" { #include <odp_config_internal.h> #include <odp/api/hints.h> +#include <string.h> #include <net/if.h> +#include <linux/if_ether.h> #define PKTIO_MAX_QUEUES 64 -#include <odp_packet_socket.h> #define PKTIO_NAME_LEN 256 diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 4a91c08a..7759f83e 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -19,7 +19,6 @@ #include <odp/api/spinlock.h> #include <odp/api/ticketlock.h> #include <odp/api/shared_memory.h> -#include <odp_packet_socket.h> #include <odp_config_internal.h> #include <odp_queue_if.h> #include <odp_schedule_if.h> diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c index 5b2f8854..6333847d 100644 --- a/platform/linux-generic/pktio/netmap.c +++ b/platform/linux-generic/pktio/netmap.c @@ -19,7 +19,6 @@ #include <odp_ethtool_stats.h> #include <odp_ethtool_rss.h> #include <odp_socket_common.h> -#include <odp_packet_socket.h> #include <odp_debug_internal.h> #include <odp_errno_define.h> #include <protocols/eth.h> diff --git a/platform/linux-generic/pktio/tap.c b/platform/linux-generic/pktio/tap.c index 20fb5f45..dc87db2b 100644 --- a/platform/linux-generic/pktio/tap.c +++ b/platform/linux-generic/pktio/tap.c @@ -43,7 +43,6 @@ #include <odp_api.h> #include <odp/api/plat/packet_inlines.h> -#include <odp_packet_socket.h> #include <odp_socket_common.h> #include <odp_packet_internal.h> #include <odp_packet_io_internal.h> commit a832529f5430e0f60fee792a95a35ce7b2bed25d Author: Bogdan Pricope <bogdan.pricope(a)linaro.org> Date: Mon Jun 4 16:40:06 2018 +0300 linux-gen: pktio: move common code out of socket pktio files Cleanup socket pktio code by moving common functionality to a separate file. Signed-off-by: Bogdan Pricope <bogdan.pricope(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index ed9ff591..07c88f85 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -112,6 +112,7 @@ noinst_HEADERS = \ include/odp_packet_io_ipc_internal.h \ include/odp_packet_io_ring_internal.h \ include/odp_packet_socket.h \ + include/odp_socket_common.h \ include/odp_ethtool_stats.h \ include/odp_ethtool_rss.h \ include/odp_pcapng.h \ @@ -201,6 +202,7 @@ __LIB__libodp_linux_la_SOURCES = \ odp_weak.c \ pktio/dpdk.c \ pktio/dpdk_parse.c \ + pktio/socket_common.c \ pktio/ethtool_stats.c \ pktio/ethtool_rss.c \ pktio/io_ops.c \ diff --git a/platform/linux-generic/include/odp_packet_socket.h b/platform/linux-generic/include/odp_packet_socket.h index dd9d53aa..6f9443a3 100644 --- a/platform/linux-generic/include/odp_packet_socket.h +++ b/platform/linux-generic/include/odp_packet_socket.h @@ -57,41 +57,4 @@ struct ring { ODP_STATIC_ASSERT(offsetof(struct ring, mm_space) <= ODP_CACHE_LINE_SIZE, "ERR_STRUCT_RING"); -static inline void -ethaddr_copy(unsigned char mac_dst[], unsigned char mac_src[]) -{ - memcpy(mac_dst, mac_src, ETH_ALEN); -} - -static inline int -ethaddrs_equal(unsigned char mac_a[], unsigned char mac_b[]) -{ - return !memcmp(mac_a, mac_b, ETH_ALEN); -} - -/** - * Read the MAC address from a packet socket - */ -int mac_addr_get_fd(int fd, const char *name, unsigned char mac_dst[]); - -/** - * Read the MTU from a packet socket - */ -uint32_t mtu_get_fd(int fd, const char *name); - -/** - * Enable/Disable promisc mode for a packet socket - */ -int promisc_mode_set_fd(int fd, const char *name, int enable); - -/** - * Return promisc mode of a packet socket - */ -int promisc_mode_get_fd(int fd, const char *name); - -/** - * Return link status of a packet socket (up/down) - */ -int link_status_fd(int fd, const char *name); - #endif diff --git a/platform/linux-generic/include/odp_socket_common.h b/platform/linux-generic/include/odp_socket_common.h new file mode 100644 index 00000000..4c6b3e63 --- /dev/null +++ b/platform/linux-generic/include/odp_socket_common.h @@ -0,0 +1,57 @@ +/* Copyright (c) 2018, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_SOCKET_COMMON_H_ +#define ODP_SOCKET_COMMON_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <string.h> +#include <linux/if_ether.h> + +static inline void +ethaddr_copy(unsigned char mac_dst[], unsigned char mac_src[]) +{ + memcpy(mac_dst, mac_src, ETH_ALEN); +} + +static inline int +ethaddrs_equal(unsigned char mac_a[], unsigned char mac_b[]) +{ + return !memcmp(mac_a, mac_b, ETH_ALEN); +} + +/** + * Read the MAC address from a packet socket + */ +int mac_addr_get_fd(int fd, const char *name, unsigned char mac_dst[]); + +/** + * Read the MTU from a packet socket + */ +uint32_t mtu_get_fd(int fd, const char *name); + +/** + * Enable/Disable promisc mode for a packet socket + */ +int promisc_mode_set_fd(int fd, const char *name, int enable); + +/** + * Return promisc mode of a packet socket + */ +int promisc_mode_get_fd(int fd, const char *name); + +/** + * Return link status of a packet socket (up/down) + */ +int link_status_fd(int fd, const char *name); + +#ifdef __cplusplus +} +#endif +#endif /* ODP_SOCKET_COMMON_H_ */ diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 34847f9c..4e320aa0 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -24,6 +24,7 @@ #include <odp_packet_io_internal.h> #include <odp_classification_internal.h> +#include <odp_socket_common.h> #include <odp_packet_dpdk.h> #include <odp_debug_internal.h> #include <odp_libconfig_internal.h> diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c index 66868486..5b2f8854 100644 --- a/platform/linux-generic/pktio/netmap.c +++ b/platform/linux-generic/pktio/netmap.c @@ -18,6 +18,7 @@ #include <odp_packet_io_internal.h> #include <odp_ethtool_stats.h> #include <odp_ethtool_rss.h> +#include <odp_socket_common.h> #include <odp_packet_socket.h> #include <odp_debug_internal.h> #include <odp_errno_define.h> diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index 18ab74dd..9422d85b 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -36,6 +36,7 @@ #include <odp_api.h> #include <odp_packet_socket.h> +#include <odp_socket_common.h> #include <odp_packet_internal.h> #include <odp_packet_io_internal.h> #include <odp_ethtool_stats.h> @@ -117,125 +118,6 @@ int sendmmsg(int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) #define ETHBUF_ALIGN(buf_ptr) ((uint8_t *)ODP_ALIGN_ROUNDUP_PTR((buf_ptr), \ sizeof(uint32_t)) + ETHBUF_OFFSET) -/** - * ODP_PACKET_SOCKET_MMSG: - * ODP_PACKET_SOCKET_MMAP: - * ODP_PACKET_NETMAP: - */ -int mac_addr_get_fd(int fd, const char *name, unsigned char mac_dst[]) -{ - struct ifreq ethreq; - int ret; - - memset(ðreq, 0, sizeof(ethreq)); - snprintf(ethreq.ifr_name, IF_NAMESIZE, "%s", name); - ret = ioctl(fd, SIOCGIFHWADDR, ðreq); - if (ret != 0) { - __odp_errno = errno; - ODP_ERR("ioctl(SIOCGIFHWADDR): %s: \"%s\".\n", strerror(errno), - ethreq.ifr_name); - return -1; - } - - memcpy(mac_dst, (unsigned char *)ethreq.ifr_ifru.ifru_hwaddr.sa_data, - ETH_ALEN); - return 0; -} - -/* - * ODP_PACKET_SOCKET_MMSG: - * ODP_PACKET_SOCKET_MMAP: - * ODP_PACKET_NETMAP: - */ -uint32_t mtu_get_fd(int fd, const char *name) -{ - struct ifreq ifr; - int ret; - - snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", name); - ret = ioctl(fd, SIOCGIFMTU, &ifr); - if (ret < 0) { - __odp_errno = errno; - ODP_DBG("ioctl(SIOCGIFMTU): %s: \"%s\".\n", strerror(errno), - ifr.ifr_name); - return 0; - } - return ifr.ifr_mtu + _ODP_ETHHDR_LEN; -} - -/* - * ODP_PACKET_SOCKET_MMSG: - * ODP_PACKET_SOCKET_MMAP: - * ODP_PACKET_NETMAP: - */ -int promisc_mode_set_fd(int fd, const char *name, int enable) -{ - struct ifreq ifr; - int ret; - - snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", name); - ret = ioctl(fd, SIOCGIFFLAGS, &ifr); - if (ret < 0) { - __odp_errno = errno; - ODP_DBG("ioctl(SIOCGIFFLAGS): %s: \"%s\".\n", strerror(errno), - ifr.ifr_name); - return -1; - } - - if (enable) - ifr.ifr_flags |= IFF_PROMISC; - else - ifr.ifr_flags &= ~(IFF_PROMISC); - - ret = ioctl(fd, SIOCSIFFLAGS, &ifr); - if (ret < 0) { - __odp_errno = errno; - ODP_DBG("ioctl(SIOCSIFFLAGS): %s: \"%s\".\n", strerror(errno), - ifr.ifr_name); - return -1; - } - return 0; -} - -/* - * ODP_PACKET_SOCKET_MMSG: - * ODP_PACKET_SOCKET_MMAP: - * ODP_PACKET_NETMAP: - */ -int promisc_mode_get_fd(int fd, const char *name) -{ - struct ifreq ifr; - int ret; - - snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", name); - ret = ioctl(fd, SIOCGIFFLAGS, &ifr); - if (ret < 0) { - __odp_errno = errno; - ODP_DBG("ioctl(SIOCGIFFLAGS): %s: \"%s\".\n", strerror(errno), - ifr.ifr_name); - return -1; - } - - return !!(ifr.ifr_flags & IFF_PROMISC); -} - -int link_status_fd(int fd, const char *name) -{ - struct ifreq ifr; - int ret; - - snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", name); - ret = ioctl(fd, SIOCGIFFLAGS, &ifr); - if (ret < 0) { - __odp_errno = errno; - ODP_DBG("ioctl(SIOCGIFFLAGS): %s: \"%s\".\n", strerror(errno), - ifr.ifr_name); - return -1; - } - - return !!(ifr.ifr_flags & IFF_RUNNING); -} - /* * ODP_PACKET_SOCKET_MMSG: */ diff --git a/platform/linux-generic/pktio/socket_common.c b/platform/linux-generic/pktio/socket_common.c new file mode 100644 index 00000000..edb4bcf3 --- /dev/null +++ b/platform/linux-generic/pktio/socket_common.c @@ -0,0 +1,143 @@ +/* Copyright (c) 2018, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ +#include "config.h" + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/socket.h> +#include <sys/types.h> +#include <sys/ioctl.h> +#include <net/if.h> +#include <linux/if_packet.h> +#include <errno.h> +#include <odp_debug_internal.h> +#include <odp_errno_define.h> +#include <odp_socket_common.h> +#include <protocols/eth.h> + +/** + * ODP_PACKET_SOCKET_MMSG: + * ODP_PACKET_SOCKET_MMAP: + * ODP_PACKET_NETMAP: + */ +int mac_addr_get_fd(int fd, const char *name, unsigned char mac_dst[]) +{ + struct ifreq ethreq; + int ret; + + memset(ðreq, 0, sizeof(ethreq)); + snprintf(ethreq.ifr_name, IF_NAMESIZE, "%s", name); + ret = ioctl(fd, SIOCGIFHWADDR, ðreq); + if (ret != 0) { + __odp_errno = errno; + ODP_ERR("ioctl(SIOCGIFHWADDR): %s: \"%s\".\n", strerror(errno), + ethreq.ifr_name); + return -1; + } + + memcpy(mac_dst, (unsigned char *)ethreq.ifr_ifru.ifru_hwaddr.sa_data, + ETH_ALEN); + return 0; +} + +/* + * ODP_PACKET_SOCKET_MMSG: + * ODP_PACKET_SOCKET_MMAP: + * ODP_PACKET_NETMAP: + */ +uint32_t mtu_get_fd(int fd, const char *name) +{ + struct ifreq ifr; + int ret; + + snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", name); + ret = ioctl(fd, SIOCGIFMTU, &ifr); + if (ret < 0) { + __odp_errno = errno; + ODP_DBG("ioctl(SIOCGIFMTU): %s: \"%s\".\n", strerror(errno), + ifr.ifr_name); + return 0; + } + return ifr.ifr_mtu + _ODP_ETHHDR_LEN; +} + +/* + * ODP_PACKET_SOCKET_MMSG: + * ODP_PACKET_SOCKET_MMAP: + * ODP_PACKET_NETMAP: + */ +int promisc_mode_set_fd(int fd, const char *name, int enable) +{ + struct ifreq ifr; + int ret; + + snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", name); + ret = ioctl(fd, SIOCGIFFLAGS, &ifr); + if (ret < 0) { + __odp_errno = errno; + ODP_DBG("ioctl(SIOCGIFFLAGS): %s: \"%s\".\n", strerror(errno), + ifr.ifr_name); + return -1; + } + + if (enable) + ifr.ifr_flags |= IFF_PROMISC; + else + ifr.ifr_flags &= ~(IFF_PROMISC); + + ret = ioctl(fd, SIOCSIFFLAGS, &ifr); + if (ret < 0) { + __odp_errno = errno; + ODP_DBG("ioctl(SIOCSIFFLAGS): %s: \"%s\".\n", strerror(errno), + ifr.ifr_name); + return -1; + } + return 0; +} + +/* + * ODP_PACKET_SOCKET_MMSG: + * ODP_PACKET_SOCKET_MMAP: + * ODP_PACKET_NETMAP: + */ +int promisc_mode_get_fd(int fd, const char *name) +{ + struct ifreq ifr; + int ret; + + snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", name); + ret = ioctl(fd, SIOCGIFFLAGS, &ifr); + if (ret < 0) { + __odp_errno = errno; + ODP_DBG("ioctl(SIOCGIFFLAGS): %s: \"%s\".\n", strerror(errno), + ifr.ifr_name); + return -1; + } + + return !!(ifr.ifr_flags & IFF_PROMISC); +} + +int link_status_fd(int fd, const char *name) +{ + struct ifreq ifr; + int ret; + + snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", name); + ret = ioctl(fd, SIOCGIFFLAGS, &ifr); + if (ret < 0) { + __odp_errno = errno; + ODP_DBG("ioctl(SIOCGIFFLAGS): %s: \"%s\".\n", strerror(errno), + ifr.ifr_name); + return -1; + } + + return !!(ifr.ifr_flags & IFF_RUNNING); +} diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c index bb8adb56..aedcceae 100644 --- a/platform/linux-generic/pktio/socket_mmap.c +++ b/platform/linux-generic/pktio/socket_mmap.c @@ -28,6 +28,7 @@ #include <odp_api.h> #include <odp/api/plat/packet_inlines.h> #include <odp_packet_socket.h> +#include <odp_socket_common.h> #include <odp_packet_internal.h> #include <odp_packet_io_internal.h> #include <odp_ethtool_stats.h> diff --git a/platform/linux-generic/pktio/tap.c b/platform/linux-generic/pktio/tap.c index 12a1945d..20fb5f45 100644 --- a/platform/linux-generic/pktio/tap.c +++ b/platform/linux-generic/pktio/tap.c @@ -44,6 +44,7 @@ #include <odp_api.h> #include <odp/api/plat/packet_inlines.h> #include <odp_packet_socket.h> +#include <odp_socket_common.h> #include <odp_packet_internal.h> #include <odp_packet_io_internal.h> #include <odp_classification_internal.h> commit 277cbcf414448fb7fd3fa8171a7cb8ffdcb6262b Author: Bogdan Pricope <bogdan.pricope(a)linaro.org> Date: Mon Jun 4 15:21:16 2018 +0300 linux-gen: pktio: move ethtool rss function to a new file Cleanup socket pktio code by moving independent rss functionality to a separate file. Signed-off-by: Bogdan Pricope <bogdan.pricope(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index c76114e0..ed9ff591 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -113,6 +113,7 @@ noinst_HEADERS = \ include/odp_packet_io_ring_internal.h \ include/odp_packet_socket.h \ include/odp_ethtool_stats.h \ + include/odp_ethtool_rss.h \ include/odp_pcapng.h \ include/odp_pkt_queue_internal.h \ include/odp_pool_internal.h \ @@ -201,6 +202,7 @@ __LIB__libodp_linux_la_SOURCES = \ pktio/dpdk.c \ pktio/dpdk_parse.c \ pktio/ethtool_stats.c \ + pktio/ethtool_rss.c \ pktio/io_ops.c \ pktio/ipc.c \ pktio/loop.c \ diff --git a/platform/linux-generic/include/odp_ethtool_rss.h b/platform/linux-generic/include/odp_ethtool_rss.h new file mode 100644 index 00000000..e942e3fd --- /dev/null +++ b/platform/linux-generic/include/odp_ethtool_rss.h @@ -0,0 +1,65 @@ +/* Copyright (c) 2018, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_ETHTOOL_RSS_H_ +#define ODP_ETHTOOL_RSS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <odp/api/packet_io.h> + +/** + * Get enabled RSS hash protocols of a packet socket + * + * @param fd Socket file descriptor + * @param name Interface name + * @param hash_proto[out] Hash protocols + * + * @returns Number enabled hash protocols + */ +int rss_conf_get_fd(int fd, const char *name, + odp_pktin_hash_proto_t *hash_proto); + +/** + * Get supported RSS hash protocols of a packet socket + * + * Can be both read and modified. + * + * @param fd Socket file descriptor + * @param name Interface name + * @param hash_proto[out] Hash protocols + * + * @returns Number of supported hash protocols + */ +int rss_conf_get_supported_fd(int fd, const char *name, + odp_pktin_hash_proto_t *hash_proto); + +/** + * Set RSS hash protocols of a packet socket + * + * @param fd Socket file descriptor + * @param name Interface name + * @param hash_proto Hash protocols + * + * @retval 0 on success + * @retval <0 on failure + */ +int rss_conf_set_fd(int fd, const char *name, + const odp_pktin_hash_proto_t *proto); + +/** + * Print enabled RSS hash protocols + * + * @param hash_proto Hash protocols + */ +void rss_conf_print(const odp_pktin_hash_proto_t *hash_proto); + +#ifdef __cplusplus +} +#endif +#endif /* ODP_ETHTOOL_RSS_H_ */ diff --git a/platform/linux-generic/include/odp_packet_socket.h b/platform/linux-generic/include/odp_packet_socket.h index 46561052..dd9d53aa 100644 --- a/platform/linux-generic/include/odp_packet_socket.h +++ b/platform/linux-generic/include/odp_packet_socket.h @@ -94,50 +94,4 @@ int promisc_mode_get_fd(int fd, const char *name); */ int link_status_fd(int fd, const char *name); -/** - * Get enabled RSS hash protocols of a packet socket - * - * @param fd Socket file descriptor - * @param name Interface name - * @param hash_proto[out] Hash protocols - * - * @returns Number enabled hash protocols - */ -int rss_conf_get_fd(int fd, const char *name, - odp_pktin_hash_proto_t *hash_proto); - -/** - * Get supported RSS hash protocols of a packet socket - * - * Can be both read and modified. - * - * @param fd Socket file descriptor - * @param name Interface name - * @param hash_proto[out] Hash protocols - * - * @returns Number of supported hash protocols - */ -int rss_conf_get_supported_fd(int fd, const char *name, - odp_pktin_hash_proto_t *hash_proto); - -/** - * Set RSS hash protocols of a packet socket - * - * @param fd Socket file descriptor - * @param name Interface name - * @param hash_proto Hash protocols - * - * @retval 0 on success - * @retval <0 on failure - */ -int rss_conf_set_fd(int fd, const char *name, - const odp_pktin_hash_proto_t *proto); - -/** - * Print enabled RSS hash protocols - * - * @param hash_proto Hash protocols - */ -void rss_conf_print(const odp_pktin_hash_proto_t *hash_proto); - #endif diff --git a/platform/linux-generic/pktio/ethtool_rss.c b/platform/linux-generic/pktio/ethtool_rss.c new file mode 100644 index 00000000..e1ba33aa --- /dev/null +++ b/platform/linux-generic/pktio/ethtool_rss.c @@ -0,0 +1,257 @@ +/* Copyright (c) 2015-2018, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "config.h" + +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/socket.h> +#include <sys/types.h> +#include <sys/ioctl.h> +#include <linux/ethtool.h> +#include <linux/sockios.h> +#include <net/if.h> +#include <odp_ethtool_rss.h> +#include <odp_debug_internal.h> + +/** + * Get enabled hash options of a packet socket + * + * @param fd Socket file descriptor + * @param name Interface name + * @param flow_type Packet flow type + * @param options[out] Enabled hash options + * + * @retval 0 on success + * @retval <0 on failure + */ +static inline int get_rss_hash_options(int fd, const char *name, + uint32_t flow_type, uint64_t *options) +{ + struct ifreq ifr; + struct ethtool_rxnfc rsscmd; + + memset(&ifr, 0, sizeof(ifr)); + memset(&rsscmd, 0, sizeof(rsscmd)); + *options = 0; + + snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", name); + + rsscmd.cmd = ETHTOOL_GRXFH; + rsscmd.flow_type = flow_type; + + ifr.ifr_data = (caddr_t)&rsscmd; + + if (ioctl(fd, SIOCETHTOOL, &ifr) < 0) + return -1; + + *options = rsscmd.data; + return 0; +} + +int rss_conf_get_fd(int fd, const char *name, + odp_pktin_hash_proto_t *hash_proto) +{ + uint64_t options; + int rss_enabled = 0; + + memset(hash_proto, 0, sizeof(odp_pktin_hash_proto_t)); + + get_rss_hash_options(fd, name, IPV4_FLOW, &options); + if ((options & RXH_IP_SRC) && (options & RXH_IP_DST)) { + hash_proto->proto.ipv4 = 1; + rss_enabled++; + } + get_rss_hash_options(fd, name, TCP_V4_FLOW, &options); + if ((options & RXH_IP_SRC) && (options & RXH_IP_DST) && + (options & RXH_L4_B_0_1) && (options & RXH_L4_B_2_3)) { + hash_proto->proto.ipv4_tcp = 1; + rss_enabled++; + } + get_rss_hash_options(fd, name, UDP_V4_FLOW, &options); + if ((options & RXH_IP_SRC) && (options & RXH_IP_DST) && + (options & RXH_L4_B_0_1) && (options & RXH_L4_B_2_3)) { + hash_proto->proto.ipv4_udp = 1; + rss_enabled++; + } + get_rss_hash_options(fd, name, IPV6_FLOW, &options); + if ((options & RXH_IP_SRC) && (options & RXH_IP_DST)) { + hash_proto->proto.ipv6 = 1; + rss_enabled++; + } + get_rss_hash_options(fd, name, TCP_V6_FLOW, &options); + if ((options & RXH_IP_SRC) && (options & RXH_IP_DST) && + (options & RXH_L4_B_0_1) && (options & RXH_L4_B_2_3)) { + hash_proto->proto.ipv6_tcp = 1; + rss_enabled++; + } + get_rss_hash_options(fd, name, UDP_V6_FLOW, &options); + if ((options & RXH_IP_SRC) && (options & RXH_IP_DST) && + (options & RXH_L4_B_0_1) && (options & RXH_L4_B_2_3)) { + hash_proto->proto.ipv6_udp = 1; + rss_enabled++; + } + return rss_enabled; +} + +/** + * Set hash options of a packet socket + * + * @param fd Socket file descriptor + * @param name Interface name + * @param flow_type Packet flow type + * @param options Hash options + * + * @retval 0 on success + * @retval <0 on failure + */ +static inline int set_rss_hash(int fd, const char *name, + uint32_t flow_type, uint64_t options) +{ + struct ifreq ifr; + struct ethtool_rxnfc rsscmd; + + memset(&rsscmd, 0, sizeof(rsscmd)); + + snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", name); + + rsscmd.cmd = ETHTOOL_SRXFH; + rsscmd.flow_type = flow_type; + rsscmd.data = options; + + ifr.ifr_data = (caddr_t)&rsscmd; + + if (ioctl(fd, SIOCETHTOOL, &ifr) < 0) + return -1; + + return 0; +} + +int rss_conf_set_fd(int fd, const char *name, + const odp_pktin_hash_proto_t *hash_proto) +{ + uint64_t options; + odp_pktin_hash_proto_t cur_hash; + + /* Compare to currently set hash protocols */ + rss_conf_get_fd(fd, name, &cur_hash); + + if (hash_proto->proto.ipv4_udp && !cur_hash.proto.ipv4_udp) { + options = RXH_IP_SRC | RXH_IP_DST | RXH_L4_B_0_1 | RXH_L4_B_2_3; + if (set_rss_hash(fd, name, UDP_V4_FLOW, options)) + return -1; + } + if (hash_proto->proto.ipv4_tcp && !cur_hash.proto.ipv4_tcp) { + options = RXH_IP_SRC | RXH_IP_DST | RXH_L4_B_0_1 | RXH_L4_B_2_3; + if (set_rss_hash(fd, name, TCP_V4_FLOW, options)) + return -1; + } + if (hash_proto->proto.ipv6_udp && !cur_hash.proto.ipv6_udp) { + options = RXH_IP_SRC | RXH_IP_DST | RXH_L4_B_0_1 | RXH_L4_B_2_3; + if (set_rss_hash(fd, name, UDP_V6_FLOW, options)) + return -1; + } + if (hash_proto->proto.ipv6_tcp && !cur_hash.proto.ipv6_tcp) { + options = RXH_IP_SRC | RXH_IP_DST | RXH_L4_B_0_1 | RXH_L4_B_2_3; + if (set_rss_hash(fd, name, TCP_V6_FLOW, options)) + return -1; + } + if (hash_proto->proto.ipv4 && !cur_hash.proto.ipv4) { + options = RXH_IP_SRC | RXH_IP_DST; + if (set_rss_hash(fd, name, IPV4_FLOW, options)) + return -1; + } + if (hash_proto->proto.ipv6 && !cur_hash.proto.ipv6) { + options = RXH_IP_SRC | RXH_IP_DST; + if (set_rss_hash(fd, name, IPV6_FLOW, options)) + return -1; + } + return 0; +} + +int rss_conf_get_supported_fd(int fd, const char *name, + odp_pktin_hash_proto_t *hash_proto) +{ + uint64_t options; + int rss_supported = 0; + + memset(hash_proto, 0, sizeof(odp_pktin_hash_proto_t)); + + if (!get_rss_hash_options(fd, name, IPV4_FLOW, &options)) { + if (!set_rss_hash(fd, name, IPV4_FLOW, options)) { + hash_proto->proto.ipv4 = 1; + rss_supported++; + } + } + if (!get_rss_hash_options(fd, name, TCP_V4_FLOW, &options)) { + if (!set_rss_hash(fd, name, TCP_V4_FLOW, options)) { + hash_proto->proto.ipv4_tcp = 1; + rss_supported++; + } + } + if (!get_rss_hash_options(fd, name, UDP_V4_FLOW, &options)) { + if (!set_rss_hash(fd, name, UDP_V4_FLOW, options)) { + hash_proto->proto.ipv4_udp = 1; + rss_supported++; + } + } + if (!get_rss_hash_options(fd, name, IPV6_FLOW, &options)) { + if (!set_rss_hash(fd, name, IPV6_FLOW, options)) { + hash_proto->proto.ipv6 = 1; + rss_supported++; + } + } + if (!get_rss_hash_options(fd, name, TCP_V6_FLOW, &options)) { + if (!set_rss_hash(fd, name, TCP_V6_FLOW, options)) { + hash_proto->proto.ipv6_tcp = 1; + rss_supported++; + } + } + if (!get_rss_hash_options(fd, name, UDP_V6_FLOW, &options)) { + if (!set_rss_hash(fd, name, UDP_V6_FLOW, options)) { + hash_proto->proto.ipv6_udp = 1; + rss_supported++; + } + } + return rss_supported; +} + +void rss_conf_print(const odp_pktin_hash_proto_t *hash_proto) +{ int max_len = 512; + char str[max_len]; + int len = 0; + int n = max_len - 1; + + len += snprintf(&str[len], n - len, " rss conf\n"); + + if (hash_proto->proto.ipv4) + len += snprintf(&str[len], n - len, + " IPV4\n"); + if (hash_proto->proto.ipv4_tcp) + len += snprintf(&str[len], n - len, + " IPV4 TCP\n"); + if (hash_proto->proto.ipv4_udp) + len += snprintf(&str[len], n - len, + " IPV4 UDP\n"); + if (hash_proto->proto.ipv6) + len += snprintf(&str[len], n - len, + " IPV6\n"); + if (hash_proto->proto.ipv6_tcp) + len += snprintf(&str[len], n - len, + " IPV6 TCP\n"); + if (hash_proto->proto.ipv6_udp) + len += snprintf(&str[len], n - len, + " IPV6 UDP\n"); + str[len] = '\0'; + + ODP_PRINT("%s\n", str); +} + diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c index 1d8f6988..66868486 100644 --- a/platform/linux-generic/pktio/netmap.c +++ b/platform/linux-generic/pktio/netmap.c @@ -17,6 +17,7 @@ #include <odp_packet_io_internal.h> #include <odp_ethtool_stats.h> +#include <odp_ethtool_rss.h> #include <odp_packet_socket.h> #include <odp_debug_internal.h> #include <odp_errno_define.h> diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index dc68a95f..18ab74dd 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -236,239 +236,6 @@ int link_status_fd(int fd, const char *name) return !!(ifr.ifr_flags & IFF_RUNNING); } -/** - * Get enabled hash options of a packet socket - * - * @param fd Socket file descriptor - * @param name Interface name - * @param flow_type Packet flow type - * @param options[out] Enabled hash options - * - * @retval 0 on success - * @retval <0 on failure - */ -static inline int get_rss_hash_options(int fd, const char *name, - uint32_t flow_type, uint64_t *options) -{ - struct ifreq ifr; - struct ethtool_rxnfc rsscmd; - - memset(&ifr, 0, sizeof(ifr)); - memset(&rsscmd, 0, sizeof(rsscmd)); - *options = 0; - - snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", name); - - rsscmd.cmd = ETHTOOL_GRXFH; - rsscmd.flow_type = flow_type; - - ifr.ifr_data = (caddr_t)&rsscmd; - - if (ioctl(fd, SIOCETHTOOL, &ifr) < 0) - return -1; - - *options = rsscmd.data; - return 0; -} - -int rss_conf_get_fd(int fd, const char *name, - odp_pktin_hash_proto_t *hash_proto) -{ - uint64_t options; - int rss_enabled = 0; - - memset(hash_proto, 0, sizeof(odp_pktin_hash_proto_t)); - - get_rss_hash_options(fd, name, IPV4_FLOW, &options); - if ((options & RXH_IP_SRC) && (options & RXH_IP_DST)) { - hash_proto->proto.ipv4 = 1; - rss_enabled++; - } - get_rss_hash_options(fd, name, TCP_V4_FLOW, &options); - if ((options & RXH_IP_SRC) && (options & RXH_IP_DST) && - (options & RXH_L4_B_0_1) && (options & RXH_L4_B_2_3)) { - hash_proto->proto.ipv4_tcp = 1; - rss_enabled++; - } - get_rss_hash_options(fd, name, UDP_V4_FLOW, &options); - if ((options & RXH_IP_SRC) && (options & RXH_IP_DST) && - (options & RXH_L4_B_0_1) && (options & RXH_L4_B_2_3)) { - hash_proto->proto.ipv4_udp = 1; - rss_enabled++; - } - get_rss_hash_options(fd, name, IPV6_FLOW, &options); - if ((options & RXH_IP_SRC) && (options & RXH_IP_DST)) { - hash_proto->proto.ipv6 = 1; - rss_enabled++; - } - get_rss_hash_options(fd, name, TCP_V6_FLOW, &options); - if ((options & RXH_IP_SRC) && (options & RXH_IP_DST) && - (options & RXH_L4_B_0_1) && (options & RXH_L4_B_2_3)) { - hash_proto->proto.ipv6_tcp = 1; - rss_enabled++; - } - get_rss_hash_options(fd, name, UDP_V6_FLOW, &options); - if ((options & RXH_IP_SRC) && (options & RXH_IP_DST) && - (options & RXH_L4_B_0_1) && (options & RXH_L4_B_2_3)) { - hash_proto->proto.ipv6_udp = 1; - rss_enabled++; - } - return rss_enabled; -} - -/** - * Set hash options of a packet socket - * - * @param fd Socket file descriptor - * @param name Interface name - * @param flow_type Packet flow type - * @param options Hash options - * - * @retval 0 on success - * @retval <0 on failure - */ -static inline int set_rss_hash(int fd, const char *name, - uint32_t flow_type, uint64_t options) -{ - struct ifreq ifr; - struct ethtool_rxnfc rsscmd; - - memset(&rsscmd, 0, sizeof(rsscmd)); - - snprintf(ifr.ifr_name, IF_NAMESIZE, "%s", name); - - rsscmd.cmd = ETHTOOL_SRXFH; - rsscmd.flow_type = flow_type; - rsscmd.data = options; - - ifr.ifr_data = (caddr_t)&rsscmd; - - if (ioctl(fd, SIOCETHTOOL, &ifr) < 0) - return -1; - - return 0; -} - -int rss_conf_set_fd(int fd, const char *name, - const odp_pktin_hash_proto_t *hash_proto) -{ - uint64_t options; - odp_pktin_hash_proto_t cur_hash; - - /* Compare to currently set hash protocols */ - rss_conf_get_fd(fd, name, &cur_hash); - - if (hash_proto->proto.ipv4_udp && !cur_hash.proto.ipv4_udp) { - options = RXH_IP_SRC | RXH_IP_DST | RXH_L4_B_0_1 | RXH_L4_B_2_3; - if (set_rss_hash(fd, name, UDP_V4_FLOW, options)) - return -1; - } - if (hash_proto->proto.ipv4_tcp && !cur_hash.proto.ipv4_tcp) { - options = RXH_IP_SRC | RXH_IP_DST | RXH_L4_B_0_1 | RXH_L4_B_2_3; - if (set_rss_hash(fd, name, TCP_V4_FLOW, options)) - return -1; - } - if (hash_proto->proto.ipv6_udp && !cur_hash.proto.ipv6_udp) { - options = RXH_IP_SRC | RXH_IP_DST | RXH_L4_B_0_1 | RXH_L4_B_2_3; - if (set_rss_hash(fd, name, UDP_V6_FLOW, options)) - return -1; - } - if (hash_proto->proto.ipv6_tcp && !cur_hash.proto.ipv6_tcp) { - options = RXH_IP_SRC | RXH_IP_DST | RXH_L4_B_0_1 | RXH_L4_B_2_3; - if (set_rss_hash(fd, name, TCP_V6_FLOW, options)) - return -1; - } - if (hash_proto->proto.ipv4 && !cur_hash.proto.ipv4) { - options = RXH_IP_SRC | RXH_IP_DST; - if (set_rss_hash(fd, name, IPV4_FLOW, options)) - return -1; - } - if (hash_proto->proto.ipv6 && !cur_hash.proto.ipv6) { - options = RXH_IP_SRC | RXH_IP_DST; - if (set_rss_hash(fd, name, IPV6_FLOW, options)) - return -1; - } - return 0; -} - -int rss_conf_get_supported_fd(int fd, const char *name, - odp_pktin_hash_proto_t *hash_proto) -{ - uint64_t options; - int rss_supported = 0; - - memset(hash_proto, 0, sizeof(odp_pktin_hash_proto_t)); - - if (!get_rss_hash_options(fd, name, IPV4_FLOW, &options)) { - if (!set_rss_hash(fd, name, IPV4_FLOW, options)) { - hash_proto->proto.ipv4 = 1; - rss_supported++; - } - } - if (!get_rss_hash_options(fd, name, TCP_V4_FLOW, &options)) { - if (!set_rss_hash(fd, name, TCP_V4_FLOW, options)) { - hash_proto->proto.ipv4_tcp = 1; - rss_supported++; - } - } - if (!get_rss_hash_options(fd, name, UDP_V4_FLOW, &options)) { - if (!set_rss_hash(fd, name, UDP_V4_FLOW, options)) { - hash_proto->proto.ipv4_udp = 1; - rss_supported++; - } - } - if (!get_rss_hash_options(fd, name, IPV6_FLOW, &options)) { - if (!set_rss_hash(fd, name, IPV6_FLOW, options)) { - hash_proto->proto.ipv6 = 1; - rss_supported++; - } - } - if (!get_rss_hash_options(fd, name, TCP_V6_FLOW, &options)) { - if (!set_rss_hash(fd, name, TCP_V6_FLOW, options)) { - hash_proto->proto.ipv6_tcp = 1; - rss_supported++; - } - } - if (!get_rss_hash_options(fd, name, UDP_V6_FLOW, &options)) { - if (!set_rss_hash(fd, name, UDP_V6_FLOW, options)) { - hash_proto->proto.ipv6_udp = 1; - rss_supported++; - } - } - return rss_supported; -} - -void rss_conf_print(const odp_pktin_hash_proto_t *hash_proto) -{ int max_len = 512; - char str[max_len]; - int len = 0; - int n = max_len - 1; - - len += snprintf(&str[len], n - len, " rss conf\n"); - - if (hash_proto->proto.ipv4) - len += snprintf(&str[len], n - len, - " IPV4\n"); - if (hash_proto->proto.ipv4_tcp) - len += snprintf(&str[len], n - len, - " IPV4 TCP\n"); - if (hash_proto->proto.ipv4_udp) - len += snprintf(&str[len], n - len, - " IPV4 UDP\n"); - if (hash_proto->proto.ipv6) - len += snprintf(&str[len], n - len, - " IPV6\n"); - if (hash_proto->proto.ipv6_tcp) - len += snprintf(&str[len], n - len, - " IPV6 TCP\n"); - if (hash_proto->proto.ipv6_udp) - len += snprintf(&str[len], n - len, - " IPV6 UDP\n"); - str[len] = '\0'; - - ODP_PRINT("%s\n", str); -} - /* * ODP_PACKET_SOCKET_MMSG: */ commit 953246794f041282cb1a59ccf47f9bde6c369069 Author: Bogdan Pricope <bogdan.pricope(a)linaro.org> Date: Mon Jun 4 11:30:15 2018 +0300 linux-gen: pktio: move ethtool stats function to a new file Cleanup the code by moving independent functionalities to separate files. Signed-off-by: Bogdan Pricope <bogdan.pricope(a)linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org> diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 8670450f..c76114e0 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -112,6 +112,7 @@ noinst_HEADERS = \ include/odp_packet_io_ipc_internal.h \ include/odp_packet_io_ring_internal.h \ include/odp_packet_socket.h \ + include/odp_ethtool_stats.h \ include/odp_pcapng.h \ include/odp_pkt_queue_internal.h \ include/odp_pool_internal.h \ @@ -199,7 +200,7 @@ __LIB__libodp_linux_la_SOURCES = \ odp_weak.c \ pktio/dpdk.c \ pktio/dpdk_parse.c \ - pktio/ethtool.c \ + pktio/ethtool_stats.c \ pktio/io_ops.c \ pktio/ipc.c \ pktio/loop.c \ diff --git a/platform/linux-generic/include/odp_ethtool_stats.h b/platform/linux-generic/include/odp_ethtool_stats.h new file mode 100644 index 00000000..04d4698e --- /dev/null +++ b/platform/linux-generic/include/odp_ethtool_stats.h @@ -0,0 +1,25 @@ +/* Copyright (c) 2018, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_ETHTOOL_H_ +#define ODP_ETHTOOL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include <string.h> +#include <odp/api/packet_io_stats.h> + +/** + * Get ethtool statistics of a packet socket + */ +int ethtool_stats_get_fd(int fd, const char *name, odp_pktio_stats_t *stats); + +#ifdef __cplusplus +} +#endif +#endif /* ODP_ETHTOOL_H_ */ diff --git a/platform/linux-generic/include/odp_packet_socket.h b/platform/linux-generic/include/odp_packet_socket.h index f77248f0..46561052 100644 --- a/platform/linux-generic/include/odp_packet_socket.h +++ b/platform/linux-generic/include/odp_packet_socket.h @@ -140,9 +140,4 @@ int rss_conf_set_fd(int fd, const char *name, */ void rss_conf_print(const odp_pktin_hash_proto_t *hash_proto); -/** - * Get ethtool statistics of a packet socket - */ -int ethtool_stats_get_fd(int fd, const char *name, odp_pktio_stats_t *stats); - #endif diff --git a/platform/linux-generic/pktio/ethtool.c b/platform/linux-generic/pktio/ethtool_stats.c similarity index 99% rename from platform/linux-generic/pktio/ethtool.c rename to platform/linux-generic/pktio/ethtool_stats.c index 784e8c3c..fc04fd31 100644 --- a/platform/linux-generic/pktio/ethtool.c +++ b/platform/linux-generic/pktio/ethtool_stats.c @@ -17,7 +17,7 @@ #include <net/if.h> #include <odp_api.h> -#include <odp_packet_socket.h> +#include <odp_ethtool_stats.h> #include <odp_debug_internal.h> #include <odp_errno_define.h> diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c index a8498aa1..1d8f6988 100644 --- a/platform/linux-generic/pktio/netmap.c +++ b/platform/linux-generic/pktio/netmap.c @@ -16,6 +16,7 @@ #include <odp/api/plat/time_inlines.h> #include <odp_packet_io_internal.h> +#include <odp_ethtool_stats.h> #include <odp_packet_socket.h> #include <odp_debug_internal.h> #include <odp_errno_define.h> diff --git a/platform/linux-generic/pktio/pktio_common.c b/platform/linux-generic/pktio/pktio_common.c index c7a1c3ab..218196b4 100644 --- a/platform/linux-generic/pktio/pktio_common.c +++ b/platform/linux-generic/pktio/pktio_common.c @@ -8,6 +8,7 @@ #include "config.h" #include <odp_packet_io_internal.h> +#include <odp_ethtool_stats.h> #include <odp_classification_internal.h> #include <errno.h> diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index 93613e54..dc68a95f 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -38,6 +38,7 @@ #include <odp_packet_socket.h> #include <odp_packet_internal.h> #include <odp_packet_io_internal.h> +#include <odp_ethtool_stats.h> #include <odp_align_internal.h> #include <odp_debug_internal.h> #include <odp_errno_define.h> diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c index 8ec2198b..bb8adb56 100644 --- a/platform/linux-generic/pktio/socket_mmap.c +++ b/platform/linux-generic/pktio/socket_mmap.c @@ -30,6 +30,7 @@ #include <odp_packet_socket.h> #include <odp_packet_internal.h> #include <odp_packet_io_internal.h> +#include <odp_ethtool_stats.h> #include <odp_debug_internal.h> #include <odp_errno_define.h> #include <odp_classification_datamodel.h> ----------------------------------------------------------------------- Summary of changes: platform/linux-generic/Makefile.am | 7 +- platform/linux-generic/include/odp_ethtool_rss.h | 65 ++++ platform/linux-generic/include/odp_ethtool_stats.h | 25 ++ .../linux-generic/include/odp_packet_io_internal.h | 3 +- platform/linux-generic/include/odp_packet_socket.h | 88 ----- platform/linux-generic/include/odp_socket_common.h | 57 ++++ platform/linux-generic/odp_packet_io.c | 1 - platform/linux-generic/pktio/dpdk.c | 1 + platform/linux-generic/pktio/ethtool_rss.c | 257 +++++++++++++++ .../pktio/{ethtool.c => ethtool_stats.c} | 2 +- platform/linux-generic/pktio/netmap.c | 4 +- platform/linux-generic/pktio/pktio_common.c | 1 + platform/linux-generic/pktio/socket.c | 354 +-------------------- platform/linux-generic/pktio/socket_common.c | 143 +++++++++ platform/linux-generic/pktio/socket_mmap.c | 2 + platform/linux-generic/pktio/tap.c | 2 +- 16 files changed, 566 insertions(+), 446 deletions(-) create mode 100644 platform/linux-generic/include/odp_ethtool_rss.h create mode 100644 platform/linux-generic/include/odp_ethtool_stats.h create mode 100644 platform/linux-generic/include/odp_socket_common.h create mode 100644 platform/linux-generic/pktio/ethtool_rss.c rename platform/linux-generic/pktio/{ethtool.c => ethtool_stats.c} (99%) create mode 100644 platform/linux-generic/pktio/socket_common.c hooks/post-receive --
8 years, 3 months
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
125
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
Results per page:
10
25
50
100
200