cperf_verify_test_destructor(void *arg)
{
if (arg) {
- comp_perf_free_memory(&((struct cperf_verify_ctx *)arg)->mem);
+ comp_perf_free_memory(
+ ((struct cperf_verify_ctx *)arg)->options,
+ &((struct cperf_verify_ctx *)arg)->mem);
rte_free(arg);
}
}
main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
{
struct comp_test_data *test_data = ctx->options;
- uint8_t *output_data_ptr;
- size_t *output_data_sz;
+ uint8_t *output_data_ptr = NULL;
+ size_t *output_data_sz = NULL;
struct cperf_mem_resources *mem = &ctx->mem;
uint8_t dev_id = mem->dev_id;
if (ops == NULL) {
RTE_LOG(ERR, USER1,
- "Can't allocate memory for ops strucures\n");
+ "Can't allocate memory for ops structures\n");
return -1;
}
ops[op_id]->private_xform = priv_xform;
}
+ if (unlikely(test_data->perf_comp_force_stop))
+ goto end;
+
num_enq = rte_compressdev_enqueue_burst(dev_id,
mem->qp_id, ops,
num_ops);
for (i = 0; i < num_deq; i++) {
struct rte_comp_op *op = deq_ops[i];
- if (op->status != RTE_COMP_OP_STATUS_SUCCESS) {
+ if (op->status ==
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED ||
+ op->status ==
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE) {
+ RTE_LOG(ERR, USER1,
+"Out of space error occurred due to uncompressible input data expanding to larger than destination buffer. Increase the EXPANSE_RATIO constant to use this data.\n");
+ res = -1;
+ goto end;
+ } else if (op->status !=
+ RTE_COMP_OP_STATUS_SUCCESS) {
RTE_LOG(ERR, USER1,
"Some operations were not successful\n");
goto end;
/* Dequeue the last operations */
while (total_deq_ops < total_ops) {
+ if (unlikely(test_data->perf_comp_force_stop))
+ goto end;
+
num_deq = rte_compressdev_dequeue_burst(dev_id,
mem->qp_id,
deq_ops,
for (i = 0; i < num_deq; i++) {
struct rte_comp_op *op = deq_ops[i];
- if (op->status != RTE_COMP_OP_STATUS_SUCCESS) {
+ if (op->status ==
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED ||
+ op->status ==
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE) {
+ RTE_LOG(ERR, USER1,
+"Out of space error occurred due to uncompressible input data expanding to larger than destination buffer. Increase the EXPANSE_RATIO constant to use this data.\n");
+ res = -1;
+ goto end;
+ } else if (op->status !=
+ RTE_COMP_OP_STATUS_SUCCESS) {
RTE_LOG(ERR, USER1,
"Some operations were not successful\n");
goto end;
}
-
const void *read_data_addr =
rte_pktmbuf_read(op->m_dst,
op->dst.offset,
rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
rte_compressdev_private_xform_free(dev_id, priv_xform);
rte_free(ops);
+
+ if (test_data->perf_comp_force_stop) {
+ RTE_LOG(ERR, USER1,
+ "lcore: %d Perf. test has been aborted by user\n",
+ mem->lcore_id);
+ res = -1;
+ }
+
return res;
}
struct cperf_verify_ctx *ctx = test_ctx;
struct comp_test_data *test_data = ctx->options;
int ret = EXIT_SUCCESS;
- static rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);
+ static uint16_t display_once;
uint32_t lcore = rte_lcore_id();
ctx->mem.lcore_id = lcore;
ctx->ratio = (double) ctx->comp_data_sz /
test_data->input_data_sz * 100;
+ uint16_t exp = 0;
if (!ctx->silent) {
- if (rte_atomic16_test_and_set(&display_once)) {
+ if (__atomic_compare_exchange_n(&display_once, &exp, 1, 0,
+ __ATOMIC_RELAXED, __ATOMIC_RELAXED)) {
printf("%12s%6s%12s%17s\n",
"lcore id", "Level", "Comp size", "Comp ratio [%]");
}