* The main decompression function. * * Function performs decompression operation. * Operation(s) configuration, depending on CLI parameters. * Operation(s) processing. * * @param int_data * Interim data containing session/transformation objects. * @param test_data * The test parameters set by users (command line parameters). * @param test_priv_data * A container used for aggregati
| 1514 | * - -1: On error. |
| 1515 | */ |
| 1516 | static int |
| 1517 | test_deflate_decomp_run(const struct interim_data_params *int_data, |
| 1518 | const struct test_data_params *test_data, |
| 1519 | struct test_private_arrays *test_priv_data) |
| 1520 | { |
| 1521 | |
| 1522 | /* local variables: */ |
| 1523 | struct priv_op_data *priv_data; |
| 1524 | unsigned int i; |
| 1525 | uint16_t num_priv_xforms = 0; |
| 1526 | int ret; |
| 1527 | int ret_status = 0; |
| 1528 | |
| 1529 | struct comp_testsuite_params *ts_params = &testsuite_params; |
| 1530 | |
| 1531 | /* from test_data: */ |
| 1532 | enum rte_comp_op_type operation_type = test_data->decompress_state; |
| 1533 | unsigned int zlib_decompress = |
| 1534 | (test_data->zlib_dir == ZLIB_ALL || |
| 1535 | test_data->zlib_dir == ZLIB_DECOMPRESS); |
| 1536 | |
| 1537 | /* from int_data: */ |
| 1538 | struct rte_comp_xform **decompress_xforms = int_data->decompress_xforms; |
| 1539 | unsigned int num_xforms = int_data->num_xforms; |
| 1540 | unsigned int num_bufs = int_data->num_bufs; |
| 1541 | |
| 1542 | /* from test_priv_data: */ |
| 1543 | struct rte_mbuf **uncomp_bufs = test_priv_data->uncomp_bufs; |
| 1544 | struct rte_mbuf **comp_bufs = test_priv_data->comp_bufs; |
| 1545 | struct rte_comp_op **ops = test_priv_data->ops; |
| 1546 | struct rte_comp_op **ops_processed = test_priv_data->ops_processed; |
| 1547 | void **priv_xforms = test_priv_data->priv_xforms; |
| 1548 | uint32_t *compressed_data_size = test_priv_data->compressed_data_size; |
| 1549 | void **stream = test_priv_data->stream; |
| 1550 | |
| 1551 | const struct rte_compressdev_capabilities *capa = |
| 1552 | rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE); |
| 1553 | |
| 1554 | ret = rte_comp_op_bulk_alloc(ts_params->op_pool, ops, num_bufs); |
| 1555 | if (ret < 0) { |
| 1556 | RTE_LOG(ERR, USER1, |
| 1557 | "Decompress operations could not be allocated " |
| 1558 | "from the mempool\n"); |
| 1559 | ret_status = -1; |
| 1560 | goto exit; |
| 1561 | } |
| 1562 | |
| 1563 | /* Source buffer is the compressed data from the previous operations */ |
| 1564 | for (i = 0; i < num_bufs; i++) { |
| 1565 | ops[i]->m_src = comp_bufs[i]; |
| 1566 | ops[i]->m_dst = uncomp_bufs[i]; |
| 1567 | ops[i]->src.offset = 0; |
| 1568 | /* |
| 1569 | * Set the length of the compressed data to the |
| 1570 | * number of bytes that were produced in the previous stage |
| 1571 | */ |
| 1572 | |
| 1573 | if (compressed_data_size[i]) |
no test coverage detected