* [dpdk-dev] [PATCH v4] fix return value for skipped tests @ 2019-05-09 11:23 Ayuj Verma 2019-05-09 11:23 ` Ayuj Verma 2019-05-09 11:23 ` [dpdk-dev] [PATCH v4] app/test: replace TEST_SKIPPED with -ENOTSUP Ayuj Verma 0 siblings, 2 replies; 6+ messages in thread From: Ayuj Verma @ 2019-05-09 11:23 UTC (permalink / raw) To: akhil.goyal, arkadiuszx.kusztal, fiona.trahe Cc: shallyv, ssahu, kkotamarthy, adesai, dev, Ayuj Verma Currently some tests return TEST_SKIPPED/-1 when tests or params are not supported for particular PMD because of which tests adds to FAILED test counter in place of Skipped/Unsupported counter. Since unsupported test is not a failure case, replace return value TEST_SKIPPED/-1 with -ENOTSUP Changes in v4: - add reason for change as part of commit message log Changes in v3: - retain '-1' for app error. - add NULL check for rte_cryptodev_asym_capability_get() - Typo correction Changes in v2: - Replace TEST_SKIPPED/-1 with -ENOTSUP Ayuj Verma (1): app/test: replace TEST_SKIPPED with -ENOTSUP app/test/test_cryptodev_asym.c | 45 ++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 13 deletions(-) -- 1.8.3.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH v4] fix return value for skipped tests 2019-05-09 11:23 [dpdk-dev] [PATCH v4] fix return value for skipped tests Ayuj Verma @ 2019-05-09 11:23 ` Ayuj Verma 2019-05-09 11:23 ` [dpdk-dev] [PATCH v4] app/test: replace TEST_SKIPPED with -ENOTSUP Ayuj Verma 1 sibling, 0 replies; 6+ messages in thread From: Ayuj Verma @ 2019-05-09 11:23 UTC (permalink / raw) To: akhil.goyal, arkadiuszx.kusztal, fiona.trahe Cc: shallyv, ssahu, kkotamarthy, adesai, dev, Ayuj Verma Currently some tests return TEST_SKIPPED/-1 when tests or params are not supported for particular PMD because of which tests adds to FAILED test counter in place of Skipped/Unsupported counter. Since unsupported test is not a failure case, replace return value TEST_SKIPPED/-1 with -ENOTSUP Changes in v4: - add reason for change as part of commit message log Changes in v3: - retain '-1' for app error. - add NULL check for rte_cryptodev_asym_capability_get() - Typo correction Changes in v2: - Replace TEST_SKIPPED/-1 with -ENOTSUP Ayuj Verma (1): app/test: replace TEST_SKIPPED with -ENOTSUP app/test/test_cryptodev_asym.c | 45 ++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 13 deletions(-) -- 1.8.3.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH v4] app/test: replace TEST_SKIPPED with -ENOTSUP 2019-05-09 11:23 [dpdk-dev] [PATCH v4] fix return value for skipped tests Ayuj Verma 2019-05-09 11:23 ` Ayuj Verma @ 2019-05-09 11:23 ` Ayuj Verma 2019-05-09 11:23 ` Ayuj Verma 2019-05-09 14:27 ` Thomas Monjalon 1 sibling, 2 replies; 6+ messages in thread From: Ayuj Verma @ 2019-05-09 11:23 UTC (permalink / raw) To: akhil.goyal, arkadiuszx.kusztal, fiona.trahe Cc: shallyv, ssahu, kkotamarthy, adesai, dev, Ayuj Verma Currently some tests return TEST_SKIPPED/-1 when tests or params are not supported for particular PMD because of which tests adds to FAILED test counter in place of Skipped/Unsupported counter. Since unsupported test is not a failure case, replace return value TEST_SKIPPED/-1 with -ENOTSUP - Return -ENOTSUP for unsupported tests - add NULL check for rte_cryptodev_asym_capability_get() - Typo correction Signed-off-by: Ayuj Verma <ayverma@marvell.com> Signed-off-by: Shally Verma <shallyv@marvell.com> --- app/test/test_cryptodev_asym.c | 45 ++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c index d2efce9..fc92d3d 100644 --- a/app/test/test_cryptodev_asym.c +++ b/app/test/test_cryptodev_asym.c @@ -119,6 +119,18 @@ struct test_cases_array { int status = TEST_SUCCESS; + xform_tc.next = NULL; + xform_tc.xform_type = data_tc->modex.xform_type; + + cap_idx.type = xform_tc.xform_type; + capability = rte_cryptodev_asym_capability_get(dev_id, &cap_idx); + + if (capability == NULL) { + RTE_LOG(INFO, USER1, + "Device doesn't support MODEX. Test Skipped\n"); + return -ENOTSUP; + } + /* Generate crypto op data structure */ op = rte_crypto_op_alloc(ts_params->op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC); @@ -133,11 +145,6 @@ struct test_cases_array { } asym_op = op->asym; - xform_tc.next = NULL; - xform_tc.xform_type = data_tc->modex.xform_type; - - cap_idx.type = xform_tc.xform_type; - capability = rte_cryptodev_asym_capability_get(dev_id, &cap_idx); switch (xform_tc.xform_type) { case RTE_CRYPTO_ASYM_XFORM_MODEX: @@ -352,7 +359,7 @@ struct test_cases_array { RTE_LOG(INFO, USER1, "Device doesn't support sign op with " "exponent key type. Test Skipped\n"); - return TEST_SKIPPED; + return -ENOTSUP; } sess = rte_cryptodev_asym_session_create(sess_mpool); @@ -498,7 +505,7 @@ struct test_cases_array { RTE_LOG(INFO, USER1, "Device doesn't support sign op with " "exponent key type. Test Skipped\n"); - return TEST_SKIPPED; + return -ENOTSUP; } sess = rte_cryptodev_asym_session_create(sess_mpool); @@ -1260,7 +1267,7 @@ static inline void print_asym_capa( if (rte_cryptodev_asym_get_xform_enum( &modinv_xform.xform_type, "modinv") < 0) { RTE_LOG(ERR, USER1, - "Invalid ASYNC algorithm specified\n"); + "Invalid ASYM algorithm specified\n"); return -1; } @@ -1268,12 +1275,18 @@ static inline void print_asym_capa( capability = rte_cryptodev_asym_capability_get(dev_id, &cap_idx); + if (capability == NULL) { + RTE_LOG(INFO, USER1, + "Device doesn't support MOD INV. Test Skipped\n"); + return -ENOTSUP; + } + if (rte_cryptodev_asym_xform_capability_check_modlen( capability, modinv_xform.modinv.modulus.length)) { RTE_LOG(ERR, USER1, - "Invalid MODULOUS length specified\n"); - return -1; + "Invalid MODULUS length specified\n"); + return -ENOTSUP; } sess = rte_cryptodev_asym_session_create(sess_mpool); @@ -1379,7 +1392,7 @@ static inline void print_asym_capa( "modexp") < 0) { RTE_LOG(ERR, USER1, - "Invalid ASYNC algorithm specified\n"); + "Invalid ASYM algorithm specified\n"); return -1; } @@ -1387,11 +1400,17 @@ static inline void print_asym_capa( cap_idx.type = modex_xform.xform_type; capability = rte_cryptodev_asym_capability_get(dev_id, &cap_idx); + if (capability == NULL) { + RTE_LOG(INFO, USER1, + "Device doesn't support MOD EXP. Test Skipped\n"); + return -ENOTSUP; + } + if (rte_cryptodev_asym_xform_capability_check_modlen( capability, modex_xform.modex.modulus.length)) { RTE_LOG(ERR, USER1, - "Invalid MODULOUS length specified\n"); - return -1; + "Invalid MODULUS length specified\n"); + return -ENOTSUP; } /* generate crypto op data structure */ -- 1.8.3.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH v4] app/test: replace TEST_SKIPPED with -ENOTSUP 2019-05-09 11:23 ` [dpdk-dev] [PATCH v4] app/test: replace TEST_SKIPPED with -ENOTSUP Ayuj Verma @ 2019-05-09 11:23 ` Ayuj Verma 2019-05-09 14:27 ` Thomas Monjalon 1 sibling, 0 replies; 6+ messages in thread From: Ayuj Verma @ 2019-05-09 11:23 UTC (permalink / raw) To: akhil.goyal, arkadiuszx.kusztal, fiona.trahe Cc: shallyv, ssahu, kkotamarthy, adesai, dev, Ayuj Verma Currently some tests return TEST_SKIPPED/-1 when tests or params are not supported for particular PMD because of which tests adds to FAILED test counter in place of Skipped/Unsupported counter. Since unsupported test is not a failure case, replace return value TEST_SKIPPED/-1 with -ENOTSUP - Return -ENOTSUP for unsupported tests - add NULL check for rte_cryptodev_asym_capability_get() - Typo correction Signed-off-by: Ayuj Verma <ayverma@marvell.com> Signed-off-by: Shally Verma <shallyv@marvell.com> --- app/test/test_cryptodev_asym.c | 45 ++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c index d2efce9..fc92d3d 100644 --- a/app/test/test_cryptodev_asym.c +++ b/app/test/test_cryptodev_asym.c @@ -119,6 +119,18 @@ struct test_cases_array { int status = TEST_SUCCESS; + xform_tc.next = NULL; + xform_tc.xform_type = data_tc->modex.xform_type; + + cap_idx.type = xform_tc.xform_type; + capability = rte_cryptodev_asym_capability_get(dev_id, &cap_idx); + + if (capability == NULL) { + RTE_LOG(INFO, USER1, + "Device doesn't support MODEX. Test Skipped\n"); + return -ENOTSUP; + } + /* Generate crypto op data structure */ op = rte_crypto_op_alloc(ts_params->op_mpool, RTE_CRYPTO_OP_TYPE_ASYMMETRIC); @@ -133,11 +145,6 @@ struct test_cases_array { } asym_op = op->asym; - xform_tc.next = NULL; - xform_tc.xform_type = data_tc->modex.xform_type; - - cap_idx.type = xform_tc.xform_type; - capability = rte_cryptodev_asym_capability_get(dev_id, &cap_idx); switch (xform_tc.xform_type) { case RTE_CRYPTO_ASYM_XFORM_MODEX: @@ -352,7 +359,7 @@ struct test_cases_array { RTE_LOG(INFO, USER1, "Device doesn't support sign op with " "exponent key type. Test Skipped\n"); - return TEST_SKIPPED; + return -ENOTSUP; } sess = rte_cryptodev_asym_session_create(sess_mpool); @@ -498,7 +505,7 @@ struct test_cases_array { RTE_LOG(INFO, USER1, "Device doesn't support sign op with " "exponent key type. Test Skipped\n"); - return TEST_SKIPPED; + return -ENOTSUP; } sess = rte_cryptodev_asym_session_create(sess_mpool); @@ -1260,7 +1267,7 @@ static inline void print_asym_capa( if (rte_cryptodev_asym_get_xform_enum( &modinv_xform.xform_type, "modinv") < 0) { RTE_LOG(ERR, USER1, - "Invalid ASYNC algorithm specified\n"); + "Invalid ASYM algorithm specified\n"); return -1; } @@ -1268,12 +1275,18 @@ static inline void print_asym_capa( capability = rte_cryptodev_asym_capability_get(dev_id, &cap_idx); + if (capability == NULL) { + RTE_LOG(INFO, USER1, + "Device doesn't support MOD INV. Test Skipped\n"); + return -ENOTSUP; + } + if (rte_cryptodev_asym_xform_capability_check_modlen( capability, modinv_xform.modinv.modulus.length)) { RTE_LOG(ERR, USER1, - "Invalid MODULOUS length specified\n"); - return -1; + "Invalid MODULUS length specified\n"); + return -ENOTSUP; } sess = rte_cryptodev_asym_session_create(sess_mpool); @@ -1379,7 +1392,7 @@ static inline void print_asym_capa( "modexp") < 0) { RTE_LOG(ERR, USER1, - "Invalid ASYNC algorithm specified\n"); + "Invalid ASYM algorithm specified\n"); return -1; } @@ -1387,11 +1400,17 @@ static inline void print_asym_capa( cap_idx.type = modex_xform.xform_type; capability = rte_cryptodev_asym_capability_get(dev_id, &cap_idx); + if (capability == NULL) { + RTE_LOG(INFO, USER1, + "Device doesn't support MOD EXP. Test Skipped\n"); + return -ENOTSUP; + } + if (rte_cryptodev_asym_xform_capability_check_modlen( capability, modex_xform.modex.modulus.length)) { RTE_LOG(ERR, USER1, - "Invalid MODULOUS length specified\n"); - return -1; + "Invalid MODULUS length specified\n"); + return -ENOTSUP; } /* generate crypto op data structure */ -- 1.8.3.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v4] app/test: replace TEST_SKIPPED with -ENOTSUP 2019-05-09 11:23 ` [dpdk-dev] [PATCH v4] app/test: replace TEST_SKIPPED with -ENOTSUP Ayuj Verma 2019-05-09 11:23 ` Ayuj Verma @ 2019-05-09 14:27 ` Thomas Monjalon 2019-05-09 14:27 ` Thomas Monjalon 1 sibling, 1 reply; 6+ messages in thread From: Thomas Monjalon @ 2019-05-09 14:27 UTC (permalink / raw) To: Ayuj Verma, shallyv Cc: dev, akhil.goyal, arkadiuszx.kusztal, fiona.trahe, ssahu, kkotamarthy, adesai 09/05/2019 13:23, Ayuj Verma: > Currently some tests return TEST_SKIPPED/-1 when tests or params > are not supported for particular PMD because of which tests adds to > FAILED test counter in place of Skipped/Unsupported counter. It looks to be a bug that TEST_SKIPPED is not caught to increment "skipped" counter. Please fix it. > Since unsupported test is not a failure case, > replace return value TEST_SKIPPED/-1 with -ENOTSUP I would say the right reason is that the test is not supported by the HW. > - Return -ENOTSUP for unsupported tests > - add NULL check for rte_cryptodev_asym_capability_get() > - Typo correction > > Signed-off-by: Ayuj Verma <ayverma@marvell.com> > Signed-off-by: Shally Verma <shallyv@marvell.com> I am not sure what the "skipped" counter is supposed to represent if it's not for the unsupported cases. There is a gap to check and document here. Applied, as it sounds right to return ENOTSUP in those cases. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v4] app/test: replace TEST_SKIPPED with -ENOTSUP 2019-05-09 14:27 ` Thomas Monjalon @ 2019-05-09 14:27 ` Thomas Monjalon 0 siblings, 0 replies; 6+ messages in thread From: Thomas Monjalon @ 2019-05-09 14:27 UTC (permalink / raw) To: Ayuj Verma, shallyv Cc: dev, akhil.goyal, arkadiuszx.kusztal, fiona.trahe, ssahu, kkotamarthy, adesai 09/05/2019 13:23, Ayuj Verma: > Currently some tests return TEST_SKIPPED/-1 when tests or params > are not supported for particular PMD because of which tests adds to > FAILED test counter in place of Skipped/Unsupported counter. It looks to be a bug that TEST_SKIPPED is not caught to increment "skipped" counter. Please fix it. > Since unsupported test is not a failure case, > replace return value TEST_SKIPPED/-1 with -ENOTSUP I would say the right reason is that the test is not supported by the HW. > - Return -ENOTSUP for unsupported tests > - add NULL check for rte_cryptodev_asym_capability_get() > - Typo correction > > Signed-off-by: Ayuj Verma <ayverma@marvell.com> > Signed-off-by: Shally Verma <shallyv@marvell.com> I am not sure what the "skipped" counter is supposed to represent if it's not for the unsupported cases. There is a gap to check and document here. Applied, as it sounds right to return ENOTSUP in those cases. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-05-09 14:28 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-05-09 11:23 [dpdk-dev] [PATCH v4] fix return value for skipped tests Ayuj Verma 2019-05-09 11:23 ` Ayuj Verma 2019-05-09 11:23 ` [dpdk-dev] [PATCH v4] app/test: replace TEST_SKIPPED with -ENOTSUP Ayuj Verma 2019-05-09 11:23 ` Ayuj Verma 2019-05-09 14:27 ` Thomas Monjalon 2019-05-09 14:27 ` Thomas Monjalon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).