tsc_end = rte_rdtsc_precise();
/* Free memory for not enqueued operations */
- for (i = ops_enqd; i < burst_size; i++)
- rte_crypto_op_free(ops[i]);
+ if (ops_enqd != burst_size)
+ rte_mempool_put_bulk(ctx->crypto_op_pool,
+ (void **)&ops_processed[ops_enqd],
+ burst_size - ops_enqd);
for (i = 0; i < ops_enqd; i++) {
ctx->res[tsc_idx].tsc_start = tsc_start;
(ops_processed[i]->opaque_data);
pres->status = ops_processed[i]->status;
pres->tsc_end = tsc_end;
-
- rte_crypto_op_free(ops_processed[i]);
}
+ rte_mempool_put_bulk(ctx->crypto_op_pool,
+ (void **)ops_processed, ops_deqd);
deqd_tot += ops_deqd;
deqd_max = max(ops_deqd, deqd_max);
(ops_processed[i]->opaque_data);
pres->status = ops_processed[i]->status;
pres->tsc_end = tsc_end;
-
- rte_crypto_op_free(ops_processed[i]);
}
+ rte_mempool_put_bulk(ctx->crypto_op_pool,
+ (void **)ops_processed, ops_deqd);
deqd_tot += ops_deqd;
deqd_max = max(ops_deqd, deqd_max);
* the crypto operation will change the data and cause
* failures.
*/
- for (i = 0; i < ops_deqd; i++)
- rte_crypto_op_free(ops_processed[i]);
+ rte_mempool_put_bulk(ctx->crypto_op_pool,
+ (void **)ops_processed, ops_deqd);
ops_deqd_total += ops_deqd;
} else {
if (ops_deqd == 0)
ops_deqd_failed++;
else {
- for (i = 0; i < ops_deqd; i++)
- rte_crypto_op_free(ops_processed[i]);
+ rte_mempool_put_bulk(ctx->crypto_op_pool,
+ (void **)ops_processed, ops_deqd);
ops_deqd_total += ops_deqd;
}