aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJanne Peltonen <janne.peltonen@nokia.com>2022-10-31 12:29:12 +0200
committerPetri Savolainen <petri.savolainen@nokia.com>2022-11-01 15:40:32 +0200
commit669f74f57efa2ea58c58dd3b49462651b584d37e (patch)
treedbda2e3635ecef0da02d1a069da6185d5b1089e4 /test
parent339811c99d06b168ce2bec7e30f08f55b2da100f (diff)
test: performance: crypto: improve printouts when session creation fails
ODP implementations are not required to support any combination of supported algorithms in any order. If session creation fails because the requested session type is not supported, do not log an error but print a message that the algorithm is skipped and the reason for it. This way things look the same whether the lack of support was noticed already through capability query or only at session creation time. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Diffstat (limited to 'test')
-rw-r--r--test/performance/odp_crypto.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/test/performance/odp_crypto.c b/test/performance/odp_crypto.c
index 46eb7141e..74b5738aa 100644
--- a/test/performance/odp_crypto.c
+++ b/test/performance/odp_crypto.c
@@ -516,7 +516,7 @@ get_elapsed_usec(time_record_t *start, time_record_t *end)
return e - s;
}
-#define REPORT_HEADER "\n%30.30s %15s %15s %15s %15s %15s %15s\n"
+#define REPORT_HEADER "%30.30s %15s %15s %15s %15s %15s %15s\n"
#define REPORT_LINE "%30.30s %15d %15d %15.3f %15.3f %15.3f %15d\n"
/**
@@ -633,6 +633,19 @@ create_session_from_config(odp_crypto_session_t *session,
}
if (odp_crypto_session_create(&params, session,
&ses_create_rc)) {
+ switch (ses_create_rc) {
+ case ODP_CRYPTO_SES_ERR_ALG_COMBO:
+ printf(" requested algorithm combination not supported\n");
+ return 1;
+ case ODP_CRYPTO_SES_ERR_ALG_ORDER:
+ printf(" requested algorithm order not supported\n");
+ return 1;
+ case ODP_CRYPTO_SES_ERR_PARAMS:
+ printf(" requested session parameters not supported\n");
+ return 1;
+ default:
+ break;
+ }
ODPH_ERR("crypto session create failed.\n");
return -1;
}
@@ -1026,6 +1039,8 @@ static int run_measure_one_config(test_run_arg_t *arg)
odp_crypto_capability_t crypto_capa = arg->crypto_capa;
int rc = 0;
+ printf("\n");
+
if (check_cipher_params(&crypto_capa, &config->session,
&config->cipher_in_bit_mode)) {
printf(" Cipher algorithm not supported\n");
@@ -1038,14 +1053,13 @@ static int run_measure_one_config(test_run_arg_t *arg)
rc = 1;
}
+ if (rc == 0)
+ rc = create_session_from_config(&session, config, cargs);
if (rc) {
- printf(" => %s skipped\n\n", config->name);
- return 0;
+ printf(" => %s skipped\n", config->name);
+ return rc > 0 ? 0 : -1;
}
- if (create_session_from_config(&session, config, cargs))
- return -1;
-
if (cargs->payload_length) {
rc = run_measure_one(cargs, config, &session,
cargs->payload_length, &result);