MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_deflate_decomp_finalize

Function test_deflate_decomp_finalize

dpdk/app/test/test_compressdev.c:1725–1878  ·  view source on GitHub ↗

* Prints out the test report. Memory freeing. * * Called after successful decompression. * Operation(s) status validation and compression buffers freeing. * -1 returned if function fail. * * @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 containe

Source from the content-addressed store, hash-verified

1723 * - -1: On error.
1724 */
1725static int
1726test_deflate_decomp_finalize(const struct interim_data_params *int_data,
1727 const struct test_data_params *test_data,
1728 const struct test_private_arrays *test_priv_data)
1729{
1730 /* local variables: */
1731 unsigned int i;
1732 struct priv_op_data *priv_data;
1733 static unsigned int step;
1734
1735 /* from int_data: */
1736 unsigned int num_bufs = int_data->num_bufs;
1737 const char * const *test_bufs = int_data->test_bufs;
1738 struct rte_comp_xform **compress_xforms = int_data->compress_xforms;
1739
1740 /* from test_priv_data: */
1741 struct rte_comp_op **ops_processed = test_priv_data->ops_processed;
1742 struct rte_mbuf **comp_bufs = test_priv_data->comp_bufs;
1743 struct rte_comp_op **ops = test_priv_data->ops;
1744 uint64_t *compress_checksum = test_priv_data->compress_checksum;
1745 unsigned int *decomp_produced_data_size =
1746 test_priv_data->decomp_produced_data_size;
1747 char **all_decomp_data = test_priv_data->all_decomp_data;
1748
1749 /* from test_data: */
1750 unsigned int out_of_space = test_data->out_of_space;
1751 enum rte_comp_op_type operation_type = test_data->decompress_state;
1752
1753 unsigned int zlib_compress =
1754 (test_data->zlib_dir == ZLIB_ALL ||
1755 test_data->zlib_dir == ZLIB_COMPRESS);
1756 unsigned int zlib_decompress =
1757 (test_data->zlib_dir == ZLIB_ALL ||
1758 test_data->zlib_dir == ZLIB_DECOMPRESS);
1759
1760 for (i = 0; i < num_bufs; i++) {
1761 priv_data = (struct priv_op_data *)(ops_processed[i] + 1);
1762 char engine[] = "zlib, (directly, no PMD)";
1763 if (zlib_compress)
1764 strlcpy(engine, "pmd", sizeof(engine));
1765 RTE_LOG(DEBUG, USER1,
1766 "Buffer %u decompressed by %s from %u to %u bytes\n",
1767 i, engine,
1768 ops_processed[i]->consumed, ops_processed[i]->produced);
1769 ops[i] = NULL;
1770 }
1771
1772 /*
1773 * Check operation status and free source mbuf (destination mbuf and
1774 * compress operation information is still needed)
1775 */
1776 for (i = 0; i < num_bufs; i++) {
1777 if (out_of_space && !zlib_decompress) {
1778 if (ops_processed[i]->status !=
1779 RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED) {
1780
1781 RTE_LOG(ERR, USER1,
1782 "Operation without expected out of "

Callers 1

test_deflate_comp_decompFunction · 0.85

Calls 5

rte_pktmbuf_readFunction · 0.85
compare_buffersFunction · 0.85
rte_pktmbuf_freeFunction · 0.85
strlcpyFunction · 0.50
rte_memcpyFunction · 0.50

Tested by

no test coverage detected