app/test-crypto-perf: fix compilation with -Og
[dpdk.git] / app / test-crypto-perf / cperf_test_verify.c
index 7416ffb..36be7b8 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());
@@ -366,6 +366,9 @@ cperf_verify_op(struct rte_crypto_op *op,
                auth = 1;
                auth_offset = vector->aad.length + options->test_buffer_size;
                break;
+       default:
+               res = 1;
+               goto out;
        }
 
        if (cipher == 1) {
@@ -386,6 +389,8 @@ cperf_verify_op(struct rte_crypto_op *op,
                                        options->digest_sz);
        }
 
+out:
+       rte_free(data);
        return !!res;
 }
 
@@ -444,8 +449,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],