struct rte_event ev;
uint32_t cap;
int ret;
+ uint8_t cipher_key[17];
memset(&m_data, 0, sizeof(m_data));
cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
cipher_xform.next = NULL;
- cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
+ cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
+ cipher_xform.cipher.key.data = cipher_key;
+ cipher_xform.cipher.key.length = 16;
+ cipher_xform.cipher.iv.offset = IV_OFFSET;
+ cipher_xform.cipher.iv.length = 16;
+
op = rte_crypto_op_alloc(params.op_mpool,
RTE_CRYPTO_OP_TYPE_SYMMETRIC);
TEST_ASSERT_NOT_NULL(op,
ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
- if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
+ if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
+ !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
map_adapter_service_core();
+ else {
+ if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
+ return TEST_SKIPPED;
+ }
TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID),
"Failed to start event crypto adapter");
ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
- if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
+ if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
+ !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
map_adapter_service_core();
+ else {
+ if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
+ return TEST_SKIPPED;
+ }
TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID
), "Failed to start event crypto adapter");
struct rte_mbuf *m;
uint32_t cap;
int ret;
+ uint8_t cipher_key[17];
memset(&m_data, 0, sizeof(m_data));
cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
cipher_xform.next = NULL;
- cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
+ cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC;
cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
+ cipher_xform.cipher.key.data = cipher_key;
+ cipher_xform.cipher.key.length = 16;
+ cipher_xform.cipher.iv.offset = IV_OFFSET;
+ cipher_xform.cipher.iv.length = 16;
+
op = rte_crypto_op_alloc(params.op_mpool,
RTE_CRYPTO_OP_TYPE_SYMMETRIC);
TEST_ASSERT_NOT_NULL(op, "Failed to allocate crypto_op!\n");
ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
- if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) ||
+ if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
map_adapter_service_core();
+ else {
+ if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
+ return TEST_SKIPPED;
+ }
/* start the event crypto adapter */
TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID),
ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap);
TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n");
- if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) ||
+ if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
map_adapter_service_core();
+ else {
+ if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
+ return TEST_SKIPPED;
+ }
TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID),
"Failed to start event crypto adapter");
"session mempool allocation failed\n");
params.session_priv_mpool = rte_mempool_create(
- "CRYPTO_ADAPTER_SESSION_MP_PRIV",
+ "CRYPTO_AD_SESS_MP_PRIV",
MAX_NB_SESSIONS,
session_size,
0, 0, NULL, NULL, NULL,
enum rte_event_crypto_adapter_mode mode;
mode = RTE_EVENT_CRYPTO_ADAPTER_OP_FORWARD;
- test_crypto_adapter_conf(mode);
+ TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
+ "Failed to config crypto adapter");
return TEST_SUCCESS;
}
enum rte_event_crypto_adapter_mode mode;
mode = RTE_EVENT_CRYPTO_ADAPTER_OP_NEW;
- test_crypto_adapter_conf(mode);
+ TEST_ASSERT_SUCCESS(test_crypto_adapter_conf(mode),
+ "Failed to config crypto adapter");
+
return TEST_SUCCESS;
}
params.session_mpool = NULL;
}
if (params.session_priv_mpool != NULL) {
+ rte_mempool_avail_count(params.session_priv_mpool);
rte_mempool_free(params.session_priv_mpool);
params.session_priv_mpool = NULL;
}