[8/9] test/crypto: add digest encrypted feature flag check
Checks
Commit Message
From: Damian Nowak <damianx.nowak@intel.com>
This patch adds checking of digest encrypted
feature flag for auth-cipher out-of-place
operations test cases to determine if the
operations are supported.
Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
---
app/test/test_cryptodev.c | 40 ++++++++++++++++++++++++++++++++++------
1 file changed, 34 insertions(+), 6 deletions(-)
@@ -4339,6 +4339,19 @@ test_snow3g_auth_cipher(const struct snow3g_test_data *tdata,
unsigned int ciphertext_pad_len;
unsigned int ciphertext_len;
+ struct rte_cryptodev_info dev_info;
+
+ rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+
+ uint64_t feat_flags = dev_info.feature_flags;
+
+ if (op_mode == OUT_OF_PLACE) {
+ if (!(feat_flags & RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED)) {
+ printf("Device doesn't support digest encrypted.\n");
+ return -ENOTSUP;
+ }
+ }
+
/* Create SNOW 3G session */
retval = create_wireless_algo_auth_cipher_session(
ts_params->valid_devs[0],
@@ -4501,16 +4514,18 @@ test_snow3g_auth_cipher_sgl(const struct snow3g_test_data *tdata,
if (op_mode == IN_PLACE) {
if (!(feat_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) {
printf("Device doesn't support in-place scatter-gather "
- "in both input and output mbufs. "
- "Test Skipped.\n");
- return 0;
+ "in both input and output mbufs.\n");
+ return -ENOTSUP;
}
} else {
if (!(feat_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT)) {
printf("Device doesn't support out-of-place scatter-gather "
- "in both input and output mbufs. "
- "Test Skipped.\n");
- return 0;
+ "in both input and output mbufs.\n");
+ return -ENOTSUP;
+ }
+ if (!(feat_flags & RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED)) {
+ printf("Device doesn't support digest encrypted.\n");
+ return -ENOTSUP;
}
}
@@ -4672,6 +4687,19 @@ test_kasumi_auth_cipher(const struct kasumi_test_data *tdata,
unsigned int ciphertext_pad_len;
unsigned int ciphertext_len;
+ struct rte_cryptodev_info dev_info;
+
+ rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+
+ uint64_t feat_flags = dev_info.feature_flags;
+
+ if (op_mode == OUT_OF_PLACE) {
+ if (!(feat_flags & RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED)) {
+ printf("Device doesn't support digest encrypted.\n");
+ return -ENOTSUP;
+ }
+ }
+
/* Create KASUMI session */
retval = create_wireless_algo_auth_cipher_session(
ts_params->valid_devs[0],