cryptodev: add auth IV
[dpdk.git] / app / test-crypto-perf / cperf_test_latency.c
index c33129b..9ac932a 100644 (file)
@@ -211,7 +211,12 @@ cperf_latency_test_constructor(uint8_t dev_id, uint16_t qp_id,
        ctx->options = options;
        ctx->test_vector = test_vector;
 
-       ctx->sess = op_fns->sess_create(dev_id, options, test_vector);
+       /* IV goes at the end of the crypto operation */
+       uint16_t iv_offset = sizeof(struct rte_crypto_op) +
+               sizeof(struct rte_crypto_sym_op) +
+               sizeof(struct cperf_op_result *);
+
+       ctx->sess = op_fns->sess_create(dev_id, options, test_vector, iv_offset);
        if (ctx->sess == NULL)
                goto err;
 
@@ -280,7 +285,9 @@ cperf_latency_test_constructor(uint8_t dev_id, uint16_t qp_id,
        snprintf(pool_name, sizeof(pool_name), "cperf_op_pool_cdev_%d",
                        dev_id);
 
-       uint16_t priv_size = sizeof(struct priv_op_data) + test_vector->iv.length;
+       uint16_t priv_size = sizeof(struct priv_op_data) +
+                       test_vector->cipher_iv.length +
+                       test_vector->auth_iv.length;
        ctx->crypto_op_pool = rte_crypto_op_pool_create(pool_name,
                        RTE_CRYPTO_OP_TYPE_SYMMETRIC, options->pool_sz,
                        512, priv_size, rte_socket_id());