[dpdk-dev] [PATCH] doc: add meson ut enhancements in prog guide
Add a programmer's guide section for meson ut enhancements Signed-off-by: Hari Kumar Vemula --- doc/guides/prog_guide/index.rst | 1 + .../prog_guide/meson_ut_enhancements.rst | 158 ++ 2 files changed, 159 insertions(+) create mode 100644 doc/guides/prog_guide/meson_ut_enhancements.rst diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst index ba8c1f6ad..41971e1cf 100644 --- a/doc/guides/prog_guide/index.rst +++ b/doc/guides/prog_guide/index.rst @@ -57,6 +57,7 @@ Programmer's Guide source_org dev_kit_build_system dev_kit_root_make_help +meson_ut_enhancements extend_dpdk build_app ext_app_lib_make_help diff --git a/doc/guides/prog_guide/meson_ut_enhancements.rst b/doc/guides/prog_guide/meson_ut_enhancements.rst new file mode 100644 index 0..328adda28 --- /dev/null +++ b/doc/guides/prog_guide/meson_ut_enhancements.rst @@ -0,0 +1,158 @@ +.. SPDX-License-Identifier: BSD-3-Clause +Copyright(c) 2014-2018 Intel Corporation. + +.. _Meson_UT_Enhancements: + +Meson_UT_Enhancements += + +The meson build support for unit tests is now available and the more enhancements are done to the build system +to classify unit tests under different categories. The build `test/test/meson.build` file has been +modified for these enhancements. This document will further down describe the below list. + +* Building and Running the unit tests. +* Grouping of testcases. +* Parallel and non parallel tests. +* Test suites. +* How to run different test suites. +* Support for skipped tests. + + +Building and Running the unit tests +--- + +* Create the meson build output folder using command. + + ``$meson `` + +* Enter into build output folder, which was created by above command. + + ``$cd build`` + +* Compile DPDK using `$ninja`. + The output file of the build will be available in meson build folder. + After successful ninja, binary `dpdk-test` is created in `build/test/test/`. + +* Run the unit testcases. + + ``$ninja test`` (or) ``$meson test`` + +* To rebuild the build directory, after any changes to meson.build. + + ``$meson configure`` + +* To run specific test case via meson command. + + ``$meson test `` (or) ``$ninja test `` + + +Grouping of testcases +- + +Testcases has been grouped into below four different groups based on conditions +of time duration and performance of the individual testcase. + +* fast_parallel_test_names +* fast_non_parallel_test_names +* perf_test_names +* driver_test_names +* dump_test_names + +Parallel and non parallel tests +~~~ + +Unless specified the meson will run all unit tests as parallel by default. +So the test cases are categorized into parallel and non parallel tests purely +based test case functionality using `is_parallel` argument of `test()` +in meson.build. Test cases marked with `is_parallel : true` will run in +parallel and tests marked with `is_parallel : false` will run in non-parallel. +While non-parallel test is running, any other test should not be run. +Parallel and non parallel test cases are grouped under the +`fast_parallel_test_names` and `fast_non_parallel_test_names`. + +Test suites +~~~ + +Test groups are considered as "suiteâ in `meson.build` and can be provided +as argument to `test()` as `suite âproject_name:labelâ` + +Ex: ``suite âDPDK:fast-testsâ`` + +Running different test suites +~ + +Below are commands to run testcases using option `suite` + +* Test cases from the groups `fast_parallel_test_names` and `fast_non_parallel_test_names` + are run under 10seconds and below is the meson command to run them. + + ``$meson test --suite DPDK:fast-tests`` + +* Test cases from the group `perf_test_names` are run under 600 seconds + and below is the meson command to run them. + + ``$meson test --suite DPDK:perf-tests`` + +* Test cases from the group `driver_test_names` are run under 600 seconds + and below is the meson command to run them. + + ``$meson test --suite DPDK:driver-tests`` + +* Test cases from the group `dump_test_names` are run under 600 seconds + and below is the meson command to run them. + + ``$meson test --suite DPDK:dump-tests`` + + +Skipped testcases +- + +Some unit test cases have dependency on external libraries, driver modules or +config flags, without which the test cases cannot be run, such test cases +should return TEST_SKIPPED when mentioned dependencies are not enabled. To make +test cases run user should enable relevant dependencies. Below are the few +current scenarios when test cases are skipped: + +#. External library dependency paths are not set. +#. Config flag for the dependent library is not enabled. +#. Dependent driver modules are not installed on the system. + +Dependent library paths can be
[dpdk-dev] [PATCH] eal: fix core number validation
When incorrect core value or range provided, as part of -l command line option, a crash occurs. Added valid range checks to fix the crash. Fixes: d888cb8b9613 ("eal: add core list input format") Cc: sta...@dpdk.org Signed-off-by: Hari Kumar Vemula --- lib/librte_eal/common/eal_common_options.c | 8 1 file changed, 8 insertions(+) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index e31eca5c0..ea6bb508b 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -602,6 +602,14 @@ eal_parse_corelist(const char *corelist) max = idx; if (min == RTE_MAX_LCORE) min = idx; + if ((unsigned int)idx >= cfg->lcore_count || + (unsigned int)min >= cfg->lcore_count) { + RTE_LOG(ERR, EAL, + "Invalid core number given core range should be(0-%u)\n", + cfg->lcore_count); + return -1; + } + for (idx = min; idx <= max; idx++) { if (cfg->lcore_role[idx] != ROLE_RTE) { cfg->lcore_role[idx] = ROLE_RTE; -- 2.17.2
[dpdk-dev] [PATCH v2] eal: fix core number validation
When incorrect core value or range provided, as part of -l command line option, a crash occurs. Added valid range checks to fix the crash. Fixes: d888cb8b9613 ("eal: add core list input format") Cc: sta...@dpdk.org -- v2: Replace strtoul with strtol Modified log message -- Signed-off-by: Hari kumar Vemula --- lib/librte_eal/common/eal_common_options.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 6e3a83b98..b24668c23 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -592,7 +592,7 @@ eal_parse_corelist(const char *corelist) if (*corelist == '\0') return -1; errno = 0; - idx = strtoul(corelist, &end, 10); + idx = strtol(corelist, &end, 10); if (errno || end == NULL) return -1; while (isblank(*end)) @@ -603,6 +603,11 @@ eal_parse_corelist(const char *corelist) max = idx; if (min == RTE_MAX_LCORE) min = idx; + if ((unsigned int)idx >= cfg->lcore_count || + (unsigned int)min >= cfg->lcore_count) { + return -1; + } + for (idx = min; idx <= max; idx++) { if (cfg->lcore_role[idx] != ROLE_RTE) { cfg->lcore_role[idx] = ROLE_RTE; @@ -1103,6 +1108,7 @@ eal_parse_common_option(int opt, const char *optarg, { static int b_used; static int w_used; + struct rte_config *cfg = rte_eal_get_configuration(); switch (opt) { /* blacklist */ @@ -1145,7 +1151,9 @@ eal_parse_common_option(int opt, const char *optarg, /* corelist */ case 'l': if (eal_parse_corelist(optarg) < 0) { - RTE_LOG(ERR, EAL, "invalid core list\n"); + RTE_LOG(ERR, EAL, + "Invalid core number given core range should be(0, %u)\n", + cfg->lcore_count-1); return -1; } -- 2.17.2
[dpdk-dev] [PATCH v2] eal: fix core number validation
From: Hari kumar Vemula When incorrect core value or range provided, as part of -l command line option, a crash occurs. Added valid range checks to fix the crash. Added ut check for negative core values. Added unit test case for invalid core number range. Fixes: d888cb8b9613 ("eal: add core list input format") Cc: sta...@dpdk.org Signed-off-by: Hari kumar Vemula --- lib/librte_eal/common/eal_common_options.c | 10 -- test/test/test_eal_flags.c | 14 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 6e3a83b98..4a900c548 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -592,7 +592,9 @@ eal_parse_corelist(const char *corelist) if (*corelist == '\0') return -1; errno = 0; - idx = strtoul(corelist, &end, 10); + idx = strtol(corelist, &end, 10); + if (idx < 0 || idx >= (int)cfg->lcore_count) + return -1; if (errno || end == NULL) return -1; while (isblank(*end)) @@ -603,6 +605,7 @@ eal_parse_corelist(const char *corelist) max = idx; if (min == RTE_MAX_LCORE) min = idx; for (idx = min; idx <= max; idx++) { if (cfg->lcore_role[idx] != ROLE_RTE) { cfg->lcore_role[idx] = ROLE_RTE; @@ -1103,6 +1106,7 @@ eal_parse_common_option(int opt, const char *optarg, { static int b_used; static int w_used; + struct rte_config *cfg = rte_eal_get_configuration(); switch (opt) { /* blacklist */ @@ -1145,7 +1149,9 @@ eal_parse_common_option(int opt, const char *optarg, /* corelist */ case 'l': if (eal_parse_corelist(optarg) < 0) { - RTE_LOG(ERR, EAL, "invalid core list\n"); + RTE_LOG(ERR, EAL, + "Invalid core number, core range should be (0, %u)\n", + cfg->lcore_count-1); return -1; } diff --git a/test/test/test_eal_flags.c b/test/test/test_eal_flags.c index 2acab9d69..ec79b2242 100644 --- a/test/test/test_eal_flags.c +++ b/test/test/test_eal_flags.c @@ -513,6 +513,16 @@ test_missing_c_flag(void) const char *argv25[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "0-1,2@(5-7),(3-5)@(0,2),(0,6),7"}; + /* when core number is negative value*/ + const char * const argv26[] = { prgname, prefix, mp_flag, + "-n", "3", "--lcores", "-5" }; + const char * const argv27[] = { prgname, prefix, mp_flag, + "-n", "3", "--lcores", "-5-7" }; + /* when core number is maximum value*/ + const char * const argv28[] = { prgname, prefix, mp_flag, + "-n", "3", "--lcores", "9" }; + const char * const argv29[] = { prgname, prefix, mp_flag, + "-n", "3", "--lcores", "1-999" }; if (launch_proc(argv2) != 0) { printf("Error - " @@ -556,7 +566,9 @@ test_missing_c_flag(void) launch_proc(argv18) == 0 || launch_proc(argv19) == 0 || launch_proc(argv20) == 0 || launch_proc(argv21) == 0 || launch_proc(argv21) == 0 || launch_proc(argv22) == 0 || - launch_proc(argv23) == 0 || launch_proc(argv24) == 0) { + launch_proc(argv23) == 0 || launch_proc(argv24) == 0 || + launch_proc(argv26) == 0 || launch_proc(argv27) == 0 || + launch_proc(argv28) == 0 || launch_proc(argv29) == 0) { printf("Error - " "process ran without error with invalid --lcore flag\n"); return -1; -- 2.17.2
[dpdk-dev] [PATCH v3] eal: fix core number validation
When incorrect core value or range provided, as part of -l command line option, a crash occurs. Added valid range checks to fix the crash. Added ut check for negative core values. Added unit test case for invalid core number range. Fixes: d888cb8b9613 ("eal: add core list input format") Cc: sta...@dpdk.org -- v3: Added unit test cases for invalid core number range v2: Replace strtoul with strtol Modified log message -- Signed-off-by: Hari Kumar Vemula --- lib/librte_eal/common/eal_common_options.c | 9 +++-- test/test/test_eal_flags.c | 14 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 6e3a83b98..9431c024e 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -592,7 +592,9 @@ eal_parse_corelist(const char *corelist) if (*corelist == '\0') return -1; errno = 0; - idx = strtoul(corelist, &end, 10); + idx = strtol(corelist, &end, 10); + if (idx < 0 || idx >= (int)cfg->lcore_count) + return -1; if (errno || end == NULL) return -1; while (isblank(*end)) @@ -1103,6 +1105,7 @@ eal_parse_common_option(int opt, const char *optarg, { static int b_used; static int w_used; + struct rte_config *cfg = rte_eal_get_configuration(); switch (opt) { /* blacklist */ @@ -1145,7 +1148,9 @@ eal_parse_common_option(int opt, const char *optarg, /* corelist */ case 'l': if (eal_parse_corelist(optarg) < 0) { - RTE_LOG(ERR, EAL, "invalid core list\n"); + RTE_LOG(ERR, EAL, + "Invalid core number, core range should be (0, %u)\n", + cfg->lcore_count-1); return -1; } diff --git a/test/test/test_eal_flags.c b/test/test/test_eal_flags.c index 2acab9d69..28e68a6c9 100644 --- a/test/test/test_eal_flags.c +++ b/test/test/test_eal_flags.c @@ -513,6 +513,16 @@ test_missing_c_flag(void) const char *argv25[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "0-1,2@(5-7),(3-5)@(0,2),(0,6),7"}; + /* core number is negative value */ + const char * const argv26[] = { prgname, prefix, mp_flag, + "-n", "3", "--lcores", "-5" }; + const char * const argv27[] = { prgname, prefix, mp_flag, + "-n", "3", "--lcores", "-5-7" }; + /* core number is maximum value */ + const char * const argv28[] = { prgname, prefix, mp_flag, + "-n", "3", "--lcores", "9" }; + const char * const argv29[] = { prgname, prefix, mp_flag, + "-n", "3", "--lcores", "1-999" }; if (launch_proc(argv2) != 0) { printf("Error - " @@ -556,7 +566,9 @@ test_missing_c_flag(void) launch_proc(argv18) == 0 || launch_proc(argv19) == 0 || launch_proc(argv20) == 0 || launch_proc(argv21) == 0 || launch_proc(argv21) == 0 || launch_proc(argv22) == 0 || - launch_proc(argv23) == 0 || launch_proc(argv24) == 0) { + launch_proc(argv23) == 0 || launch_proc(argv24) == 0 || + launch_proc(argv26) == 0 || launch_proc(argv27) == 0 || + launch_proc(argv28) == 0 || launch_proc(argv29) == 0) { printf("Error - " "process ran without error with invalid --lcore flag\n"); return -1; -- 2.17.2
[dpdk-dev] [PATCH] net/bonding: fix create bonded device test failure
Create bonded device test is failing due to improper initialisation in bonded device configuration. which leads to crash while setting up queues. The value of nb_rx_desc is checked if it is not in range of rx_desc_lim of bonded device which fails. This is due to "rx_desc_lim" is set to 0 as default value of bonded device during bond_alloc(). Hence nb_rx_desc (1024) is > 0 and test fails. Fix is to set the default values of rx_desc_lim of bonded device to appropriate value. Fixes: 2efb58cbab ("bond: new link bonding library") Cc: sta...@dpdk.org Signed-off-by: Hari Kumar Vemula --- drivers/net/bonding/rte_eth_bond_pmd.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 44deaf119..e0888e960 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2225,6 +2225,11 @@ static void bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct bond_dev_private *internals = dev->data->dev_private; + struct rte_eth_desc_lim bond_lim = { + .nb_max = UINT16_MAX, + .nb_min = 0, + .nb_align = 1, + }; uint16_t max_nb_rx_queues = UINT16_MAX; uint16_t max_nb_tx_queues = UINT16_MAX; @@ -2263,10 +2268,8 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) memcpy(&dev_info->default_txconf, &internals->default_txconf, sizeof(dev_info->default_txconf)); - memcpy(&dev_info->rx_desc_lim, &internals->rx_desc_lim, - sizeof(dev_info->rx_desc_lim)); - memcpy(&dev_info->tx_desc_lim, &internals->tx_desc_lim, - sizeof(dev_info->tx_desc_lim)); + dev_info->rx_desc_lim = bond_lim; + dev_info->tx_desc_lim = bond_lim; /** * If dedicated hw queues enabled for link bonding device in LACP mode -- 2.17.2
[dpdk-dev] [PATCH v3] lib/efd: fix to free tail queue entry after use
In rte_efd_create() allocated memory for tail queue entry but not freed. Added freeing the tail queue entry. Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library") Cc: sta...@dpdk.org Signed-off-by: Hari Kumar Vemula Acked-by: Reshma Pattan --- v3: Replaced TAILQ_FOREACH_SAFE with TAILQ_FOREACH v2: Updated commit message. --- lib/librte_efd/rte_efd.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c index e6e5cfda2..8b8330e0b 100644 --- a/lib/librte_efd/rte_efd.c +++ b/lib/librte_efd/rte_efd.c @@ -740,17 +740,32 @@ void rte_efd_free(struct rte_efd_table *table) { uint8_t socket_id; + struct rte_efd_list *efd_list; + struct rte_tailq_entry *te, *temp; if (table == NULL) return; + efd_list = RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list); + for (socket_id = 0; socket_id < RTE_MAX_NUMA_NODES; socket_id++) rte_free(table->chunks[socket_id]); + rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK); + TAILQ_FOREACH_SAFE(te, efd_list, next, temp) { + if (te->data == (void *) table) { + TAILQ_REMOVE(efd_list, te, next); + rte_free(te); + te = NULL; + } + } + + rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); rte_ring_free(table->free_slots); rte_free(table->offline_chunks); rte_free(table->keys); rte_free(table); + } /** -- 2.17.2
[dpdk-dev] [PATCH v4] eal: fix core number validation
When incorrect core value or range provided, as part of -l command line option, a crash occurs. Added valid range checks to fix the crash. Added ut check for negative core values. Added unit test case for invalid core number range. Fixes: d888cb8b9613 ("eal: add core list input format") Cc: sta...@dpdk.org Signed-off-by: Hari Kumar Vemula -- v4: Used RTE_MAX_LCORE for max core check v3: Added unit test cases for invalid core number range v2: Replace strtoul with strtol Modified log message --- lib/librte_eal/common/eal_common_options.c | 9 +++-- test/test/test_eal_flags.c | 15 ++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 6e3a83b98..14f40c62c 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -592,7 +592,9 @@ eal_parse_corelist(const char *corelist) if (*corelist == '\0') return -1; errno = 0; - idx = strtoul(corelist, &end, 10); + idx = strtol(corelist, &end, 10); + if (idx < 0 || idx >= (int)cfg->lcore_count) + return -1; if (errno || end == NULL) return -1; while (isblank(*end)) @@ -1103,6 +1105,7 @@ eal_parse_common_option(int opt, const char *optarg, { static int b_used; static int w_used; + struct rte_config *cfg = rte_eal_get_configuration(); switch (opt) { /* blacklist */ @@ -1145,7 +1148,9 @@ eal_parse_common_option(int opt, const char *optarg, /* corelist */ case 'l': if (eal_parse_corelist(optarg) < 0) { - RTE_LOG(ERR, EAL, "invalid core list\n"); + RTE_LOG(ERR, EAL, + "invalid core list, please check core numbers are in [0, %u] range\n", + cfg->lcore_count-1); return -1; } diff --git a/test/test/test_eal_flags.c b/test/test/test_eal_flags.c index 2acab9d69..fc45bf953 100644 --- a/test/test/test_eal_flags.c +++ b/test/test/test_eal_flags.c @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -513,6 +514,16 @@ test_missing_c_flag(void) const char *argv25[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "0-1,2@(5-7),(3-5)@(0,2),(0,6),7"}; + /* core number is negative value */ + const char * const argv26[] = { prgname, prefix, mp_flag, + "-n", "3", "--lcores", "-5" }; + const char * const argv27[] = { prgname, prefix, mp_flag, + "-n", "3", "--lcores", "-5-7" }; + /* core number is maximum value */ + const char * const argv28[] = { prgname, prefix, mp_flag, + "-n", "3", "--lcores", "RTE_MAX_LCORE+1" }; + const char * const argv29[] = { prgname, prefix, mp_flag, + "-n", "3", "--lcores", "1-(RTE_MAX_LCORE+1)" }; if (launch_proc(argv2) != 0) { printf("Error - " @@ -556,7 +567,9 @@ test_missing_c_flag(void) launch_proc(argv18) == 0 || launch_proc(argv19) == 0 || launch_proc(argv20) == 0 || launch_proc(argv21) == 0 || launch_proc(argv21) == 0 || launch_proc(argv22) == 0 || - launch_proc(argv23) == 0 || launch_proc(argv24) == 0) { + launch_proc(argv23) == 0 || launch_proc(argv24) == 0 || + launch_proc(argv26) == 0 || launch_proc(argv27) == 0 || + launch_proc(argv28) == 0 || launch_proc(argv29) == 0) { printf("Error - " "process ran without error with invalid --lcore flag\n"); return -1; -- 2.17.2
[dpdk-dev] [PATCH 0/4] enable meson support for aesni_gcm, aesni_mb, kasumi and zuc
1/4: enablement of aesni_gcm pmd in meson 2/4: enablement of aesni_mb pmd in meson 3/4: enablement of kasumi pmd enable in meson 4/4: enablement of zuc pmd enable in meson Hari Kumar Vemula (4): driver/crypto: enable meson support for the aesni gcm drivers/crypto: enable meson support for the aesni mb drivers/crypto: enable meson support for the kasumi drivers/crypto: enable meson support for the zuc drivers/crypto/aesni_gcm/meson.build | 17 + drivers/crypto/aesni_mb/meson.build | 16 drivers/crypto/kasumi/meson.build| 18 ++ drivers/crypto/meson.build | 4 ++-- drivers/crypto/zuc/meson.build | 18 ++ meson_options.txt| 6 ++ 6 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 drivers/crypto/aesni_gcm/meson.build create mode 100644 drivers/crypto/aesni_mb/meson.build create mode 100644 drivers/crypto/kasumi/meson.build create mode 100644 drivers/crypto/zuc/meson.build -- 2.13.6
[dpdk-dev] [PATCH 3/4] drivers/crypto: enable meson support for the kasumi
Added new meson.build file for KASUMI Exported dependency library path through meson_options.txt file Signed-off-by: Hari Kumar Vemula --- drivers/crypto/kasumi/meson.build | 18 ++ drivers/crypto/meson.build| 2 +- meson_options.txt | 2 ++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/kasumi/meson.build diff --git a/drivers/crypto/kasumi/meson.build b/drivers/crypto/kasumi/meson.build new file mode 100644 index 0..b65de65cc --- /dev/null +++ b/drivers/crypto/kasumi/meson.build @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Intel Corporation + +path = get_option('libsso_kasumi_dir') +lib_dir = path + '/build' +inc_dir = path + '/include' + +lib = cc.find_library('libsso_kasumi', dirs: lib_dir, required: false) +if not lib.found() + build = false +else + ext_deps += lib + includes += include_directories(inc_dir) +endif + +sources = files('rte_kasumi_pmd.c', 'rte_kasumi_pmd_ops.c') + +deps += ['bus_vdev'] diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build index ab68c2751..4ed87c367 100644 --- a/drivers/crypto/meson.build +++ b/drivers/crypto/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -drivers = ['aesni_gcm', 'aesni_mb', 'ccp', 'dpaa_sec', 'dpaa2_sec', 'mvsam', +drivers = ['aesni_gcm', 'aesni_mb', 'ccp', 'dpaa_sec', 'dpaa2_sec', 'kasumi', 'mvsam', 'null', 'openssl', 'qat', 'scheduler', 'virtio'] std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps diff --git a/meson_options.txt b/meson_options.txt index 8c75826c1..782213477 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -26,3 +26,5 @@ option('tests', type: 'boolean', value: true, description: 'build unit tests') option('lib_IPSec_MB', type: 'string', value: '', description: 'path to the IPSec_MB library installation directory') +option('libsso_kasumi_dir', type: 'string', value: '', + description: 'path to the KASUMI library installation directory') -- 2.13.6
[dpdk-dev] [PATCH 4/4] drivers/crypto: enable meson support for the zuc
Added new meson.build file for ZUC Exported dependency library path through meson_options.txt file Signed-off-by: Hari Kumar Vemula --- drivers/crypto/meson.build | 2 +- drivers/crypto/zuc/meson.build | 18 ++ meson_options.txt | 2 ++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/zuc/meson.build diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build index 4ed87c367..b45049ce3 100644 --- a/drivers/crypto/meson.build +++ b/drivers/crypto/meson.build @@ -2,7 +2,7 @@ # Copyright(c) 2017 Intel Corporation drivers = ['aesni_gcm', 'aesni_mb', 'ccp', 'dpaa_sec', 'dpaa2_sec', 'kasumi', 'mvsam', - 'null', 'openssl', 'qat', 'scheduler', 'virtio'] + 'null', 'openssl', 'qat', 'scheduler', 'virtio', 'zuc'] std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps config_flag_fmt = 'RTE_LIBRTE_@0@_PMD' diff --git a/drivers/crypto/zuc/meson.build b/drivers/crypto/zuc/meson.build new file mode 100644 index 0..4fa5d9b8c --- /dev/null +++ b/drivers/crypto/zuc/meson.build @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Intel Corporation + +path = get_option('libsso_zuc_dir') +lib_dir = path + '/build' +inc_dir = path + '/include' + +lib = cc.find_library('libsso_zuc', dirs: lib_dir, required: false) +if not lib.found() + build = false +else + ext_deps += lib + includes += include_directories(inc_dir) +endif + +sources = files('rte_zuc_pmd.c', 'rte_zuc_pmd_ops.c') + +deps += ['bus_vdev'] diff --git a/meson_options.txt b/meson_options.txt index 782213477..842b6c6de 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -28,3 +28,5 @@ option('lib_IPSec_MB', type: 'string', value: '', description: 'path to the IPSec_MB library installation directory') option('libsso_kasumi_dir', type: 'string', value: '', description: 'path to the KASUMI library installation directory') +option('libsso_zuc_dir', type: 'string', value: '', + description: 'path to the ZUC library installation directory') -- 2.13.6
[dpdk-dev] [PATCH 1/4] driver/crypto: enable meson support for the aesni gcm
Added new meson.build files for aesni_gcm Exported dependency library path through meson_options.txt file Signed-off-by: Hari Kumar Vemula --- drivers/crypto/aesni_gcm/meson.build | 17 + drivers/crypto/meson.build | 2 +- meson_options.txt| 2 ++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/aesni_gcm/meson.build diff --git a/drivers/crypto/aesni_gcm/meson.build b/drivers/crypto/aesni_gcm/meson.build new file mode 100644 index 0..a84c792c5 --- /dev/null +++ b/drivers/crypto/aesni_gcm/meson.build @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Intel Corporation + +path = get_option('lib_IPSec_MB') +lib_dir = path + '/lib' + +lib = cc.find_library('IPSec_MB', required: false) +if not lib.found() + build = false +else + ext_deps += lib +endif + +sources = files('aesni_gcm_pmd.c', 'aesni_gcm_pmd_ops.c') + +deps += ['bus_vdev'] + diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build index 6ed853b7a..7e14cbba0 100644 --- a/drivers/crypto/meson.build +++ b/drivers/crypto/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -drivers = ['ccp', 'dpaa_sec', 'dpaa2_sec', 'mvsam', +drivers = ['aesni_gcm', 'ccp', 'dpaa_sec', 'dpaa2_sec', 'mvsam', 'null', 'openssl', 'qat', 'scheduler', 'virtio'] std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps diff --git a/meson_options.txt b/meson_options.txt index d38ba56e2..8c75826c1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -24,3 +24,5 @@ option('use_hpet', type: 'boolean', value: false, description: 'use HPET timer in EAL') option('tests', type: 'boolean', value: true, description: 'build unit tests') +option('lib_IPSec_MB', type: 'string', value: '', + description: 'path to the IPSec_MB library installation directory') -- 2.13.6
[dpdk-dev] [PATCH 2/4] drivers/crypto: enable meson support for the aesni mb
Added new meson.build file for aesni_mb Exported dependency library path through meson_options.txt file Signed-off-by: Hari Kumar Vemula --- drivers/crypto/aesni_mb/meson.build | 16 drivers/crypto/meson.build | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/aesni_mb/meson.build diff --git a/drivers/crypto/aesni_mb/meson.build b/drivers/crypto/aesni_mb/meson.build new file mode 100644 index 0..000c7adb4 --- /dev/null +++ b/drivers/crypto/aesni_mb/meson.build @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Intel Corporation + +path = get_option('lib_IPSec_MB') +lib_dir = path + '/lib' + +lib = cc.find_library('IPSec_MB', required: false) +if not lib.found() + build = false +else + ext_deps += lib +endif + +sources = files('rte_aesni_mb_pmd.c', 'rte_aesni_mb_pmd_ops.c') + +deps += ['bus_vdev'] diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build index 7e14cbba0..ab68c2751 100644 --- a/drivers/crypto/meson.build +++ b/drivers/crypto/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -drivers = ['aesni_gcm', 'ccp', 'dpaa_sec', 'dpaa2_sec', 'mvsam', +drivers = ['aesni_gcm', 'aesni_mb', 'ccp', 'dpaa_sec', 'dpaa2_sec', 'mvsam', 'null', 'openssl', 'qat', 'scheduler', 'virtio'] std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps -- 2.13.6
[dpdk-dev] [PATCH v2 2/4] drivers/crypto: enable meson support for the aesni mb
Added new meson.build file for aesni_mb Signed-off-by: Hari Kumar Vemula --- drivers/crypto/aesni_mb/meson.build | 12 drivers/crypto/meson.build | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/aesni_mb/meson.build diff --git a/drivers/crypto/aesni_mb/meson.build b/drivers/crypto/aesni_mb/meson.build new file mode 100644 index 0..aae0995e5 --- /dev/null +++ b/drivers/crypto/aesni_mb/meson.build @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Intel Corporation + +lib = cc.find_library('IPSec_MB', required: false) +if not lib.found() + build = false +else + ext_deps += lib +endif + +sources = files('rte_aesni_mb_pmd.c', 'rte_aesni_mb_pmd_ops.c') +deps += ['bus_vdev'] diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build index 7e14cbba0..1de5cfa35 100644 --- a/drivers/crypto/meson.build +++ b/drivers/crypto/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -drivers = ['aesni_gcm', 'ccp', 'dpaa_sec', 'dpaa2_sec', 'mvsam', +drivers = ['aesni_gcm', 'aesni_mb', 'ccp', 'dpaa_sec', 'dpaa2_sec', 'mvsam', 'null', 'openssl', 'qat', 'scheduler', 'virtio'] std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps -- 2.13.6
[dpdk-dev] [PATCH v2 0/4] enable meson support for aesni_gcm, aesni_mb, kasumi and zuc
1/4: enablement of aesni_gcm pmd in meson 2/4: enablement of aesni_mb pmd in meson 3/4: enablement of kasumi pmd enable in meson 4/4: enablement of zuc pmd enable in meson -- v2: Removed lib dependancy options from meson_option.txt file -- Hari Kumar Vemula (4): drivers/crypto: enable meson support for the aesni gcm drivers/crypto: enable meson support for the aesni mb drivers/crypto: enable meson support for the kasumi drivers/crypto: enable meson support for the zuc drivers/crypto/aesni_gcm/meson.build | 13 + drivers/crypto/aesni_mb/meson.build | 12 drivers/crypto/kasumi/meson.build| 12 drivers/crypto/meson.build | 4 ++-- drivers/crypto/zuc/meson.build | 12 5 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 drivers/crypto/aesni_gcm/meson.build create mode 100644 drivers/crypto/aesni_mb/meson.build create mode 100644 drivers/crypto/kasumi/meson.build create mode 100644 drivers/crypto/zuc/meson.build -- 2.13.6
[dpdk-dev] [PATCH v2 1/4] drivers/crypto: enable meson support for the aesni gcm
Added new meson.build files for aesni_gcm Signed-off-by: Hari Kumar Vemula --- drivers/crypto/aesni_gcm/meson.build | 13 + drivers/crypto/meson.build | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/aesni_gcm/meson.build diff --git a/drivers/crypto/aesni_gcm/meson.build b/drivers/crypto/aesni_gcm/meson.build new file mode 100644 index 0..e64f8ce71 --- /dev/null +++ b/drivers/crypto/aesni_gcm/meson.build @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Intel Corporation + +lib = cc.find_library('IPSec_MB', required: false) +if not lib.found() + build = false +else + ext_deps += lib +endif + +sources = files('aesni_gcm_pmd.c', 'aesni_gcm_pmd_ops.c') +deps += ['bus_vdev'] + diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build index 6ed853b7a..7e14cbba0 100644 --- a/drivers/crypto/meson.build +++ b/drivers/crypto/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -drivers = ['ccp', 'dpaa_sec', 'dpaa2_sec', 'mvsam', +drivers = ['aesni_gcm', 'ccp', 'dpaa_sec', 'dpaa2_sec', 'mvsam', 'null', 'openssl', 'qat', 'scheduler', 'virtio'] std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps -- 2.13.6
[dpdk-dev] [PATCH v2 3/4] drivers/crypto: enable meson support for the kasumi
Added new meson.build file for KASUMI Signed-off-by: Hari Kumar Vemula --- drivers/crypto/kasumi/meson.build | 12 drivers/crypto/meson.build| 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/kasumi/meson.build diff --git a/drivers/crypto/kasumi/meson.build b/drivers/crypto/kasumi/meson.build new file mode 100644 index 0..a09b0e251 --- /dev/null +++ b/drivers/crypto/kasumi/meson.build @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Intel Corporation + +lib = cc.find_library('libsso_kasumi', required: false) +if not lib.found() + build = false +else + ext_deps += lib +endif + +sources = files('rte_kasumi_pmd.c', 'rte_kasumi_pmd_ops.c') +deps += ['bus_vdev'] diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build index 1de5cfa35..228729da1 100644 --- a/drivers/crypto/meson.build +++ b/drivers/crypto/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -drivers = ['aesni_gcm', 'aesni_mb', 'ccp', 'dpaa_sec', 'dpaa2_sec', 'mvsam', +drivers = ['aesni_gcm', 'aesni_mb', 'ccp', 'dpaa_sec', 'dpaa2_sec', 'kasumi', 'mvsam', 'null', 'openssl', 'qat', 'scheduler', 'virtio'] std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps -- 2.13.6
[dpdk-dev] [PATCH v2 4/4] drivers/crypto: enable meson support for the zuc
Added new meson.build file for ZUC Signed-off-by: Hari Kumar Vemula --- drivers/crypto/meson.build | 2 +- drivers/crypto/zuc/meson.build | 12 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/zuc/meson.build diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build index 228729da1..85ab80557 100644 --- a/drivers/crypto/meson.build +++ b/drivers/crypto/meson.build @@ -2,7 +2,7 @@ # Copyright(c) 2017 Intel Corporation drivers = ['aesni_gcm', 'aesni_mb', 'ccp', 'dpaa_sec', 'dpaa2_sec', 'kasumi', 'mvsam', - 'null', 'openssl', 'qat', 'scheduler', 'virtio'] + 'null', 'openssl', 'qat', 'scheduler', 'virtio', 'zuc'] std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps config_flag_fmt = 'RTE_LIBRTE_@0@_PMD' diff --git a/drivers/crypto/zuc/meson.build b/drivers/crypto/zuc/meson.build new file mode 100644 index 0..b8ca7107e --- /dev/null +++ b/drivers/crypto/zuc/meson.build @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Intel Corporation + +lib = cc.find_library('libsso_zuc', required: false) +if not lib.found() + build = false +else + ext_deps += lib +endif + +sources = files('rte_zuc_pmd.c', 'rte_zuc_pmd_ops.c') +deps += ['bus_vdev'] -- 2.13.6
[dpdk-dev] [PATCH v5] test: add unit tests for metrics library
Unit testcases are added for metrics library Added metrics unit test to autotest list Updated meson build file Updated MAINTAINERSHIP for metrics unit test Signed-off-by: Hari Kumar Vemula Reviewed-by: Reshma Pattan Reviewed-by: Remy Horton Acked-by: Remy Horton --- v5: Rebased on new codebase v4: Updated changes required for meson build v3: Resolved clang compilation issue, changed the expected value of tests in test_metrics_without_init as per library fix added metrics test to the autotest list updated maintainers file for metrics unit test v2: Removal of overstated array size based testcases as suggested --- MAINTAINERS| 1 + test/test/Makefile | 2 + test/test/autotest_data.py | 6 + test/test/meson.build | 3 + test/test/test_metrics.c | 313 + 5 files changed, 325 insertions(+) create mode 100644 test/test/test_metrics.c diff --git a/MAINTAINERS b/MAINTAINERS index 84b9ff786..6b73dc22d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1152,6 +1152,7 @@ F: doc/guides/sample_app_ug/l2_forward_job_stats.rst Metrics M: Remy Horton F: lib/librte_metrics/ +F: test/test/test_metrics.c Bit-rate statistics M: Remy Horton diff --git a/test/test/Makefile b/test/test/Makefile index dcea4410d..e01fdd90a 100644 --- a/test/test/Makefile +++ b/test/test/Makefile @@ -183,6 +183,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c +SRCS-$(CONFIG_RTE_LIBRTE_METRICS) += test_metrics.c + ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c endif diff --git a/test/test/autotest_data.py b/test/test/autotest_data.py index f68d9b111..9fc4f2fbc 100644 --- a/test/test/autotest_data.py +++ b/test/test/autotest_data.py @@ -482,6 +482,12 @@ "Func":default_autotest, "Report": None, }, +{ +"Name":"Metrics autotest", +"Command": "metrics_autotest", +"Func":default_autotest, +"Report": None, +}, # #Please always keep all dump tests at the end and together! # diff --git a/test/test/meson.build b/test/test/meson.build index bacb5b144..9dba82d52 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -67,6 +67,7 @@ test_sources = files('commands.c', 'test_mempool_perf.c', 'test_memzone.c', 'test_meter.c', + 'test_metrics.c', 'test_mp_secondary.c', 'test_per_lcore.c', 'test_pmd_perf.c', @@ -115,6 +116,7 @@ test_deps = ['acl', 'hash', 'lpm', 'member', + 'metrics', 'pipeline', 'port', 'reorder', @@ -192,6 +194,7 @@ test_names = [ 'mempool_perf_autotest', 'memzone_autotest', 'meter_autotest', + 'metrics_autotest', 'multiprocess_autotest', 'per_lcore_autotest', 'pmd_perf_autotest', diff --git a/test/test/test_metrics.c b/test/test/test_metrics.c new file mode 100644 index 0..94d54d71c --- /dev/null +++ b/test/test/test_metrics.c @@ -0,0 +1,313 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Intel Corporation + */ + +#include +#include +#include +#include + +#include +#include + +#include "test.h" + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#defineREG_METRIC_COUNT6 +#defineMETRIC_LESSER_COUNT 3 +#defineKEY 1 +#defineVALUE 1 + +/* Initializes metric module. This function must be called + * from a primary process before metrics are used + */ +static int +test_metrics_init(void) +{ + rte_metrics_init(rte_socket_id()); + return TEST_SUCCESS; +} + + /* Test Case to check failures when memzone init is not done */ +static int +test_metrics_without_init(void) +{ + int err = 0; + const uint64_t value[REG_METRIC_COUNT] = {0}; + const char * const mnames[] = { + "mean_bits_in", "mean_bits_out", + "peak_bits_in", "peak_bits_out", + }; + + /* Failure Test: Checking for memzone initialization */ + err = rte_metrics_reg_name("peak_bits_in"); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_reg_names(&mnames[0], 1); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE); + TEST_ASSERT(err == -EIO, "%s, %d&qu
[dpdk-dev] [PATCH v2 0/5] create different meson test targets
From: Hari Kumar Vemula 1/5: remove existing test cases to reorganize further 2/5: add test-fast suite to meson targets 3/5: add test-perf suite to meson targets 4/5: add test-driver suite to meson targets 5/5: add test-dump suite to meson targets -- v2: Divided fast-test list into two lists -- Hari Kumar Vemula (5): test: remove existing testcases for categorization test: add quick run tests under test-fast suite test: add performance tests under test-perf suite test: add library dependent tests under test-driver suite test: add dump test cases under test-dump suite test/test/meson.build | 291 ++ 1 file changed, 178 insertions(+), 113 deletions(-) -- 2.13.6
[dpdk-dev] [PATCH v2 1/5] test: remove existing testcases for categorization
From: Hari Kumar Vemula Removed testcase list from meson build to categorize testcases into suites Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 110 -- 1 file changed, 110 deletions(-) diff --git a/test/test/meson.build b/test/test/meson.build index 6a71ee0d3..8827c02aa 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -122,109 +122,6 @@ test_deps = ['acl', 'timer' ] -test_names = [ - 'acl_autotest', - 'alarm_autotest', - 'atomic_autotest', - 'barrier_autotest', - 'byteorder_autotest', - 'cmdline_autotest', - 'common_autotest', - 'cpuflags_autotest', - 'crc_autotest', - 'cryptodev_qat_autotest', - 'cryptodev_aesni_mb_autotest', - 'cryptodev_openssl_autotest', - 'cryptodev_openssl_asym_autotest', - 'cryptodev_aesni_gcm_autotest', - 'cryptodev_null_autotest', - 'cryptodev_sw_snow3g_autotest', - 'cryptodev_sw_kasumi_autotest', - 'cryptodev_sw_zuc_autotest', - 'cryptodev_sw_armv8_autotest', - 'cryptodev_sw_mvsam_autotest', - 'cryptodev_dpaa2_sec_autotest', - 'cryptodev_dpaa_sec_autotest', - 'cycles_autotest', - 'debug_autotest', - 'devargs_autotest', - 'distributor_autotest', - 'distributor_perf_autotest', - 'eal_flags_autotest', - 'eal_fs_autotest', - 'efd_autotest', - 'efd_perf_autotest', - 'errno_autotest', - 'event_crypto_adapter_autotest', - 'event_eth_rx_adapter_autotest', - 'event_eth_rx_intr_adapter_autotest', - 'event_ring_autotest', - 'event_eth_tx_adapter_autotest', - 'event_timer_adapter_autotest', - 'eventdev_common_autotest', - 'eventdev_octeontx_autotest', - 'eventdev_sw_autotest', - 'external_mem_autotest', - 'func_reentrancy_autotest', - 'flow_classify_autotest', - 'hash_scaling_autotest', - 'hash_autotest', - 'hash_functions_autotest', - 'hash_multiwriter_autotest', - 'hash_perf_autotest', - 'interrupt_autotest', - 'kni_autotest', - 'kvargs_autotest', - 'link_bonding_autotest', - 'link_bonding_mode4_autotest', - 'logs_autotest', - 'lpm6_autotest', - 'lpm6_perf_autotest', - 'lpm_autotest', - 'lpm_perf_autotest', - 'malloc_autotest', - 'mbuf_autotest', - 'member_autotest', - 'member_perf_autotest', - 'memcpy_autotest', - 'memcpy_perf_autotest', - 'memory_autotest', - 'mempool_autotest', - 'mempool_perf_autotest', - 'memzone_autotest', - 'meter_autotest', - 'multiprocess_autotest', - 'per_lcore_autotest', - 'pmd_perf_autotest', - 'power_acpi_cpufreq_autotest', - 'power_autotest', - 'power_kvm_vm_autotest', - 'prefetch_autotest', - 'reciprocal_division', - 'reciprocal_division_perf', - 'red_all', - 'red_autotest', - 'red_perf', - 'reorder_autotest', - 'ring_autotest', - 'ring_perf_autotest', - 'ring_pmd_autotest', - 'ring_pmd_perf_autotest', - 'rwlock_autotest', - 'sched_autotest', - 'service_autotest', - 'spinlock_autotest', - 'string_autotest', - 'table_autotest', - 'tailq_autotest', - 'thash_autotest', - 'timer_autotest', - 'timer_perf__autotest', - 'timer_racecond_autotest', - 'user_delay_us', - 'version_autotest', -] - if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -258,7 +155,6 @@ if compress_test_dep.found() test_dep_objs += compress_test_dep test_sources += 'test_compressdev.c' test_deps += 'compressdev' - test_names += 'compressdev_autotest' endif foreach d:test_deps @@ -285,10 +181,4 @@ if get_option('tests') # to complete, so timeout to 10 minutes timeout_seconds = 600 - foreach t:test_names - test(t, dpdk_test, - env : ['DPDK_TEST='+t], - timeout : timeout_seconds, - is_parallel : false) - endforeach endif -- 2.13.6
[dpdk-dev] [PATCH v2 2/5] test: add quick run tests under test-fast suite
From: Hari Kumar Vemula Added test cases that runs quickly under test fast category Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 102 +++--- 1 file changed, 97 insertions(+), 5 deletions(-) diff --git a/test/test/meson.build b/test/test/meson.build index 8827c02aa..b6443c88a 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -122,6 +122,75 @@ test_deps = ['acl', 'timer' ] +#All test cases in fast_parallel_test_names list are parallel +fast_parallel_test_names =[ +'acl_autotest', +'alarm_autotest', +'atomic_autotest', +'byteorder_autotest', +'cmdline_autotest', +'common_autotest', +'cpuflags_autotest', +'cycles_autotest', +'debug_autotest', +'eal_flags_autotest', +'eal_fs_autotest', +'errno_autotest', +'event_ring_autotest', +'func_reentrancy_autotest', +'flow_classify_autotest', +'hash_autotest', +'interrupt_autotest', +'logs_autotest', +'lpm6_autotest', +'lpm_autotest', +'malloc_autotest', +'mbuf_autotest', +'memcpy_autotest', +'memory_autotest', +'mempool_autotest', +'memzone_autotest', +'meter_autotest', +'multiprocess_autotest', +'per_lcore_autotest', +'prefetch_autotest', +'red_autotest', +'ring_autotest', +'ring_pmd_autotest', +'rwlock_autotest', +'sched_autotest', +'spinlock_autotest', +'string_autotest', +'table_autotest', +'tailq_autotest', +'timer_autotest', +'user_delay_us', +'version_autotest', +] + +#All test cases in fast_non_parallel_test_names list are non-parallel +fast_non_parallel_test_names =[ +'cryptodev_sw_armv8_autotest', +'crc_autotest', +'cryptodev_openssl_asym_autotest', +'cryptodev_sw_mvsam_autotest', +'devargs_autotest', +'distributor_autotest', +'eventdev_common_autotest', +'eventdev_octeontx_autotest', +'eventdev_sw_autotest', +'hash_scaling_autotest', +'kni_autotest', +'kvargs_autotest', +'member_autotest', +'power_acpi_cpufreq_autotest', +'power_autotest', +'power_kvm_vm_autotest', +'reorder_autotest', +'service_autotest', +'thash_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -150,11 +219,14 @@ if cc.has_argument('-Wno-format-truncation') endif test_dep_objs = [] -compress_test_dep = dependency('zlib', required: false) -if compress_test_dep.found() - test_dep_objs += compress_test_dep - test_sources += 'test_compressdev.c' - test_deps += 'compressdev' +if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV') + compress_test_dep = dependency('zlib', required: false) + if compress_test_dep.found() + test_dep_objs += compress_test_dep + test_sources += 'test_compressdev.c' + test_deps += 'compressdev' + fast_non_parallel_test_names += 'compressdev_autotest' + endif endif foreach d:test_deps @@ -180,5 +252,25 @@ if get_option('tests') # some perf tests (eg: memcpy perf autotest)take very long # to complete, so timeout to 10 minutes timeout_seconds = 600 + timeout_seconds_fast = 10 + + itr = 0 +foreach arg : fast_parallel_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], + args : ['-c f','-n 4', '--file-prefix=test@0@'.format(itr)], +timeout : timeout_seconds_fast, +is_parallel : true, +suite : 'test-fast') + itr += 1 +endforeach + +foreach arg : fast_non_parallel_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds_fast, +is_parallel : false, +suite : 'test-fast') +endforeach endif -- 2.13.6
[dpdk-dev] [PATCH v2 5/5] test: add dump test cases under test-dump suite
From: Hari Kumar Vemula Grouped logging or dump related test cases to test-dump category Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 22 ++ 1 file changed, 22 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index 4668eed81..007c810bb 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -236,6 +236,20 @@ driver_test_names = [ 'cryptodev_sw_zuc_autotest', ] +#All test cases in dump_test_names list are non-parallel +dump_test_names = [ +'dump_struct_sizes', +'dump_mempool', +'dump_malloc_stats', +'dump_devargs', +'dump_log_types', +'dump_ring', +'quit_autotest', +'dump_physmem', +'dump_memzone', +'devargs_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -334,4 +348,12 @@ if get_option('tests') suite : 'test-driver') endforeach +foreach arg : dump_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds, +is_parallel : false, +suite : 'test-dump') +endforeach + endif -- 2.13.6
[dpdk-dev] [PATCH v2 4/5] test: add library dependent tests under test-driver suite
From: Hari Kumar Vemula Added test cases that depend on library as cryptodev Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 27 +++ 1 file changed, 27 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index c69fe0007..4668eed81 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -217,6 +217,25 @@ perf_test_names = [ 'pmd_perf_autotest', ] +#All test cases in driver_test_names list are non-parallel +driver_test_names = [ +'link_bonding_autotest', +'link_bonding_mode4_autotest', +'link_bonding_rssconf_autotest', +'cryptodev_sw_mrvl_autotest', +'cryptodev_dpaa2_sec_autotest', +'cryptodev_dpaa_sec_autotest', +'cryptodev_qat_autotest', +'cryptodev_aesni_mb_autotest', +'cryptodev_openssl_autotest', +'cryptodev_scheduler_autotest', +'cryptodev_aesni_gcm_autotest', +'cryptodev_null_autotest', +'cryptodev_sw_snow3g_autotest', +'cryptodev_sw_kasumi_autotest', +'cryptodev_sw_zuc_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -307,4 +326,12 @@ if get_option('tests') suite : 'test-perf') endforeach +foreach arg : driver_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds, +is_parallel : false, +suite : 'test-driver') +endforeach + endif -- 2.13.6
[dpdk-dev] [PATCH v2 3/5] test: add performance tests under test-perf suite
From: Hari Kumar Vemula Grouped performace test cases under test-perf category Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 34 ++ 1 file changed, 34 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index b6443c88a..c69fe0007 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -191,6 +191,32 @@ fast_non_parallel_test_names =[ 'thash_autotest', ] +#All test cases in perf_test_names list are non-parallel +perf_test_names = [ +'ring_perf_autotest', +'mempool_perf_autotest', +'memcpy_perf_autotest', +'hash_perf_autotest', +'timer_perf_autotest', +'reciprocal_division', +'reciprocal_division_perf', +'lpm_perf_autotest', +'red_all', +'barrier_autotest', +'hash_multiwriter_autotest', +'timer_racecond_autotest', +'efd_autotest', +'hash_functions_autotest', +'eventdev_selftest_sw', +'member_perf_autotest', +'efd_perf_autotest', +'lpm6_perf_autotest', +'red_perf', +'distributor_perf_autotest', +'ring_pmd_perf_autotest', +'pmd_perf_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -273,4 +299,12 @@ if get_option('tests') suite : 'test-fast') endforeach +foreach arg : perf_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds, +is_parallel : false, +suite : 'test-perf') +endforeach + endif -- 2.13.6
[dpdk-dev] [PATCH] test: add unit tests for metrics library
Unit Testcases are added for metrics library. Signed-off-by: Hari Kumar Reviewed-by: Reshma Pattan --- test/test/Makefile | 2 + test/test/test_metrics.c | 340 +++ 2 files changed, 342 insertions(+) create mode 100644 test/test/test_metrics.c diff --git a/test/test/Makefile b/test/test/Makefile index eccc8efcf..8f391cf84 100644 --- a/test/test/Makefile +++ b/test/test/Makefile @@ -180,6 +180,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring_perf.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c +SRCS-$(CONFIG_RTE_LIBRTE_METRICS) += test_metrics.c + ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c endif diff --git a/test/test/test_metrics.c b/test/test/test_metrics.c new file mode 100644 index 0..eaec43dd1 --- /dev/null +++ b/test/test/test_metrics.c @@ -0,0 +1,340 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Intel Corporation + */ + +#include +#include + +#include +#include +#include + +#include "test.h" + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#defineREG_METRIC_COUNT6 +#defineMETRIC_LESSER_COUNT 3 +#define INVAL_METRIC_COUNT 30 +#defineKEY 1 +#defineVALUE 1 +#define INVALID_COUNT 257 + +/* Initializes metric module. This function must be called + * from a primary process before metrics are used + */ +static int +test_metrics_init(void) +{ + rte_metrics_init(rte_socket_id()); + return TEST_SUCCESS; +} + + /* Test Case to check failures when memzone init is not done */ +static int +test_metrics_without_init(void) +{ + int err = 0; + const uint64_t value[REG_METRIC_COUNT] = {0}; + const char * const mnames[] = { + "mean_bits_in", "mean_bits_out", + "peak_bits_in", "peak_bits_out", + }; + + /* Failure Test: Checking for memzone initialization */ + err = rte_metrics_reg_name(NULL); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_reg_names(&mnames[0], 1); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_update_values(RTE_METRICS_GLOBAL, KEY, &value[0], 4); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_get_names(NULL, 0); + TEST_ASSERT(err == 0, "%s, %d", __func__, __LINE__); + + err = rte_metrics_get_values(RTE_METRICS_GLOBAL, NULL, 0); + TEST_ASSERT(err == 0, "%s, %d", __func__, __LINE__); + + return TEST_SUCCESS; +} + +/* Test Case to validate registering a single metric */ +static int +test_metrics_reg_name_with_validname(void) +{ + int err = 0; + + /* Test to register the new metric name */ + err = rte_metrics_reg_name("peak_bits_out"); + TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__); + + /* Test to register the same metric name */ + err = rte_metrics_reg_name("peak_bits_out"); + TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__); + + /* Test case to validate registering a invalid metric */ + err = rte_metrics_reg_name(NULL); + TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__); + + return TEST_SUCCESS; +} + +/* Test case to validate registering a list of valid metric names */ +static int +test_metrics_reg_names(void) +{ + int err = 0; + const char * const mnames[] = { + "mean_bits_in", "mean_bits_out", + "peak_bits_in", "peak_bits_out", + }; + + + /* Success Test: valid array and count size */ + err = rte_metrics_reg_names(&mnames[0], ARRAY_SIZE(mnames)); + TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__); + + /* Failure Test: valid array and higher count size than array size*/ + err = rte_metrics_reg_names(&mnames[0], ARRAY_SIZE(mnames) + 2); + TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__); + + /* Failure Test: valid array and count size lessthan 1*/ + err = rte_metrics_reg_names(&mnames[0], 0); + TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__); + + /* Failure Test: valid array and count exceeds max count */ + err = rte_metrics_reg_names(&mnames[0], INVALID_COUNT); + TEST_ASSERT(err == -ENOMEM, "%s, %d", __func__, __LINE__); + + /* Failure Test: Invalid array and valid count size */ + err = rte_metrics_reg_names(NULL, ARRAY_SIZE(mnames) + 2); + TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__); + + /* Failure Test: Valid array and Invalid count size */ + err = rte_metrics_reg_names(&mnames[0], INVAL_METRIC_COUNT); + TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__); + +
[dpdk-dev] [PATCH v3 1/5] test: remove existing testcases for categorization
From: Hari Kumar Vemula Removed testcase list from meson build to categorize testcases into suites Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 111 -- 1 file changed, 111 deletions(-) diff --git a/test/test/meson.build b/test/test/meson.build index 7c6e3b00b..088a44726 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -122,110 +122,6 @@ test_deps = ['acl', 'timer' ] -test_names = [ - 'acl_autotest', - 'alarm_autotest', - 'atomic_autotest', - 'barrier_autotest', - 'byteorder_autotest', - 'cmdline_autotest', - 'common_autotest', - 'cpuflags_autotest', - 'crc_autotest', - 'cryptodev_qat_autotest', - 'cryptodev_aesni_mb_autotest', - 'cryptodev_openssl_autotest', - 'cryptodev_openssl_asym_autotest', - 'cryptodev_aesni_gcm_autotest', - 'cryptodev_null_autotest', - 'cryptodev_sw_snow3g_autotest', - 'cryptodev_sw_kasumi_autotest', - 'cryptodev_sw_zuc_autotest', - 'cryptodev_sw_armv8_autotest', - 'cryptodev_sw_mvsam_autotest', - 'cryptodev_dpaa2_sec_autotest', - 'cryptodev_dpaa_sec_autotest', - 'cryptodev_octeontx_autotest', - 'cycles_autotest', - 'debug_autotest', - 'devargs_autotest', - 'distributor_autotest', - 'distributor_perf_autotest', - 'eal_flags_autotest', - 'eal_fs_autotest', - 'efd_autotest', - 'efd_perf_autotest', - 'errno_autotest', - 'event_crypto_adapter_autotest', - 'event_eth_rx_adapter_autotest', - 'event_eth_rx_intr_adapter_autotest', - 'event_ring_autotest', - 'event_eth_tx_adapter_autotest', - 'event_timer_adapter_autotest', - 'eventdev_common_autotest', - 'eventdev_octeontx_autotest', - 'eventdev_sw_autotest', - 'external_mem_autotest', - 'func_reentrancy_autotest', - 'flow_classify_autotest', - 'hash_scaling_autotest', - 'hash_autotest', - 'hash_functions_autotest', - 'hash_multiwriter_autotest', - 'hash_perf_autotest', - 'interrupt_autotest', - 'kni_autotest', - 'kvargs_autotest', - 'link_bonding_autotest', - 'link_bonding_mode4_autotest', - 'logs_autotest', - 'lpm6_autotest', - 'lpm6_perf_autotest', - 'lpm_autotest', - 'lpm_perf_autotest', - 'malloc_autotest', - 'mbuf_autotest', - 'member_autotest', - 'member_perf_autotest', - 'memcpy_autotest', - 'memcpy_perf_autotest', - 'memory_autotest', - 'mempool_autotest', - 'mempool_perf_autotest', - 'memzone_autotest', - 'meter_autotest', - 'multiprocess_autotest', - 'per_lcore_autotest', - 'pmd_perf_autotest', - 'power_acpi_cpufreq_autotest', - 'power_autotest', - 'power_kvm_vm_autotest', - 'prefetch_autotest', - 'reciprocal_division', - 'reciprocal_division_perf', - 'red_all', - 'red_autotest', - 'red_perf', - 'reorder_autotest', - 'ring_autotest', - 'ring_perf_autotest', - 'ring_pmd_autotest', - 'ring_pmd_perf_autotest', - 'rwlock_autotest', - 'sched_autotest', - 'service_autotest', - 'spinlock_autotest', - 'string_autotest', - 'table_autotest', - 'tailq_autotest', - 'thash_autotest', - 'timer_autotest', - 'timer_perf__autotest', - 'timer_racecond_autotest', - 'user_delay_us', - 'version_autotest', -] - if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -262,7 +158,6 @@ if compress_test_dep.found() test_dep_objs += compress_test_dep test_sources += 'test_compressdev.c' test_deps += 'compressdev' - test_names += 'compressdev_autotest' endif foreach d:test_deps @@ -289,10 +184,4 @@ if get_option('tests') # to complete, so timeout to 10 minutes timeout_seconds = 600 - foreach t:test_names - test(t, dpdk_test, - env : ['DPDK_TEST='+t], - timeout : timeout_seconds, - is_parallel : false) - endforeach endif -- 2.13.6
[dpdk-dev] [PATCH v3 2/5] test: add quick run tests under test-fast suite
From: Hari Kumar Vemula Added test cases that runs quickly under test fast category Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 99 --- 1 file changed, 94 insertions(+), 5 deletions(-) diff --git a/test/test/meson.build b/test/test/meson.build index 088a44726..825e84fce 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -122,6 +122,75 @@ test_deps = ['acl', 'timer' ] +#All test cases in fast_parallel_test_names list are parallel +fast_parallel_test_names =[ +'acl_autotest', +'alarm_autotest', +'atomic_autotest', +'byteorder_autotest', +'cmdline_autotest', +'common_autotest', +'cpuflags_autotest', +'cycles_autotest', +'debug_autotest', +'eal_flags_autotest', +'eal_fs_autotest', +'errno_autotest', +'event_ring_autotest', +'func_reentrancy_autotest', +'flow_classify_autotest', +'hash_autotest', +'interrupt_autotest', +'logs_autotest', +'lpm6_autotest', +'lpm_autotest', +'malloc_autotest', +'mbuf_autotest', +'memcpy_autotest', +'memory_autotest', +'mempool_autotest', +'memzone_autotest', +'meter_autotest', +'multiprocess_autotest', +'per_lcore_autotest', +'prefetch_autotest', +'red_autotest', +'ring_autotest', +'ring_pmd_autotest', +'rwlock_autotest', +'sched_autotest', +'spinlock_autotest', +'string_autotest', +'table_autotest', +'tailq_autotest', +'timer_autotest', +'user_delay_us', +'version_autotest', +] + +#All test cases in fast_non_parallel_test_names list are non-parallel +fast_non_parallel_test_names =[ +'cryptodev_sw_armv8_autotest', +'crc_autotest', +'cryptodev_openssl_asym_autotest', +'cryptodev_sw_mvsam_autotest', +'devargs_autotest', +'distributor_autotest', +'eventdev_common_autotest', +'eventdev_octeontx_autotest', +'eventdev_sw_autotest', +'hash_scaling_autotest', +'kni_autotest', +'kvargs_autotest', +'member_autotest', +'power_acpi_cpufreq_autotest', +'power_autotest', +'power_kvm_vm_autotest', +'reorder_autotest', +'service_autotest', +'thash_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -153,11 +222,14 @@ endif default_cflags += '-D_GNU_SOURCE' test_dep_objs = [] -compress_test_dep = dependency('zlib', required: false) -if compress_test_dep.found() - test_dep_objs += compress_test_dep - test_sources += 'test_compressdev.c' - test_deps += 'compressdev' +if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV') + compress_test_dep = dependency('zlib', required: false) + if compress_test_dep.found() + test_dep_objs += compress_test_dep + test_sources += 'test_compressdev.c' + test_deps += 'compressdev' + fast_non_parallel_test_names += 'compressdev_autotest' + endif endif foreach d:test_deps @@ -183,5 +255,22 @@ if get_option('tests') # some perf tests (eg: memcpy perf autotest)take very long # to complete, so timeout to 10 minutes timeout_seconds = 600 +timeout_seconds_fast = 10 + +foreach arg : fast_parallel_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +args : ['-c f','-n 4', '--file-prefix=test@0@'.format(arg)], +timeout : timeout_seconds_fast, +suite : 'test-fast') +endforeach + +foreach arg : fast_non_parallel_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds_fast, +is_parallel : false, +suite : 'test-fast') +endforeach endif -- 2.13.6
[dpdk-dev] [PATCH v3 3/5] test: add performance tests under test-perf suite
From: Hari Kumar Vemula Grouped performace test cases under test-perf category Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 34 ++ 1 file changed, 34 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index 825e84fce..70a4c6bed 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -191,6 +191,32 @@ fast_non_parallel_test_names =[ 'thash_autotest', ] +#All test cases in perf_test_names list are non-parallel +perf_test_names = [ +'ring_perf_autotest', +'mempool_perf_autotest', +'memcpy_perf_autotest', +'hash_perf_autotest', +'timer_perf_autotest', +'reciprocal_division', +'reciprocal_division_perf', +'lpm_perf_autotest', +'red_all', +'barrier_autotest', +'hash_multiwriter_autotest', +'timer_racecond_autotest', +'efd_autotest', +'hash_functions_autotest', +'eventdev_selftest_sw', +'member_perf_autotest', +'efd_perf_autotest', +'lpm6_perf_autotest', +'red_perf', +'distributor_perf_autotest', +'ring_pmd_perf_autotest', +'pmd_perf_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -273,4 +299,12 @@ if get_option('tests') suite : 'test-fast') endforeach +foreach arg : perf_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds, +is_parallel : false, +suite : 'test-perf') +endforeach + endif -- 2.13.6
[dpdk-dev] [PATCH v3 0/5] create different meson test targets
From: Hari Kumar Vemula 1/5: remove existing test cases to reorganize further 2/5: add test-fast suite to meson targets 3/5: add test-perf suite to meson targets 4/5: add test-driver suite to meson targets 5/5: add test-dump suite to meson targets -- v3: Updated testcase names in file prefix option v2: Divided fast-test list into two lists -- Hari Kumar Vemula (5): test: remove existing testcases for categorization test: add quick run tests under test-fast suite test: add performance tests under test-perf suite test: add library dependent tests under test-driver suite test: add dump test cases under test-dump suite test/test/meson.build | 288 ++ 1 file changed, 174 insertions(+), 114 deletions(-) -- 2.13.6
[dpdk-dev] [PATCH v3 4/5] test: add library dependent tests under test-driver suite
From: Hari Kumar Vemula Added test cases that depend on library as cryptodev Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 27 +++ 1 file changed, 27 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index 70a4c6bed..a727cf461 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -217,6 +217,25 @@ perf_test_names = [ 'pmd_perf_autotest', ] +#All test cases in driver_test_names list are non-parallel +driver_test_names = [ +'link_bonding_autotest', +'link_bonding_mode4_autotest', +'link_bonding_rssconf_autotest', +'cryptodev_sw_mrvl_autotest', +'cryptodev_dpaa2_sec_autotest', +'cryptodev_dpaa_sec_autotest', +'cryptodev_qat_autotest', +'cryptodev_aesni_mb_autotest', +'cryptodev_openssl_autotest', +'cryptodev_scheduler_autotest', +'cryptodev_aesni_gcm_autotest', +'cryptodev_null_autotest', +'cryptodev_sw_snow3g_autotest', +'cryptodev_sw_kasumi_autotest', +'cryptodev_sw_zuc_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -307,4 +326,12 @@ if get_option('tests') suite : 'test-perf') endforeach +foreach arg : driver_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds, +is_parallel : false, +suite : 'test-driver') +endforeach + endif -- 2.13.6
[dpdk-dev] [PATCH v3 5/5] test: add dump test cases under test-dump suite
From: Hari Kumar Vemula Grouped logging or dump related test cases to test-dump category Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 21 + 1 file changed, 21 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index a727cf461..9132ad0c1 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -236,6 +236,20 @@ driver_test_names = [ 'cryptodev_sw_zuc_autotest', ] +#All test cases in dump_test_names list are non-parallel +dump_test_names = [ +'dump_struct_sizes', +'dump_mempool', +'dump_malloc_stats', +'dump_devargs', +'dump_log_types', +'dump_ring', +'quit_autotest', +'dump_physmem', +'dump_memzone', +'devargs_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -334,4 +348,11 @@ if get_option('tests') suite : 'test-driver') endforeach +foreach arg : dump_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds, +is_parallel : false, +suite : 'test-dump') +endforeach endif -- 2.13.6
[dpdk-dev] [PATCH v4 0/5] create different meson test targets
From: Hari Kumar Vemula 1/5: remove existing test cases to reorganize further 2/5: add test-fast suite to meson targets 3/5: add test-perf suite to meson targets 4/5: add test-driver suite to meson targets 5/5: add test-dump suite to meson targets -- v4: Removed test from file prefix v3: Updated testcase names in file prefix option v2: Divided fast-test list into two lists -- Hari Kumar Vemula (5): test: remove existing testcases for categorization test: add quick run tests under test-fast suite test: add performance tests under test-perf suite test: add library dependent tests under test-driver suite test: add dump test cases under test-dump suite test/test/meson.build | 288 ++ 1 file changed, 174 insertions(+), 114 deletions(-) -- 2.13.6
[dpdk-dev] [PATCH v4 3/5] test: add performance tests under test-perf suite
From: Hari Kumar Vemula Grouped performace test cases under test-perf category Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 34 ++ 1 file changed, 34 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index a10908fb3..9e4d7621d 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -191,6 +191,32 @@ fast_non_parallel_test_names =[ 'thash_autotest', ] +#All test cases in perf_test_names list are non-parallel +perf_test_names = [ +'ring_perf_autotest', +'mempool_perf_autotest', +'memcpy_perf_autotest', +'hash_perf_autotest', +'timer_perf_autotest', +'reciprocal_division', +'reciprocal_division_perf', +'lpm_perf_autotest', +'red_all', +'barrier_autotest', +'hash_multiwriter_autotest', +'timer_racecond_autotest', +'efd_autotest', +'hash_functions_autotest', +'eventdev_selftest_sw', +'member_perf_autotest', +'efd_perf_autotest', +'lpm6_perf_autotest', +'red_perf', +'distributor_perf_autotest', +'ring_pmd_perf_autotest', +'pmd_perf_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -273,4 +299,12 @@ if get_option('tests') suite : 'test-fast') endforeach +foreach arg : perf_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds, +is_parallel : false, +suite : 'test-perf') +endforeach + endif -- 2.13.6
[dpdk-dev] [PATCH v4 4/5] test: add library dependent tests under test-driver suite
From: Hari Kumar Vemula Added test cases that depend on library as cryptodev Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 27 +++ 1 file changed, 27 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index 9e4d7621d..da1dbfac4 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -217,6 +217,25 @@ perf_test_names = [ 'pmd_perf_autotest', ] +#All test cases in driver_test_names list are non-parallel +driver_test_names = [ +'link_bonding_autotest', +'link_bonding_mode4_autotest', +'link_bonding_rssconf_autotest', +'cryptodev_sw_mrvl_autotest', +'cryptodev_dpaa2_sec_autotest', +'cryptodev_dpaa_sec_autotest', +'cryptodev_qat_autotest', +'cryptodev_aesni_mb_autotest', +'cryptodev_openssl_autotest', +'cryptodev_scheduler_autotest', +'cryptodev_aesni_gcm_autotest', +'cryptodev_null_autotest', +'cryptodev_sw_snow3g_autotest', +'cryptodev_sw_kasumi_autotest', +'cryptodev_sw_zuc_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -307,4 +326,12 @@ if get_option('tests') suite : 'test-perf') endforeach +foreach arg : driver_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds, +is_parallel : false, +suite : 'test-driver') +endforeach + endif -- 2.13.6
[dpdk-dev] [PATCH v4 5/5] test: add dump test cases under test-dump suite
From: Hari Kumar Vemula Grouped logging or dump related test cases to test-dump category Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 21 + 1 file changed, 21 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index da1dbfac4..266e1bfa6 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -236,6 +236,20 @@ driver_test_names = [ 'cryptodev_sw_zuc_autotest', ] +#All test cases in dump_test_names list are non-parallel +dump_test_names = [ +'dump_struct_sizes', +'dump_mempool', +'dump_malloc_stats', +'dump_devargs', +'dump_log_types', +'dump_ring', +'quit_autotest', +'dump_physmem', +'dump_memzone', +'devargs_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -334,4 +348,11 @@ if get_option('tests') suite : 'test-driver') endforeach +foreach arg : dump_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds, +is_parallel : false, +suite : 'test-dump') +endforeach endif -- 2.13.6
[dpdk-dev] [PATCH v4 2/5] test: add quick run tests under test-fast suite
From: Hari Kumar Vemula Added test cases that runs quickly under test fast category Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 99 --- 1 file changed, 94 insertions(+), 5 deletions(-) diff --git a/test/test/meson.build b/test/test/meson.build index 088a44726..a10908fb3 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -122,6 +122,75 @@ test_deps = ['acl', 'timer' ] +#All test cases in fast_parallel_test_names list are parallel +fast_parallel_test_names =[ +'acl_autotest', +'alarm_autotest', +'atomic_autotest', +'byteorder_autotest', +'cmdline_autotest', +'common_autotest', +'cpuflags_autotest', +'cycles_autotest', +'debug_autotest', +'eal_flags_autotest', +'eal_fs_autotest', +'errno_autotest', +'event_ring_autotest', +'func_reentrancy_autotest', +'flow_classify_autotest', +'hash_autotest', +'interrupt_autotest', +'logs_autotest', +'lpm6_autotest', +'lpm_autotest', +'malloc_autotest', +'mbuf_autotest', +'memcpy_autotest', +'memory_autotest', +'mempool_autotest', +'memzone_autotest', +'meter_autotest', +'multiprocess_autotest', +'per_lcore_autotest', +'prefetch_autotest', +'red_autotest', +'ring_autotest', +'ring_pmd_autotest', +'rwlock_autotest', +'sched_autotest', +'spinlock_autotest', +'string_autotest', +'table_autotest', +'tailq_autotest', +'timer_autotest', +'user_delay_us', +'version_autotest', +] + +#All test cases in fast_non_parallel_test_names list are non-parallel +fast_non_parallel_test_names =[ +'cryptodev_sw_armv8_autotest', +'crc_autotest', +'cryptodev_openssl_asym_autotest', +'cryptodev_sw_mvsam_autotest', +'devargs_autotest', +'distributor_autotest', +'eventdev_common_autotest', +'eventdev_octeontx_autotest', +'eventdev_sw_autotest', +'hash_scaling_autotest', +'kni_autotest', +'kvargs_autotest', +'member_autotest', +'power_acpi_cpufreq_autotest', +'power_autotest', +'power_kvm_vm_autotest', +'reorder_autotest', +'service_autotest', +'thash_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -153,11 +222,14 @@ endif default_cflags += '-D_GNU_SOURCE' test_dep_objs = [] -compress_test_dep = dependency('zlib', required: false) -if compress_test_dep.found() - test_dep_objs += compress_test_dep - test_sources += 'test_compressdev.c' - test_deps += 'compressdev' +if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV') + compress_test_dep = dependency('zlib', required: false) + if compress_test_dep.found() + test_dep_objs += compress_test_dep + test_sources += 'test_compressdev.c' + test_deps += 'compressdev' + fast_non_parallel_test_names += 'compressdev_autotest' + endif endif foreach d:test_deps @@ -183,5 +255,22 @@ if get_option('tests') # some perf tests (eg: memcpy perf autotest)take very long # to complete, so timeout to 10 minutes timeout_seconds = 600 +timeout_seconds_fast = 10 + +foreach arg : fast_parallel_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +args : ['-c f','-n 4', '--file-prefix=@0@'.format(arg)], +timeout : timeout_seconds_fast, +suite : 'test-fast') +endforeach + +foreach arg : fast_non_parallel_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds_fast, +is_parallel : false, +suite : 'test-fast') +endforeach endif -- 2.13.6
[dpdk-dev] [PATCH v4 1/5] test: remove existing testcases for categorization
From: Hari Kumar Vemula Removed testcase list from meson build to categorize testcases into suites Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 111 -- 1 file changed, 111 deletions(-) diff --git a/test/test/meson.build b/test/test/meson.build index 7c6e3b00b..088a44726 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -122,110 +122,6 @@ test_deps = ['acl', 'timer' ] -test_names = [ - 'acl_autotest', - 'alarm_autotest', - 'atomic_autotest', - 'barrier_autotest', - 'byteorder_autotest', - 'cmdline_autotest', - 'common_autotest', - 'cpuflags_autotest', - 'crc_autotest', - 'cryptodev_qat_autotest', - 'cryptodev_aesni_mb_autotest', - 'cryptodev_openssl_autotest', - 'cryptodev_openssl_asym_autotest', - 'cryptodev_aesni_gcm_autotest', - 'cryptodev_null_autotest', - 'cryptodev_sw_snow3g_autotest', - 'cryptodev_sw_kasumi_autotest', - 'cryptodev_sw_zuc_autotest', - 'cryptodev_sw_armv8_autotest', - 'cryptodev_sw_mvsam_autotest', - 'cryptodev_dpaa2_sec_autotest', - 'cryptodev_dpaa_sec_autotest', - 'cryptodev_octeontx_autotest', - 'cycles_autotest', - 'debug_autotest', - 'devargs_autotest', - 'distributor_autotest', - 'distributor_perf_autotest', - 'eal_flags_autotest', - 'eal_fs_autotest', - 'efd_autotest', - 'efd_perf_autotest', - 'errno_autotest', - 'event_crypto_adapter_autotest', - 'event_eth_rx_adapter_autotest', - 'event_eth_rx_intr_adapter_autotest', - 'event_ring_autotest', - 'event_eth_tx_adapter_autotest', - 'event_timer_adapter_autotest', - 'eventdev_common_autotest', - 'eventdev_octeontx_autotest', - 'eventdev_sw_autotest', - 'external_mem_autotest', - 'func_reentrancy_autotest', - 'flow_classify_autotest', - 'hash_scaling_autotest', - 'hash_autotest', - 'hash_functions_autotest', - 'hash_multiwriter_autotest', - 'hash_perf_autotest', - 'interrupt_autotest', - 'kni_autotest', - 'kvargs_autotest', - 'link_bonding_autotest', - 'link_bonding_mode4_autotest', - 'logs_autotest', - 'lpm6_autotest', - 'lpm6_perf_autotest', - 'lpm_autotest', - 'lpm_perf_autotest', - 'malloc_autotest', - 'mbuf_autotest', - 'member_autotest', - 'member_perf_autotest', - 'memcpy_autotest', - 'memcpy_perf_autotest', - 'memory_autotest', - 'mempool_autotest', - 'mempool_perf_autotest', - 'memzone_autotest', - 'meter_autotest', - 'multiprocess_autotest', - 'per_lcore_autotest', - 'pmd_perf_autotest', - 'power_acpi_cpufreq_autotest', - 'power_autotest', - 'power_kvm_vm_autotest', - 'prefetch_autotest', - 'reciprocal_division', - 'reciprocal_division_perf', - 'red_all', - 'red_autotest', - 'red_perf', - 'reorder_autotest', - 'ring_autotest', - 'ring_perf_autotest', - 'ring_pmd_autotest', - 'ring_pmd_perf_autotest', - 'rwlock_autotest', - 'sched_autotest', - 'service_autotest', - 'spinlock_autotest', - 'string_autotest', - 'table_autotest', - 'tailq_autotest', - 'thash_autotest', - 'timer_autotest', - 'timer_perf__autotest', - 'timer_racecond_autotest', - 'user_delay_us', - 'version_autotest', -] - if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -262,7 +158,6 @@ if compress_test_dep.found() test_dep_objs += compress_test_dep test_sources += 'test_compressdev.c' test_deps += 'compressdev' - test_names += 'compressdev_autotest' endif foreach d:test_deps @@ -289,10 +184,4 @@ if get_option('tests') # to complete, so timeout to 10 minutes timeout_seconds = 600 - foreach t:test_names - test(t, dpdk_test, - env : ['DPDK_TEST='+t], - timeout : timeout_seconds, - is_parallel : false) - endforeach endif -- 2.13.6
[dpdk-dev] [PATCH v5 0/5] create different meson test targets
From: Hari Kumar Vemula 1/5: remove existing test cases to reorganize further 2/5: add fast-tests suite to meson targets 3/5: add perf-tests suite to meson targets 4/5: add driver-tests suite to meson targets 5/5: add debug-tests suite to meson targets -- v5: Renamed test suite names Removed quit and devargs_autotest from test list v4: Removed test from file prefix v3: Updated testcase names in file prefix option v2: Divided fast-test list into two lists -- Hari Kumar Vemula (5): test: remove existing testcases for categorization test: add quick run tests under fast-tests suite test: add performance tests under perf-tests suite test: add driver dependent tests under driver-tests suite test: add dump test cases under debug-tests suite test/test/meson.build | 286 ++ 1 file changed, 172 insertions(+), 114 deletions(-) -- 2.13.6
[dpdk-dev] [PATCH v5 2/5] test: add quick run tests under fast-tests suite
From: Hari Kumar Vemula Added test cases that runs quickly under fast tests category Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 99 --- 1 file changed, 94 insertions(+), 5 deletions(-) diff --git a/test/test/meson.build b/test/test/meson.build index 088a44726..b59c87493 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -122,6 +122,75 @@ test_deps = ['acl', 'timer' ] +#All test cases in fast_parallel_test_names list are parallel +fast_parallel_test_names =[ +'acl_autotest', +'alarm_autotest', +'atomic_autotest', +'byteorder_autotest', +'cmdline_autotest', +'common_autotest', +'cpuflags_autotest', +'cycles_autotest', +'debug_autotest', +'eal_flags_autotest', +'eal_fs_autotest', +'errno_autotest', +'event_ring_autotest', +'func_reentrancy_autotest', +'flow_classify_autotest', +'hash_autotest', +'interrupt_autotest', +'logs_autotest', +'lpm6_autotest', +'lpm_autotest', +'malloc_autotest', +'mbuf_autotest', +'memcpy_autotest', +'memory_autotest', +'mempool_autotest', +'memzone_autotest', +'meter_autotest', +'multiprocess_autotest', +'per_lcore_autotest', +'prefetch_autotest', +'red_autotest', +'ring_autotest', +'ring_pmd_autotest', +'rwlock_autotest', +'sched_autotest', +'spinlock_autotest', +'string_autotest', +'table_autotest', +'tailq_autotest', +'timer_autotest', +'user_delay_us', +'version_autotest', +] + +#All test cases in fast_non_parallel_test_names list are non-parallel +fast_non_parallel_test_names =[ +'cryptodev_sw_armv8_autotest', +'crc_autotest', +'cryptodev_openssl_asym_autotest', +'cryptodev_sw_mvsam_autotest', +'devargs_autotest', +'distributor_autotest', +'eventdev_common_autotest', +'eventdev_octeontx_autotest', +'eventdev_sw_autotest', +'hash_scaling_autotest', +'kni_autotest', +'kvargs_autotest', +'member_autotest', +'power_acpi_cpufreq_autotest', +'power_autotest', +'power_kvm_vm_autotest', +'reorder_autotest', +'service_autotest', +'thash_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -153,11 +222,14 @@ endif default_cflags += '-D_GNU_SOURCE' test_dep_objs = [] -compress_test_dep = dependency('zlib', required: false) -if compress_test_dep.found() - test_dep_objs += compress_test_dep - test_sources += 'test_compressdev.c' - test_deps += 'compressdev' +if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV') + compress_test_dep = dependency('zlib', required: false) + if compress_test_dep.found() + test_dep_objs += compress_test_dep + test_sources += 'test_compressdev.c' + test_deps += 'compressdev' + fast_non_parallel_test_names += 'compressdev_autotest' + endif endif foreach d:test_deps @@ -183,5 +255,22 @@ if get_option('tests') # some perf tests (eg: memcpy perf autotest)take very long # to complete, so timeout to 10 minutes timeout_seconds = 600 +timeout_seconds_fast = 10 + +foreach arg : fast_parallel_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +args : ['-c f','-n 4', '--file-prefix=@0@'.format(arg)], +timeout : timeout_seconds_fast, +suite : 'fast-tests') +endforeach + +foreach arg : fast_non_parallel_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds_fast, +is_parallel : false, +suite : 'fast-tests') +endforeach endif -- 2.13.6
[dpdk-dev] [PATCH v5 1/5] test: remove existing testcases for categorization
From: Hari Kumar Vemula Removed testcase list from meson build to categorize testcases into suites Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 111 -- 1 file changed, 111 deletions(-) diff --git a/test/test/meson.build b/test/test/meson.build index 7c6e3b00b..088a44726 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -122,110 +122,6 @@ test_deps = ['acl', 'timer' ] -test_names = [ - 'acl_autotest', - 'alarm_autotest', - 'atomic_autotest', - 'barrier_autotest', - 'byteorder_autotest', - 'cmdline_autotest', - 'common_autotest', - 'cpuflags_autotest', - 'crc_autotest', - 'cryptodev_qat_autotest', - 'cryptodev_aesni_mb_autotest', - 'cryptodev_openssl_autotest', - 'cryptodev_openssl_asym_autotest', - 'cryptodev_aesni_gcm_autotest', - 'cryptodev_null_autotest', - 'cryptodev_sw_snow3g_autotest', - 'cryptodev_sw_kasumi_autotest', - 'cryptodev_sw_zuc_autotest', - 'cryptodev_sw_armv8_autotest', - 'cryptodev_sw_mvsam_autotest', - 'cryptodev_dpaa2_sec_autotest', - 'cryptodev_dpaa_sec_autotest', - 'cryptodev_octeontx_autotest', - 'cycles_autotest', - 'debug_autotest', - 'devargs_autotest', - 'distributor_autotest', - 'distributor_perf_autotest', - 'eal_flags_autotest', - 'eal_fs_autotest', - 'efd_autotest', - 'efd_perf_autotest', - 'errno_autotest', - 'event_crypto_adapter_autotest', - 'event_eth_rx_adapter_autotest', - 'event_eth_rx_intr_adapter_autotest', - 'event_ring_autotest', - 'event_eth_tx_adapter_autotest', - 'event_timer_adapter_autotest', - 'eventdev_common_autotest', - 'eventdev_octeontx_autotest', - 'eventdev_sw_autotest', - 'external_mem_autotest', - 'func_reentrancy_autotest', - 'flow_classify_autotest', - 'hash_scaling_autotest', - 'hash_autotest', - 'hash_functions_autotest', - 'hash_multiwriter_autotest', - 'hash_perf_autotest', - 'interrupt_autotest', - 'kni_autotest', - 'kvargs_autotest', - 'link_bonding_autotest', - 'link_bonding_mode4_autotest', - 'logs_autotest', - 'lpm6_autotest', - 'lpm6_perf_autotest', - 'lpm_autotest', - 'lpm_perf_autotest', - 'malloc_autotest', - 'mbuf_autotest', - 'member_autotest', - 'member_perf_autotest', - 'memcpy_autotest', - 'memcpy_perf_autotest', - 'memory_autotest', - 'mempool_autotest', - 'mempool_perf_autotest', - 'memzone_autotest', - 'meter_autotest', - 'multiprocess_autotest', - 'per_lcore_autotest', - 'pmd_perf_autotest', - 'power_acpi_cpufreq_autotest', - 'power_autotest', - 'power_kvm_vm_autotest', - 'prefetch_autotest', - 'reciprocal_division', - 'reciprocal_division_perf', - 'red_all', - 'red_autotest', - 'red_perf', - 'reorder_autotest', - 'ring_autotest', - 'ring_perf_autotest', - 'ring_pmd_autotest', - 'ring_pmd_perf_autotest', - 'rwlock_autotest', - 'sched_autotest', - 'service_autotest', - 'spinlock_autotest', - 'string_autotest', - 'table_autotest', - 'tailq_autotest', - 'thash_autotest', - 'timer_autotest', - 'timer_perf__autotest', - 'timer_racecond_autotest', - 'user_delay_us', - 'version_autotest', -] - if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -262,7 +158,6 @@ if compress_test_dep.found() test_dep_objs += compress_test_dep test_sources += 'test_compressdev.c' test_deps += 'compressdev' - test_names += 'compressdev_autotest' endif foreach d:test_deps @@ -289,10 +184,4 @@ if get_option('tests') # to complete, so timeout to 10 minutes timeout_seconds = 600 - foreach t:test_names - test(t, dpdk_test, - env : ['DPDK_TEST='+t], - timeout : timeout_seconds, - is_parallel : false) - endforeach endif -- 2.13.6
[dpdk-dev] [PATCH v5 3/5] test: add performance tests under perf-tests suite
From: Hari Kumar Vemula Grouped performace test cases under perf tests category Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 34 ++ 1 file changed, 34 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index b59c87493..217e4d3de 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -191,6 +191,32 @@ fast_non_parallel_test_names =[ 'thash_autotest', ] +#All test cases in perf_test_names list are non-parallel +perf_test_names = [ +'ring_perf_autotest', +'mempool_perf_autotest', +'memcpy_perf_autotest', +'hash_perf_autotest', +'timer_perf_autotest', +'reciprocal_division', +'reciprocal_division_perf', +'lpm_perf_autotest', +'red_all', +'barrier_autotest', +'hash_multiwriter_autotest', +'timer_racecond_autotest', +'efd_autotest', +'hash_functions_autotest', +'eventdev_selftest_sw', +'member_perf_autotest', +'efd_perf_autotest', +'lpm6_perf_autotest', +'red_perf', +'distributor_perf_autotest', +'ring_pmd_perf_autotest', +'pmd_perf_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -273,4 +299,12 @@ if get_option('tests') suite : 'fast-tests') endforeach +foreach arg : perf_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds, +is_parallel : false, +suite : 'perf-tests') +endforeach + endif -- 2.13.6
[dpdk-dev] [PATCH v5 4/5] test: add driver dependent tests under driver-tests suite
From: Hari Kumar Vemula Added test cases that depend on specific drivers Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 27 +++ 1 file changed, 27 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index 217e4d3de..dd54800dd 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -217,6 +217,25 @@ perf_test_names = [ 'pmd_perf_autotest', ] +#All test cases in driver_test_names list are non-parallel +driver_test_names = [ +'link_bonding_autotest', +'link_bonding_mode4_autotest', +'link_bonding_rssconf_autotest', +'cryptodev_sw_mrvl_autotest', +'cryptodev_dpaa2_sec_autotest', +'cryptodev_dpaa_sec_autotest', +'cryptodev_qat_autotest', +'cryptodev_aesni_mb_autotest', +'cryptodev_openssl_autotest', +'cryptodev_scheduler_autotest', +'cryptodev_aesni_gcm_autotest', +'cryptodev_null_autotest', +'cryptodev_sw_snow3g_autotest', +'cryptodev_sw_kasumi_autotest', +'cryptodev_sw_zuc_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -307,4 +326,12 @@ if get_option('tests') suite : 'perf-tests') endforeach +foreach arg : driver_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds, +is_parallel : false, +suite : 'driver-tests') +endforeach + endif -- 2.13.6
[dpdk-dev] [PATCH v5 5/5] test: add dump test cases under debug-tests suite
From: Hari Kumar Vemula Grouped logging or dump related test cases to test debug category Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 19 +++ 1 file changed, 19 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index dd54800dd..c5b10e153 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -236,6 +236,18 @@ driver_test_names = [ 'cryptodev_sw_zuc_autotest', ] +#All test cases in dump_test_names list are non-parallel +dump_test_names = [ +'dump_struct_sizes', +'dump_mempool', +'dump_malloc_stats', +'dump_devargs', +'dump_log_types', +'dump_ring', +'dump_physmem', +'dump_memzone', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -334,4 +346,11 @@ if get_option('tests') suite : 'driver-tests') endforeach +foreach arg : dump_test_names +test(arg, dpdk_test, +env : ['DPDK_TEST=' + arg], +timeout : timeout_seconds, +is_parallel : false, +suite : 'debug-tests') +endforeach endif -- 2.13.6
[dpdk-dev] [PATCH] lib: fix to free trail queue entry after use
In rte_efd_create() allocated memory for trail queue entry but not freed. Added freeing the trail queue entry. Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library") Cc: sta...@dpdk.org Signed-off-by: Hari Kumar Vemula --- lib/librte_efd/rte_efd.c | 21 + 1 file changed, 21 insertions(+) diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c index a780e2fe8..f8c6c447f 100644 --- a/lib/librte_efd/rte_efd.c +++ b/lib/librte_efd/rte_efd.c @@ -739,17 +739,38 @@ void rte_efd_free(struct rte_efd_table *table) { uint8_t socket_id; + struct rte_efd_list *efd_list = NULL; + struct rte_tailq_entry *te; if (table == NULL) return; + efd_list = RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list); + for (socket_id = 0; socket_id < RTE_MAX_NUMA_NODES; socket_id++) rte_free(table->chunks[socket_id]); + rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK); + + /* find our tailq entry */ + TAILQ_FOREACH(te, efd_list, next) { + if (te->data == (void *) table) + break; + } + + if (te == NULL) { + rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + return; + } + + TAILQ_REMOVE(efd_list, te, next); + rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_ring_free(table->free_slots); rte_free(table->offline_chunks); rte_free(table->keys); rte_free(table); + rte_free(te); } /** -- 2.13.6
[dpdk-dev] [PATCH v2] lib/efd: fix to free tail queue entry after use
In rte_efd_create() allocated memory for tail queue entry but not freed. Added freeing the tail queue entry. Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library") Cc: sta...@dpdk.org Signed-off-by: Hari Kumar Vemula Acked-by: Reshma Pattan --- v2: Updated commit message. --- lib/librte_efd/rte_efd.c | 21 + 1 file changed, 21 insertions(+) diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c index a780e2fe8..f8c6c447f 100644 --- a/lib/librte_efd/rte_efd.c +++ b/lib/librte_efd/rte_efd.c @@ -739,17 +739,38 @@ void rte_efd_free(struct rte_efd_table *table) { uint8_t socket_id; + struct rte_efd_list *efd_list = NULL; + struct rte_tailq_entry *te; if (table == NULL) return; + efd_list = RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list); + for (socket_id = 0; socket_id < RTE_MAX_NUMA_NODES; socket_id++) rte_free(table->chunks[socket_id]); + rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK); + + /* find our tailq entry */ + TAILQ_FOREACH(te, efd_list, next) { + if (te->data == (void *) table) + break; + } + + if (te == NULL) { + rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + return; + } + + TAILQ_REMOVE(efd_list, te, next); + rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); + rte_ring_free(table->free_slots); rte_free(table->offline_chunks); rte_free(table->keys); rte_free(table); + rte_free(te); } /** -- 2.13.6
[dpdk-dev] [PATCH v2] test: add unit tests for metrics library
From: Hari Kumar Vemula Unit testcases are added for metrics library. Signed-off-by: Hari Kumar Vemula Reviewed-by: Reshma Pattan Reviewed-by: Remy Horton --- v2: Removal of overstated array size based testcases as suggested --- test/test/Makefile | 2 + test/test/test_metrics.c | 307 +++ 2 files changed, 309 insertions(+) create mode 100644 test/test/test_metrics.c diff --git a/test/test/Makefile b/test/test/Makefile index e6967bab6..30bc53087 100644 --- a/test/test/Makefile +++ b/test/test/Makefile @@ -183,6 +183,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c +SRCS-$(CONFIG_RTE_LIBRTE_METRICS) += test_metrics.c + ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c endif diff --git a/test/test/test_metrics.c b/test/test/test_metrics.c new file mode 100644 index 0..d01f381cd --- /dev/null +++ b/test/test/test_metrics.c @@ -0,0 +1,307 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Intel Corporation + */ + +#include +#include + +#include +#include +#include + +#include "test.h" + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#defineREG_METRIC_COUNT6 +#defineMETRIC_LESSER_COUNT 3 +#defineKEY 1 +#defineVALUE 1 + +/* Initializes metric module. This function must be called + * from a primary process before metrics are used + */ +static int +test_metrics_init(void) +{ + rte_metrics_init(rte_socket_id()); + return TEST_SUCCESS; +} + + /* Test Case to check failures when memzone init is not done */ +static int +test_metrics_without_init(void) +{ + int err = 0; + const uint64_t value[REG_METRIC_COUNT] = {0}; + const char * const mnames[] = { + "mean_bits_in", "mean_bits_out", + "peak_bits_in", "peak_bits_out", + }; + + /* Failure Test: Checking for memzone initialization */ + err = rte_metrics_reg_name(NULL); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_reg_names(&mnames[0], 1); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_update_values(RTE_METRICS_GLOBAL, KEY, &value[0], 4); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_get_names(NULL, 0); + TEST_ASSERT(err == 0, "%s, %d", __func__, __LINE__); + + err = rte_metrics_get_values(RTE_METRICS_GLOBAL, NULL, 0); + TEST_ASSERT(err == 0, "%s, %d", __func__, __LINE__); + + return TEST_SUCCESS; +} + +/* Test Case to validate registering a single metric */ +static int +test_metrics_reg_name_with_validname(void) +{ + int err = 0; + + /* Test to register the new metric name */ + err = rte_metrics_reg_name("peak_bits_out"); + TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__); + + /* Test to register the same metric name */ + err = rte_metrics_reg_name("peak_bits_out"); + TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__); + + /* Test case to validate registering a invalid metric */ + err = rte_metrics_reg_name(NULL); + TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__); + + return TEST_SUCCESS; +} + +/* Test case to validate registering a list of valid metric names */ +static int +test_metrics_reg_names(void) +{ + int err = 0; + const char * const mnames[] = { + "mean_bits_in", "mean_bits_out", + "peak_bits_in", "peak_bits_out", + }; + + /* Success Test: valid array and count size */ + err = rte_metrics_reg_names(&mnames[0], ARRAY_SIZE(mnames)); + TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__); + + return TEST_SUCCESS; +} + +/* Test case to validate update a metric */ +static int +test_metrics_update_value(void) +{ + int err = 0; + + /* Successful Test: Valid port_id, key and value */ + err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE); + TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__); + + /* Successful Test: Valid port_id otherthan RTE_METRICS_GLOBAL, key +* and value +*/ + err = rte_metrics_update_value(9, KEY, VALUE); + TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__); + + /* Failed Test: Invalid port_id with lower value */ + err = rte_metrics_update_value(
[dpdk-dev] [PATCH v3 1/3] test: add unit tests for metrics library
Unit testcases are added for metrics library. Signed-off-by: Hari Kumar Vemula Reviewed-by: Reshma Pattan Reviewed-by: Remy Horton Acked-by: Remy Horton --- test/test/Makefile | 2 + test/test/test_metrics.c | 312 +++ 2 files changed, 314 insertions(+) create mode 100644 test/test/test_metrics.c diff --git a/test/test/Makefile b/test/test/Makefile index e6967bab6..30bc53087 100644 --- a/test/test/Makefile +++ b/test/test/Makefile @@ -183,6 +183,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c +SRCS-$(CONFIG_RTE_LIBRTE_METRICS) += test_metrics.c + ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c endif diff --git a/test/test/test_metrics.c b/test/test/test_metrics.c new file mode 100644 index 0..12b96625f --- /dev/null +++ b/test/test/test_metrics.c @@ -0,0 +1,312 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Intel Corporation + */ + +#include +#include + +#include +#include +#include + +#include "test.h" + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#defineREG_METRIC_COUNT6 +#defineMETRIC_LESSER_COUNT 3 +#defineKEY 1 +#defineVALUE 1 + +/* Initializes metric module. This function must be called + * from a primary process before metrics are used + */ +static int +test_metrics_init(void) +{ + rte_metrics_init(rte_socket_id()); + return TEST_SUCCESS; +} + + /* Test Case to check failures when memzone init is not done */ +static int +test_metrics_without_init(void) +{ + int err = 0; + const uint64_t value[REG_METRIC_COUNT] = {0}; + const char * const mnames[] = { + "mean_bits_in", "mean_bits_out", + "peak_bits_in", "peak_bits_out", + }; + + /* Failure Test: Checking for memzone initialization */ + err = rte_metrics_reg_name("peak_bits_in"); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_reg_names(&mnames[0], 1); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_update_values(RTE_METRICS_GLOBAL, KEY, &value[0], 4); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_get_names(NULL, 0); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_get_values(RTE_METRICS_GLOBAL, NULL, 0); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + return TEST_SUCCESS; +} + +/* Test Case to validate registering a single metric */ +static int +test_metrics_reg_name_with_validname(void) +{ + int err = 0; + + /* Test to register the new metric name */ + err = rte_metrics_reg_name("peak_bits_out"); + TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__); + + /* Test to register the same metric name */ + err = rte_metrics_reg_name("peak_bits_out"); + TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__); + + /* Test case to validate registering a invalid metric */ + err = rte_metrics_reg_name(NULL); + TEST_ASSERT(err == -EINVAL, "%s, %d", __func__, __LINE__); + + return TEST_SUCCESS; +} + +/* Test case to validate registering a list of valid metric names */ +static int +test_metrics_reg_names(void) +{ + int err = 0; + const char * const mnames[] = { + "mean_bits_in", "mean_bits_out", + "peak_bits_in", "peak_bits_out", + }; + + /* Success Test: valid array and count size */ + err = rte_metrics_reg_names(&mnames[0], ARRAY_SIZE(mnames)); + TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__); + + return TEST_SUCCESS; +} + +/* Test case to validate update a metric */ +static int +test_metrics_update_value(void) +{ + int err = 0; + + /* Successful Test: Valid port_id, key and value */ + err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE); + TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__); + + /* Successful Test: Valid port_id otherthan RTE_METRICS_GLOBAL, key +* and value +*/ + err = rte_metrics_update_value(9, KEY, VALUE); + TEST_ASSERT(err >= 0, "%s, %d", __func__, __LINE__); + + /* Failed Test: Invalid port_id with lower value */ + err = rte_metrics_update_value(-2, KEY, VALUE); + TEST_ASSERT(err == -EINV
[dpdk-dev] [PATCH v3 0/3] add unit test for metrics library
1/3: add unit tests for metrics library 2/3: add new unit tests to autotest list 3/3: updated maintainer for metrics test Signed-off-by: Hari Kumar Vemula Reviewed-by: Reshma Pattan Acked-by: Reshma Pattan --- v3: Resolved clang compilation issue, changed the expected value of tests in test_metrics_without_init as per library fix added metrics test to the autotest list updated maintainers file for metrics unit test v2: Removal of overstated array size based testcases as suggested --- Hari Kumar Vemula (3): test: add unit tests for metrics library autotest: add new unit tests to autotest list maintainers: add metrics test MAINTAINERS| 1 + test/test/Makefile | 2 + test/test/autotest_data.py | 6 + test/test/test_metrics.c | 312 + 4 files changed, 321 insertions(+) create mode 100644 test/test/test_metrics.c -- 2.13.6
[dpdk-dev] [PATCH v3 2/3] autotest: add new unit tests to autotest list
added metrics unit test to autotest list. Signed-off-by: Hari Kumar Vemula Reviewed-by: Reshma Pattan --- test/test/autotest_data.py | 6 ++ 1 file changed, 6 insertions(+) diff --git a/test/test/autotest_data.py b/test/test/autotest_data.py index f68d9b111..9fc4f2fbc 100644 --- a/test/test/autotest_data.py +++ b/test/test/autotest_data.py @@ -482,6 +482,12 @@ "Func":default_autotest, "Report": None, }, +{ +"Name":"Metrics autotest", +"Command": "metrics_autotest", +"Func":default_autotest, +"Report": None, +}, # #Please always keep all dump tests at the end and together! # -- 2.13.6
[dpdk-dev] [PATCH v3 3/3] maintainers: add metrics test
Update MAINTAINERSHIP for metrics unit test Signed-off-by: Hari Kumar Vemula Reviewed-by: Reshma Pattan --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3b9fec76f..7057b8a0c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1140,6 +1140,7 @@ F: doc/guides/sample_app_ug/l2_forward_job_stats.rst Metrics M: Remy Horton F: lib/librte_metrics/ +F: test/test/test_metrics.c Bit-rate statistics M: Remy Horton -- 2.13.6
[dpdk-dev] [PATCH v4] test: add unit tests for metrics library
Unit testcases are added for metrics library Added metrics unit test to autotest list Updated meson build file Updated MAINTAINERSHIP for metrics unit test Signed-off-by: Hari Kumar Vemula Reviewed-by: Reshma Pattan Reviewed-by: Remy Horton Acked-by: Remy Horton --- v4: Updated changes required for meson build Updated headers as per iwyu v3: Resolved clang compilation issue, changed the expected value of tests in test_metrics_without_init as per library fix added metrics test to the autotest list updated maintainers file for metrics unit test v2: Removal of overstated array size based testcases as suggested --- MAINTAINERS| 1 + test/test/Makefile | 2 + test/test/autotest_data.py | 6 + test/test/meson.build | 3 + test/test/test_metrics.c | 313 + 5 files changed, 325 insertions(+) create mode 100644 test/test/test_metrics.c diff --git a/MAINTAINERS b/MAINTAINERS index 9fd258fad..3b04419c8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1140,6 +1140,7 @@ F: doc/guides/sample_app_ug/l2_forward_job_stats.rst Metrics M: Remy Horton F: lib/librte_metrics/ +F: test/test/test_metrics.c Bit-rate statistics M: Remy Horton diff --git a/test/test/Makefile b/test/test/Makefile index e6967bab6..30bc53087 100644 --- a/test/test/Makefile +++ b/test/test/Makefile @@ -183,6 +183,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c +SRCS-$(CONFIG_RTE_LIBRTE_METRICS) += test_metrics.c + ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y) SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c endif diff --git a/test/test/autotest_data.py b/test/test/autotest_data.py index f68d9b111..9fc4f2fbc 100644 --- a/test/test/autotest_data.py +++ b/test/test/autotest_data.py @@ -482,6 +482,12 @@ "Func":default_autotest, "Report": None, }, +{ +"Name":"Metrics autotest", +"Command": "metrics_autotest", +"Func":default_autotest, +"Report": None, +}, # #Please always keep all dump tests at the end and together! # diff --git a/test/test/meson.build b/test/test/meson.build index b1dd6eca2..7f846f707 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -63,6 +63,7 @@ test_sources = files('commands.c', 'test_mempool_perf.c', 'test_memzone.c', 'test_meter.c', + 'test_metrics.c', 'test_mp_secondary.c', 'test_per_lcore.c', 'test_pmd_perf.c', @@ -111,6 +112,7 @@ test_deps = ['acl', 'hash', 'lpm', 'member', + 'metrics', 'pipeline', 'port', 'reorder', @@ -183,6 +185,7 @@ test_names = [ 'mempool_perf_autotest', 'memzone_autotest', 'meter_autotest', + 'metrics_autotest', 'multiprocess_autotest', 'per_lcore_autotest', 'pmd_perf_autotest', diff --git a/test/test/test_metrics.c b/test/test/test_metrics.c new file mode 100644 index 0..94d54d71c --- /dev/null +++ b/test/test/test_metrics.c @@ -0,0 +1,313 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Intel Corporation + */ + +#include +#include +#include +#include + +#include +#include + +#include "test.h" + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#defineREG_METRIC_COUNT6 +#defineMETRIC_LESSER_COUNT 3 +#defineKEY 1 +#defineVALUE 1 + +/* Initializes metric module. This function must be called + * from a primary process before metrics are used + */ +static int +test_metrics_init(void) +{ + rte_metrics_init(rte_socket_id()); + return TEST_SUCCESS; +} + + /* Test Case to check failures when memzone init is not done */ +static int +test_metrics_without_init(void) +{ + int err = 0; + const uint64_t value[REG_METRIC_COUNT] = {0}; + const char * const mnames[] = { + "mean_bits_in", "mean_bits_out", + "peak_bits_in", "peak_bits_out", + }; + + /* Failure Test: Checking for memzone initialization */ + err = rte_metrics_reg_name("peak_bits_in"); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_reg_names(&mnames[0], 1); + TEST_ASSERT(err == -EIO, "%s, %d", __func__, __LINE__); + + err = rte_metrics_update_value(RTE_METRICS_GLOBAL, KEY, VALUE); + TEST_ASSERT(err == -EIO, "%s, %d&qu
[dpdk-dev] [PATCH 2/5] test: add quick run tests under test-fast suite
Added test cases that runs quickly under test fast category Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 89 +++ 1 file changed, 83 insertions(+), 6 deletions(-) diff --git a/test/test/meson.build b/test/test/meson.build index a364d1aac..087d635e1 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -118,6 +118,70 @@ test_deps = ['acl', 'timer' ] +fast_test_names =[ +['acl_autotest', 'parallel', true], +['alarm_autotest', 'parallel', true], +['atomic_autotest', 'parallel', true], +['byteorder_autotest', 'parallel', true], +['cryptodev_sw_armv8_autotest', 'non-parallel', false], +['cmdline_autotest', 'parallel', true], +['common_autotest', 'parallel', true], +['cpuflags_autotest', 'parallel', true], +['crc_autotest', 'non-parallel', false], +['cryptodev_openssl_asym_autotest', 'non-parallel', false], +['cryptodev_sw_mvsam_autotest', 'non-parallel', false], +['cycles_autotest', 'parallel', true], +['debug_autotest', 'parallel', true], +['devargs_autotest', 'non-parallel', false], +['distributor_autotest', 'non-parallel', false], +['eal_flags_autotest', 'parallel', true], +['eal_fs_autotest', 'parallel', true], +['errno_autotest', 'parallel', true], +['event_ring_autotest', 'parallel', true], +['eventdev_common_autotest', 'non-parallel', false], +['eventdev_octeontx_autotest', 'non-parallel', false], +['eventdev_sw_autotest', 'non-parallel', false], +['func_reentrancy_autotest', 'parallel', true], +['flow_classify_autotest', 'parallel', true], +['hash_scaling_autotest', 'non-parallel', false], +['hash_autotest', 'parallel', true], +['interrupt_autotest', 'parallel', true], +['kni_autotest', 'non-parallel', false], +['kvargs_autotest', 'non-parallel', false], +['logs_autotest', 'parallel', true], +['lpm6_autotest', 'parallel', true], +['lpm_autotest', 'parallel', true], +['malloc_autotest', 'parallel', true], +['mbuf_autotest', 'parallel', true], +['member_autotest', 'non-parallel', false], +['memcpy_autotest', 'parallel', true], +['memory_autotest', 'parallel', true], +['mempool_autotest', 'parallel', true], +['memzone_autotest', 'parallel', true], +['meter_autotest', 'parallel', true], +['multiprocess_autotest', 'parallel', true], +['per_lcore_autotest', 'parallel', true], +['power_acpi_cpufreq_autotest', 'non-parallel', false], +['power_autotest', 'non-parallel', false], +['power_kvm_vm_autotest', 'non-parallel', false], +['prefetch_autotest', 'parallel', true], +['red_autotest', 'parallel', true], +['reorder_autotest', 'non-parallel', false], +['ring_autotest', 'parallel', true], +['ring_pmd_autotest', 'parallel', true], +['rwlock_autotest', 'parallel', true], +['sched_autotest', 'parallel', true], +['service_autotest', 'non-parallel', false], +['spinlock_autotest', 'parallel', true], +['string_autotest', 'parallel', true], +['table_autotest', 'parallel', true], +['tailq_autotest', 'parallel', true], +['thash_autotest', 'non-parallel', false], +['timer_autotest', 'parallel', true], +['user_delay_us', 'parallel', true], +['version_autotest', 'parallel', true], +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -146,12 +210,15 @@ if cc.has_argumen
[dpdk-dev] [PATCH 1/5] test: remove existing testcases for categorization
Removed testcase list from meson build to categorize testcases into suites Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 104 -- 1 file changed, 104 deletions(-) diff --git a/test/test/meson.build b/test/test/meson.build index b1dd6eca2..a364d1aac 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -118,103 +118,6 @@ test_deps = ['acl', 'timer' ] -test_names = [ - 'acl_autotest', - 'alarm_autotest', - 'atomic_autotest', - 'barrier_autotest', - 'byteorder_autotest', - 'cmdline_autotest', - 'common_autotest', - 'cpuflags_autotest', - 'crc_autotest', - 'cryptodev_qat_autotest', - 'cryptodev_aesni_mb_autotest', - 'cryptodev_openssl_autotest', - 'cryptodev_openssl_asym_autotest', - 'cryptodev_aesni_gcm_autotest', - 'cryptodev_null_autotest', - 'cryptodev_sw_snow3g_autotest', - 'cryptodev_sw_kasumi_autotest', - 'cryptodev_sw_zuc_autotest', - 'cryptodev_sw_armv8_autotest', - 'cryptodev_sw_mvsam_autotest', - 'cryptodev_dpaa2_sec_autotest', - 'cryptodev_dpaa_sec_autotest', - 'cycles_autotest', - 'debug_autotest', - 'devargs_autotest', - 'distributor_autotest', - 'distributor_perf_autotest', - 'eal_flags_autotest', - 'eal_fs_autotest', - 'efd_autotest', - 'efd_perf_autotest', - 'errno_autotest', - 'event_ring_autotest', - 'eventdev_common_autotest', - 'eventdev_octeontx_autotest', - 'eventdev_sw_autotest', - 'func_reentrancy_autotest', - 'flow_classify_autotest', - 'hash_scaling_autotest', - 'hash_autotest', - 'hash_functions_autotest', - 'hash_multiwriter_autotest', - 'hash_perf_autotest', - 'interrupt_autotest', - 'kni_autotest', - 'kvargs_autotest', - 'link_bonding_autotest', - 'link_bonding_mode4_autotest', - 'logs_autotest', - 'lpm6_autotest', - 'lpm6_perf_autotest', - 'lpm_autotest', - 'lpm_perf_autotest', - 'malloc_autotest', - 'mbuf_autotest', - 'member_autotest', - 'member_perf_autotest', - 'memcpy_autotest', - 'memcpy_perf_autotest', - 'memory_autotest', - 'mempool_autotest', - 'mempool_perf_autotest', - 'memzone_autotest', - 'meter_autotest', - 'multiprocess_autotest', - 'per_lcore_autotest', - 'pmd_perf_autotest', - 'power_acpi_cpufreq_autotest', - 'power_autotest', - 'power_kvm_vm_autotest', - 'prefetch_autotest', - 'reciprocal_division', - 'reciprocal_division_perf', - 'red_all', - 'red_autotest', - 'red_perf', - 'reorder_autotest', - 'ring_autotest', - 'ring_perf_autotest', - 'ring_pmd_autotest', - 'ring_pmd_perf_autotest', - 'rwlock_autotest', - 'sched_autotest', - 'service_autotest', - 'spinlock_autotest', - 'string_autotest', - 'table_autotest', - 'tailq_autotest', - 'thash_autotest', - 'timer_autotest', - 'timer_perf__autotest', - 'timer_racecond_autotest', - 'user_delay_us', - 'version_autotest', -] - if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -273,12 +176,5 @@ if get_option('tests') # some perf tests (eg: memcpy perf autotest)take very long # to complete, so timeout to 10 minutes - timeout_seconds = 600 - foreach t:test_names - test(t, dpdk_test, - env : ['DPDK_TEST='+t], - timeout : timeout_seconds, - is_parallel : false) - endforeach endif -- 2.13.6
[dpdk-dev] [PATCH 3/5] test: add performance tests under test-perf suite
Grouped performace test cases under test-perf category Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 34 ++ 1 file changed, 34 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index 087d635e1..edda0b5b7 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -182,6 +182,32 @@ fast_test_names =[ ['version_autotest', 'parallel', true], ] +#All test cases in perf_test_names list are non-parallel +perf_test_names = [ +['ring_perf_autotest'], +['mempool_perf_autotest'], +['memcpy_perf_autotest'], +['hash_perf_autotest'], +['timer_perf_autotest'], +['reciprocal_division'], +['reciprocal_division_perf'], +['lpm_perf_autotest'], +['red_all'], +['barrier_autotest'], +['hash_multiwriter_autotest'], +['timer_racecond_autotest'], +['efd_autotest'], +['hash_functions_autotest'], +['eventdev_selftest_sw'], +['member_perf_autotest'], +['efd_perf_autotest'], +['lpm6_perf_autotest'], +['red_perf'], +['distributor_perf_autotest'], +['ring_pmd_perf_autotest'], +['pmd_perf_autotest'], +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -244,6 +270,7 @@ if get_option('tests') # some perf tests (eg: memcpy perf autotest)take very long # to complete, so timeout to 10 minutes timeout_seconds_fast = 10 + timeout_seconds = 600 foreach arg : fast_test_names bool_value = arg[2] @@ -253,5 +280,12 @@ if get_option('tests') is_parallel : bool_value, suite : 'test-fast') endforeach +foreach arg : perf_test_names + test(arg[0], dpdk_test, + env : ['DPDK_TEST=' + arg[0]], +timeout : timeout_seconds, +is_parallel : false, +suite : 'test-perf') +endforeach endif -- 2.13.6
[dpdk-dev] [PATCH 0/5] create different meson test targets
1/5: remove existing test cases to reorganize further 2/5: add test-fast suite to meson targets 3/5: add test-perf suite to meson targets 4/5: add test-driver suite to meson targets 5/5: add test-dump suite to meson targets 2/5, 3/5, 4/5, 5/5 are needed to execute unit test from meson Hari Kumar Vemula (5): test: remove existing testcases for categorization test: add quick run tests under test-fast suite test: add performance tests under test-perf suite test: add library dependent tests under test-driver suite test: add dump test cases under test-dump suite test/test/meson.build | 268 ++ 1 file changed, 161 insertions(+), 107 deletions(-) -- 2.13.6
[dpdk-dev] [PATCH 5/5] test: add dump test cases under test-dump suite
Grouped logging or dump related test cases to test-dump category Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/test/test/meson.build b/test/test/meson.build index b3a9e7ef9..f6ba600b7 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -227,6 +227,20 @@ driver_test_names = [ ['cryptodev_sw_zuc_autotest'], ] +#All test cases in dump_test_names list are non-parallel +dump_test_names = [ +['dump_struct_sizes'], +['dump_mempool'], +['dump_malloc_stats'], +['dump_devargs'], +['dump_log_types'], +['dump_ring'], +['quit_autotest'], +['dump_physmem'], +['dump_memzone'], +['devargs_autotest'], +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -313,6 +327,12 @@ if get_option('tests') is_parallel : false, suite : 'test-driver') endforeach - +foreach arg : dump_test_names + test(arg[0], dpdk_test, + env : ['DPDK_TEST=' + arg[0]], +timeout : timeout_seconds, +is_parallel : false, +suite : 'test-dump') +endforeach endif -- 2.13.6
[dpdk-dev] [PATCH 4/5] test: add library dependent tests under test-driver suite
Added test cases that depend on library as cryptodev Signed-off-by: Hari Kumar Vemula --- test/test/meson.build | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/test/test/meson.build b/test/test/meson.build index edda0b5b7..b3a9e7ef9 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -208,6 +208,25 @@ perf_test_names = [ ['pmd_perf_autotest'], ] +#All test cases in driver_test_names list are non-parallel +driver_test_names = [ +['link_bonding_autotest'], +['link_bonding_mode4_autotest'], +['link_bonding_rssconf_autotest'], +['cryptodev_sw_mrvl_autotest'], +['cryptodev_dpaa2_sec_autotest'], +['cryptodev_dpaa_sec_autotest'], +['cryptodev_qat_autotest'], +['cryptodev_aesni_mb_autotest'], +['cryptodev_openssl_autotest'], +['cryptodev_scheduler_autotest'], +['cryptodev_aesni_gcm_autotest'], +['cryptodev_null_autotest'], +['cryptodev_sw_snow3g_autotest'], +['cryptodev_sw_kasumi_autotest'], +['cryptodev_sw_zuc_autotest'], +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -281,11 +300,19 @@ if get_option('tests') suite : 'test-fast') endforeach foreach arg : perf_test_names - test(arg[0], dpdk_test, + test(arg[0], dpdk_test, env : ['DPDK_TEST=' + arg[0]], timeout : timeout_seconds, is_parallel : false, suite : 'test-perf') endforeach +foreach arg : driver_test_names + test(arg[0], dpdk_test, + env : ['DPDK_TEST=' + arg[0]], +timeout : timeout_seconds, +is_parallel : false, +suite : 'test-driver') +endforeach + endif -- 2.13.6
[dpdk-dev] [PATCH v5] eal: fix core number validation
When incorrect core value or range provided, as part of -l command line option, a crash occurs. Added valid range checks to fix the crash. Added ut check for negative core values. Added unit test case for invalid core number range. Fixes: d888cb8b9613 ("eal: add core list input format") Cc: sta...@dpdk.org Signed-off-by: Hari Kumar Vemula -- v5: corrected unit test case for -l option v4: Used RTE_MAX_LCORE for max core check v3: Added unit test cases for invalid core number range v2: Replace strtoul with strtol Modified log message --- lib/librte_eal/common/eal_common_options.c | 9 +++-- test/test/test_eal_flags.c | 15 ++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 6e3a83b98..14f40c62c 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -592,7 +592,9 @@ eal_parse_corelist(const char *corelist) if (*corelist == '\0') return -1; errno = 0; - idx = strtoul(corelist, &end, 10); + idx = strtol(corelist, &end, 10); + if (idx < 0 || idx >= (int)cfg->lcore_count) + return -1; if (errno || end == NULL) return -1; while (isblank(*end)) @@ -1103,6 +1105,7 @@ eal_parse_common_option(int opt, const char *optarg, { static int b_used; static int w_used; + struct rte_config *cfg = rte_eal_get_configuration(); switch (opt) { /* blacklist */ @@ -1145,7 +1148,9 @@ eal_parse_common_option(int opt, const char *optarg, /* corelist */ case 'l': if (eal_parse_corelist(optarg) < 0) { - RTE_LOG(ERR, EAL, "invalid core list\n"); + RTE_LOG(ERR, EAL, + "invalid core list, please check core numbers are in [0, %u] range\n", + cfg->lcore_count-1); return -1; } diff --git a/test/test/test_eal_flags.c b/test/test/test_eal_flags.c index 2acab9d69..4dc22ec36 100644 --- a/test/test/test_eal_flags.c +++ b/test/test/test_eal_flags.c @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -513,6 +514,16 @@ test_missing_c_flag(void) const char *argv25[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "0-1,2@(5-7),(3-5)@(0,2),(0,6),7"}; + /* core number is negative value */ + const char * const argv26[] = { prgname, prefix, mp_flag, + "-n", "3", "-l", "-5" }; + const char * const argv27[] = { prgname, prefix, mp_flag, + "-n", "3", "-l", "-5-7" }; + /* core number is maximum value */ + const char * const argv28[] = { prgname, prefix, mp_flag, + "-n", "3", "-l", RTE_STR(RTE_MAX_LCORE) }; + const char * const argv29[] = { prgname, prefix, mp_flag, + "-n", "3", "-l", "1-"RTE_STR(RTE_MAX_LCORE) }; if (launch_proc(argv2) != 0) { printf("Error - " @@ -556,7 +567,9 @@ test_missing_c_flag(void) launch_proc(argv18) == 0 || launch_proc(argv19) == 0 || launch_proc(argv20) == 0 || launch_proc(argv21) == 0 || launch_proc(argv21) == 0 || launch_proc(argv22) == 0 || - launch_proc(argv23) == 0 || launch_proc(argv24) == 0) { + launch_proc(argv23) == 0 || launch_proc(argv24) == 0 || + launch_proc(argv26) == 0 || launch_proc(argv27) == 0 || + launch_proc(argv28) == 0 || launch_proc(argv29) == 0) { printf("Error - " "process ran without error with invalid --lcore flag\n"); return -1; -- 2.17.2
[dpdk-dev] [PATCH v6] eal: fix core number validation
When incorrect core value or range provided, as part of -l command line option, a crash occurs. Added valid range checks to fix the crash. Added ut check for negative core values. Added unit test case for invalid core number range. Fixes: d888cb8b9613 ("eal: add core list input format") Cc: sta...@dpdk.org Signed-off-by: Hari Kumar Vemula Reviewed-by: David Marchand -- v6: Changed testcase order v5: Corrected unit test case for -l option v4: Used RTE_MAX_LCORE for max core check v3: Added unit test cases for invalid core number range v2: Replace strtoul with strtol Modified log message --- lib/librte_eal/common/eal_common_options.c | 9 +++- test/test/test_eal_flags.c | 61 ++ 2 files changed, 45 insertions(+), 25 deletions(-) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 6e3a83b98..14f40c62c 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -592,7 +592,9 @@ eal_parse_corelist(const char *corelist) if (*corelist == '\0') return -1; errno = 0; - idx = strtoul(corelist, &end, 10); + idx = strtol(corelist, &end, 10); + if (idx < 0 || idx >= (int)cfg->lcore_count) + return -1; if (errno || end == NULL) return -1; while (isblank(*end)) @@ -1103,6 +1105,7 @@ eal_parse_common_option(int opt, const char *optarg, { static int b_used; static int w_used; + struct rte_config *cfg = rte_eal_get_configuration(); switch (opt) { /* blacklist */ @@ -1145,7 +1148,9 @@ eal_parse_common_option(int opt, const char *optarg, /* corelist */ case 'l': if (eal_parse_corelist(optarg) < 0) { - RTE_LOG(ERR, EAL, "invalid core list\n"); + RTE_LOG(ERR, EAL, + "invalid core list, please check core numbers are in [0, %u] range\n", + cfg->lcore_count-1); return -1; } diff --git a/test/test/test_eal_flags.c b/test/test/test_eal_flags.c index 2acab9d69..e3a60c7ae 100644 --- a/test/test/test_eal_flags.c +++ b/test/test/test_eal_flags.c @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -477,40 +478,50 @@ test_missing_c_flag(void) "-n", "3", "-l", "1," }; const char *argv10[] = { prgname, prefix, mp_flag, "-n", "3", "-l", "1#2" }; + /* core number is negative value */ + const char * const argv11[] = { prgname, prefix, mp_flag, + "-n", "3", "-l", "-5" }; + const char * const argv12[] = { prgname, prefix, mp_flag, + "-n", "3", "-l", "-5-7" }; + /* core number is maximum value */ + const char * const argv13[] = { prgname, prefix, mp_flag, + "-n", "3", "-l", RTE_STR(RTE_MAX_LCORE) }; + const char * const argv14[] = { prgname, prefix, mp_flag, + "-n", "3", "-l", "1-"RTE_STR(RTE_MAX_LCORE) }; /* sanity check test - valid corelist value */ - const char *argv11[] = { prgname, prefix, mp_flag, + const char * const argv15[] = { prgname, prefix, mp_flag, "-n", "3", "-l", "1-2,3" }; /* --lcores flag but no lcores value */ - const char *argv12[] = { prgname, prefix, mp_flag, + const char * const argv16[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores" }; - const char *argv13[] = { prgname, prefix, mp_flag, + const char * const argv17[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", " " }; /* bad lcores value */ - const char *argv14[] = { prgname, prefix, mp_flag, + const char * const argv18[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "1-3-5" }; - const char *argv15[] = { prgname, prefix, mp_flag, + const char * const argv19[] = { prgname, prefix, mp_flag, "-n", "3", "--lcores", "0-1,,2" }; - const char *argv16[] = { prgname, prefix, mp_flag, + const char * const argv20[] = {
[dpdk-dev] [PATCH v4] lib/efd: fix to free tail queue entry after use
In rte_efd_create() allocated memory for tail queue entry but not freed. Added freeing the tail queue entry. Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library") Cc: sta...@dpdk.org Signed-off-by: Hari Kumar Vemula Acked-by: Reshma Pattan Reviewed-by: Honnappa Nagarahalli --- v4: RTE_TAILQ_CAST moved after for loop v3: Replaced TAILQ_FOREACH_SAFE with TAILQ_FOREACH v2: Updated commit message. --- lib/librte_efd/rte_efd.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c index e6e5cfda2..b19e707d8 100644 --- a/lib/librte_efd/rte_efd.c +++ b/lib/librte_efd/rte_efd.c @@ -740,6 +740,8 @@ void rte_efd_free(struct rte_efd_table *table) { uint8_t socket_id; + struct rte_efd_list *efd_list; + struct rte_tailq_entry *te, *temp; if (table == NULL) return; @@ -747,6 +749,18 @@ rte_efd_free(struct rte_efd_table *table) for (socket_id = 0; socket_id < RTE_MAX_NUMA_NODES; socket_id++) rte_free(table->chunks[socket_id]); + efd_list = RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list); + rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK); + + TAILQ_FOREACH_SAFE(te, efd_list, next, temp) { + if (te->data == (void *) table) { + TAILQ_REMOVE(efd_list, te, next); + rte_free(te); + te = NULL; + } + } + + rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); rte_ring_free(table->free_slots); rte_free(table->offline_chunks); rte_free(table->keys); -- 2.17.2
[dpdk-dev] [PATCH v5] lib/efd: fix to free tail queue entry after use
In rte_efd_create() allocated memory for tail queue entry but not freed. Added freeing the tail queue entry. Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library") Cc: sta...@dpdk.org Signed-off-by: Hari Kumar Vemula Reviewed-by: Honnappa Nagarahalli Acked-by: Reshma Pattan Acked-by: Pablo de Lara --- v5: Removed NULL initialization v4: RTE_TAILQ_CAST moved after for loop v3: Replaced TAILQ_FOREACH_SAFE with TAILQ_FOREACH v2: Updated commit message. --- lib/librte_efd/rte_efd.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c index e6e5cfda2..1a97ece05 100644 --- a/lib/librte_efd/rte_efd.c +++ b/lib/librte_efd/rte_efd.c @@ -740,6 +740,8 @@ void rte_efd_free(struct rte_efd_table *table) { uint8_t socket_id; + struct rte_efd_list *efd_list; + struct rte_tailq_entry *te, *temp; if (table == NULL) return; @@ -747,6 +749,18 @@ rte_efd_free(struct rte_efd_table *table) for (socket_id = 0; socket_id < RTE_MAX_NUMA_NODES; socket_id++) rte_free(table->chunks[socket_id]); + efd_list = RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list); + rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK); + + TAILQ_FOREACH_SAFE(te, efd_list, next, temp) { + if (te->data == (void *) table) { + TAILQ_REMOVE(efd_list, te, next); + rte_free(te); + break; + } + } + + rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); rte_ring_free(table->free_slots); rte_free(table->offline_chunks); rte_free(table->keys); -- 2.17.2
[dpdk-dev] [PATCH v6 0/5] create different meson test targets
1/5: remove existing test cases to reorganize further 2/5: add fast-tests suite to meson targets 3/5: add perf-tests suite to meson targets 4/5: add driver-tests suite to meson targets 5/5: add debug-tests suite to meson targets -- v6: Rebased v5: Renamed test suite names Removed quit and devargs_autotest from test list v4: Removed test from file prefix v3: Updated testcase names in file prefix option v2: Divided fast-test list into two lists -- Hari Kumar Vemula (5): test: remove existing testcases for categorization test: add quick run tests under fast-tests suite test: add performance tests under perf-tests suite test: add driver dependent tests under driver-tests suite test: add dump test cases under debug-tests suite test/test/meson.build | 299 +- 1 file changed, 179 insertions(+), 120 deletions(-) -- 2.17.2
[dpdk-dev] [PATCH v6 4/5] test: add driver dependent tests under driver-tests suite
Added test cases that depend on specific drivers Signed-off-by: Hari Kumar Vemula Acked-by: Bruce Richardson --- test/test/meson.build | 27 +++ 1 file changed, 27 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index 47c97c276..d56c525ea 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -239,6 +239,25 @@ perf_test_names = [ 'pmd_perf_autotest', ] +#All test cases in driver_test_names list are non-parallel +driver_test_names = [ +'link_bonding_autotest', +'link_bonding_mode4_autotest', +'link_bonding_rssconf_autotest', +'cryptodev_sw_mrvl_autotest', +'cryptodev_dpaa2_sec_autotest', +'cryptodev_dpaa_sec_autotest', +'cryptodev_qat_autotest', +'cryptodev_aesni_mb_autotest', +'cryptodev_openssl_autotest', +'cryptodev_scheduler_autotest', +'cryptodev_aesni_gcm_autotest', +'cryptodev_null_autotest', +'cryptodev_sw_snow3g_autotest', +'cryptodev_sw_kasumi_autotest', +'cryptodev_sw_zuc_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -328,4 +347,12 @@ if get_option('tests') is_parallel : false, suite : 'perf-tests') endforeach + + foreach arg : driver_test_names + test(arg, dpdk_test, + env : ['DPDK_TEST=' + arg], + timeout : timeout_seconds, + is_parallel : false, + suite : 'driver-tests') + endforeach endif -- 2.17.2
[dpdk-dev] [PATCH v6 3/5] test: add performance tests under perf-tests suite
Grouped performace test cases under perf tests category Signed-off-by: Hari Kumar Vemula Acked-by: Bruce Richardson --- test/test/meson.build | 34 ++ 1 file changed, 34 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index 1d416967c..47c97c276 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -213,6 +213,32 @@ fast_non_parallel_test_names =[ 'thash_autotest', ] +#All test cases in perf_test_names list are non-parallel +perf_test_names = [ +'ring_perf_autotest', +'mempool_perf_autotest', +'memcpy_perf_autotest', +'hash_perf_autotest', +'timer_perf_autotest', +'reciprocal_division', +'reciprocal_division_perf', +'lpm_perf_autotest', +'red_all', +'barrier_autotest', +'hash_multiwriter_autotest', +'timer_racecond_autotest', +'efd_autotest', +'hash_functions_autotest', +'eventdev_selftest_sw', +'member_perf_autotest', +'efd_perf_autotest', +'lpm6_perf_autotest', +'red_perf', +'distributor_perf_autotest', +'ring_pmd_perf_autotest', +'pmd_perf_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -294,4 +320,12 @@ if get_option('tests') is_parallel : false, suite : 'fast-tests') endforeach + + foreach arg : perf_test_names + test(arg, dpdk_test, + env : ['DPDK_TEST=' + arg], + timeout : timeout_seconds, + is_parallel : false, + suite : 'perf-tests') + endforeach endif -- 2.17.2
[dpdk-dev] [PATCH v6 1/5] test: remove existing testcases for categorization
Removed testcase list from meson build to categorize testcases into suites Signed-off-by: Hari Kumar Vemula Acked-by: Bruce Richardson --- test/test/meson.build | 119 -- 1 file changed, 119 deletions(-) diff --git a/test/test/meson.build b/test/test/meson.build index 045d7c8de..defdbbd22 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -135,118 +135,6 @@ test_deps = ['acl', 'timer' ] -test_names = [ - 'acl_autotest', - 'alarm_autotest', - 'atomic_autotest', - 'barrier_autotest', - 'bitratestats_autotest', - 'byteorder_autotest', - 'cmdline_autotest', - 'common_autotest', - 'cpuflags_autotest', - 'crc_autotest', - 'cryptodev_qat_autotest', - 'cryptodev_aesni_mb_autotest', - 'cryptodev_openssl_autotest', - 'cryptodev_openssl_asym_autotest', - 'cryptodev_aesni_gcm_autotest', - 'cryptodev_null_autotest', - 'cryptodev_sw_snow3g_autotest', - 'cryptodev_sw_kasumi_autotest', - 'cryptodev_sw_zuc_autotest', - 'cryptodev_sw_armv8_autotest', - 'cryptodev_sw_mvsam_autotest', - 'cryptodev_dpaa2_sec_autotest', - 'cryptodev_dpaa_sec_autotest', - 'cryptodev_octeontx_autotest', - 'cycles_autotest', - 'debug_autotest', - 'delay_us_sleep_autotest', - 'devargs_autotest', - 'distributor_autotest', - 'distributor_perf_autotest', - 'eal_flags_autotest', - 'eal_fs_autotest', - 'efd_autotest', - 'efd_perf_autotest', - 'errno_autotest', - 'event_crypto_adapter_autotest', - 'event_eth_rx_adapter_autotest', - 'event_eth_rx_intr_adapter_autotest', - 'event_ring_autotest', - 'event_eth_tx_adapter_autotest', - 'event_timer_adapter_autotest', - 'eventdev_common_autotest', - 'eventdev_octeontx_autotest', - 'eventdev_sw_autotest', - 'external_mem_autotest', - 'fbarray_autotest', - 'func_reentrancy_autotest', - 'flow_classify_autotest', - 'hash_autotest', - 'hash_functions_autotest', - 'hash_multiwriter_autotest', - 'hash_perf_autotest', - 'hash_readwrite_autotest', - 'hash_readwrite_lf_autotest', - 'interrupt_autotest', - 'ipsec_autotest', - 'kni_autotest', - 'kvargs_autotest', - 'latencystats_autotest', - 'link_bonding_autotest', - 'link_bonding_mode4_autotest', - 'logs_autotest', - 'lpm6_autotest', - 'lpm6_perf_autotest', - 'lpm_autotest', - 'lpm_perf_autotest', - 'malloc_autotest', - 'mbuf_autotest', - 'member_autotest', - 'member_perf_autotest', - 'memcpy_autotest', - 'memcpy_perf_autotest', - 'memory_autotest', - 'mempool_autotest', - 'mempool_perf_autotest', - 'memzone_autotest', - 'meter_autotest', - 'metrics_autotest', - 'multiprocess_autotest', - 'pdump_autotest', - 'per_lcore_autotest', - 'pmd_perf_autotest', - 'power_acpi_cpufreq_autotest', - 'power_autotest', - 'power_kvm_vm_autotest', - 'prefetch_autotest', - 'reciprocal_division', - 'reciprocal_division_perf', - 'red_all', - 'red_autotest', - 'red_perf', - 'reorder_autotest', - 'ring_autotest', - 'ring_perf_autotest', - 'ring_pmd_autotest', - 'ring_pmd_perf_autotest', - 'rwlock_autotest', - 'sched_autotest', - 'service_autotest', - 'spinlock_autotest', - 'string_autotest', - 'table_autotest', - 'tailq_autotest', - 'thash_autotest', - 'timer_autotest', - 'timer_perf__autotest', - 'timer_racecond_autotest', - 'user_delay_us', - 'version_autotest', -] - if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -283,7 +171,6 @@ if compress_test_dep.found() test_dep_objs += compress_test_dep test_sources += 'test_compressdev.c' test_deps += 'compressdev' - test_names += 'compressdev_autotest' endif foreach d:test_deps @@ -310,10 +197,4 @@ if get_option('tests') # to complete, so timeout to 10 minutes timeout_seconds = 600 - foreach t:test_names - test(t, dpdk_test, - env : ['DPDK_TEST='+t], - timeout : timeout_seconds, - is_parallel : false) - endforeach endif -- 2.17.2
[dpdk-dev] [PATCH v6 5/5] test: add dump test cases under debug-tests suite
Grouped logging or dump related test cases to test debug category Signed-off-by: Hari Kumar Vemula Acked-by: Bruce Richardson --- test/test/meson.build | 20 1 file changed, 20 insertions(+) diff --git a/test/test/meson.build b/test/test/meson.build index d56c525ea..318e0454d 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -258,6 +258,18 @@ driver_test_names = [ 'cryptodev_sw_zuc_autotest', ] +#All test cases in dump_test_names list are non-parallel +dump_test_names = [ +'dump_struct_sizes', +'dump_mempool', +'dump_malloc_stats', +'dump_devargs', +'dump_log_types', +'dump_ring', +'dump_physmem', +'dump_memzone', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -355,4 +367,12 @@ if get_option('tests') is_parallel : false, suite : 'driver-tests') endforeach + + foreach arg : dump_test_names + test(arg, dpdk_test, + env : ['DPDK_TEST=' + arg], + timeout : timeout_seconds, + is_parallel : false, + suite : 'debug-tests') + endforeach endif -- 2.17.2
[dpdk-dev] [PATCH v6 2/5] test: add quick run tests under fast-tests suite
Added test cases that runs quickly under fast tests category Signed-off-by: Hari Kumar Vemula Acked-by: Bruce Richardson --- test/test/meson.build | 107 -- 1 file changed, 102 insertions(+), 5 deletions(-) diff --git a/test/test/meson.build b/test/test/meson.build index defdbbd22..1d416967c 100644 --- a/test/test/meson.build +++ b/test/test/meson.build @@ -135,6 +135,84 @@ test_deps = ['acl', 'timer' ] +#All test cases in fast_parallel_test_names list are parallel +fast_parallel_test_names =[ +'acl_autotest', +'alarm_autotest', +'atomic_autotest', +'byteorder_autotest', +'cmdline_autotest', +'common_autotest', +'cpuflags_autotest', +'cycles_autotest', +'debug_autotest', +'eal_flags_autotest', +'eal_fs_autotest', +'errno_autotest', +'event_ring_autotest', +'func_reentrancy_autotest', +'flow_classify_autotest', +'hash_autotest', +'interrupt_autotest', +'logs_autotest', +'lpm6_autotest', +'lpm_autotest', +'malloc_autotest', +'mbuf_autotest', +'memcpy_autotest', +'memory_autotest', +'mempool_autotest', +'memzone_autotest', +'meter_autotest', +'multiprocess_autotest', +'per_lcore_autotest', +'prefetch_autotest', +'red_autotest', +'ring_autotest', +'ring_pmd_autotest', +'rwlock_autotest', +'sched_autotest', +'spinlock_autotest', +'string_autotest', +'table_autotest', +'tailq_autotest', +'timer_autotest', +'user_delay_us', +'version_autotest', +] + +#All test cases in fast_non_parallel_test_names list are non-parallel +fast_non_parallel_test_names =[ +'bitratestats_autotest', +'cryptodev_sw_armv8_autotest', +'crc_autotest', +'cryptodev_openssl_asym_autotest', +'cryptodev_sw_mvsam_autotest', +'delay_us_sleep_autotest', +'devargs_autotest', +'distributor_autotest', +'eventdev_common_autotest', +'eventdev_octeontx_autotest', +'eventdev_sw_autotest', +'fbarray_autotest', +'hash_readwrite_autotest', +'hash_readwrite_lf_autotest', +'hash_scaling_autotest', +'ipsec_autotest', +'kni_autotest', +'kvargs_autotest', +'latencystats_autotest', +'member_autotest', +'metrics_autotest', +'pdump_autotest', +'power_acpi_cpufreq_autotest', +'power_autotest', +'power_kvm_vm_autotest', +'reorder_autotest', +'service_autotest', +'thash_autotest', +] + if dpdk_conf.has('RTE_LIBRTE_PDUMP') test_deps += 'pdump' endif @@ -166,11 +244,14 @@ endif default_cflags += '-D_GNU_SOURCE' test_dep_objs = [] -compress_test_dep = dependency('zlib', required: false) -if compress_test_dep.found() - test_dep_objs += compress_test_dep - test_sources += 'test_compressdev.c' - test_deps += 'compressdev' +if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV') + compress_test_dep = dependency('zlib', required: false) + if compress_test_dep.found() + test_dep_objs += compress_test_dep + test_sources += 'test_compressdev.c' + test_deps += 'compressdev' + fast_non_parallel_test_names += 'compressdev_autotest' + endif endif foreach d:test_deps @@ -196,5 +277,21 @@ if get_option('tests') # some perf tests (eg: memcpy perf autotest)take very long # to complete, so timeout to 10 minutes timeout_seconds = 600 + timeout_seconds_fast = 10 + + foreach arg : fast_parallel_test_names + test(arg, dpdk_test, + env : ['DPDK_TEST=' + arg], + args : ['-c f','-n 4', '--file-prefix=@0@'.format(arg)], + timeout : timeout_seconds_fast, + suite : 'fast-tests') + endforeach + foreach arg : fast_non_parallel_test_names + test(arg, dpdk_test, + env : ['DPDK_TEST=' + arg], + timeout : timeout_seconds_fast, + is_parallel : false, + suite : 'fast-tests') + endforeach endif -- 2.17.2
[dpdk-dev] [PATCH v2] doc: add meson ut info in prog guide
Add a programmer's guide section for meson ut Signed-off-by: Hari Kumar Vemula --- v2: Removed enhancement details --- doc/guides/prog_guide/index.rst| 1 + doc/guides/prog_guide/meson_ut.rst | 164 + 2 files changed, 165 insertions(+) create mode 100644 doc/guides/prog_guide/meson_ut.rst diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst index 6726b1e8d..f4274573f 100644 --- a/doc/guides/prog_guide/index.rst +++ b/doc/guides/prog_guide/index.rst @@ -58,6 +58,7 @@ Programmer's Guide source_org dev_kit_build_system dev_kit_root_make_help +meson_ut extend_dpdk build_app ext_app_lib_make_help diff --git a/doc/guides/prog_guide/meson_ut.rst b/doc/guides/prog_guide/meson_ut.rst new file mode 100644 index 0..ab4adbbe8 --- /dev/null +++ b/doc/guides/prog_guide/meson_ut.rst @@ -0,0 +1,164 @@ +.. SPDX-License-Identifier: BSD-3-Clause + +Copyright(c) 2014-2018 Intel Corporation. + +.. _Meson: + +Meson_UT + + +The meson build for unit tests under different categories is supported using 'test/test/meson.build'. + +This document describes the below list in detail. + +* Building and Running the unit tests. +* Grouping of testcases. +* Parallel and non parallel tests. +* Test suites. +* How to run different test suites. +* Support for skipped tests. + + + +Building and Running the unit tests +--- + +* Create the meson build output folder using command. + + ``$meson `` + +* Enter into build output folder, which was created by above command. + + ``$cd build`` + +* Compile DPDK using `$ninja`. + The output file of the build will be available in meson build folder. + After successful ninja command, binary `dpdk-test` is created in `build/test/test/`. + +* Run the unit testcases. + + ``$ninja test`` (or) ``$meson test`` + +* To rebuild the build directory, after any changes to meson.build. + + ``$meson configure`` + +* To run specific test case via meson command. + + ``$meson test `` (or) ``$ninja test `` + + + +Grouping of testcases +- + +Testcases has been grouped into below four different groups based on conditions +of time duration and performance of the individual testcase. + +* fast_parallel_test_names +* fast_non_parallel_test_names +* perf_test_names +* driver_test_names +* dump_test_names + +Parallel and non parallel tests +~~~ + +Unless specified the meson will run all unit tests as parallel by default. +So the test cases are categorized into parallel and non parallel tests purely +based on test case functionality using `is_parallel` argument of `test()` +in meson.build. Test cases marked with `is_parallel : true` will run in +parallel and tests marked with `is_parallel : false` will run in non-parallel. +While non-parallel test is running, any other test should not be run. +Parallel and non parallel test cases are grouped under the +`fast_parallel_test_names` and `fast_non_parallel_test_names`. + + + +Test suites +~~~ + +Test groups are considered as "suiteâ in `meson.build` and can be provided +as argument to `test()` as `suite âproject_name:labelâ` + +Ex: ``suite âDPDK:fast-testsâ`` + +Running different test suites +~ + +Below are commands to run testcases using option `suite` + +* Test cases from the groups `fast_parallel_test_names` and `fast_non_parallel_test_names` + are run under 10seconds and below is the meson command to run them. + + ``$meson test --suite DPDK:fast-tests`` + +* Test cases from the group `perf_test_names` are run under 600 seconds + and below is the meson command to run them. + + ``$meson test --suite DPDK:perf-tests`` + +* Test cases from the group `driver_test_names` are run under 600 seconds + and below is the meson command to run them. + + ``$meson test --suite DPDK:driver-tests`` + +* Test cases from the group `dump_test_names` are run under 600 seconds + and below is the meson command to run them. + + ``$meson test --suite DPDK:dump-tests`` + + + +Skipped testcases +- + +Some unit test cases have dependency on external libraries, driver modules or +config flags, without which the test cases cannot be run, such test cases +should return TEST_SKIPPED when mentioned dependencies are not enabled. To make +test cases run user should enable relevant dependencies. Below are the few +current scenarios when test cases are skipped: + +#. External library dependency paths are not set. +#. Config flag for the dependent library is not enabled. +#. Dependent driver modules are not installed on the system. + +Dependent library paths can be set using below + +* Single path ``export LIBRARY_PATH=path`` + +* Multiple paths ``export LIBRARY_PATH=path1:path2:path3`` + +Dependent library headers path can be exported as below. + +* Single path ``$C
[dpdk-dev] [PATCH v3] doc: add meson ut info in prog guide
Add a programmer's guide section for meson ut Signed-off-by: Hari Kumar Vemula --- v3: Modified v2: Removed enhancement details --- doc/guides/prog_guide/index.rst| 1 + doc/guides/prog_guide/meson_ut.rst | 159 + 2 files changed, 160 insertions(+) create mode 100644 doc/guides/prog_guide/meson_ut.rst diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst index 6726b1e8d..f4274573f 100644 --- a/doc/guides/prog_guide/index.rst +++ b/doc/guides/prog_guide/index.rst @@ -58,6 +58,7 @@ Programmer's Guide source_org dev_kit_build_system dev_kit_root_make_help +meson_ut extend_dpdk build_app ext_app_lib_make_help diff --git a/doc/guides/prog_guide/meson_ut.rst b/doc/guides/prog_guide/meson_ut.rst new file mode 100644 index 0..0e59f5526 --- /dev/null +++ b/doc/guides/prog_guide/meson_ut.rst @@ -0,0 +1,159 @@ +.. SPDX-License-Identifier: BSD-3-Clause + +Copyright(c) 2014-2018 Intel Corporation. + +.. _Meson: + +Meson_UT + + +The meson build for unit tests under different categories is supported using 'test/test/meson.build'. + +This document describes the below list in detail. + +* Building and Running the unit tests. +* Grouping of testcases. +* Parallel and non parallel tests. +* Test suites. +* How to run different test suites. +* Support for skipped tests. + + + +Building and Running the unit tests +--- + +* Create the meson build output folder using command. + + ``$ meson `` + +* Enter into build output folder, which was created by above command. + + ``$ cd build`` + +* Compile DPDK using `$ ninja`. + The output file of the build will be available in meson build folder. + After successful ninja command, binary `dpdk-test` is created in `build/test/test/`. + +* Run the unit testcases. + + ``$ ninja test`` (or) ``$ meson test`` + +* To run specific test case via meson command. + + ``$ meson test `` (or) ``$ ninja test `` + + + +Grouping of testcases +- + +Testcases has been grouped into below four different groups based on conditions +of time duration and performance of the individual testcase. + +* fast_parallel_test_names +* fast_non_parallel_test_names +* perf_test_names +* driver_test_names +* dump_test_names + +Parallel and non parallel tests +~~~ + +By default, meson will run test cases in parallel. However `is_parallel` argument +of `test()` in meson.build can be used to run tests in parallel or non-parallel +mode based on its functionality. Test cases marked with `is_parallel : true` will +run in parallel and tests marked with `is_parallel : false` will run in non-parallel. +While non-parallel test is running, no other test should run. +Parallel and non parallel test cases are grouped under the `fast_parallel_test_names` +and `fast_non_parallel_test_names`. + + + +Test suites +~~~ + +Test groups are considered as `--suite` in `meson.build` and can be provided +as argument to `test()` as `--suite âproject_name:labelâ`. + +Ex: ``$ mesin test --suite âDPDK:fast-testsâ`` + +Running different test suites +~ + +Below are commands to run testcases using option `suite` + +* Test cases from the groups `fast_parallel_test_names` and `fast_non_parallel_test_names` + are run under 10seconds and below is the meson command to run them. + + ``$ meson test --suite DPDK:fast-tests`` + +* Test cases from the group `perf_test_names` are run under 600 seconds + and below is the meson command to run them. + + ``$ meson test --suite DPDK:perf-tests`` + +* Test cases from the group `driver_test_names` are run under 600 seconds + and below is the meson command to run them. + + ``$ meson test --suite DPDK:driver-tests`` + +* Test cases from the group `dump_test_names` are run under 600 seconds + and below is the meson command to run them. + + ``$ meson test --suite DPDK:dump-tests`` + + + +Skipped testcases +- + +Some unit test cases have dependency on external libraries, driver modules or +config flags, without which the test cases cannot be run. such test cases +should return TEST_SKIPPED when mentioned dependencies are not enabled. To make +test cases run user should enable relevant dependencies. Below are the few +current scenarios when test cases are skipped: + +#. External library dependency paths are not set. +#. Config flag for the dependent library is not enabled. +#. Dependent driver modules are not installed on the system. + +Dependent library paths can be set using below + +* Single path ``$ export LIBRARY_PATH=path`` + +* Multiple paths ``$ export LIBRARY_PATH=path1:path2:path3`` + +Dependent library headers path can be stated as part of meson build command as below. + +* Single path ``$ CFLAGS=-I/path meson build`` + +* Multiple paths ``$ CFLAGS=-I/path1 -I/path2 meson build
[dpdk-dev] [PATCH v4] doc: add meson ut info in prog guide
Add a programmer's guide section for meson ut Signed-off-by: Hari Kumar Vemula --- v4: Typos corrected v3: Modified v2: Removed enhancement details --- doc/guides/prog_guide/index.rst| 1 + doc/guides/prog_guide/meson_ut.rst | 159 + 2 files changed, 160 insertions(+) create mode 100644 doc/guides/prog_guide/meson_ut.rst diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst index 6726b1e8d..f4274573f 100644 --- a/doc/guides/prog_guide/index.rst +++ b/doc/guides/prog_guide/index.rst @@ -58,6 +58,7 @@ Programmer's Guide source_org dev_kit_build_system dev_kit_root_make_help +meson_ut extend_dpdk build_app ext_app_lib_make_help diff --git a/doc/guides/prog_guide/meson_ut.rst b/doc/guides/prog_guide/meson_ut.rst new file mode 100644 index 0..9485b1e63 --- /dev/null +++ b/doc/guides/prog_guide/meson_ut.rst @@ -0,0 +1,159 @@ +.. SPDX-License-Identifier: BSD-3-Clause + +Copyright(c) 2014-2018 Intel Corporation. + +.. _Meson: + +Meson_UT + + +The meson build for unit tests under different categories is supported using 'test/test/meson.build'. + +This document describes the below list in detail. + +* Building and Running the unit tests. +* Grouping of testcases. +* Parallel and non parallel tests. +* Test suites. +* How to run different test suites. +* Support for skipped tests. + + + +Building and Running the unit tests +--- + +* Create the meson build output folder using command. + + ``$ meson `` + +* Enter into build output folder, which was created by above command. + + ``$ cd build`` + +* Compile DPDK using `$ ninja`. + The output file of the build will be available in meson build folder. + After successful ninja command, binary `dpdk-test` is created in `build/test/test/`. + +* Run the unit testcases. + + ``$ ninja test`` (or) ``$ meson test`` + +* To run specific test case via meson command. + + ``$ meson test `` (or) ``$ ninja test `` + + + +Grouping of testcases +- + +Testcases has been grouped into below four different groups based on conditions +of time duration and performance of the individual testcase. + +* fast_parallel_test_names +* fast_non_parallel_test_names +* perf_test_names +* driver_test_names +* dump_test_names + +Parallel and non parallel tests +~~~ + +By default, meson will run test cases in parallel. However `is_parallel` argument +of `test()` in meson.build can be used to run tests in parallel or non-parallel +mode based on its functionality. Test cases marked with `is_parallel : true` will +run in parallel and tests marked with `is_parallel : false` will run in non-parallel. +While non-parallel test is running, no other test should run. +Parallel and non parallel test cases are grouped under the `fast_parallel_test_names` +and `fast_non_parallel_test_names`. + + + +Test suites +~~~ + +Tests are grouped into test suites in meson.build and these suite names can be provided +as argument to `meson test` as `--suite âproject_name:labelâ`. + +Ex: ``$ meson test --suite âDPDK:fast-testsâ`` + +Running different test suites +~ + +Below are commands to run testcases using option `suite` + +* Test cases from the groups `fast_parallel_test_names` and `fast_non_parallel_test_names` + are run under 10seconds and below is the meson command to run them. + + ``$ meson test --suite DPDK:fast-tests`` + +* Test cases from the group `perf_test_names` are run under 600 seconds + and below is the meson command to run them. + + ``$ meson test --suite DPDK:perf-tests`` + +* Test cases from the group `driver_test_names` are run under 600 seconds + and below is the meson command to run them. + + ``$ meson test --suite DPDK:driver-tests`` + +* Test cases from the group `dump_test_names` are run under 600 seconds + and below is the meson command to run them. + + ``$ meson test --suite DPDK:dump-tests`` + + + +Skipped testcases +- + +Some unit test cases have dependency on external libraries, driver modules or +config flags, without which the test cases cannot be run. Such test cases +should return TEST_SKIPPED when mentioned dependencies are not enabled. To make +test cases run user should enable relevant dependencies. Below are the few +current scenarios when test cases are skipped: + +#. External library dependency paths are not set. +#. Config flag for the dependent library is not enabled. +#. Dependent driver modules are not installed on the system. + +Dependent library paths can be set using below + +* Single path ``$ export LIBRARY_PATH=path`` + +* Multiple paths ``$ export LIBRARY_PATH=path1:path2:path3`` + +Dependent library headers path can be stated as part of meson build command as below. + +* Single path ``$ CFLAGS=-I/path meson build`` + +* Multiple paths ``
[dpdk-dev] [PATCH v2] net/bonding: fix create bonded device test failure
Create bonded device test is failing due to improper initialisation in bonded device configuration. which leads to crash while setting up queues. The value of nb_rx_desc is checked if it is not in range of rx_desc_lim of bonded device which fails. This is due to "rx_desc_lim" is set to 0 as default value of bonded device during bond_alloc(). Hence nb_rx_desc (1024) is > 0 and test fails. Fix is to set the default values of rx_desc_lim of bonded device to appropriate value. Fixes: 2efb58cbab6e ("bond: new link bonding library") Cc: sta...@dpdk.org Signed-off-by: Hari Kumar Vemula --- v2: bonded device desc_lim values are received from slave configuration --- drivers/net/bonding/rte_eth_bond_pmd.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 44deaf119..23cec2549 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2228,6 +2228,8 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) uint16_t max_nb_rx_queues = UINT16_MAX; uint16_t max_nb_tx_queues = UINT16_MAX; + uint16_t max_rx_desc_lim = UINT16_MAX; + uint16_t max_tx_desc_lim = UINT16_MAX; dev_info->max_mac_addrs = BOND_MAX_MAC_ADDRS; @@ -2252,6 +2254,12 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) if (slave_info.max_tx_queues < max_nb_tx_queues) max_nb_tx_queues = slave_info.max_tx_queues; + + if (slave_info.rx_desc_lim.nb_max < max_rx_desc_lim) + max_rx_desc_lim = slave_info.rx_desc_lim.nb_max; + + if (slave_info.tx_desc_lim.nb_max < max_tx_desc_lim) + max_tx_desc_lim = slave_info.tx_desc_lim.nb_max; } } @@ -2263,10 +2271,8 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) memcpy(&dev_info->default_txconf, &internals->default_txconf, sizeof(dev_info->default_txconf)); - memcpy(&dev_info->rx_desc_lim, &internals->rx_desc_lim, - sizeof(dev_info->rx_desc_lim)); - memcpy(&dev_info->tx_desc_lim, &internals->tx_desc_lim, - sizeof(dev_info->tx_desc_lim)); + dev_info->rx_desc_lim.nb_max = max_rx_desc_lim; + dev_info->tx_desc_lim.nb_max = max_tx_desc_lim; /** * If dedicated hw queues enabled for link bonding device in LACP mode -- 2.17.2
[dpdk-dev] [PATCH v5] doc: add meson ut info in prog guide
Add a programmer's guide section for meson ut Signed-off-by: Hari Kumar Vemula --- v5: Modified v4: Typos corrected v3: Modified v2: Removed enhancement details --- doc/guides/prog_guide/index.rst| 1 + doc/guides/prog_guide/meson_ut.rst | 143 + 2 files changed, 144 insertions(+) create mode 100644 doc/guides/prog_guide/meson_ut.rst diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst index 6726b1e8d..f4274573f 100644 --- a/doc/guides/prog_guide/index.rst +++ b/doc/guides/prog_guide/index.rst @@ -58,6 +58,7 @@ Programmer's Guide source_org dev_kit_build_system dev_kit_root_make_help +meson_ut extend_dpdk build_app ext_app_lib_make_help diff --git a/doc/guides/prog_guide/meson_ut.rst b/doc/guides/prog_guide/meson_ut.rst new file mode 100644 index 0..e4b449049 --- /dev/null +++ b/doc/guides/prog_guide/meson_ut.rst @@ -0,0 +1,143 @@ +.. SPDX-License-Identifier: BSD-3-Clause + +Copyright(c) 2018-2019 Intel Corporation. + +.. _Meson: + +Meson_UT + + +This document describes the below list in detail. + +* Building and Running the unit tests. +* Grouping of testcases. +* How to run different test suites. +* Support for skipped tests. + + + +Building and Running the unit tests +--- + +* Create the meson build output folder using command. + + ``$ meson `` + +* Enter into build output folder, which was created by above command. + + ``$ cd build`` + +* Compile DPDK using command. + + ``$ ninja`` + + The output file of the build will be available in meson build folder. + After successful ninja command, binary `dpdk-test` is created in `build/test/test/`. + +* Run the unit testcases. + + ``$ ninja test`` (or) ``$ meson test`` + +* To run specific test case via meson command. + + ``$ meson test `` (or) ``$ ninja test `` + + + +Grouping of testcases +- + +Testcases have been grouped into four different groups based on conditions +of time duration and performance of the individual testcase. + +* fast tests which can be run in parallel +* fast tests which must run serially +* performance tests +* driver tests +* tests which produce lists of objects as output, and therefore that need manual checking + +Testcases can be run in parallel or non-parallel mode using the `is_parallel` argument +of `test()` in meson.build + +These tests can be run using the argument to `meson test` as +`--suite âproject_name:labelâ`. + +Ex: ``$ meson test --suite âDPDK:fast-testsâ`` + +Running different test suites +~ + +Commands to run testcases using option `--suite` + +* Fast Tests should take less than 10 seconds and below is the meson command to run them. + + ``$ meson test --suite DPDK:fast-tests`` + +* Performance Tests should take less than 600 seconds and below is the meson command to run them. + + ``$ meson test --suite DPDK:perf-tests`` + +* Driver Tests should take less than 600 seconds and below is the meson command to run them. + + ``$ meson test --suite DPDK:driver-tests`` + +* Below is the meson command to run Dump Tests + + ``$ meson test --suite DPDK:dump-tests`` + + + +Skipped testcases +- + +Some unit test cases have a dependency on external libraries, driver modules or +config flags, without which the test cases cannot be run. Such test cases will be reported +out as skipped if they cannot run. To enable those test cases, +the user should ensure the required dependencies are met. +Below are a few possible causes why tests may be skipped and how they may be resolved: + +#. External library is not found. +#. Config flag for the dependent library is not enabled. +#. Dependent driver modules are not installed on the system. + +To help find missing libraries, the user can specify addition search paths +for those libraries as below: + +* Single path ``$ export LIBRARY_PATH=path`` + +* Multiple paths ``$ export LIBRARY_PATH=path1:path2:path3`` + +Some functionality may be disabled due to library headers being missed as part of the build. +To specify an addition search path for headers at configuration time, use one of the commands below: + +* Single path ``$ CFLAGS=-I/path meson build`` + +* Multiple paths ``$ CFLAGS=-I/path1 -I/path2 meson build`` + +Below examples shows how to export libraries and their header paths. + +To specify single library at a time. + +``$ export LIBRARY_PATH=/root/wireless_libs/zuc/`` +``$ CFLAGS=-I/root/wireless_libs/zuc/include meson build`` + +To specify multiple libraries at a time. + +``$ export LIBRARY_PATH=/root/wireless_libs/zuc/:/root/wireless_libs/`` \ +``libsso_kasumi/build/`` +``$ CFLAGS=-I/root/wireless_libs/zuc/include -I/root/wireless_libs/`` \ +``libsso_kasumi/include m
[dpdk-dev] [PATCH v3] net/bonding: fix create bonded device test failure
test_create_bonded_device is failing due to improper initialisation in bonded device configuration. Which leads to crash while setting up queues. The value of nb_rx_desc is checked if it is not in range of rx_desc_lim of bonded device which fails. This is due to "rx_desc_lim" is set to 0 as default value of bonded device during bond_alloc(). Hence nb_rx_desc (1024) is > 0 and test fails. Fix is to set the default values of rx_desc_lim of bonded device to appropriate value. Receive the values from slaves configuration like done for other existing slave configuration Fixes: 2efb58cbab6e ("bond: new link bonding library") Cc: sta...@dpdk.org Signed-off-by: Hari Kumar Vemula Acked-by: Chas Williams --- v3: Modified commit message v2: Bonded device desc_lim values are received from slave configuration --- drivers/net/bonding/rte_eth_bond_pmd.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 44deaf119..23cec2549 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2228,6 +2228,8 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) uint16_t max_nb_rx_queues = UINT16_MAX; uint16_t max_nb_tx_queues = UINT16_MAX; + uint16_t max_rx_desc_lim = UINT16_MAX; + uint16_t max_tx_desc_lim = UINT16_MAX; dev_info->max_mac_addrs = BOND_MAX_MAC_ADDRS; @@ -2252,6 +2254,12 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) if (slave_info.max_tx_queues < max_nb_tx_queues) max_nb_tx_queues = slave_info.max_tx_queues; + + if (slave_info.rx_desc_lim.nb_max < max_rx_desc_lim) + max_rx_desc_lim = slave_info.rx_desc_lim.nb_max; + + if (slave_info.tx_desc_lim.nb_max < max_tx_desc_lim) + max_tx_desc_lim = slave_info.tx_desc_lim.nb_max; } } @@ -2263,10 +2271,8 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) memcpy(&dev_info->default_txconf, &internals->default_txconf, sizeof(dev_info->default_txconf)); - memcpy(&dev_info->rx_desc_lim, &internals->rx_desc_lim, - sizeof(dev_info->rx_desc_lim)); - memcpy(&dev_info->tx_desc_lim, &internals->tx_desc_lim, - sizeof(dev_info->tx_desc_lim)); + dev_info->rx_desc_lim.nb_max = max_rx_desc_lim; + dev_info->tx_desc_lim.nb_max = max_tx_desc_lim; /** * If dedicated hw queues enabled for link bonding device in LACP mode -- 2.17.2
[dpdk-dev] [PATCH] net/bonding: fix reset active slave
test_alb_reply_from_client test fails due to incorrect active slave array's index. This was due to invalid active slave count. Count of internals->active_slave is not updated even when active slave is deactivated. Hence active slave count always keeps incrementing beyond the actual active slaves. Fix is to set the internals->active_slave to starting index 0 whenever it exceeds the number of slaves in active slave list and also update the active slave count during slave de-activation. Fixes: e1110e977648 ("net/bonding: fix Rx slave fairness") Cc: sta...@dpdk.org Signed-off-by: Hari Kumar Vemula --- drivers/net/bonding/rte_eth_bond_api.c | 6 ++ drivers/net/bonding/rte_eth_bond_pmd.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index e5e146540..ac084c4fd 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -129,6 +129,12 @@ deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) RTE_ASSERT(active_count < RTE_DIM(internals->active_slaves)); internals->active_slave_count = active_count; + /* Resetting active_slave when reaches to max +* no of slaves in active list +*/ + if (internals->active_slave >= active_count) + internals->active_slave = 0; + if (eth_dev->data->dev_started) { if (internals->mode == BONDING_MODE_8023AD) { bond_mode_8023ad_start(eth_dev); diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 23cec2549..319215c0b 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -84,7 +84,7 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) active_slave = 0; } - if (++internals->active_slave == slave_count) + if (++internals->active_slave >= slave_count) internals->active_slave = 0; return num_rx_total; } @@ -288,7 +288,7 @@ bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, active_slave = 0; } - if (++internals->active_slave == slave_count) + if (++internals->active_slave >= slave_count) internals->active_slave = 0; return num_rx_total; @@ -474,7 +474,7 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, idx = 0; } - if (++internals->active_slave == slave_count) + if (++internals->active_slave >= slave_count) internals->active_slave = 0; return num_rx_total; -- 2.17.2
[dpdk-dev] [PATCH v6] doc: add meson ut info in prog guide
Add a programmer's guide section for meson ut Signed-off-by: Hari Kumar Vemula Acked-by: Bruce Richardson --- v6: Updated comments v5: Modified v4: Typos corrected v3: Modified v2: Removed enhancement details --- doc/guides/prog_guide/index.rst| 1 + doc/guides/prog_guide/meson_ut.rst | 151 + 2 files changed, 152 insertions(+) create mode 100644 doc/guides/prog_guide/meson_ut.rst diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst index 692409af8..9465bc8e6 100644 --- a/doc/guides/prog_guide/index.rst +++ b/doc/guides/prog_guide/index.rst @@ -60,6 +60,7 @@ Programmer's Guide source_org dev_kit_build_system dev_kit_root_make_help +meson_ut extend_dpdk build_app ext_app_lib_make_help diff --git a/doc/guides/prog_guide/meson_ut.rst b/doc/guides/prog_guide/meson_ut.rst new file mode 100644 index 0..e0aa15389 --- /dev/null +++ b/doc/guides/prog_guide/meson_ut.rst @@ -0,0 +1,151 @@ +.. SPDX-License-Identifier: BSD-3-Clause + +Copyright(c) 2018-2019 Intel Corporation. + +.. _meson_unit_tests: + +Running DPDK Unit Tests with Meson +== + +This section describes how to run testcases with the DPDK meson build system. + + +Building and running the unit tests +--- + +* Create the meson build output folder using the following command:: + + $ meson + +* Enter into build output folder, which was created by above command:: + + $ cd build + +* Compile DPDK using command:: + + $ ninja + +The output file of the build will be available in meson build folder. After +a successful ninja command, the binary ``dpdk-test`` is created in +``build/test/test/``. + +* Run the unit testcases:: + + $ ninja test + # or + $ meson test + +* To run specific test case via meson:: + + $ meson test + # or + $ ninja test + + +Grouping of testcases +- + +Testcases have been grouped into four different groups based on conditions +of time duration and performance of the individual testcase. + +* Fast tests which can be run in parallel. +* Fast tests which must run serially. +* Performance tests. +* Driver tests. +* Tests which produce lists of objects as output, and therefore that need + manual checking. + +Testcases can be run in parallel or non-parallel mode using the ``is_parallel`` argument +of ``test()`` in meson.build + +These tests can be run using the argument to ``meson test`` as +``--suite project_name:label``. + +For example:: + +$ meson test --suite DPDK:fast-tests + + +The project name is optional so the following is equivalent to the previous +command:: + + +$ meson test --suite fast-tests + + +Running different test suites +~ + +The following commands are some examples of how to run testcases using option +``--suite``: + +* Fast Tests should take less than 10 seconds. The meson command to run them + is:: + + $ meson test --suite DPDK:fast-tests + +* Performance Tests should take less than 600 seconds. The meson command to + run them is:: + + $ meson test --suite DPDK:perf-tests + +* Driver Tests should take less than 600 seconds. The meson command to run + them is:: + + $ meson test --suite DPDK:driver-tests + +* The meson command to run Dump Tests is:: + + $ meson test --suite DPDK:dump-tests + + +Dealing with skipped testcases +-- + +Some unit test cases have a dependency on external libraries, driver modules +or config flags, without which the test cases cannot be run. Such test cases +will be reported as skipped if they cannot run. To enable those test cases, +the user should ensure the required dependencies are met. Below are a few +possible causes why tests may be skipped and how they may be resolved: + +#. Optional external libraries are not found. +#. Config flags for the dependent library are not enabled. +#. Dependent driver modules are not installed on the system. + +To help find missing libraries, the user can specify addition search paths +for those libraries as below: + +* Single path:: + + $ export LIBRARY_PATH=path + +* Multiple paths:: + + $ export LIBRARY_PATH=path1:path2:path3 + +Some functionality may be disabled due to library headers being missed as part +of the build. To specify an additional search path for headers at +configuration time, use one of the commands below: + +* Single path:: + + $ CFLAGS=-I/path meson build + +* Multiple paths:: + + $ CFLAGS=-I/path1 -I/path2 meson build + +Below are some examples that show how to export libraries and their header +paths. + +To specify a single library at a time:: + +$ export LIBRARY_PATH=/root/wireless_libs/zuc/ +$ CFLAGS=-I/root/wireless_libs/zuc/include meson build + +To specify multiple libraries at a time:: + +$ export LIBRARY_PATH=/path/zuc/:/path/libsso_kasumi/build/ +