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 <adwivedi@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
This commit is contained in:
Ankur Dwivedi 2020-05-07 20:56:10 +05:30 committed by Akhil Goyal
parent 90ecace4f6
commit 439d222ba0

View File

@ -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");