From: Ankur Dwivedi Date: Thu, 7 May 2020 15:26:10 +0000 (+0530) Subject: test/crypto: handle unsupported error on session init X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=439d222ba01893cdbe92dd362456bfb6398a986f;p=dpdk.git test/crypto: handle unsupported error on session init The session init routine rte_cryptodev_sym_session_init(), could return -ENOTSUP when the requested algo combination is not supported by the PMD. This should be treated as unsupported features. For other return values like -EINVAL or -ENOMEM the test can be treated as failure. Signed-off-by: Ankur Dwivedi Acked-by: Anoob Joseph Acked-by: Akhil Goyal --- diff --git a/app/test/test_cryptodev_blockcipher.c b/app/test/test_cryptodev_blockcipher.c index 909b615e81..642b549717 100644 --- a/app/test/test_cryptodev_blockcipher.c +++ b/app/test/test_cryptodev_blockcipher.c @@ -431,9 +431,13 @@ iterate: nb_iterates == 0) { sess = rte_cryptodev_sym_session_create(sess_mpool); - rte_cryptodev_sym_session_init(dev_id, sess, init_xform, - sess_priv_mpool); - if (!sess) { + status = rte_cryptodev_sym_session_init(dev_id, sess, + init_xform, sess_priv_mpool); + if (status == -ENOTSUP) { + snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "UNSUPPORTED"); + goto error_exit; + } + if (!sess || status < 0) { snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u " "FAILED: %s", __LINE__, "Session creation failed");