app/crypto-perf: fix IV allocation for AEAD
[dpdk.git] / app / test-crypto-perf / cperf_test_verify.c
index 9c37954..a314646 100644 (file)
@@ -275,7 +275,7 @@ cperf_verify_test_constructor(struct rte_mempool *sess_mp,
                        dev_id);
 
        uint16_t priv_size = test_vector->cipher_iv.length +
-               test_vector->auth_iv.length;
+               test_vector->auth_iv.length + test_vector->aead_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());
@@ -444,8 +444,14 @@ cperf_verify_test_runner(void *test_ctx)
                if (ops_needed != rte_crypto_op_bulk_alloc(
                                ctx->crypto_op_pool,
                                RTE_CRYPTO_OP_TYPE_SYMMETRIC,
-                               ops, ops_needed))
+                               ops, ops_needed)) {
+                       RTE_LOG(ERR, USER1,
+                               "Failed to allocate more crypto operations "
+                               "from the the crypto operation pool.\n"
+                               "Consider increasing the pool size "
+                               "with --pool-sz\n");
                        return -1;
+               }
 
                /* Setup crypto op, attach mbuf etc */
                (ctx->populate_ops)(ops, &ctx->mbufs_in[m_idx],
@@ -588,5 +594,7 @@ cperf_verify_test_destructor(void *arg)
        if (ctx == NULL)
                return;
 
+       rte_cryptodev_stop(ctx->dev_id);
+
        cperf_verify_test_free(ctx, ctx->options->pool_sz);
 }