[dpdk-dev] [PATCH v2] app/test: replace TEST_SKIPPED with -ENOTSUP
Trahe, Fiona
fiona.trahe at intel.com
Tue Apr 9 17:17:13 CEST 2019
Hi Ayuj,
> -----Original Message-----
> From: Ayuj Verma [mailto:ayverma at marvell.com]
> Sent: Tuesday, April 9, 2019 12:34 PM
> To: akhil.goyal at nxp.com; Trahe, Fiona <fiona.trahe at intel.com>; Kusztal, ArkadiuszX
> <arkadiuszx.kusztal at intel.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>
> Cc: shallyv at marvell.com; ssahu at marvell.com; kkotamarthy at marvell.com; adesai at marvell.com;
> dev at dpdk.org; Ayuj Verma <ayverma at marvell.com>
> Subject: [PATCH v2] app/test: replace TEST_SKIPPED with -ENOTSUP
>
> Return -ENOTSUP for unsupported tests
>
> Signed-off-by: Ayuj Verma <ayverma at marvell.com>
> Signed-off-by: Shally Verma <shallyv at marvell.com>
> ---
> app/test/test_cryptodev_asym.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
> index d2efce9..feed3a8 100644
> --- a/app/test/test_cryptodev_asym.c
> +++ b/app/test/test_cryptodev_asym.c
> @@ -352,7 +352,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 +498,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);
> @@ -1261,7 +1261,7 @@ static inline void print_asym_capa(
> &modinv_xform.xform_type, "modinv") < 0) {
> RTE_LOG(ERR, USER1,
> "Invalid ASYNC algorithm specified\n");
> - return -1;
> + return -ENOTSUP;
[Fiona] this looks more like a test code bug rather than an indication that the device doesn't support modinv. SO should still return -1.
Also - while you're updating, can you please fix the typo in the trace - ASYNC should be ASYMM
> }
>
> cap_idx.type = modinv_xform.xform_type;
> @@ -1273,7 +1273,7 @@ static inline void print_asym_capa(
> modinv_xform.modinv.modulus.length)) {
> RTE_LOG(ERR, USER1,
> "Invalid MODULOUS length specified\n");
> - return -1;
> + return -ENOTSUP;
[Fiona] please update the trace to match the return, e.g. something like "modulus length %len not supported by this device"
> }
>
> sess = rte_cryptodev_asym_session_create(sess_mpool);
> @@ -1380,7 +1380,7 @@ static inline void print_asym_capa(
> < 0) {
> RTE_LOG(ERR, USER1,
> "Invalid ASYNC algorithm specified\n");
> - return -1;
> + return -ENOTSUP;
> }
[Fiona] same as above, i.e. code bug. And typo in trace.
>
> /* check for modlen capability */
> @@ -1391,7 +1391,7 @@ static inline void print_asym_capa(
> capability, modex_xform.modex.modulus.length)) {
> RTE_LOG(ERR, USER1,
> "Invalid MODULOUS length specified\n");
> - return -1;
> + return -ENOTSUP;
[Fiona] same as above. Fix trace.
> }
>
> /* generate crypto op data structure */
> --
> 1.8.3.1
More information about the dev
mailing list