test/crypto: check out-of-place support
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Thu, 16 Apr 2020 09:25:31 +0000 (10:25 +0100)
committerAkhil Goyal <akhil.goyal@nxp.com>
Sun, 19 Apr 2020 20:45:36 +0000 (22:45 +0200)
Before running any out-of-place 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 43f9d17..0c24d70 100644 (file)
@@ -168,6 +168,20 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
                nb_segs = 3;
        }
 
+       if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_OOP) {
+               uint64_t oop_flags = RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT |
+                       RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT |
+                       RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT |
+                       RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT;
+               if (!(feat_flags & oop_flags)) {
+                       printf("Device doesn't support out-of-place operations."
+                               "Test Skipped.\n");
+                       snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
+                               "SKIPPED");
+                       return 0;
+               }
+       }
+
        if (tdata->cipher_key.len)
                memcpy(cipher_key, tdata->cipher_key.data,
                        tdata->cipher_key.len);