test/crypto: check session-less support
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Thu, 16 Apr 2020 09:25:30 +0000 (10:25 +0100)
committerAkhil Goyal <akhil.goyal@nxp.com>
Sun, 19 Apr 2020 20:45:29 +0000 (22:45 +0200)
Before running any sessionless test cases,
check if device supports this mode.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
app/test/test_cryptodev_blockcipher.c

index 8453470..43f9d17 100644 (file)
@@ -131,9 +131,18 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
        uint32_t nb_iterates = 0;
 
        rte_cryptodev_info_get(dev_id, &dev_info);
+       uint64_t feat_flags = dev_info.feature_flags;
 
+       if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SESSIONLESS) {
+               if (!(feat_flags & RTE_CRYPTODEV_FF_SYM_SESSIONLESS)) {
+                       printf("Device doesn't support sesionless operations "
+                               "Test Skipped.\n");
+                       snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
+                               "SKIPPED");
+                       return 0;
+               }
+       }
        if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SG) {
-               uint64_t feat_flags = dev_info.feature_flags;
                uint64_t oop_flag = RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT;
 
                if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_OOP) {