* [dpdk-dev] [PATCH v1 1/2] test/compress: add out of space test
@ 2018-12-14 15:33 Marko Kovacevic
2018-12-14 15:33 ` [dpdk-dev] [PATCH v1 2/2] test/compress: add varied buffer input/outputs Marko Kovacevic
` (2 more replies)
0 siblings, 3 replies; 25+ messages in thread
From: Marko Kovacevic @ 2018-12-14 15:33 UTC (permalink / raw)
To: dev
Cc: akhil.goyal, lee.daly, tomaszx.jozwiak, cathal.ohare,
fiona.trahe, Kovacevic, Marko
From: "Kovacevic, Marko" <marko.kovacevic@intel.com>
This patch adds new out of space testcase to check
that the destination mbuf is smaller than required for
the output of compression to ensure the driver doesn't crash
and returns the valid error case.
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
---
test/test/test_compressdev.c | 112 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 108 insertions(+), 4 deletions(-)
diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index 4ea13f4..63b1ba9 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -41,6 +41,9 @@
#define ZLIB_TRAILER_SIZE 4
#define GZIP_HEADER_SIZE 10
#define GZIP_TRAILER_SIZE 8
+#define OUT_OF_SPACE_BUF 1
+
+int out_of_space;
const char *
huffman_type_strings[] = {
@@ -727,8 +730,9 @@ test_deflate_comp_decomp(const char * const test_bufs[],
if (sgl) {
for (i = 0; i < num_bufs; i++) {
- data_size = strlen(test_bufs[i]) *
- COMPRESS_BUF_SIZE_RATIO;
+ out_of_space ? data_size = OUT_OF_SPACE_BUF :
+ (data_size = strlen(test_bufs[i]) *
+ COMPRESS_BUF_SIZE_RATIO);
if (prepare_sgl_bufs(NULL, comp_bufs[i],
data_size,
ts_params->small_mbuf_pool,
@@ -739,8 +743,9 @@ test_deflate_comp_decomp(const char * const test_bufs[],
} else {
for (i = 0; i < num_bufs; i++) {
- data_size = strlen(test_bufs[i]) *
- COMPRESS_BUF_SIZE_RATIO;
+ out_of_space ? data_size = OUT_OF_SPACE_BUF :
+ (data_size = strlen(test_bufs[i]) *
+ COMPRESS_BUF_SIZE_RATIO);
rte_pktmbuf_append(comp_bufs[i], data_size);
}
}
@@ -1663,6 +1668,103 @@ test_compressdev_deflate_stateless_checksum(void)
return ret;
}
+static int
+test_compressdev_out_of_space_buffer(void)
+{
+ struct comp_testsuite_params *ts_params = &testsuite_params;
+ const char *test_buffer;
+ int ret;
+ uint16_t i = 0;
+ const struct rte_compressdev_capabilities *capab;
+ out_of_space = 1;
+
+ capab = rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
+ TEST_ASSERT(capab != NULL, "Failed to retrieve device capabilities");
+
+ if ((capab->comp_feature_flags & RTE_COMP_FF_HUFFMAN_FIXED) == 0)
+ return -ENOTSUP;
+
+ struct rte_comp_xform *compress_xform =
+ rte_malloc(NULL, sizeof(struct rte_comp_xform), 0);
+
+ if (compress_xform == NULL) {
+ RTE_LOG(ERR, USER1,
+ "Compress xform could not be created\n");
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ test_buffer = compress_test_bufs[i];
+
+ if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_SGL_OUT) {
+
+ /* Compress with compressdev, decompress with Zlib */
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ 1,
+ ZLIB_DECOMPRESS,
+ 0) == 0) {
+ ret = TEST_FAILED;
+ goto exit;
+
+ }
+
+ /* Compress with Zlib, decompress with compressdev */
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_COMPRESS,
+ 0) == 0) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+ }
+
+ /* Compress with compressdev, decompress with Zlib */
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS,
+ 0) == 0) {
+ ret = TEST_FAILED;
+ goto exit;
+
+ }
+
+ /* Compress with Zlib, decompress with compressdev */
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_COMPRESS,
+ 0) == 0) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ ret = TEST_SUCCESS;
+ out_of_space = 0;
+
+exit:
+ rte_free(compress_xform);
+ return ret;
+}
+
static struct unit_test_suite compressdev_testsuite = {
.suite_name = "compressdev unit test suite",
.setup = testsuite_setup,
@@ -1684,6 +1786,8 @@ static struct unit_test_suite compressdev_testsuite = {
test_compressdev_deflate_stateless_sgl),
TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
test_compressdev_deflate_stateless_checksum),
+ TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
+ test_compressdev_out_of_space_buffer),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [dpdk-dev] [PATCH v1 2/2] test/compress: add varied buffer input/outputs
2018-12-14 15:33 [dpdk-dev] [PATCH v1 1/2] test/compress: add out of space test Marko Kovacevic
@ 2018-12-14 15:33 ` Marko Kovacevic
2018-12-14 15:56 ` Daly, Lee
2018-12-14 15:55 ` [dpdk-dev] [PATCH v1 1/2] test/compress: add out of space test Daly, Lee
2018-12-20 14:58 ` [dpdk-dev] [PATCH v2 " Marko Kovacevic
2 siblings, 1 reply; 25+ messages in thread
From: Marko Kovacevic @ 2018-12-14 15:33 UTC (permalink / raw)
To: dev
Cc: akhil.goyal, lee.daly, tomaszx.jozwiak, cathal.ohare,
fiona.trahe, Marko Kovacevic
Added unit test to check if a SGL buffer
was added as an input and a Linear Buffer
as output and vice versa so we can test if the
application would process the different buffers
properly.
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
---
test/test/test_compressdev.c | 185 +++++++++++++++++++++++++++++++------------
1 file changed, 134 insertions(+), 51 deletions(-)
diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index 63b1ba9..1fa9824 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -71,6 +71,13 @@ struct comp_testsuite_params {
struct rte_comp_xform *def_decomp_xform;
};
+enum varied_buff {
+ LB_BOTH = 0, /* both input and output are linear*/
+ SGL_BOTH, /* both input and output are chained */
+ SGL_TO_LB, /* input buffer is chained */
+ LB_TO_SGL /* output buffer is chained */
+};
+
static struct comp_testsuite_params testsuite_params = { 0 };
static void
@@ -346,7 +353,7 @@ compress_zlib(struct rte_comp_op *op,
}
/* Assuming stateless operation */
- /* SGL */
+ /* SGL Input */
if (op->m_src->nb_segs > 1) {
single_src_buf = rte_malloc(NULL,
rte_pktmbuf_pkt_len(op->m_src), 0);
@@ -354,14 +361,10 @@ compress_zlib(struct rte_comp_op *op,
RTE_LOG(ERR, USER1, "Buffer could not be allocated\n");
goto exit;
}
- single_dst_buf = rte_malloc(NULL,
- rte_pktmbuf_pkt_len(op->m_dst), 0);
- if (single_dst_buf == NULL) {
- RTE_LOG(ERR, USER1, "Buffer could not be allocated\n");
- goto exit;
- }
- if (rte_pktmbuf_read(op->m_src, 0,
- rte_pktmbuf_pkt_len(op->m_src),
+
+ if (rte_pktmbuf_read(op->m_src, op->src.offset,
+ rte_pktmbuf_pkt_len(op->m_src) -
+ op->src.offset,
single_src_buf) == NULL) {
RTE_LOG(ERR, USER1,
"Buffer could not be read entirely\n");
@@ -370,15 +373,31 @@ compress_zlib(struct rte_comp_op *op,
stream.avail_in = op->src.length;
stream.next_in = single_src_buf;
- stream.avail_out = rte_pktmbuf_pkt_len(op->m_dst);
- stream.next_out = single_dst_buf;
} else {
stream.avail_in = op->src.length;
- stream.next_in = rte_pktmbuf_mtod(op->m_src, uint8_t *);
+ stream.next_in = rte_pktmbuf_mtod_offset(op->m_src, uint8_t *,
+ op->src.offset);
+ }
+ /* SGL output */
+ if (op->m_dst->nb_segs > 1) {
+
+ single_dst_buf = rte_malloc(NULL,
+ rte_pktmbuf_pkt_len(op->m_dst), 0);
+ if (single_dst_buf == NULL) {
+ RTE_LOG(ERR, USER1, "Buffer could not be allocated\n");
+ goto exit;
+ }
+
+ stream.avail_out = op->m_dst->pkt_len;
+ stream.next_out = single_dst_buf;
+
+ } else {/* linear output */
stream.avail_out = op->m_dst->data_len;
- stream.next_out = rte_pktmbuf_mtod(op->m_dst, uint8_t *);
+ stream.next_out = rte_pktmbuf_mtod_offset(op->m_dst, uint8_t *,
+ op->dst.offset);
}
+
/* Stateless operation, all buffer will be compressed in one go */
zlib_flush = map_zlib_flush_flag(op->flush_flag);
ret = deflate(&stream, zlib_flush);
@@ -392,14 +411,14 @@ compress_zlib(struct rte_comp_op *op,
goto exit;
/* Copy data to destination SGL */
- if (op->m_src->nb_segs > 1) {
+ if (op->m_dst->nb_segs > 1) {
uint32_t remaining_data = stream.total_out;
uint8_t *src_data = single_dst_buf;
struct rte_mbuf *dst_buf = op->m_dst;
while (remaining_data > 0) {
- uint8_t *dst_data = rte_pktmbuf_mtod(dst_buf,
- uint8_t *);
+ uint8_t *dst_data = rte_pktmbuf_mtod_offset(dst_buf,
+ uint8_t *, op->dst.offset);
/* Last segment */
if (remaining_data < dst_buf->data_len) {
memcpy(dst_data, src_data, remaining_data);
@@ -655,7 +674,7 @@ test_deflate_comp_decomp(const char * const test_bufs[],
struct rte_comp_xform *decompress_xforms[],
unsigned int num_xforms,
enum rte_comp_op_type state,
- unsigned int sgl,
+ enum varied_buff buff_type,
enum zlib_direction zlib_dir)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
@@ -686,7 +705,7 @@ test_deflate_comp_decomp(const char * const test_bufs[],
memset(ops_processed, 0, sizeof(struct rte_comp_op *) * num_bufs);
memset(priv_xforms, 0, sizeof(void *) * num_bufs);
- if (sgl)
+ if (buff_type == SGL_BOTH)
buf_pool = ts_params->small_mbuf_pool;
else
buf_pool = ts_params->large_mbuf_pool;
@@ -701,7 +720,7 @@ test_deflate_comp_decomp(const char * const test_bufs[],
goto exit;
}
- if (sgl) {
+ if (buff_type == SGL_BOTH || buff_type == SGL_TO_LB) {
for (i = 0; i < num_bufs; i++) {
data_size = strlen(test_bufs[i]) + 1;
if (prepare_sgl_bufs(test_bufs[i], uncomp_bufs[i],
@@ -728,7 +747,7 @@ test_deflate_comp_decomp(const char * const test_bufs[],
goto exit;
}
- if (sgl) {
+ if (buff_type == SGL_BOTH || buff_type == LB_TO_SGL) {
for (i = 0; i < num_bufs; i++) {
out_of_space ? data_size = OUT_OF_SPACE_BUF :
(data_size = strlen(test_bufs[i]) *
@@ -931,7 +950,7 @@ test_deflate_comp_decomp(const char * const test_bufs[],
goto exit;
}
- if (sgl) {
+ if (buff_type == SGL_BOTH || buff_type == LB_TO_SGL) {
for (i = 0; i < num_bufs; i++) {
priv_data = (struct priv_op_data *)
(ops_processed[i] + 1);
@@ -1220,7 +1239,7 @@ test_compressdev_deflate_stateless_fixed(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1233,7 +1252,7 @@ test_compressdev_deflate_stateless_fixed(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_COMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1286,7 +1305,7 @@ test_compressdev_deflate_stateless_dynamic(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1299,7 +1318,7 @@ test_compressdev_deflate_stateless_dynamic(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_COMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1331,7 +1350,7 @@ test_compressdev_deflate_stateless_multi_op(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS) < 0)
return TEST_FAILED;
@@ -1342,7 +1361,7 @@ test_compressdev_deflate_stateless_multi_op(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_COMPRESS) < 0)
return TEST_FAILED;
@@ -1382,7 +1401,7 @@ test_compressdev_deflate_stateless_multi_level(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1453,7 +1472,7 @@ test_compressdev_deflate_stateless_multi_xform(void)
decompress_xforms,
NUM_XFORMS,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1492,8 +1511,8 @@ test_compressdev_deflate_stateless_sgl(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 1,
- ZLIB_DECOMPRESS) < 0)
+ SGL_BOTH,
+ ZLIB_COMPRESS) < 0)
return TEST_FAILED;
/* Compress with Zlib, decompress with compressdev */
@@ -1503,13 +1522,12 @@ test_compressdev_deflate_stateless_sgl(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 1,
- ZLIB_COMPRESS) < 0)
+ SGL_BOTH,
+ ZLIB_DECOMPRESS) < 0)
return TEST_FAILED;
}
return TEST_SUCCESS;
-
}
static int
@@ -1571,7 +1589,7 @@ test_compressdev_deflate_stateless_checksum(void)
&decompress_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_COMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1586,7 +1604,7 @@ test_compressdev_deflate_stateless_checksum(void)
&decompress_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_NONE) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1611,7 +1629,7 @@ test_compressdev_deflate_stateless_checksum(void)
&decompress_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_COMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1625,7 +1643,7 @@ test_compressdev_deflate_stateless_checksum(void)
&decompress_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_NONE) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1652,7 +1670,7 @@ test_compressdev_deflate_stateless_checksum(void)
&decompress_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_NONE) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1705,9 +1723,8 @@ test_compressdev_out_of_space_buffer(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 1,
- ZLIB_DECOMPRESS,
- 0) == 0) {
+ LB_BOTH,
+ ZLIB_DECOMPRESS) == 0) {
ret = TEST_FAILED;
goto exit;
@@ -1720,9 +1737,8 @@ test_compressdev_out_of_space_buffer(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS,
- 0) == 0) {
+ LB_BOTH,
+ ZLIB_COMPRESS) == 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1735,9 +1751,8 @@ test_compressdev_out_of_space_buffer(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS,
- 0) == 0) {
+ SGL_BOTH,
+ ZLIB_DECOMPRESS) == 0) {
ret = TEST_FAILED;
goto exit;
@@ -1750,9 +1765,8 @@ test_compressdev_out_of_space_buffer(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS,
- 0) == 0) {
+ SGL_BOTH,
+ ZLIB_COMPRESS) == 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1765,6 +1779,72 @@ test_compressdev_out_of_space_buffer(void)
return ret;
}
+static int
+test_compressdev_deflate_stateless_varied_buf(void)
+{
+ struct comp_testsuite_params *ts_params = &testsuite_params;
+ uint16_t i;
+ const char *test_buffer;
+ const struct rte_compressdev_capabilities *capab;
+
+ capab = rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
+ TEST_ASSERT(capab != NULL, "Failed to retrieve device capabilities");
+
+ for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
+ test_buffer = compress_test_bufs[0];
+
+ if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_LB_OUT) {
+ /* Compress with compressdev, decompress with Zlib*/
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ SGL_TO_LB,
+ ZLIB_DECOMPRESS) < 0)
+ return TEST_FAILED;
+
+ /* Compress with Zlib, decompress with compressdev*/
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ SGL_TO_LB,
+ ZLIB_COMPRESS) < 0)
+ return TEST_FAILED;
+ }
+
+ if (capab->comp_feature_flags & RTE_COMP_FF_OOP_LB_IN_SGL_OUT) {
+ /* Compress with compressdev, decompress with Zlib*/
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ LB_TO_SGL,
+ ZLIB_DECOMPRESS) < 0)
+ return TEST_FAILED;
+
+ /* Compress with Zlib, decompress with compressdev*/
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ LB_TO_SGL,
+ ZLIB_COMPRESS) < 0)
+ return TEST_FAILED;
+ }
+ }
+
+ return TEST_SUCCESS;
+}
+
static struct unit_test_suite compressdev_testsuite = {
.suite_name = "compressdev unit test suite",
.setup = testsuite_setup,
@@ -1788,6 +1868,9 @@ static struct unit_test_suite compressdev_testsuite = {
test_compressdev_deflate_stateless_checksum),
TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
test_compressdev_out_of_space_buffer),
+ TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
+ test_compressdev_deflate_stateless_varied_buf),
+
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [dpdk-dev] [PATCH v1 1/2] test/compress: add out of space test
2018-12-14 15:33 [dpdk-dev] [PATCH v1 1/2] test/compress: add out of space test Marko Kovacevic
2018-12-14 15:33 ` [dpdk-dev] [PATCH v1 2/2] test/compress: add varied buffer input/outputs Marko Kovacevic
@ 2018-12-14 15:55 ` Daly, Lee
2018-12-20 14:58 ` [dpdk-dev] [PATCH v2 " Marko Kovacevic
2 siblings, 0 replies; 25+ messages in thread
From: Daly, Lee @ 2018-12-14 15:55 UTC (permalink / raw)
To: Kovacevic, Marko, dev
Cc: akhil.goyal, Jozwiak, TomaszX, O'Hare, Cathal, Trahe, Fiona
> -----Original Message-----
> From: Kovacevic, Marko
> Sent: Friday, December 14, 2018 3:33 PM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; Daly, Lee <lee.daly@intel.com>; Jozwiak, TomaszX
> <tomaszx.jozwiak@intel.com>; O'Hare, Cathal <cathal.ohare@intel.com>;
> Trahe, Fiona <fiona.trahe@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>
> Subject: [PATCH v1 1/2] test/compress: add out of space test
>
> From: "Kovacevic, Marko" <marko.kovacevic@intel.com>
>
> This patch adds new out of space testcase to check that the destination mbuf
> is smaller than required for the output of compression to ensure the driver
> doesn't crash and returns the valid error case.
>
> Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> ---
Acked-by: Lee Daly <lee.daly@intel.com>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [dpdk-dev] [PATCH v1 2/2] test/compress: add varied buffer input/outputs
2018-12-14 15:33 ` [dpdk-dev] [PATCH v1 2/2] test/compress: add varied buffer input/outputs Marko Kovacevic
@ 2018-12-14 15:56 ` Daly, Lee
0 siblings, 0 replies; 25+ messages in thread
From: Daly, Lee @ 2018-12-14 15:56 UTC (permalink / raw)
To: Kovacevic, Marko, dev
Cc: akhil.goyal, Jozwiak, TomaszX, O'Hare, Cathal, Trahe, Fiona
> -----Original Message-----
> From: Kovacevic, Marko
> Sent: Friday, December 14, 2018 3:33 PM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; Daly, Lee <lee.daly@intel.com>; Jozwiak, TomaszX
> <tomaszx.jozwiak@intel.com>; O'Hare, Cathal <cathal.ohare@intel.com>;
> Trahe, Fiona <fiona.trahe@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>
> Subject: [PATCH v1 2/2] test/compress: add varied buffer input/outputs
>
> Added unit test to check if a SGL buffer was added as an input and a Linear
> Buffer as output and vice versa so we can test if the application would
> process the different buffers properly.
>
> Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> ---
Acked-by: Lee Daly <lee.daly@intel.com>
^ permalink raw reply [flat|nested] 25+ messages in thread
* [dpdk-dev] [PATCH v2 1/2] test/compress: add out of space test
2018-12-14 15:33 [dpdk-dev] [PATCH v1 1/2] test/compress: add out of space test Marko Kovacevic
2018-12-14 15:33 ` [dpdk-dev] [PATCH v1 2/2] test/compress: add varied buffer input/outputs Marko Kovacevic
2018-12-14 15:55 ` [dpdk-dev] [PATCH v1 1/2] test/compress: add out of space test Daly, Lee
@ 2018-12-20 14:58 ` Marko Kovacevic
2018-12-20 14:58 ` [dpdk-dev] [PATCH v2 2/2] test/compress: add varied buffer input/outputs Marko Kovacevic
` (3 more replies)
2 siblings, 4 replies; 25+ messages in thread
From: Marko Kovacevic @ 2018-12-20 14:58 UTC (permalink / raw)
To: dev
Cc: akhil.goyal, lee.daly, tomaszx.jozwiak, cathal.ohare,
fiona.trahe, Kovacevic, Marko
From: "Kovacevic, Marko" <marko.kovacevic@intel.com>
This patch adds new out of space testcase to check
that the destination mbuf is smaller than required for
the output of compression to ensure the driver doesn't crash
and returns the valid error case.
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
---
V2:
Added check flag to return proper status to user
---
test/test/test_compressdev.c | 130 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 126 insertions(+), 4 deletions(-)
diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index 42327dc..b2999fa 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -41,6 +41,9 @@
#define ZLIB_TRAILER_SIZE 4
#define GZIP_HEADER_SIZE 10
#define GZIP_TRAILER_SIZE 8
+#define OUT_OF_SPACE_BUF 1
+
+int out_of_space;
const char *
huffman_type_strings[] = {
@@ -734,8 +737,9 @@ test_deflate_comp_decomp(const char * const test_bufs[],
if (sgl) {
for (i = 0; i < num_bufs; i++) {
- data_size = strlen(test_bufs[i]) *
- COMPRESS_BUF_SIZE_RATIO;
+ out_of_space ? data_size = OUT_OF_SPACE_BUF :
+ (data_size = strlen(test_bufs[i]) *
+ COMPRESS_BUF_SIZE_RATIO);
if (prepare_sgl_bufs(NULL, comp_bufs[i],
data_size,
ts_params->small_mbuf_pool,
@@ -746,8 +750,9 @@ test_deflate_comp_decomp(const char * const test_bufs[],
} else {
for (i = 0; i < num_bufs; i++) {
- data_size = strlen(test_bufs[i]) *
- COMPRESS_BUF_SIZE_RATIO;
+ out_of_space ? data_size = OUT_OF_SPACE_BUF :
+ (data_size = strlen(test_bufs[i]) *
+ COMPRESS_BUF_SIZE_RATIO);
rte_pktmbuf_append(comp_bufs[i], data_size);
}
}
@@ -913,6 +918,16 @@ test_deflate_comp_decomp(const char * const test_bufs[],
* compress operation information is needed for the decompression stage)
*/
for (i = 0; i < num_bufs; i++) {
+ if(out_of_space) {
+ if (ops_processed[i]->status ==
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED) {
+ RTE_LOG(ERR, USER1,
+ "Some operations were not successful\n");
+ out_of_space = 0;
+ goto exit;
+ }
+ }
+
if (ops_processed[i]->status != RTE_COMP_OP_STATUS_SUCCESS) {
RTE_LOG(ERR, USER1,
"Some operations were not successful\n");
@@ -1110,6 +1125,16 @@ test_deflate_comp_decomp(const char * const test_bufs[],
* compress operation information is still needed)
*/
for (i = 0; i < num_bufs; i++) {
+ if(out_of_space) {
+ if (ops_processed[i]->status ==
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED) {
+ RTE_LOG(ERR, USER1,
+ "Some operations were not successful\n");
+ out_of_space = 0;
+ goto exit;
+ }
+ }
+
if (ops_processed[i]->status != RTE_COMP_OP_STATUS_SUCCESS) {
RTE_LOG(ERR, USER1,
"Some operations were not successful\n");
@@ -1664,6 +1689,101 @@ test_compressdev_deflate_stateless_checksum(void)
return ret;
}
+static int
+test_compressdev_out_of_space_buffer(void)
+{
+ struct comp_testsuite_params *ts_params = &testsuite_params;
+ const char *test_buffer;
+ int ret;
+ uint16_t i = 0;
+ const struct rte_compressdev_capabilities *capab;
+ out_of_space = 1;
+
+ capab = rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
+ TEST_ASSERT(capab != NULL, "Failed to retrieve device capabilities");
+
+ if ((capab->comp_feature_flags & RTE_COMP_FF_HUFFMAN_FIXED) == 0)
+ return -ENOTSUP;
+
+ struct rte_comp_xform *compress_xform =
+ rte_malloc(NULL, sizeof(struct rte_comp_xform), 0);
+
+ if (compress_xform == NULL) {
+ RTE_LOG(ERR, USER1,
+ "Compress xform could not be created\n");
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ test_buffer = compress_test_bufs[i];
+
+ /* Compress with compressdev, decompress with Zlib */
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS) == 0 && out_of_space == 1) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+ out_of_space =1;
+
+ /* Compress with Zlib, decompress with compressdev */
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_COMPRESS) == 0 && out_of_space == 1) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+ out_of_space =1;
+
+ if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_SGL_OUT) {
+ /* Compress with compressdev, decompress with Zlib */
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ 1,
+ ZLIB_DECOMPRESS) == 0 && out_of_space == 1) {
+ ret = TEST_FAILED;
+ goto exit;
+
+ }
+ out_of_space =1;
+
+ /* Compress with Zlib, decompress with compressdev */
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ 1,
+ ZLIB_COMPRESS) == 0 && out_of_space == 1) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ }
+
+ ret = TEST_SUCCESS;
+
+exit:
+ out_of_space = 0;
+ rte_free(compress_xform);
+ return ret;
+}
+
static struct unit_test_suite compressdev_testsuite = {
.suite_name = "compressdev unit test suite",
.setup = testsuite_setup,
@@ -1685,6 +1805,8 @@ static struct unit_test_suite compressdev_testsuite = {
test_compressdev_deflate_stateless_sgl),
TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
test_compressdev_deflate_stateless_checksum),
+ TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
+ test_compressdev_out_of_space_buffer),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [dpdk-dev] [PATCH v2 2/2] test/compress: add varied buffer input/outputs
2018-12-20 14:58 ` [dpdk-dev] [PATCH v2 " Marko Kovacevic
@ 2018-12-20 14:58 ` Marko Kovacevic
2018-12-21 0:44 ` Trahe, Fiona
2019-01-09 17:02 ` De Lara Guarch, Pablo
2018-12-21 0:41 ` [dpdk-dev] [PATCH v2 1/2] test/compress: add out of space test Trahe, Fiona
` (2 subsequent siblings)
3 siblings, 2 replies; 25+ messages in thread
From: Marko Kovacevic @ 2018-12-20 14:58 UTC (permalink / raw)
To: dev
Cc: akhil.goyal, lee.daly, tomaszx.jozwiak, cathal.ohare,
fiona.trahe, Marko Kovacevic
Added unit test to check if a SGL buffer
was added as an input and a Linear Buffer
as output and vice versa so we can test if the
application would process the different buffers
properly.
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
---
test/test/test_compressdev.c | 173 ++++++++++++++++++++++++++++++++-----------
1 file changed, 130 insertions(+), 43 deletions(-)
diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index b2999fa..5d62206 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -71,6 +71,13 @@ struct comp_testsuite_params {
struct rte_comp_xform *def_decomp_xform;
};
+enum varied_buff {
+ LB_BOTH = 0, /* both input and output are linear*/
+ SGL_BOTH, /* both input and output are chained */
+ SGL_TO_LB, /* input buffer is chained */
+ LB_TO_SGL /* output buffer is chained */
+};
+
static struct comp_testsuite_params testsuite_params = { 0 };
static void
@@ -353,7 +360,7 @@ compress_zlib(struct rte_comp_op *op,
}
/* Assuming stateless operation */
- /* SGL */
+ /* SGL Input */
if (op->m_src->nb_segs > 1) {
single_src_buf = rte_malloc(NULL,
rte_pktmbuf_pkt_len(op->m_src), 0);
@@ -361,14 +368,10 @@ compress_zlib(struct rte_comp_op *op,
RTE_LOG(ERR, USER1, "Buffer could not be allocated\n");
goto exit;
}
- single_dst_buf = rte_malloc(NULL,
- rte_pktmbuf_pkt_len(op->m_dst), 0);
- if (single_dst_buf == NULL) {
- RTE_LOG(ERR, USER1, "Buffer could not be allocated\n");
- goto exit;
- }
- if (rte_pktmbuf_read(op->m_src, 0,
- rte_pktmbuf_pkt_len(op->m_src),
+
+ if (rte_pktmbuf_read(op->m_src, op->src.offset,
+ rte_pktmbuf_pkt_len(op->m_src) -
+ op->src.offset,
single_src_buf) == NULL) {
RTE_LOG(ERR, USER1,
"Buffer could not be read entirely\n");
@@ -377,15 +380,31 @@ compress_zlib(struct rte_comp_op *op,
stream.avail_in = op->src.length;
stream.next_in = single_src_buf;
- stream.avail_out = rte_pktmbuf_pkt_len(op->m_dst);
- stream.next_out = single_dst_buf;
} else {
stream.avail_in = op->src.length;
- stream.next_in = rte_pktmbuf_mtod(op->m_src, uint8_t *);
+ stream.next_in = rte_pktmbuf_mtod_offset(op->m_src, uint8_t *,
+ op->src.offset);
+ }
+ /* SGL output */
+ if (op->m_dst->nb_segs > 1) {
+
+ single_dst_buf = rte_malloc(NULL,
+ rte_pktmbuf_pkt_len(op->m_dst), 0);
+ if (single_dst_buf == NULL) {
+ RTE_LOG(ERR, USER1, "Buffer could not be allocated\n");
+ goto exit;
+ }
+
+ stream.avail_out = op->m_dst->pkt_len;
+ stream.next_out = single_dst_buf;
+
+ } else {/* linear output */
stream.avail_out = op->m_dst->data_len;
- stream.next_out = rte_pktmbuf_mtod(op->m_dst, uint8_t *);
+ stream.next_out = rte_pktmbuf_mtod_offset(op->m_dst, uint8_t *,
+ op->dst.offset);
}
+
/* Stateless operation, all buffer will be compressed in one go */
zlib_flush = map_zlib_flush_flag(op->flush_flag);
ret = deflate(&stream, zlib_flush);
@@ -399,14 +418,14 @@ compress_zlib(struct rte_comp_op *op,
goto exit;
/* Copy data to destination SGL */
- if (op->m_src->nb_segs > 1) {
+ if (op->m_dst->nb_segs > 1) {
uint32_t remaining_data = stream.total_out;
uint8_t *src_data = single_dst_buf;
struct rte_mbuf *dst_buf = op->m_dst;
while (remaining_data > 0) {
- uint8_t *dst_data = rte_pktmbuf_mtod(dst_buf,
- uint8_t *);
+ uint8_t *dst_data = rte_pktmbuf_mtod_offset(dst_buf,
+ uint8_t *, op->dst.offset);
/* Last segment */
if (remaining_data < dst_buf->data_len) {
memcpy(dst_data, src_data, remaining_data);
@@ -662,7 +681,7 @@ test_deflate_comp_decomp(const char * const test_bufs[],
struct rte_comp_xform *decompress_xforms[],
unsigned int num_xforms,
enum rte_comp_op_type state,
- unsigned int sgl,
+ enum varied_buff buff_type,
enum zlib_direction zlib_dir)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
@@ -693,7 +712,7 @@ test_deflate_comp_decomp(const char * const test_bufs[],
memset(ops_processed, 0, sizeof(struct rte_comp_op *) * num_bufs);
memset(priv_xforms, 0, sizeof(void *) * num_bufs);
- if (sgl)
+ if (buff_type == SGL_BOTH)
buf_pool = ts_params->small_mbuf_pool;
else
buf_pool = ts_params->large_mbuf_pool;
@@ -708,7 +727,7 @@ test_deflate_comp_decomp(const char * const test_bufs[],
goto exit;
}
- if (sgl) {
+ if (buff_type == SGL_BOTH || buff_type == SGL_TO_LB) {
for (i = 0; i < num_bufs; i++) {
data_size = strlen(test_bufs[i]) + 1;
if (prepare_sgl_bufs(test_bufs[i], uncomp_bufs[i],
@@ -735,7 +754,7 @@ test_deflate_comp_decomp(const char * const test_bufs[],
goto exit;
}
- if (sgl) {
+ if (buff_type == SGL_BOTH || buff_type == LB_TO_SGL) {
for (i = 0; i < num_bufs; i++) {
out_of_space ? data_size = OUT_OF_SPACE_BUF :
(data_size = strlen(test_bufs[i]) *
@@ -947,7 +966,7 @@ test_deflate_comp_decomp(const char * const test_bufs[],
goto exit;
}
- if (sgl) {
+ if (buff_type == SGL_BOTH || buff_type == LB_TO_SGL) {
for (i = 0; i < num_bufs; i++) {
priv_data = (struct priv_op_data *)
(ops_processed[i] + 1);
@@ -1241,7 +1260,7 @@ test_compressdev_deflate_stateless_fixed(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1254,7 +1273,7 @@ test_compressdev_deflate_stateless_fixed(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_COMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1307,7 +1326,7 @@ test_compressdev_deflate_stateless_dynamic(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1320,7 +1339,7 @@ test_compressdev_deflate_stateless_dynamic(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_COMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1352,7 +1371,7 @@ test_compressdev_deflate_stateless_multi_op(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS) < 0)
return TEST_FAILED;
@@ -1363,7 +1382,7 @@ test_compressdev_deflate_stateless_multi_op(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_COMPRESS) < 0)
return TEST_FAILED;
@@ -1403,7 +1422,7 @@ test_compressdev_deflate_stateless_multi_level(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1474,7 +1493,7 @@ test_compressdev_deflate_stateless_multi_xform(void)
decompress_xforms,
NUM_XFORMS,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1513,8 +1532,8 @@ test_compressdev_deflate_stateless_sgl(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 1,
- ZLIB_DECOMPRESS) < 0)
+ SGL_BOTH,
+ ZLIB_COMPRESS) < 0)
return TEST_FAILED;
/* Compress with Zlib, decompress with compressdev */
@@ -1524,13 +1543,12 @@ test_compressdev_deflate_stateless_sgl(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 1,
- ZLIB_COMPRESS) < 0)
+ SGL_BOTH,
+ ZLIB_DECOMPRESS) < 0)
return TEST_FAILED;
}
return TEST_SUCCESS;
-
}
static int
@@ -1592,7 +1610,7 @@ test_compressdev_deflate_stateless_checksum(void)
&decompress_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_COMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1607,7 +1625,7 @@ test_compressdev_deflate_stateless_checksum(void)
&decompress_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_NONE) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1632,7 +1650,7 @@ test_compressdev_deflate_stateless_checksum(void)
&decompress_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_COMPRESS) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1646,7 +1664,7 @@ test_compressdev_deflate_stateless_checksum(void)
&decompress_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_NONE) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1673,7 +1691,7 @@ test_compressdev_deflate_stateless_checksum(void)
&decompress_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_NONE) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1724,7 +1742,7 @@ test_compressdev_out_of_space_buffer(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS) == 0 && out_of_space == 1) {
ret = TEST_FAILED;
goto exit;
@@ -1738,7 +1756,7 @@ test_compressdev_out_of_space_buffer(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_COMPRESS) == 0 && out_of_space == 1) {
ret = TEST_FAILED;
goto exit;
@@ -1753,7 +1771,7 @@ test_compressdev_out_of_space_buffer(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 1,
+ SGL_BOTH,
ZLIB_DECOMPRESS) == 0 && out_of_space == 1) {
ret = TEST_FAILED;
goto exit;
@@ -1768,7 +1786,7 @@ test_compressdev_out_of_space_buffer(void)
&ts_params->def_decomp_xform,
1,
RTE_COMP_OP_STATELESS,
- 1,
+ SGL_BOTH,
ZLIB_COMPRESS) == 0 && out_of_space == 1) {
ret = TEST_FAILED;
goto exit;
@@ -1784,6 +1802,72 @@ test_compressdev_out_of_space_buffer(void)
return ret;
}
+static int
+test_compressdev_deflate_stateless_varied_buf(void)
+{
+ struct comp_testsuite_params *ts_params = &testsuite_params;
+ uint16_t i;
+ const char *test_buffer;
+ const struct rte_compressdev_capabilities *capab;
+
+ capab = rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
+ TEST_ASSERT(capab != NULL, "Failed to retrieve device capabilities");
+
+ for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
+ test_buffer = compress_test_bufs[0];
+
+ if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_LB_OUT) {
+ /* Compress with compressdev, decompress with Zlib*/
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ SGL_TO_LB,
+ ZLIB_DECOMPRESS) < 0)
+ return TEST_FAILED;
+
+ /* Compress with Zlib, decompress with compressdev*/
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ SGL_TO_LB,
+ ZLIB_COMPRESS) < 0)
+ return TEST_FAILED;
+ }
+
+ if (capab->comp_feature_flags & RTE_COMP_FF_OOP_LB_IN_SGL_OUT) {
+ /* Compress with compressdev, decompress with Zlib*/
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ LB_TO_SGL,
+ ZLIB_DECOMPRESS) < 0)
+ return TEST_FAILED;
+
+ /* Compress with Zlib, decompress with compressdev*/
+ if (test_deflate_comp_decomp(&test_buffer, 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1,
+ RTE_COMP_OP_STATELESS,
+ LB_TO_SGL,
+ ZLIB_COMPRESS) < 0)
+ return TEST_FAILED;
+ }
+ }
+
+ return TEST_SUCCESS;
+}
+
static struct unit_test_suite compressdev_testsuite = {
.suite_name = "compressdev unit test suite",
.setup = testsuite_setup,
@@ -1807,6 +1891,9 @@ static struct unit_test_suite compressdev_testsuite = {
test_compressdev_deflate_stateless_checksum),
TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
test_compressdev_out_of_space_buffer),
+ TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
+ test_compressdev_deflate_stateless_varied_buf),
+
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/2] test/compress: add out of space test
2018-12-20 14:58 ` [dpdk-dev] [PATCH v2 " Marko Kovacevic
2018-12-20 14:58 ` [dpdk-dev] [PATCH v2 2/2] test/compress: add varied buffer input/outputs Marko Kovacevic
@ 2018-12-21 0:41 ` Trahe, Fiona
2019-01-09 16:47 ` De Lara Guarch, Pablo
2019-01-11 15:08 ` [dpdk-dev] [PATCH v3 0/3] Compression Unit Tests Kovacevic, Marko
3 siblings, 0 replies; 25+ messages in thread
From: Trahe, Fiona @ 2018-12-21 0:41 UTC (permalink / raw)
To: Kovacevic, Marko, dev; +Cc: akhil.goyal, Daly, Lee, Jozwiak, TomaszX
> -----Original Message-----
> From: Kovacevic, Marko
> Sent: Thursday, December 20, 2018 7:58 AM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; Daly, Lee <lee.daly@intel.com>; Jozwiak, TomaszX
> <tomaszx.jozwiak@intel.com>; O'Hare, Cathal <cathal.ohare@intel.com>; Trahe, Fiona
> <fiona.trahe@intel.com>; Kovacevic, Marko <marko.kovacevic@intel.com>
> Subject: [PATCH v2 1/2] test/compress: add out of space test
>
> From: "Kovacevic, Marko" <marko.kovacevic@intel.com>
>
> This patch adds new out of space testcase to check
> that the destination mbuf is smaller than required for
> the output of compression to ensure the driver doesn't crash
> and returns the valid error case.
>
> Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> Acked-by: Lee Daly <lee.daly@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [dpdk-dev] [PATCH v2 2/2] test/compress: add varied buffer input/outputs
2018-12-20 14:58 ` [dpdk-dev] [PATCH v2 2/2] test/compress: add varied buffer input/outputs Marko Kovacevic
@ 2018-12-21 0:44 ` Trahe, Fiona
2019-01-09 17:02 ` De Lara Guarch, Pablo
1 sibling, 0 replies; 25+ messages in thread
From: Trahe, Fiona @ 2018-12-21 0:44 UTC (permalink / raw)
To: Kovacevic, Marko, dev; +Cc: akhil.goyal, Daly, Lee, Jozwiak, TomaszX
> -----Original Message-----
> From: Kovacevic, Marko
> Sent: Thursday, December 20, 2018 7:58 AM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; Daly, Lee <lee.daly@intel.com>; Jozwiak, TomaszX
> <tomaszx.jozwiak@intel.com>; O'Hare, Cathal <cathal.ohare@intel.com>; Trahe, Fiona
> <fiona.trahe@intel.com>; Kovacevic, Marko <marko.kovacevic@intel.com>
> Subject: [PATCH v2 2/2] test/compress: add varied buffer input/outputs
>
> Added unit test to check if a SGL buffer
> was added as an input and a Linear Buffer
> as output and vice versa so we can test if the
> application would process the different buffers
> properly.
>
> Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> Acked-by: Lee Daly <lee.daly@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/2] test/compress: add out of space test
2018-12-20 14:58 ` [dpdk-dev] [PATCH v2 " Marko Kovacevic
2018-12-20 14:58 ` [dpdk-dev] [PATCH v2 2/2] test/compress: add varied buffer input/outputs Marko Kovacevic
2018-12-21 0:41 ` [dpdk-dev] [PATCH v2 1/2] test/compress: add out of space test Trahe, Fiona
@ 2019-01-09 16:47 ` De Lara Guarch, Pablo
2019-01-11 15:08 ` [dpdk-dev] [PATCH v3 0/3] Compression Unit Tests Kovacevic, Marko
3 siblings, 0 replies; 25+ messages in thread
From: De Lara Guarch, Pablo @ 2019-01-09 16:47 UTC (permalink / raw)
To: Kovacevic, Marko
Cc: akhil.goyal, Daly, Lee, Jozwiak, TomaszX, O'Hare, Cathal,
Trahe, Fiona, Kovacevic, Marko, dev
Hi Marko,
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Marko Kovacevic
> Sent: Thursday, December 20, 2018 2:58 PM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; Daly, Lee <lee.daly@intel.com>; Jozwiak, TomaszX
> <tomaszx.jozwiak@intel.com>; O'Hare, Cathal <cathal.ohare@intel.com>;
> Trahe, Fiona <fiona.trahe@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>
> Subject: [dpdk-dev] [PATCH v2 1/2] test/compress: add out of space test
>
> From: "Kovacevic, Marko" <marko.kovacevic@intel.com>
>
> This patch adds new out of space testcase to check that the destination
> mbuf is smaller than required for the output of compression to ensure the
> driver doesn't crash and returns the valid error case.
>
> Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> Acked-by: Lee Daly <lee.daly@intel.com>
>
> ---
> V2:
> Added check flag to return proper status to user
> ---
> test/test/test_compressdev.c | 130
> +++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 126 insertions(+), 4 deletions(-)
>
> diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
> index 42327dc..b2999fa 100644
> --- a/test/test/test_compressdev.c
> +++ b/test/test/test_compressdev.c
> @@ -41,6 +41,9 @@
> #define ZLIB_TRAILER_SIZE 4
> #define GZIP_HEADER_SIZE 10
> #define GZIP_TRAILER_SIZE 8
> +#define OUT_OF_SPACE_BUF 1
> +
> +int out_of_space;
I think we should avoid global variables if possible.
This is a variable to change a test type, so it should go with the other test parameters.
I get that the list of arguments is growing a lot, therefore refactoring
the test_deflate_comp_decomp function is highly needed.
I will send a patch doing that, so code is cleaner.
>
> const char *
> huffman_type_strings[] = {
> @@ -734,8 +737,9 @@ test_deflate_comp_decomp(const char * const
> test_bufs[],
>
> if (sgl) {
> for (i = 0; i < num_bufs; i++) {
> - data_size = strlen(test_bufs[i]) *
> - COMPRESS_BUF_SIZE_RATIO;
> + out_of_space ? data_size = OUT_OF_SPACE_BUF :
> + (data_size = strlen(test_bufs[i]) *
> + COMPRESS_BUF_SIZE_RATIO);
This is OK when compressing with compressdev.
When testing out of place error when decompressing with compressdev,
then compression (with Zlib) needs to be successful.
Therefore, data_size should only be equal to OUT_OF_SPACE_BUF
when zlib_dir = ZLIB_COMPRESS and out_of_space = 1.
> if (prepare_sgl_bufs(NULL, comp_bufs[i],
> data_size,
> ts_params->small_mbuf_pool,
> @@ -746,8 +750,9 @@ test_deflate_comp_decomp(const char * const
> test_bufs[],
>
> } else {
> for (i = 0; i < num_bufs; i++) {
> - data_size = strlen(test_bufs[i]) *
> - COMPRESS_BUF_SIZE_RATIO;
> + out_of_space ? data_size = OUT_OF_SPACE_BUF :
> + (data_size = strlen(test_bufs[i]) *
> + COMPRESS_BUF_SIZE_RATIO);
> rte_pktmbuf_append(comp_bufs[i], data_size);
> }
> }
> @@ -913,6 +918,16 @@ test_deflate_comp_decomp(const char * const
> test_bufs[],
> * compress operation information is needed for the decompression
> stage)
> */
> for (i = 0; i < num_bufs; i++) {
> + if(out_of_space) {
> + if (ops_processed[i]->status ==
> +
> RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED) {
> + RTE_LOG(ERR, USER1,
> + "Some operations were not successful\n");
I think this log should be removed, as if status is "out of space terminated",
the test is actually passing (this is a negative test), so there is no error.
Instead, the log should be placed in the else part of this condition,
with a message saying that the status is incorrect.
> + out_of_space = 0;
I think instead of using out_of_space as an output, ret_status can be changed to 0
and just exit the function successfully.
If status is not the expected, then ret_status = -1 (default, so no need to change).
Also, all operations should be checked if their status is the right one.
Therefore, one thing you can do is check if not status = OOS_TERMINATED and return an error in that case.
Then, after the loop, if out_of_space = 1, just go to exit.
> + goto exit;
> + }
> + }
> +
> if (ops_processed[i]->status !=
> RTE_COMP_OP_STATUS_SUCCESS) {
> RTE_LOG(ERR, USER1,
> "Some operations were not successful\n");
> @@ -1110,6 +1125,16 @@ test_deflate_comp_decomp(const char * const
> test_bufs[],
> * compress operation information is still needed)
> */
> for (i = 0; i < num_bufs; i++) {
> + if(out_of_space) {
> + if (ops_processed[i]->status ==
> +
> RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED) {
> + RTE_LOG(ERR, USER1,
> + "Some operations were not successful\n");
> + out_of_space = 0;
> + goto exit;
Same comments as above apply here.
Also, data_size of the output buffers need to be modified as it is done for compression.
> + }
> + }
> +
> if (ops_processed[i]->status !=
> RTE_COMP_OP_STATUS_SUCCESS) {
> RTE_LOG(ERR, USER1,
> "Some operations were not successful\n");
> @@ -1664,6 +1689,101 @@
> test_compressdev_deflate_stateless_checksum(void)
> return ret;
> }
>
> +static int
> +test_compressdev_out_of_space_buffer(void)
> +{
> + struct comp_testsuite_params *ts_params = &testsuite_params;
> + const char *test_buffer;
> + int ret;
> + uint16_t i = 0;
> + const struct rte_compressdev_capabilities *capab;
> + out_of_space = 1;
> +
> + capab = rte_compressdev_capability_get(0,
> RTE_COMP_ALGO_DEFLATE);
> + TEST_ASSERT(capab != NULL, "Failed to retrieve device capabilities");
> +
> + if ((capab->comp_feature_flags & RTE_COMP_FF_HUFFMAN_FIXED)
> == 0)
> + return -ENOTSUP;
> +
> + struct rte_comp_xform *compress_xform =
> + rte_malloc(NULL, sizeof(struct rte_comp_xform), 0);
> +
> + if (compress_xform == NULL) {
> + RTE_LOG(ERR, USER1,
> + "Compress xform could not be created\n");
> + ret = TEST_FAILED;
> + goto exit;
> + }
> +
> + test_buffer = compress_test_bufs[i];
> +
> + /* Compress with compressdev, decompress with Zlib */
> + if (test_deflate_comp_decomp(&test_buffer, 1,
> + &i,
> + &ts_params->def_comp_xform,
> + &ts_params->def_decomp_xform,
> + 1,
> + RTE_COMP_OP_STATELESS,
> + 0,
> + ZLIB_DECOMPRESS) == 0 && out_of_space == 1) {
As said above, I think out_of_space does not need to be checked as an ouput.
Instead, only the return value of this function should be checked.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [dpdk-dev] [PATCH v2 2/2] test/compress: add varied buffer input/outputs
2018-12-20 14:58 ` [dpdk-dev] [PATCH v2 2/2] test/compress: add varied buffer input/outputs Marko Kovacevic
2018-12-21 0:44 ` Trahe, Fiona
@ 2019-01-09 17:02 ` De Lara Guarch, Pablo
1 sibling, 0 replies; 25+ messages in thread
From: De Lara Guarch, Pablo @ 2019-01-09 17:02 UTC (permalink / raw)
To: Kovacevic, Marko, dev
Cc: akhil.goyal, Daly, Lee, Jozwiak, TomaszX, O'Hare, Cathal,
Trahe, Fiona, Kovacevic, Marko
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Marko Kovacevic
> Sent: Thursday, December 20, 2018 2:58 PM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; Daly, Lee <lee.daly@intel.com>; Jozwiak, TomaszX
> <tomaszx.jozwiak@intel.com>; O'Hare, Cathal <cathal.ohare@intel.com>;
> Trahe, Fiona <fiona.trahe@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>
> Subject: [dpdk-dev] [PATCH v2 2/2] test/compress: add varied buffer
> input/outputs
>
> Added unit test to check if a SGL buffer was added as an input and a Linear
> Buffer as output and vice versa so we can test if the application would
> process the different buffers properly.
>
> Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> Acked-by: Lee Daly <lee.daly@intel.com>
> ---
> test/test/test_compressdev.c | 173 ++++++++++++++++++++++++++++++++---
> --------
> 1 file changed, 130 insertions(+), 43 deletions(-)
>
> diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
> index b2999fa..5d62206 100644
> --- a/test/test/test_compressdev.c
> +++ b/test/test/test_compressdev.c
> @@ -71,6 +71,13 @@ struct comp_testsuite_params {
> struct rte_comp_xform *def_decomp_xform; };
>
> +enum varied_buff {
> + LB_BOTH = 0, /* both input and output are linear*/
> + SGL_BOTH, /* both input and output are chained */
> + SGL_TO_LB, /* input buffer is chained */
> + LB_TO_SGL /* output buffer is chained */
>
Great idea to have this enum. It really makes the tests more readable :)
>
> +static int
> +test_compressdev_deflate_stateless_varied_buf(void)
> +{
I think, since these new tests could be integrated in the SGL test, extending the existing ones,
as so far they were only testing SGL in SGL out and this is extending to other combinations.
This way, we don't add another test unnecessarily.
Thanks,
Pablo
^ permalink raw reply [flat|nested] 25+ messages in thread
* [dpdk-dev] [PATCH v3 0/3] Compression Unit Tests
2018-12-20 14:58 ` [dpdk-dev] [PATCH v2 " Marko Kovacevic
` (2 preceding siblings ...)
2019-01-09 16:47 ` De Lara Guarch, Pablo
@ 2019-01-11 15:08 ` Kovacevic, Marko
2019-01-11 15:08 ` [dpdk-dev] [PATCH v3 1/3] test/compress: refactor main test function Kovacevic, Marko
` (2 more replies)
3 siblings, 3 replies; 25+ messages in thread
From: Kovacevic, Marko @ 2019-01-11 15:08 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, pablo.de.lara.guarch, Kovacevic, Marko
Made changes to the two unit tests for the out of space i have added
proper checkes for all the cases compressing with compress dev and
decompressing with compress dev.
Varied buffer patch i have removed the extra unit test and merged it
into the sgl test as one.
Added a third patch into my patch set this patch refactors the
test_deflate_comp_decomp to make it a less congested with parameters
Kovacevic, Marko (2):
test/compress: add out of space test
test/compress: add varied buffer input/outputs
Pablo de Lara (1):
test/compress: refactor main test function
test/test/test_compressdev.c | 582 ++++++++++++++++++++++++++++++-------------
1 file changed, 411 insertions(+), 171 deletions(-)
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [dpdk-dev] [PATCH v3 1/3] test/compress: refactor main test function
2019-01-11 15:08 ` [dpdk-dev] [PATCH v3 0/3] Compression Unit Tests Kovacevic, Marko
@ 2019-01-11 15:08 ` Kovacevic, Marko
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 0/3] Compression Unit Tests Kovacevic, Marko
2019-01-11 15:08 ` [dpdk-dev] [PATCH v3 2/3] test/compress: add out of space test Kovacevic, Marko
2019-01-11 15:09 ` [dpdk-dev] [PATCH v3 3/3] test/compress: add varied buffer input/outputs Kovacevic, Marko
2 siblings, 1 reply; 25+ messages in thread
From: Kovacevic, Marko @ 2019-01-11 15:08 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, pablo.de.lara.guarch
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Since the start of the compression tests,
the main test function, test_deflate_comp_decomp,
has increased its parameter with each new test added.
In order to make the code cleaner, and more scalable,
these parameters have been divided into two structures,
which are now passed as the sole arguments of the function.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
test/test/test_compressdev.c | 319 ++++++++++++++++++++++++-------------------
1 file changed, 178 insertions(+), 141 deletions(-)
diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index 6a2a341..20895fc 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -68,6 +68,21 @@ struct comp_testsuite_params {
struct rte_comp_xform *def_decomp_xform;
};
+struct interim_data_params {
+ const char * const *test_bufs;
+ unsigned int num_bufs;
+ uint16_t *buf_idx;
+ struct rte_comp_xform **compress_xforms;
+ struct rte_comp_xform **decompress_xforms;
+ unsigned int num_xforms;
+};
+
+struct test_data_params {
+ enum rte_comp_op_type state;
+ unsigned int sgl;
+ enum zlib_direction zlib_dir;
+};
+
static struct comp_testsuite_params testsuite_params = { 0 };
static void
@@ -650,17 +665,19 @@ prepare_sgl_bufs(const char *test_buf, struct rte_mbuf *head_buf,
* Compresses and decompresses buffer with compressdev API and Zlib API
*/
static int
-test_deflate_comp_decomp(const char * const test_bufs[],
- unsigned int num_bufs,
- uint16_t buf_idx[],
- struct rte_comp_xform *compress_xforms[],
- struct rte_comp_xform *decompress_xforms[],
- unsigned int num_xforms,
- enum rte_comp_op_type state,
- unsigned int sgl,
- enum zlib_direction zlib_dir)
+test_deflate_comp_decomp(const struct interim_data_params *int_data,
+ const struct test_data_params *test_data)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
+ const char * const *test_bufs = int_data->test_bufs;
+ unsigned int num_bufs = int_data->num_bufs;
+ uint16_t *buf_idx = int_data->buf_idx;
+ struct rte_comp_xform **compress_xforms = int_data->compress_xforms;
+ struct rte_comp_xform **decompress_xforms = int_data->decompress_xforms;
+ unsigned int num_xforms = int_data->num_xforms;
+ enum rte_comp_op_type state = test_data->state;
+ unsigned int sgl = test_data->sgl;
+ enum zlib_direction zlib_dir = test_data->zlib_dir;
int ret_status = -1;
int ret;
struct rte_mbuf *uncomp_bufs[num_bufs];
@@ -1179,7 +1196,6 @@ static int
test_compressdev_deflate_stateless_fixed(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
- const char *test_buffer;
uint16_t i;
int ret;
const struct rte_compressdev_capabilities *capab;
@@ -1204,31 +1220,35 @@ test_compressdev_deflate_stateless_fixed(void)
sizeof(struct rte_comp_xform));
compress_xform->compress.deflate.huffman = RTE_COMP_HUFFMAN_FIXED;
+ struct interim_data_params int_data = {
+ NULL,
+ 1,
+ NULL,
+ &compress_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
/* Compress with Zlib, decompress with compressdev */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1245,7 +1265,6 @@ static int
test_compressdev_deflate_stateless_dynamic(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
- const char *test_buffer;
uint16_t i;
int ret;
struct rte_comp_xform *compress_xform =
@@ -1270,31 +1289,35 @@ test_compressdev_deflate_stateless_dynamic(void)
sizeof(struct rte_comp_xform));
compress_xform->compress.deflate.huffman = RTE_COMP_HUFFMAN_DYNAMIC;
+ struct interim_data_params int_data = {
+ NULL,
+ 1,
+ NULL,
+ &compress_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
/* Compress with Zlib, decompress with compressdev */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1318,26 +1341,29 @@ test_compressdev_deflate_stateless_multi_op(void)
for (i = 0; i < num_bufs; i++)
buf_idx[i] = i;
+ struct interim_data_params int_data = {
+ compress_test_bufs,
+ num_bufs,
+ buf_idx,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(compress_test_bufs, num_bufs,
- buf_idx,
- &ts_params->def_comp_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS) < 0)
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
return TEST_FAILED;
/* Compress with Zlib, decompress with compressdev */
- if (test_deflate_comp_decomp(compress_test_bufs, num_bufs,
- buf_idx,
- &ts_params->def_comp_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS) < 0)
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
return TEST_FAILED;
return TEST_SUCCESS;
@@ -1347,7 +1373,6 @@ static int
test_compressdev_deflate_stateless_multi_level(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
- const char *test_buffer;
unsigned int level;
uint16_t i;
int ret;
@@ -1364,20 +1389,31 @@ test_compressdev_deflate_stateless_multi_level(void)
memcpy(compress_xform, ts_params->def_comp_xform,
sizeof(struct rte_comp_xform));
+ struct interim_data_params int_data = {
+ NULL,
+ 1,
+ NULL,
+ &compress_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
+
for (level = RTE_COMP_LEVEL_MIN; level <= RTE_COMP_LEVEL_MAX;
level++) {
compress_xform->compress.level = level;
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1440,15 +1476,24 @@ test_compressdev_deflate_stateless_multi_xform(void)
/* Use the same buffer in all sessions */
test_buffers[i] = compress_test_bufs[0];
}
+
+ struct interim_data_params int_data = {
+ test_buffers,
+ num_bufs,
+ buf_idx,
+ compress_xforms,
+ decompress_xforms,
+ NUM_XFORMS
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(test_buffers, num_bufs,
- buf_idx,
- compress_xforms,
- decompress_xforms,
- NUM_XFORMS,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS) < 0) {
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1468,7 +1513,6 @@ test_compressdev_deflate_stateless_sgl(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
uint16_t i;
- const char *test_buffer;
const struct rte_compressdev_capabilities *capab;
capab = rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
@@ -1477,28 +1521,33 @@ test_compressdev_deflate_stateless_sgl(void)
if ((capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_SGL_OUT) == 0)
return -ENOTSUP;
+ struct interim_data_params int_data = {
+ NULL,
+ 1,
+ NULL,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 1,
+ ZLIB_DECOMPRESS
+ };
+
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
+
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &ts_params->def_comp_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 1,
- ZLIB_DECOMPRESS) < 0)
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
return TEST_FAILED;
/* Compress with Zlib, decompress with compressdev */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &ts_params->def_comp_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 1,
- ZLIB_COMPRESS) < 0)
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
return TEST_FAILED;
}
@@ -1510,7 +1559,6 @@ static int
test_compressdev_deflate_stateless_checksum(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
- const char *test_buffer;
uint16_t i;
int ret;
const struct rte_compressdev_capabilities *capab;
@@ -1549,25 +1597,36 @@ test_compressdev_deflate_stateless_checksum(void)
memcpy(decompress_xform, ts_params->def_decomp_xform,
sizeof(struct rte_comp_xform));
+ struct interim_data_params int_data = {
+ NULL,
+ 1,
+ NULL,
+ &compress_xform,
+ &decompress_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
/* Check if driver supports crc32 checksum and test */
if ((capab->comp_feature_flags & RTE_COMP_FF_CRC32_CHECKSUM)) {
compress_xform->compress.chksum = RTE_COMP_CHECKSUM_CRC32;
decompress_xform->decompress.chksum = RTE_COMP_CHECKSUM_CRC32;
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ /* Compress with compressdev, decompress with Zlib */
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
/* Generate zlib checksum and test against selected
* drivers decompression checksum
*/
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &decompress_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1575,14 +1634,8 @@ test_compressdev_deflate_stateless_checksum(void)
/* Generate compression and decompression
* checksum of selected driver
*/
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &decompress_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_NONE) < 0) {
+ test_data.zlib_dir = ZLIB_NONE;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1595,33 +1648,22 @@ test_compressdev_deflate_stateless_checksum(void)
decompress_xform->decompress.chksum = RTE_COMP_CHECKSUM_ADLER32;
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
/* Generate zlib checksum and test against selected
* drivers decompression checksum
*/
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &decompress_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
/* Generate compression and decompression
* checksum of selected driver
*/
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &decompress_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_NONE) < 0) {
+ test_data.zlib_dir = ZLIB_NONE;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1636,19 +1678,14 @@ test_compressdev_deflate_stateless_checksum(void)
RTE_COMP_CHECKSUM_CRC32_ADLER32;
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
/* Generate compression and decompression
* checksum of selected driver
*/
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &decompress_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_NONE) < 0) {
+ test_data.zlib_dir = ZLIB_NONE;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [dpdk-dev] [PATCH v3 2/3] test/compress: add out of space test
2019-01-11 15:08 ` [dpdk-dev] [PATCH v3 0/3] Compression Unit Tests Kovacevic, Marko
2019-01-11 15:08 ` [dpdk-dev] [PATCH v3 1/3] test/compress: refactor main test function Kovacevic, Marko
@ 2019-01-11 15:08 ` Kovacevic, Marko
2019-01-11 15:09 ` [dpdk-dev] [PATCH v3 3/3] test/compress: add varied buffer input/outputs Kovacevic, Marko
2 siblings, 0 replies; 25+ messages in thread
From: Kovacevic, Marko @ 2019-01-11 15:08 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, pablo.de.lara.guarch, Kovacevic, Marko, Kovacevic
This patch adds new out of space testcase to check
that the destination mbuf is smaller than required for
the output of compression to ensure the driver doesn't crash
and returns the valid error case.
Signed-off-by: Kovacevic, Marko <marko.kovacevic@intel.com>
---
test/test/test_compressdev.c | 178 +++++++++++++++++++++++++++++++++++++++----
1 file changed, 165 insertions(+), 13 deletions(-)
diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index 20895fc..1e41113 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -42,6 +42,8 @@
#define GZIP_HEADER_SIZE 10
#define GZIP_TRAILER_SIZE 8
+#define OUT_OF_SPACE_BUF 1
+
const char *
huffman_type_strings[] = {
[RTE_COMP_HUFFMAN_DEFAULT] = "PMD default",
@@ -81,6 +83,7 @@ struct test_data_params {
enum rte_comp_op_type state;
unsigned int sgl;
enum zlib_direction zlib_dir;
+ unsigned int out_of_space;
};
static struct comp_testsuite_params testsuite_params = { 0 };
@@ -677,6 +680,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
unsigned int num_xforms = int_data->num_xforms;
enum rte_comp_op_type state = test_data->state;
unsigned int sgl = test_data->sgl;
+ unsigned int out_of_space = test_data->out_of_space;
enum zlib_direction zlib_dir = test_data->zlib_dir;
int ret_status = -1;
int ret;
@@ -693,6 +697,12 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
unsigned int i;
struct rte_mempool *buf_pool;
uint32_t data_size;
+ /* Compressing with CompressDev */
+ unsigned int oos_zlib_decompress =
+ (zlib_dir == ZLIB_NONE || zlib_dir == ZLIB_DECOMPRESS);
+ /* Decompressing with CompressDev */
+ unsigned int oos_zlib_compress =
+ (zlib_dir == ZLIB_NONE || zlib_dir == ZLIB_COMPRESS);
const struct rte_compressdev_capabilities *capa =
rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
char *contig_buf = NULL;
@@ -749,8 +759,12 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
if (sgl) {
for (i = 0; i < num_bufs; i++) {
- data_size = strlen(test_bufs[i]) *
- COMPRESS_BUF_SIZE_RATIO;
+ if (out_of_space == 1 && oos_zlib_decompress) {
+ data_size = OUT_OF_SPACE_BUF;
+ } else {
+ (data_size = strlen(test_bufs[i]) *
+ COMPRESS_BUF_SIZE_RATIO);
+ }
if (prepare_sgl_bufs(NULL, comp_bufs[i],
data_size,
ts_params->small_mbuf_pool,
@@ -761,8 +775,12 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
} else {
for (i = 0; i < num_bufs; i++) {
- data_size = strlen(test_bufs[i]) *
- COMPRESS_BUF_SIZE_RATIO;
+ if (out_of_space == 1 && oos_zlib_decompress) {
+ data_size = OUT_OF_SPACE_BUF;
+ } else {
+ (data_size = strlen(test_bufs[i]) *
+ COMPRESS_BUF_SIZE_RATIO);
+ }
rte_pktmbuf_append(comp_bufs[i], data_size);
}
}
@@ -928,6 +946,18 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
* compress operation information is needed for the decompression stage)
*/
for (i = 0; i < num_bufs; i++) {
+ if (out_of_space && oos_zlib_decompress) {
+ if (ops_processed[i]->status !=
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED) {
+ ret_status = -1;
+
+ RTE_LOG(ERR, USER1,
+ "Out of Space operation was not successful\n");
+ goto exit;
+ } else
+ continue;
+ }
+
if (ops_processed[i]->status != RTE_COMP_OP_STATUS_SUCCESS) {
RTE_LOG(ERR, USER1,
"Some operations were not successful\n");
@@ -938,6 +968,11 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
uncomp_bufs[priv_data->orig_idx] = NULL;
}
+ if (out_of_space && oos_zlib_decompress) {
+ ret_status = 0;
+ goto exit;
+ }
+
/* Allocate buffers for decompressed data */
ret = rte_pktmbuf_alloc_bulk(buf_pool, uncomp_bufs, num_bufs);
if (ret < 0) {
@@ -951,7 +986,12 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
for (i = 0; i < num_bufs; i++) {
priv_data = (struct priv_op_data *)
(ops_processed[i] + 1);
- data_size = strlen(test_bufs[priv_data->orig_idx]) + 1;
+ if (out_of_space == 1 && oos_zlib_compress)
+ data_size = OUT_OF_SPACE_BUF;
+ else
+ data_size =
+ strlen(test_bufs[priv_data->orig_idx]) + 1;
+
if (prepare_sgl_bufs(NULL, uncomp_bufs[i],
data_size,
ts_params->small_mbuf_pool,
@@ -964,7 +1004,12 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
for (i = 0; i < num_bufs; i++) {
priv_data = (struct priv_op_data *)
(ops_processed[i] + 1);
- data_size = strlen(test_bufs[priv_data->orig_idx]) + 1;
+ if (out_of_space == 1 && oos_zlib_compress)
+ data_size = OUT_OF_SPACE_BUF;
+ else
+ data_size =
+ strlen(test_bufs[priv_data->orig_idx]) + 1;
+
rte_pktmbuf_append(uncomp_bufs[i], data_size);
}
}
@@ -1125,6 +1170,18 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
* compress operation information is still needed)
*/
for (i = 0; i < num_bufs; i++) {
+ if (out_of_space && oos_zlib_compress) {
+ if (ops_processed[i]->status !=
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED) {
+ ret_status = -1;
+
+ RTE_LOG(ERR, USER1,
+ "Out of Space operation was not successful\n");
+ goto exit;
+ } else
+ continue;
+ }
+
if (ops_processed[i]->status != RTE_COMP_OP_STATUS_SUCCESS) {
RTE_LOG(ERR, USER1,
"Some operations were not successful\n");
@@ -1135,6 +1192,11 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
comp_bufs[priv_data->orig_idx] = NULL;
}
+ if (out_of_space && oos_zlib_compress) {
+ ret_status = 0;
+ goto exit;
+ }
+
/*
* Compare the original stream with the decompressed stream
* (in size and the data)
@@ -1232,7 +1294,8 @@ test_compressdev_deflate_stateless_fixed(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1301,7 +1364,8 @@ test_compressdev_deflate_stateless_dynamic(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1353,7 +1417,8 @@ test_compressdev_deflate_stateless_multi_op(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
/* Compress with compressdev, decompress with Zlib */
@@ -1401,7 +1466,8 @@ test_compressdev_deflate_stateless_multi_level(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1489,7 +1555,8 @@ test_compressdev_deflate_stateless_multi_xform(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
/* Compress with compressdev, decompress with Zlib */
@@ -1533,7 +1600,8 @@ test_compressdev_deflate_stateless_sgl(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
1,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1609,7 +1677,8 @@ test_compressdev_deflate_stateless_checksum(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
/* Check if driver supports crc32 checksum and test */
@@ -1700,6 +1769,87 @@ test_compressdev_deflate_stateless_checksum(void)
return ret;
}
+static int
+test_compressdev_out_of_space_buffer(void)
+{
+ struct comp_testsuite_params *ts_params = &testsuite_params;
+ int ret;
+ uint16_t i;
+ const struct rte_compressdev_capabilities *capab;
+
+ RTE_LOG(INFO, USER1, "This is a negative test errors are expected\n");
+
+ capab = rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
+ TEST_ASSERT(capab != NULL, "Failed to retrieve device capabilities");
+
+ if ((capab->comp_feature_flags & RTE_COMP_FF_HUFFMAN_FIXED) == 0)
+ return -ENOTSUP;
+
+ struct rte_comp_xform *compress_xform =
+ rte_malloc(NULL, sizeof(struct rte_comp_xform), 0);
+
+ if (compress_xform == NULL) {
+ RTE_LOG(ERR, USER1,
+ "Compress xform could not be created\n");
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ struct interim_data_params int_data = {
+ &compress_test_bufs[0],
+ 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS,
+ 1
+ };
+ /* Compress with compressdev, decompress with Zlib */
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ /* Compress with Zlib, decompress with compressdev */
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_SGL_OUT) {
+ /* Compress with compressdev, decompress with Zlib */
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ test_data.sgl = 1;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ /* Compress with Zlib, decompress with compressdev */
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ test_data.sgl = 1;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+ }
+
+ ret = TEST_SUCCESS;
+
+exit:
+ rte_free(compress_xform);
+ return ret;
+}
+
+
static struct unit_test_suite compressdev_testsuite = {
.suite_name = "compressdev unit test suite",
.setup = testsuite_setup,
@@ -1721,6 +1871,8 @@ static struct unit_test_suite compressdev_testsuite = {
test_compressdev_deflate_stateless_sgl),
TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
test_compressdev_deflate_stateless_checksum),
+ TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
+ test_compressdev_out_of_space_buffer),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [dpdk-dev] [PATCH v3 3/3] test/compress: add varied buffer input/outputs
2019-01-11 15:08 ` [dpdk-dev] [PATCH v3 0/3] Compression Unit Tests Kovacevic, Marko
2019-01-11 15:08 ` [dpdk-dev] [PATCH v3 1/3] test/compress: refactor main test function Kovacevic, Marko
2019-01-11 15:08 ` [dpdk-dev] [PATCH v3 2/3] test/compress: add out of space test Kovacevic, Marko
@ 2019-01-11 15:09 ` Kovacevic, Marko
2 siblings, 0 replies; 25+ messages in thread
From: Kovacevic, Marko @ 2019-01-11 15:09 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, pablo.de.lara.guarch, Kovacevic, Marko, Kovacevic
Added unit test to check if a SGL buffer
was added as an input and a Linear Buffer
as output and vice versa so we can test if the
application would process the different buffers
properly.
Signed-off-by: Kovacevic, Marko <marko.kovacevic@intel.com>
---
test/test/test_compressdev.c | 123 ++++++++++++++++++++++++++++++-------------
1 file changed, 87 insertions(+), 36 deletions(-)
diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index 1e41113..9c43ed1 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -58,6 +58,13 @@ enum zlib_direction {
ZLIB_ALL
};
+enum varied_buff {
+ LB_BOTH = 0, /* both input and output are linear*/
+ SGL_BOTH, /* both input and output are chained */
+ SGL_TO_LB, /* input buffer is chained */
+ LB_TO_SGL /* output buffer is chained */
+};
+
struct priv_op_data {
uint16_t orig_idx;
};
@@ -81,7 +88,7 @@ struct interim_data_params {
struct test_data_params {
enum rte_comp_op_type state;
- unsigned int sgl;
+ enum varied_buff buff_type;
enum zlib_direction zlib_dir;
unsigned int out_of_space;
};
@@ -368,7 +375,7 @@ compress_zlib(struct rte_comp_op *op,
}
/* Assuming stateless operation */
- /* SGL */
+ /* SGL Input */
if (op->m_src->nb_segs > 1) {
single_src_buf = rte_malloc(NULL,
rte_pktmbuf_pkt_len(op->m_src), 0);
@@ -376,14 +383,10 @@ compress_zlib(struct rte_comp_op *op,
RTE_LOG(ERR, USER1, "Buffer could not be allocated\n");
goto exit;
}
- single_dst_buf = rte_malloc(NULL,
- rte_pktmbuf_pkt_len(op->m_dst), 0);
- if (single_dst_buf == NULL) {
- RTE_LOG(ERR, USER1, "Buffer could not be allocated\n");
- goto exit;
- }
- if (rte_pktmbuf_read(op->m_src, 0,
- rte_pktmbuf_pkt_len(op->m_src),
+
+ if (rte_pktmbuf_read(op->m_src, op->src.offset,
+ rte_pktmbuf_pkt_len(op->m_src) -
+ op->src.offset,
single_src_buf) == NULL) {
RTE_LOG(ERR, USER1,
"Buffer could not be read entirely\n");
@@ -392,15 +395,31 @@ compress_zlib(struct rte_comp_op *op,
stream.avail_in = op->src.length;
stream.next_in = single_src_buf;
- stream.avail_out = rte_pktmbuf_pkt_len(op->m_dst);
- stream.next_out = single_dst_buf;
} else {
stream.avail_in = op->src.length;
- stream.next_in = rte_pktmbuf_mtod(op->m_src, uint8_t *);
+ stream.next_in = rte_pktmbuf_mtod_offset(op->m_src, uint8_t *,
+ op->src.offset);
+ }
+ /* SGL output */
+ if (op->m_dst->nb_segs > 1) {
+
+ single_dst_buf = rte_malloc(NULL,
+ rte_pktmbuf_pkt_len(op->m_dst), 0);
+ if (single_dst_buf == NULL) {
+ RTE_LOG(ERR, USER1, "Buffer could not be allocated\n");
+ goto exit;
+ }
+
+ stream.avail_out = op->m_dst->pkt_len;
+ stream.next_out = single_dst_buf;
+
+ } else {/* linear output */
stream.avail_out = op->m_dst->data_len;
- stream.next_out = rte_pktmbuf_mtod(op->m_dst, uint8_t *);
+ stream.next_out = rte_pktmbuf_mtod_offset(op->m_dst, uint8_t *,
+ op->dst.offset);
}
+
/* Stateless operation, all buffer will be compressed in one go */
zlib_flush = map_zlib_flush_flag(op->flush_flag);
ret = deflate(&stream, zlib_flush);
@@ -414,14 +433,14 @@ compress_zlib(struct rte_comp_op *op,
goto exit;
/* Copy data to destination SGL */
- if (op->m_src->nb_segs > 1) {
+ if (op->m_dst->nb_segs > 1) {
uint32_t remaining_data = stream.total_out;
uint8_t *src_data = single_dst_buf;
struct rte_mbuf *dst_buf = op->m_dst;
while (remaining_data > 0) {
- uint8_t *dst_data = rte_pktmbuf_mtod(dst_buf,
- uint8_t *);
+ uint8_t *dst_data = rte_pktmbuf_mtod_offset(dst_buf,
+ uint8_t *, op->dst.offset);
/* Last segment */
if (remaining_data < dst_buf->data_len) {
memcpy(dst_data, src_data, remaining_data);
@@ -438,12 +457,14 @@ compress_zlib(struct rte_comp_op *op,
op->consumed = stream.total_in;
if (xform->compress.chksum == RTE_COMP_CHECKSUM_ADLER32) {
rte_pktmbuf_adj(op->m_dst, ZLIB_HEADER_SIZE);
- op->produced = stream.total_out -
- (ZLIB_HEADER_SIZE + ZLIB_TRAILER_SIZE);
+ rte_pktmbuf_trim(op->m_dst, ZLIB_TRAILER_SIZE);
+ op->produced = stream.total_out - (ZLIB_HEADER_SIZE +
+ ZLIB_TRAILER_SIZE);
} else if (xform->compress.chksum == RTE_COMP_CHECKSUM_CRC32) {
rte_pktmbuf_adj(op->m_dst, GZIP_HEADER_SIZE);
- op->produced = stream.total_out -
- (GZIP_HEADER_SIZE + GZIP_TRAILER_SIZE);
+ rte_pktmbuf_trim(op->m_dst, GZIP_TRAILER_SIZE);
+ op->produced = stream.total_out - (GZIP_HEADER_SIZE +
+ GZIP_TRAILER_SIZE);
} else
op->produced = stream.total_out;
@@ -679,7 +700,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
struct rte_comp_xform **decompress_xforms = int_data->decompress_xforms;
unsigned int num_xforms = int_data->num_xforms;
enum rte_comp_op_type state = test_data->state;
- unsigned int sgl = test_data->sgl;
+ unsigned int buff_type = test_data->buff_type;
unsigned int out_of_space = test_data->out_of_space;
enum zlib_direction zlib_dir = test_data->zlib_dir;
int ret_status = -1;
@@ -715,7 +736,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
memset(ops_processed, 0, sizeof(struct rte_comp_op *) * num_bufs);
memset(priv_xforms, 0, sizeof(void *) * num_bufs);
- if (sgl)
+ if (buff_type == SGL_BOTH)
buf_pool = ts_params->small_mbuf_pool;
else
buf_pool = ts_params->large_mbuf_pool;
@@ -730,7 +751,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
goto exit;
}
- if (sgl) {
+ if (buff_type == SGL_BOTH || buff_type == SGL_TO_LB) {
for (i = 0; i < num_bufs; i++) {
data_size = strlen(test_bufs[i]) + 1;
if (prepare_sgl_bufs(test_bufs[i], uncomp_bufs[i],
@@ -757,7 +778,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
goto exit;
}
- if (sgl) {
+ if (buff_type == SGL_BOTH || buff_type == LB_TO_SGL) {
for (i = 0; i < num_bufs; i++) {
if (out_of_space == 1 && oos_zlib_decompress) {
data_size = OUT_OF_SPACE_BUF;
@@ -982,7 +1003,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
goto exit;
}
- if (sgl) {
+ if (buff_type == SGL_BOTH || buff_type == LB_TO_SGL) {
for (i = 0; i < num_bufs; i++) {
priv_data = (struct priv_op_data *)
(ops_processed[i] + 1);
@@ -1293,7 +1314,7 @@ test_compressdev_deflate_stateless_fixed(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1363,7 +1384,7 @@ test_compressdev_deflate_stateless_dynamic(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1416,7 +1437,7 @@ test_compressdev_deflate_stateless_multi_op(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1465,7 +1486,7 @@ test_compressdev_deflate_stateless_multi_level(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1554,7 +1575,7 @@ test_compressdev_deflate_stateless_multi_xform(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1599,7 +1620,7 @@ test_compressdev_deflate_stateless_sgl(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 1,
+ SGL_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1617,6 +1638,36 @@ test_compressdev_deflate_stateless_sgl(void)
test_data.zlib_dir = ZLIB_COMPRESS;
if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
return TEST_FAILED;
+
+ if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_LB_OUT) {
+ /* Compress with compressdev, decompress with Zlib */
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ test_data.buff_type = SGL_TO_LB;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
+ return TEST_FAILED;
+
+ /* Compress with Zlib, decompress with compressdev */
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ test_data.buff_type = SGL_TO_LB;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
+ return TEST_FAILED;
+ }
+
+ if (capab->comp_feature_flags & RTE_COMP_FF_OOP_LB_IN_SGL_OUT) {
+ /* Compress with compressdev, decompress with Zlib */
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ test_data.buff_type = LB_TO_SGL;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
+ return TEST_FAILED;
+
+ /* Compress with Zlib, decompress with compressdev */
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ test_data.buff_type = LB_TO_SGL;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
+ return TEST_FAILED;
+ }
+
+
}
return TEST_SUCCESS;
@@ -1676,7 +1727,7 @@ test_compressdev_deflate_stateless_checksum(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1806,7 +1857,7 @@ test_compressdev_out_of_space_buffer(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
1
};
@@ -1827,7 +1878,7 @@ test_compressdev_out_of_space_buffer(void)
if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_SGL_OUT) {
/* Compress with compressdev, decompress with Zlib */
test_data.zlib_dir = ZLIB_DECOMPRESS;
- test_data.sgl = 1;
+ test_data.buff_type = SGL_BOTH;
if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1835,7 +1886,7 @@ test_compressdev_out_of_space_buffer(void)
/* Compress with Zlib, decompress with compressdev */
test_data.zlib_dir = ZLIB_COMPRESS;
- test_data.sgl = 1;
+ test_data.buff_type = SGL_BOTH;
if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [dpdk-dev] [PATCH v4 0/3] Compression Unit Tests
2019-01-11 15:08 ` [dpdk-dev] [PATCH v3 1/3] test/compress: refactor main test function Kovacevic, Marko
@ 2019-01-11 16:52 ` Kovacevic, Marko
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 1/3] test/compress: refactor main test function Kovacevic, Marko
` (2 more replies)
0 siblings, 3 replies; 25+ messages in thread
From: Kovacevic, Marko @ 2019-01-11 16:52 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, pablo.de.lara.guarch, Kovacevic, Marko
Made changes to the two unit tests for the out of space i have added
proper checkes for all the cases compressing with compress dev and
decompressing with compress dev.
Varied buffer patch i have removed the extra unit test and merged it
into the sgl test as one.
Added a third patch into my patch set this patch refactors the
test_deflate_comp_decomp to make it a less congested with parameters
Kovacevic, Marko (2):
test/compress: add out of space test
test/compress: add varied buffer input/outputs
Pablo de Lara (1):
test/compress: refactor main test function
test/test/test_compressdev.c | 583 ++++++++++++++++++++++++++++++-------------
1 file changed, 412 insertions(+), 171 deletions(-)
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [dpdk-dev] [PATCH v4 1/3] test/compress: refactor main test function
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 0/3] Compression Unit Tests Kovacevic, Marko
@ 2019-01-11 16:52 ` Kovacevic, Marko
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 0/3] Compression Unit Tests Kovacevic, Marko
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 2/3] test/compress: add out of space test Kovacevic, Marko
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 3/3] test/compress: add varied buffer input/outputs Kovacevic, Marko
2 siblings, 1 reply; 25+ messages in thread
From: Kovacevic, Marko @ 2019-01-11 16:52 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, pablo.de.lara.guarch
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Since the start of the compression tests,
the main test function, test_deflate_comp_decomp,
has increased its parameter with each new test added.
In order to make the code cleaner, and more scalable,
these parameters have been divided into two structures,
which are now passed as the sole arguments of the function.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
test/test/test_compressdev.c | 319 ++++++++++++++++++++++++-------------------
1 file changed, 178 insertions(+), 141 deletions(-)
diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index 6a2a341..20895fc 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -68,6 +68,21 @@ struct comp_testsuite_params {
struct rte_comp_xform *def_decomp_xform;
};
+struct interim_data_params {
+ const char * const *test_bufs;
+ unsigned int num_bufs;
+ uint16_t *buf_idx;
+ struct rte_comp_xform **compress_xforms;
+ struct rte_comp_xform **decompress_xforms;
+ unsigned int num_xforms;
+};
+
+struct test_data_params {
+ enum rte_comp_op_type state;
+ unsigned int sgl;
+ enum zlib_direction zlib_dir;
+};
+
static struct comp_testsuite_params testsuite_params = { 0 };
static void
@@ -650,17 +665,19 @@ prepare_sgl_bufs(const char *test_buf, struct rte_mbuf *head_buf,
* Compresses and decompresses buffer with compressdev API and Zlib API
*/
static int
-test_deflate_comp_decomp(const char * const test_bufs[],
- unsigned int num_bufs,
- uint16_t buf_idx[],
- struct rte_comp_xform *compress_xforms[],
- struct rte_comp_xform *decompress_xforms[],
- unsigned int num_xforms,
- enum rte_comp_op_type state,
- unsigned int sgl,
- enum zlib_direction zlib_dir)
+test_deflate_comp_decomp(const struct interim_data_params *int_data,
+ const struct test_data_params *test_data)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
+ const char * const *test_bufs = int_data->test_bufs;
+ unsigned int num_bufs = int_data->num_bufs;
+ uint16_t *buf_idx = int_data->buf_idx;
+ struct rte_comp_xform **compress_xforms = int_data->compress_xforms;
+ struct rte_comp_xform **decompress_xforms = int_data->decompress_xforms;
+ unsigned int num_xforms = int_data->num_xforms;
+ enum rte_comp_op_type state = test_data->state;
+ unsigned int sgl = test_data->sgl;
+ enum zlib_direction zlib_dir = test_data->zlib_dir;
int ret_status = -1;
int ret;
struct rte_mbuf *uncomp_bufs[num_bufs];
@@ -1179,7 +1196,6 @@ static int
test_compressdev_deflate_stateless_fixed(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
- const char *test_buffer;
uint16_t i;
int ret;
const struct rte_compressdev_capabilities *capab;
@@ -1204,31 +1220,35 @@ test_compressdev_deflate_stateless_fixed(void)
sizeof(struct rte_comp_xform));
compress_xform->compress.deflate.huffman = RTE_COMP_HUFFMAN_FIXED;
+ struct interim_data_params int_data = {
+ NULL,
+ 1,
+ NULL,
+ &compress_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
/* Compress with Zlib, decompress with compressdev */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1245,7 +1265,6 @@ static int
test_compressdev_deflate_stateless_dynamic(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
- const char *test_buffer;
uint16_t i;
int ret;
struct rte_comp_xform *compress_xform =
@@ -1270,31 +1289,35 @@ test_compressdev_deflate_stateless_dynamic(void)
sizeof(struct rte_comp_xform));
compress_xform->compress.deflate.huffman = RTE_COMP_HUFFMAN_DYNAMIC;
+ struct interim_data_params int_data = {
+ NULL,
+ 1,
+ NULL,
+ &compress_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
/* Compress with Zlib, decompress with compressdev */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1318,26 +1341,29 @@ test_compressdev_deflate_stateless_multi_op(void)
for (i = 0; i < num_bufs; i++)
buf_idx[i] = i;
+ struct interim_data_params int_data = {
+ compress_test_bufs,
+ num_bufs,
+ buf_idx,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(compress_test_bufs, num_bufs,
- buf_idx,
- &ts_params->def_comp_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS) < 0)
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
return TEST_FAILED;
/* Compress with Zlib, decompress with compressdev */
- if (test_deflate_comp_decomp(compress_test_bufs, num_bufs,
- buf_idx,
- &ts_params->def_comp_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS) < 0)
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
return TEST_FAILED;
return TEST_SUCCESS;
@@ -1347,7 +1373,6 @@ static int
test_compressdev_deflate_stateless_multi_level(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
- const char *test_buffer;
unsigned int level;
uint16_t i;
int ret;
@@ -1364,20 +1389,31 @@ test_compressdev_deflate_stateless_multi_level(void)
memcpy(compress_xform, ts_params->def_comp_xform,
sizeof(struct rte_comp_xform));
+ struct interim_data_params int_data = {
+ NULL,
+ 1,
+ NULL,
+ &compress_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
+
for (level = RTE_COMP_LEVEL_MIN; level <= RTE_COMP_LEVEL_MAX;
level++) {
compress_xform->compress.level = level;
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1440,15 +1476,24 @@ test_compressdev_deflate_stateless_multi_xform(void)
/* Use the same buffer in all sessions */
test_buffers[i] = compress_test_bufs[0];
}
+
+ struct interim_data_params int_data = {
+ test_buffers,
+ num_bufs,
+ buf_idx,
+ compress_xforms,
+ decompress_xforms,
+ NUM_XFORMS
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(test_buffers, num_bufs,
- buf_idx,
- compress_xforms,
- decompress_xforms,
- NUM_XFORMS,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS) < 0) {
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1468,7 +1513,6 @@ test_compressdev_deflate_stateless_sgl(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
uint16_t i;
- const char *test_buffer;
const struct rte_compressdev_capabilities *capab;
capab = rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
@@ -1477,28 +1521,33 @@ test_compressdev_deflate_stateless_sgl(void)
if ((capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_SGL_OUT) == 0)
return -ENOTSUP;
+ struct interim_data_params int_data = {
+ NULL,
+ 1,
+ NULL,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 1,
+ ZLIB_DECOMPRESS
+ };
+
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
+
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &ts_params->def_comp_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 1,
- ZLIB_DECOMPRESS) < 0)
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
return TEST_FAILED;
/* Compress with Zlib, decompress with compressdev */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &ts_params->def_comp_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 1,
- ZLIB_COMPRESS) < 0)
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
return TEST_FAILED;
}
@@ -1510,7 +1559,6 @@ static int
test_compressdev_deflate_stateless_checksum(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
- const char *test_buffer;
uint16_t i;
int ret;
const struct rte_compressdev_capabilities *capab;
@@ -1549,25 +1597,36 @@ test_compressdev_deflate_stateless_checksum(void)
memcpy(decompress_xform, ts_params->def_decomp_xform,
sizeof(struct rte_comp_xform));
+ struct interim_data_params int_data = {
+ NULL,
+ 1,
+ NULL,
+ &compress_xform,
+ &decompress_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
/* Check if driver supports crc32 checksum and test */
if ((capab->comp_feature_flags & RTE_COMP_FF_CRC32_CHECKSUM)) {
compress_xform->compress.chksum = RTE_COMP_CHECKSUM_CRC32;
decompress_xform->decompress.chksum = RTE_COMP_CHECKSUM_CRC32;
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ /* Compress with compressdev, decompress with Zlib */
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
/* Generate zlib checksum and test against selected
* drivers decompression checksum
*/
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &decompress_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1575,14 +1634,8 @@ test_compressdev_deflate_stateless_checksum(void)
/* Generate compression and decompression
* checksum of selected driver
*/
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &decompress_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_NONE) < 0) {
+ test_data.zlib_dir = ZLIB_NONE;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1595,33 +1648,22 @@ test_compressdev_deflate_stateless_checksum(void)
decompress_xform->decompress.chksum = RTE_COMP_CHECKSUM_ADLER32;
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
/* Generate zlib checksum and test against selected
* drivers decompression checksum
*/
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &decompress_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
/* Generate compression and decompression
* checksum of selected driver
*/
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &decompress_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_NONE) < 0) {
+ test_data.zlib_dir = ZLIB_NONE;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1636,19 +1678,14 @@ test_compressdev_deflate_stateless_checksum(void)
RTE_COMP_CHECKSUM_CRC32_ADLER32;
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
/* Generate compression and decompression
* checksum of selected driver
*/
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &decompress_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_NONE) < 0) {
+ test_data.zlib_dir = ZLIB_NONE;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [dpdk-dev] [PATCH v4 2/3] test/compress: add out of space test
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 0/3] Compression Unit Tests Kovacevic, Marko
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 1/3] test/compress: refactor main test function Kovacevic, Marko
@ 2019-01-11 16:52 ` Kovacevic, Marko
2019-01-16 17:16 ` De Lara Guarch, Pablo
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 3/3] test/compress: add varied buffer input/outputs Kovacevic, Marko
2 siblings, 1 reply; 25+ messages in thread
From: Kovacevic, Marko @ 2019-01-11 16:52 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, pablo.de.lara.guarch, Kovacevic, Marko, Kovacevic
This patch adds new out of space testcase to check
that the destination mbuf is smaller than required for
the output of compression to ensure the driver doesn't crash
and returns the valid error case.
Signed-off-by: Kovacevic, Marko <marko.kovacevic@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
---
v4:
Added Acks
V3:
Made requested changes(Pablo)
---
test/test/test_compressdev.c | 178 +++++++++++++++++++++++++++++++++++++++----
1 file changed, 165 insertions(+), 13 deletions(-)
diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index 20895fc..1e41113 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -42,6 +42,8 @@
#define GZIP_HEADER_SIZE 10
#define GZIP_TRAILER_SIZE 8
+#define OUT_OF_SPACE_BUF 1
+
const char *
huffman_type_strings[] = {
[RTE_COMP_HUFFMAN_DEFAULT] = "PMD default",
@@ -81,6 +83,7 @@ struct test_data_params {
enum rte_comp_op_type state;
unsigned int sgl;
enum zlib_direction zlib_dir;
+ unsigned int out_of_space;
};
static struct comp_testsuite_params testsuite_params = { 0 };
@@ -677,6 +680,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
unsigned int num_xforms = int_data->num_xforms;
enum rte_comp_op_type state = test_data->state;
unsigned int sgl = test_data->sgl;
+ unsigned int out_of_space = test_data->out_of_space;
enum zlib_direction zlib_dir = test_data->zlib_dir;
int ret_status = -1;
int ret;
@@ -693,6 +697,12 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
unsigned int i;
struct rte_mempool *buf_pool;
uint32_t data_size;
+ /* Compressing with CompressDev */
+ unsigned int oos_zlib_decompress =
+ (zlib_dir == ZLIB_NONE || zlib_dir == ZLIB_DECOMPRESS);
+ /* Decompressing with CompressDev */
+ unsigned int oos_zlib_compress =
+ (zlib_dir == ZLIB_NONE || zlib_dir == ZLIB_COMPRESS);
const struct rte_compressdev_capabilities *capa =
rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
char *contig_buf = NULL;
@@ -749,8 +759,12 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
if (sgl) {
for (i = 0; i < num_bufs; i++) {
- data_size = strlen(test_bufs[i]) *
- COMPRESS_BUF_SIZE_RATIO;
+ if (out_of_space == 1 && oos_zlib_decompress) {
+ data_size = OUT_OF_SPACE_BUF;
+ } else {
+ (data_size = strlen(test_bufs[i]) *
+ COMPRESS_BUF_SIZE_RATIO);
+ }
if (prepare_sgl_bufs(NULL, comp_bufs[i],
data_size,
ts_params->small_mbuf_pool,
@@ -761,8 +775,12 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
} else {
for (i = 0; i < num_bufs; i++) {
- data_size = strlen(test_bufs[i]) *
- COMPRESS_BUF_SIZE_RATIO;
+ if (out_of_space == 1 && oos_zlib_decompress) {
+ data_size = OUT_OF_SPACE_BUF;
+ } else {
+ (data_size = strlen(test_bufs[i]) *
+ COMPRESS_BUF_SIZE_RATIO);
+ }
rte_pktmbuf_append(comp_bufs[i], data_size);
}
}
@@ -928,6 +946,18 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
* compress operation information is needed for the decompression stage)
*/
for (i = 0; i < num_bufs; i++) {
+ if (out_of_space && oos_zlib_decompress) {
+ if (ops_processed[i]->status !=
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED) {
+ ret_status = -1;
+
+ RTE_LOG(ERR, USER1,
+ "Out of Space operation was not successful\n");
+ goto exit;
+ } else
+ continue;
+ }
+
if (ops_processed[i]->status != RTE_COMP_OP_STATUS_SUCCESS) {
RTE_LOG(ERR, USER1,
"Some operations were not successful\n");
@@ -938,6 +968,11 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
uncomp_bufs[priv_data->orig_idx] = NULL;
}
+ if (out_of_space && oos_zlib_decompress) {
+ ret_status = 0;
+ goto exit;
+ }
+
/* Allocate buffers for decompressed data */
ret = rte_pktmbuf_alloc_bulk(buf_pool, uncomp_bufs, num_bufs);
if (ret < 0) {
@@ -951,7 +986,12 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
for (i = 0; i < num_bufs; i++) {
priv_data = (struct priv_op_data *)
(ops_processed[i] + 1);
- data_size = strlen(test_bufs[priv_data->orig_idx]) + 1;
+ if (out_of_space == 1 && oos_zlib_compress)
+ data_size = OUT_OF_SPACE_BUF;
+ else
+ data_size =
+ strlen(test_bufs[priv_data->orig_idx]) + 1;
+
if (prepare_sgl_bufs(NULL, uncomp_bufs[i],
data_size,
ts_params->small_mbuf_pool,
@@ -964,7 +1004,12 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
for (i = 0; i < num_bufs; i++) {
priv_data = (struct priv_op_data *)
(ops_processed[i] + 1);
- data_size = strlen(test_bufs[priv_data->orig_idx]) + 1;
+ if (out_of_space == 1 && oos_zlib_compress)
+ data_size = OUT_OF_SPACE_BUF;
+ else
+ data_size =
+ strlen(test_bufs[priv_data->orig_idx]) + 1;
+
rte_pktmbuf_append(uncomp_bufs[i], data_size);
}
}
@@ -1125,6 +1170,18 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
* compress operation information is still needed)
*/
for (i = 0; i < num_bufs; i++) {
+ if (out_of_space && oos_zlib_compress) {
+ if (ops_processed[i]->status !=
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED) {
+ ret_status = -1;
+
+ RTE_LOG(ERR, USER1,
+ "Out of Space operation was not successful\n");
+ goto exit;
+ } else
+ continue;
+ }
+
if (ops_processed[i]->status != RTE_COMP_OP_STATUS_SUCCESS) {
RTE_LOG(ERR, USER1,
"Some operations were not successful\n");
@@ -1135,6 +1192,11 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
comp_bufs[priv_data->orig_idx] = NULL;
}
+ if (out_of_space && oos_zlib_compress) {
+ ret_status = 0;
+ goto exit;
+ }
+
/*
* Compare the original stream with the decompressed stream
* (in size and the data)
@@ -1232,7 +1294,8 @@ test_compressdev_deflate_stateless_fixed(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1301,7 +1364,8 @@ test_compressdev_deflate_stateless_dynamic(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1353,7 +1417,8 @@ test_compressdev_deflate_stateless_multi_op(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
/* Compress with compressdev, decompress with Zlib */
@@ -1401,7 +1466,8 @@ test_compressdev_deflate_stateless_multi_level(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1489,7 +1555,8 @@ test_compressdev_deflate_stateless_multi_xform(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
/* Compress with compressdev, decompress with Zlib */
@@ -1533,7 +1600,8 @@ test_compressdev_deflate_stateless_sgl(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
1,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1609,7 +1677,8 @@ test_compressdev_deflate_stateless_checksum(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
/* Check if driver supports crc32 checksum and test */
@@ -1700,6 +1769,87 @@ test_compressdev_deflate_stateless_checksum(void)
return ret;
}
+static int
+test_compressdev_out_of_space_buffer(void)
+{
+ struct comp_testsuite_params *ts_params = &testsuite_params;
+ int ret;
+ uint16_t i;
+ const struct rte_compressdev_capabilities *capab;
+
+ RTE_LOG(INFO, USER1, "This is a negative test errors are expected\n");
+
+ capab = rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
+ TEST_ASSERT(capab != NULL, "Failed to retrieve device capabilities");
+
+ if ((capab->comp_feature_flags & RTE_COMP_FF_HUFFMAN_FIXED) == 0)
+ return -ENOTSUP;
+
+ struct rte_comp_xform *compress_xform =
+ rte_malloc(NULL, sizeof(struct rte_comp_xform), 0);
+
+ if (compress_xform == NULL) {
+ RTE_LOG(ERR, USER1,
+ "Compress xform could not be created\n");
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ struct interim_data_params int_data = {
+ &compress_test_bufs[0],
+ 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS,
+ 1
+ };
+ /* Compress with compressdev, decompress with Zlib */
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ /* Compress with Zlib, decompress with compressdev */
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_SGL_OUT) {
+ /* Compress with compressdev, decompress with Zlib */
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ test_data.sgl = 1;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ /* Compress with Zlib, decompress with compressdev */
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ test_data.sgl = 1;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+ }
+
+ ret = TEST_SUCCESS;
+
+exit:
+ rte_free(compress_xform);
+ return ret;
+}
+
+
static struct unit_test_suite compressdev_testsuite = {
.suite_name = "compressdev unit test suite",
.setup = testsuite_setup,
@@ -1721,6 +1871,8 @@ static struct unit_test_suite compressdev_testsuite = {
test_compressdev_deflate_stateless_sgl),
TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
test_compressdev_deflate_stateless_checksum),
+ TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
+ test_compressdev_out_of_space_buffer),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [dpdk-dev] [PATCH v4 3/3] test/compress: add varied buffer input/outputs
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 0/3] Compression Unit Tests Kovacevic, Marko
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 1/3] test/compress: refactor main test function Kovacevic, Marko
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 2/3] test/compress: add out of space test Kovacevic, Marko
@ 2019-01-11 16:52 ` Kovacevic, Marko
2019-01-16 17:21 ` De Lara Guarch, Pablo
2 siblings, 1 reply; 25+ messages in thread
From: Kovacevic, Marko @ 2019-01-11 16:52 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, pablo.de.lara.guarch, Kovacevic, Marko, Kovacevic
Added unit test to check if a SGL buffer
was added as an input and a Linear Buffer
as output and vice versa so we can test if the
application would process the different buffers
properly.
Signed-off-by: Kovacevic, Marko <marko.kovacevic@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
---
v4:
Added Acks resolved checkpatch issue
V3:
Merged test into sgl test to make
it all into one
---
test/test/test_compressdev.c | 124 ++++++++++++++++++++++++++++++-------------
1 file changed, 88 insertions(+), 36 deletions(-)
diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index 1e41113..f4e7708 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -58,6 +58,13 @@ enum zlib_direction {
ZLIB_ALL
};
+enum varied_buff {
+ LB_BOTH = 0, /* both input and output are linear*/
+ SGL_BOTH, /* both input and output are chained */
+ SGL_TO_LB, /* input buffer is chained */
+ LB_TO_SGL /* output buffer is chained */
+};
+
struct priv_op_data {
uint16_t orig_idx;
};
@@ -81,7 +88,7 @@ struct interim_data_params {
struct test_data_params {
enum rte_comp_op_type state;
- unsigned int sgl;
+ enum varied_buff buff_type;
enum zlib_direction zlib_dir;
unsigned int out_of_space;
};
@@ -368,7 +375,7 @@ compress_zlib(struct rte_comp_op *op,
}
/* Assuming stateless operation */
- /* SGL */
+ /* SGL Input */
if (op->m_src->nb_segs > 1) {
single_src_buf = rte_malloc(NULL,
rte_pktmbuf_pkt_len(op->m_src), 0);
@@ -376,14 +383,10 @@ compress_zlib(struct rte_comp_op *op,
RTE_LOG(ERR, USER1, "Buffer could not be allocated\n");
goto exit;
}
- single_dst_buf = rte_malloc(NULL,
- rte_pktmbuf_pkt_len(op->m_dst), 0);
- if (single_dst_buf == NULL) {
- RTE_LOG(ERR, USER1, "Buffer could not be allocated\n");
- goto exit;
- }
- if (rte_pktmbuf_read(op->m_src, 0,
- rte_pktmbuf_pkt_len(op->m_src),
+
+ if (rte_pktmbuf_read(op->m_src, op->src.offset,
+ rte_pktmbuf_pkt_len(op->m_src) -
+ op->src.offset,
single_src_buf) == NULL) {
RTE_LOG(ERR, USER1,
"Buffer could not be read entirely\n");
@@ -392,15 +395,32 @@ compress_zlib(struct rte_comp_op *op,
stream.avail_in = op->src.length;
stream.next_in = single_src_buf;
- stream.avail_out = rte_pktmbuf_pkt_len(op->m_dst);
- stream.next_out = single_dst_buf;
} else {
stream.avail_in = op->src.length;
- stream.next_in = rte_pktmbuf_mtod(op->m_src, uint8_t *);
+ stream.next_in = rte_pktmbuf_mtod_offset(op->m_src, uint8_t *,
+ op->src.offset);
+ }
+ /* SGL output */
+ if (op->m_dst->nb_segs > 1) {
+
+ single_dst_buf = rte_malloc(NULL,
+ rte_pktmbuf_pkt_len(op->m_dst), 0);
+ if (single_dst_buf == NULL) {
+ RTE_LOG(ERR, USER1,
+ "Buffer could not be allocated\n");
+ goto exit;
+ }
+
+ stream.avail_out = op->m_dst->pkt_len;
+ stream.next_out = single_dst_buf;
+
+ } else {/* linear output */
stream.avail_out = op->m_dst->data_len;
- stream.next_out = rte_pktmbuf_mtod(op->m_dst, uint8_t *);
+ stream.next_out = rte_pktmbuf_mtod_offset(op->m_dst, uint8_t *,
+ op->dst.offset);
}
+
/* Stateless operation, all buffer will be compressed in one go */
zlib_flush = map_zlib_flush_flag(op->flush_flag);
ret = deflate(&stream, zlib_flush);
@@ -414,14 +434,14 @@ compress_zlib(struct rte_comp_op *op,
goto exit;
/* Copy data to destination SGL */
- if (op->m_src->nb_segs > 1) {
+ if (op->m_dst->nb_segs > 1) {
uint32_t remaining_data = stream.total_out;
uint8_t *src_data = single_dst_buf;
struct rte_mbuf *dst_buf = op->m_dst;
while (remaining_data > 0) {
- uint8_t *dst_data = rte_pktmbuf_mtod(dst_buf,
- uint8_t *);
+ uint8_t *dst_data = rte_pktmbuf_mtod_offset(dst_buf,
+ uint8_t *, op->dst.offset);
/* Last segment */
if (remaining_data < dst_buf->data_len) {
memcpy(dst_data, src_data, remaining_data);
@@ -438,12 +458,14 @@ compress_zlib(struct rte_comp_op *op,
op->consumed = stream.total_in;
if (xform->compress.chksum == RTE_COMP_CHECKSUM_ADLER32) {
rte_pktmbuf_adj(op->m_dst, ZLIB_HEADER_SIZE);
- op->produced = stream.total_out -
- (ZLIB_HEADER_SIZE + ZLIB_TRAILER_SIZE);
+ rte_pktmbuf_trim(op->m_dst, ZLIB_TRAILER_SIZE);
+ op->produced = stream.total_out - (ZLIB_HEADER_SIZE +
+ ZLIB_TRAILER_SIZE);
} else if (xform->compress.chksum == RTE_COMP_CHECKSUM_CRC32) {
rte_pktmbuf_adj(op->m_dst, GZIP_HEADER_SIZE);
- op->produced = stream.total_out -
- (GZIP_HEADER_SIZE + GZIP_TRAILER_SIZE);
+ rte_pktmbuf_trim(op->m_dst, GZIP_TRAILER_SIZE);
+ op->produced = stream.total_out - (GZIP_HEADER_SIZE +
+ GZIP_TRAILER_SIZE);
} else
op->produced = stream.total_out;
@@ -679,7 +701,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
struct rte_comp_xform **decompress_xforms = int_data->decompress_xforms;
unsigned int num_xforms = int_data->num_xforms;
enum rte_comp_op_type state = test_data->state;
- unsigned int sgl = test_data->sgl;
+ unsigned int buff_type = test_data->buff_type;
unsigned int out_of_space = test_data->out_of_space;
enum zlib_direction zlib_dir = test_data->zlib_dir;
int ret_status = -1;
@@ -715,7 +737,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
memset(ops_processed, 0, sizeof(struct rte_comp_op *) * num_bufs);
memset(priv_xforms, 0, sizeof(void *) * num_bufs);
- if (sgl)
+ if (buff_type == SGL_BOTH)
buf_pool = ts_params->small_mbuf_pool;
else
buf_pool = ts_params->large_mbuf_pool;
@@ -730,7 +752,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
goto exit;
}
- if (sgl) {
+ if (buff_type == SGL_BOTH || buff_type == SGL_TO_LB) {
for (i = 0; i < num_bufs; i++) {
data_size = strlen(test_bufs[i]) + 1;
if (prepare_sgl_bufs(test_bufs[i], uncomp_bufs[i],
@@ -757,7 +779,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
goto exit;
}
- if (sgl) {
+ if (buff_type == SGL_BOTH || buff_type == LB_TO_SGL) {
for (i = 0; i < num_bufs; i++) {
if (out_of_space == 1 && oos_zlib_decompress) {
data_size = OUT_OF_SPACE_BUF;
@@ -982,7 +1004,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
goto exit;
}
- if (sgl) {
+ if (buff_type == SGL_BOTH || buff_type == LB_TO_SGL) {
for (i = 0; i < num_bufs; i++) {
priv_data = (struct priv_op_data *)
(ops_processed[i] + 1);
@@ -1293,7 +1315,7 @@ test_compressdev_deflate_stateless_fixed(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1363,7 +1385,7 @@ test_compressdev_deflate_stateless_dynamic(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1416,7 +1438,7 @@ test_compressdev_deflate_stateless_multi_op(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1465,7 +1487,7 @@ test_compressdev_deflate_stateless_multi_level(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1554,7 +1576,7 @@ test_compressdev_deflate_stateless_multi_xform(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1599,7 +1621,7 @@ test_compressdev_deflate_stateless_sgl(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 1,
+ SGL_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1617,6 +1639,36 @@ test_compressdev_deflate_stateless_sgl(void)
test_data.zlib_dir = ZLIB_COMPRESS;
if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
return TEST_FAILED;
+
+ if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_LB_OUT) {
+ /* Compress with compressdev, decompress with Zlib */
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ test_data.buff_type = SGL_TO_LB;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
+ return TEST_FAILED;
+
+ /* Compress with Zlib, decompress with compressdev */
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ test_data.buff_type = SGL_TO_LB;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
+ return TEST_FAILED;
+ }
+
+ if (capab->comp_feature_flags & RTE_COMP_FF_OOP_LB_IN_SGL_OUT) {
+ /* Compress with compressdev, decompress with Zlib */
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ test_data.buff_type = LB_TO_SGL;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
+ return TEST_FAILED;
+
+ /* Compress with Zlib, decompress with compressdev */
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ test_data.buff_type = LB_TO_SGL;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
+ return TEST_FAILED;
+ }
+
+
}
return TEST_SUCCESS;
@@ -1676,7 +1728,7 @@ test_compressdev_deflate_stateless_checksum(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1806,7 +1858,7 @@ test_compressdev_out_of_space_buffer(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
1
};
@@ -1827,7 +1879,7 @@ test_compressdev_out_of_space_buffer(void)
if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_SGL_OUT) {
/* Compress with compressdev, decompress with Zlib */
test_data.zlib_dir = ZLIB_DECOMPRESS;
- test_data.sgl = 1;
+ test_data.buff_type = SGL_BOTH;
if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1835,7 +1887,7 @@ test_compressdev_out_of_space_buffer(void)
/* Compress with Zlib, decompress with compressdev */
test_data.zlib_dir = ZLIB_COMPRESS;
- test_data.sgl = 1;
+ test_data.buff_type = SGL_BOTH;
if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [dpdk-dev] [PATCH v4 2/3] test/compress: add out of space test
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 2/3] test/compress: add out of space test Kovacevic, Marko
@ 2019-01-16 17:16 ` De Lara Guarch, Pablo
0 siblings, 0 replies; 25+ messages in thread
From: De Lara Guarch, Pablo @ 2019-01-16 17:16 UTC (permalink / raw)
To: Kovacevic, Marko, dev; +Cc: akhil.goyal
Hi Marko,
Minor comments.
> -----Original Message-----
> From: Kovacevic, Marko
> Sent: Friday, January 11, 2019 4:53 PM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>; Kovacevic
> Subject: [PATCH v4 2/3] test/compress: add out of space test
>
> This patch adds new out of space testcase to check that the destination
> mbuf is smaller than required for the output of compression to ensure the
> driver doesn't crash and returns the valid error case.
>
> Signed-off-by: Kovacevic, Marko <marko.kovacevic@intel.com>
> Acked-by: Lee Daly <lee.daly@intel.com>
> Acked-by: Fiona Trahe <fiona.trahe@intel.com>
>
> ---
> v4:
> Added Acks
> V3:
> Made requested changes(Pablo)
>
> ---
> test/test/test_compressdev.c | 178
> +++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 165 insertions(+), 13 deletions(-)
>
> diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
> index 20895fc..1e41113 100644
> --- a/test/test/test_compressdev.c
> +++ b/test/test/test_compressdev.c
> @@ -42,6 +42,8 @@
> #define GZIP_HEADER_SIZE 10
> #define GZIP_TRAILER_SIZE 8
>
> +#define OUT_OF_SPACE_BUF 1
> +
> const char *
> huffman_type_strings[] = {
> [RTE_COMP_HUFFMAN_DEFAULT] = "PMD default",
> @@ -81,6 +83,7 @@ struct test_data_params {
> enum rte_comp_op_type state;
> unsigned int sgl;
> enum zlib_direction zlib_dir;
> + unsigned int out_of_space;
> };
>
> static struct comp_testsuite_params testsuite_params = { 0 }; @@ -677,6
> +680,7 @@ test_deflate_comp_decomp(const struct interim_data_params
> *int_data,
> unsigned int num_xforms = int_data->num_xforms;
> enum rte_comp_op_type state = test_data->state;
> unsigned int sgl = test_data->sgl;
> + unsigned int out_of_space = test_data->out_of_space;
> enum zlib_direction zlib_dir = test_data->zlib_dir;
> int ret_status = -1;
> int ret;
> @@ -693,6 +697,12 @@ test_deflate_comp_decomp(const struct
> interim_data_params *int_data,
> unsigned int i;
> struct rte_mempool *buf_pool;
> uint32_t data_size;
> + /* Compressing with CompressDev */
> + unsigned int oos_zlib_decompress =
> + (zlib_dir == ZLIB_NONE || zlib_dir ==
> ZLIB_DECOMPRESS);
> + /* Decompressing with CompressDev */
> + unsigned int oos_zlib_compress =
> + (zlib_dir == ZLIB_NONE || zlib_dir ==
> ZLIB_COMPRESS);
> const struct rte_compressdev_capabilities *capa =
> rte_compressdev_capability_get(0,
> RTE_COMP_ALGO_DEFLATE);
> char *contig_buf = NULL;
> @@ -749,8 +759,12 @@ test_deflate_comp_decomp(const struct
> interim_data_params *int_data,
>
> if (sgl) {
> for (i = 0; i < num_bufs; i++) {
> - data_size = strlen(test_bufs[i]) *
> - COMPRESS_BUF_SIZE_RATIO;
> + if (out_of_space == 1 && oos_zlib_decompress) {
> + data_size = OUT_OF_SPACE_BUF;
> + } else {
> + (data_size = strlen(test_bufs[i]) *
> + COMPRESS_BUF_SIZE_RATIO);
No need for the parenthesis around this statement (plus, no need for the curly braces).
> + }
> if (prepare_sgl_bufs(NULL, comp_bufs[i],
> data_size,
> ts_params->small_mbuf_pool,
> @@ -761,8 +775,12 @@ test_deflate_comp_decomp(const struct
> interim_data_params *int_data,
>
> } else {
> for (i = 0; i < num_bufs; i++) {
> - data_size = strlen(test_bufs[i]) *
> - COMPRESS_BUF_SIZE_RATIO;
> + if (out_of_space == 1 && oos_zlib_decompress) {
> + data_size = OUT_OF_SPACE_BUF;
> + } else {
> + (data_size = strlen(test_bufs[i]) *
> + COMPRESS_BUF_SIZE_RATIO);
Same here.
> + }
> rte_pktmbuf_append(comp_bufs[i], data_size);
> }
> }
> @@ -928,6 +946,18 @@ test_deflate_comp_decomp(const struct
> interim_data_params *int_data,
> * compress operation information is needed for the decompression
> stage)
> */
> for (i = 0; i < num_bufs; i++) {
> + if (out_of_space && oos_zlib_decompress) {
> + if (ops_processed[i]->status !=
> +
> RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED) {
Better to add an extra tab here, even though you cross the 80 char limit.
> + ret_status = -1;
> +
> + RTE_LOG(ERR, USER1,
> + "Out of Space operation was not
> successful\n");
I would reword this to something more clear, like:
Operation without expected out of space status error.
Also, make these changes in the decompression side of the function (code below).
Apart from this:
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [dpdk-dev] [PATCH v4 3/3] test/compress: add varied buffer input/outputs
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 3/3] test/compress: add varied buffer input/outputs Kovacevic, Marko
@ 2019-01-16 17:21 ` De Lara Guarch, Pablo
0 siblings, 0 replies; 25+ messages in thread
From: De Lara Guarch, Pablo @ 2019-01-16 17:21 UTC (permalink / raw)
To: Kovacevic, Marko, dev; +Cc: akhil.goyal
> -----Original Message-----
> From: Kovacevic, Marko
> Sent: Friday, January 11, 2019 4:53 PM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>; Kovacevic
> Subject: [PATCH v4 3/3] test/compress: add varied buffer input/outputs
>
> Added unit test to check if a SGL buffer was added as an input and a Linear
> Buffer as output and vice versa so we can test if the application would
> process the different buffers properly.
>
> Signed-off-by: Kovacevic, Marko <marko.kovacevic@intel.com>
> Acked-by: Fiona Trahe <fiona.trahe@intel.com>
> Acked-by: Lee Daly <lee.daly@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
^ permalink raw reply [flat|nested] 25+ messages in thread
* [dpdk-dev] [PATCH v5 0/3] Compression Unit Tests
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 1/3] test/compress: refactor main test function Kovacevic, Marko
@ 2019-01-17 10:19 ` Kovacevic, Marko
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 1/3] test/compress: refactor main test function Kovacevic, Marko
` (3 more replies)
0 siblings, 4 replies; 25+ messages in thread
From: Kovacevic, Marko @ 2019-01-17 10:19 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, pablo.de.lara.guarch, Kovacevic, Marko
Made changes to the two unit tests for the out of space i have added
proper checkes for all the cases compressing with compress dev and
decompressing with compress dev.
Varied buffer patch i have removed the extra unit test and merged it
into the sgl test as one.
Added a third patch into my patch set this patch refactors the
test_deflate_comp_decomp to make it a less congested with parameters
V5 has minor code chnages requested by Pablo.
Kovacevic, Marko (2):
test/compress: add out of space test
test/compress: add varied buffer input/outputs
Pablo de Lara (1):
test/compress: refactor main test function
test/test/test_compressdev.c | 585 ++++++++++++++++++++++++++++++-------------
1 file changed, 414 insertions(+), 171 deletions(-)
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [dpdk-dev] [PATCH v5 1/3] test/compress: refactor main test function
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 0/3] Compression Unit Tests Kovacevic, Marko
@ 2019-01-17 10:19 ` Kovacevic, Marko
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 2/3] test/compress: add out of space test Kovacevic, Marko
` (2 subsequent siblings)
3 siblings, 0 replies; 25+ messages in thread
From: Kovacevic, Marko @ 2019-01-17 10:19 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, pablo.de.lara.guarch
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Since the start of the compression tests,
the main test function, test_deflate_comp_decomp,
has increased its parameter with each new test added.
In order to make the code cleaner, and more scalable,
these parameters have been divided into two structures,
which are now passed as the sole arguments of the function.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
V5:
No change
---
test/test/test_compressdev.c | 319 ++++++++++++++++++++++++-------------------
1 file changed, 178 insertions(+), 141 deletions(-)
diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index 6a2a341..20895fc 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -68,6 +68,21 @@ struct comp_testsuite_params {
struct rte_comp_xform *def_decomp_xform;
};
+struct interim_data_params {
+ const char * const *test_bufs;
+ unsigned int num_bufs;
+ uint16_t *buf_idx;
+ struct rte_comp_xform **compress_xforms;
+ struct rte_comp_xform **decompress_xforms;
+ unsigned int num_xforms;
+};
+
+struct test_data_params {
+ enum rte_comp_op_type state;
+ unsigned int sgl;
+ enum zlib_direction zlib_dir;
+};
+
static struct comp_testsuite_params testsuite_params = { 0 };
static void
@@ -650,17 +665,19 @@ prepare_sgl_bufs(const char *test_buf, struct rte_mbuf *head_buf,
* Compresses and decompresses buffer with compressdev API and Zlib API
*/
static int
-test_deflate_comp_decomp(const char * const test_bufs[],
- unsigned int num_bufs,
- uint16_t buf_idx[],
- struct rte_comp_xform *compress_xforms[],
- struct rte_comp_xform *decompress_xforms[],
- unsigned int num_xforms,
- enum rte_comp_op_type state,
- unsigned int sgl,
- enum zlib_direction zlib_dir)
+test_deflate_comp_decomp(const struct interim_data_params *int_data,
+ const struct test_data_params *test_data)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
+ const char * const *test_bufs = int_data->test_bufs;
+ unsigned int num_bufs = int_data->num_bufs;
+ uint16_t *buf_idx = int_data->buf_idx;
+ struct rte_comp_xform **compress_xforms = int_data->compress_xforms;
+ struct rte_comp_xform **decompress_xforms = int_data->decompress_xforms;
+ unsigned int num_xforms = int_data->num_xforms;
+ enum rte_comp_op_type state = test_data->state;
+ unsigned int sgl = test_data->sgl;
+ enum zlib_direction zlib_dir = test_data->zlib_dir;
int ret_status = -1;
int ret;
struct rte_mbuf *uncomp_bufs[num_bufs];
@@ -1179,7 +1196,6 @@ static int
test_compressdev_deflate_stateless_fixed(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
- const char *test_buffer;
uint16_t i;
int ret;
const struct rte_compressdev_capabilities *capab;
@@ -1204,31 +1220,35 @@ test_compressdev_deflate_stateless_fixed(void)
sizeof(struct rte_comp_xform));
compress_xform->compress.deflate.huffman = RTE_COMP_HUFFMAN_FIXED;
+ struct interim_data_params int_data = {
+ NULL,
+ 1,
+ NULL,
+ &compress_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
/* Compress with Zlib, decompress with compressdev */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1245,7 +1265,6 @@ static int
test_compressdev_deflate_stateless_dynamic(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
- const char *test_buffer;
uint16_t i;
int ret;
struct rte_comp_xform *compress_xform =
@@ -1270,31 +1289,35 @@ test_compressdev_deflate_stateless_dynamic(void)
sizeof(struct rte_comp_xform));
compress_xform->compress.deflate.huffman = RTE_COMP_HUFFMAN_DYNAMIC;
+ struct interim_data_params int_data = {
+ NULL,
+ 1,
+ NULL,
+ &compress_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
/* Compress with Zlib, decompress with compressdev */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1318,26 +1341,29 @@ test_compressdev_deflate_stateless_multi_op(void)
for (i = 0; i < num_bufs; i++)
buf_idx[i] = i;
+ struct interim_data_params int_data = {
+ compress_test_bufs,
+ num_bufs,
+ buf_idx,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(compress_test_bufs, num_bufs,
- buf_idx,
- &ts_params->def_comp_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS) < 0)
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
return TEST_FAILED;
/* Compress with Zlib, decompress with compressdev */
- if (test_deflate_comp_decomp(compress_test_bufs, num_bufs,
- buf_idx,
- &ts_params->def_comp_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS) < 0)
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
return TEST_FAILED;
return TEST_SUCCESS;
@@ -1347,7 +1373,6 @@ static int
test_compressdev_deflate_stateless_multi_level(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
- const char *test_buffer;
unsigned int level;
uint16_t i;
int ret;
@@ -1364,20 +1389,31 @@ test_compressdev_deflate_stateless_multi_level(void)
memcpy(compress_xform, ts_params->def_comp_xform,
sizeof(struct rte_comp_xform));
+ struct interim_data_params int_data = {
+ NULL,
+ 1,
+ NULL,
+ &compress_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
+
for (level = RTE_COMP_LEVEL_MIN; level <= RTE_COMP_LEVEL_MAX;
level++) {
compress_xform->compress.level = level;
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1440,15 +1476,24 @@ test_compressdev_deflate_stateless_multi_xform(void)
/* Use the same buffer in all sessions */
test_buffers[i] = compress_test_bufs[0];
}
+
+ struct interim_data_params int_data = {
+ test_buffers,
+ num_bufs,
+ buf_idx,
+ compress_xforms,
+ decompress_xforms,
+ NUM_XFORMS
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(test_buffers, num_bufs,
- buf_idx,
- compress_xforms,
- decompress_xforms,
- NUM_XFORMS,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_DECOMPRESS) < 0) {
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1468,7 +1513,6 @@ test_compressdev_deflate_stateless_sgl(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
uint16_t i;
- const char *test_buffer;
const struct rte_compressdev_capabilities *capab;
capab = rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
@@ -1477,28 +1521,33 @@ test_compressdev_deflate_stateless_sgl(void)
if ((capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_SGL_OUT) == 0)
return -ENOTSUP;
+ struct interim_data_params int_data = {
+ NULL,
+ 1,
+ NULL,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 1,
+ ZLIB_DECOMPRESS
+ };
+
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
+
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &ts_params->def_comp_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 1,
- ZLIB_DECOMPRESS) < 0)
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
return TEST_FAILED;
/* Compress with Zlib, decompress with compressdev */
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &ts_params->def_comp_xform,
- &ts_params->def_decomp_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 1,
- ZLIB_COMPRESS) < 0)
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
return TEST_FAILED;
}
@@ -1510,7 +1559,6 @@ static int
test_compressdev_deflate_stateless_checksum(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
- const char *test_buffer;
uint16_t i;
int ret;
const struct rte_compressdev_capabilities *capab;
@@ -1549,25 +1597,36 @@ test_compressdev_deflate_stateless_checksum(void)
memcpy(decompress_xform, ts_params->def_decomp_xform,
sizeof(struct rte_comp_xform));
+ struct interim_data_params int_data = {
+ NULL,
+ 1,
+ NULL,
+ &compress_xform,
+ &decompress_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS
+ };
+
/* Check if driver supports crc32 checksum and test */
if ((capab->comp_feature_flags & RTE_COMP_FF_CRC32_CHECKSUM)) {
compress_xform->compress.chksum = RTE_COMP_CHECKSUM_CRC32;
decompress_xform->decompress.chksum = RTE_COMP_CHECKSUM_CRC32;
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ /* Compress with compressdev, decompress with Zlib */
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
/* Generate zlib checksum and test against selected
* drivers decompression checksum
*/
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &decompress_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1575,14 +1634,8 @@ test_compressdev_deflate_stateless_checksum(void)
/* Generate compression and decompression
* checksum of selected driver
*/
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &decompress_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_NONE) < 0) {
+ test_data.zlib_dir = ZLIB_NONE;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1595,33 +1648,22 @@ test_compressdev_deflate_stateless_checksum(void)
decompress_xform->decompress.chksum = RTE_COMP_CHECKSUM_ADLER32;
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
/* Generate zlib checksum and test against selected
* drivers decompression checksum
*/
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &decompress_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_COMPRESS) < 0) {
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
/* Generate compression and decompression
* checksum of selected driver
*/
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &decompress_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_NONE) < 0) {
+ test_data.zlib_dir = ZLIB_NONE;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
@@ -1636,19 +1678,14 @@ test_compressdev_deflate_stateless_checksum(void)
RTE_COMP_CHECKSUM_CRC32_ADLER32;
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
- test_buffer = compress_test_bufs[i];
+ int_data.test_bufs = &compress_test_bufs[i];
+ int_data.buf_idx = &i;
/* Generate compression and decompression
* checksum of selected driver
*/
- if (test_deflate_comp_decomp(&test_buffer, 1,
- &i,
- &compress_xform,
- &decompress_xform,
- 1,
- RTE_COMP_OP_STATELESS,
- 0,
- ZLIB_NONE) < 0) {
+ test_data.zlib_dir = ZLIB_NONE;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
}
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [dpdk-dev] [PATCH v5 2/3] test/compress: add out of space test
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 0/3] Compression Unit Tests Kovacevic, Marko
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 1/3] test/compress: refactor main test function Kovacevic, Marko
@ 2019-01-17 10:19 ` Kovacevic, Marko
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 3/3] test/compress: add varied buffer input/outputs Kovacevic, Marko
2019-01-18 0:06 ` [dpdk-dev] [PATCH v5 0/3] Compression Unit Tests Thomas Monjalon
3 siblings, 0 replies; 25+ messages in thread
From: Kovacevic, Marko @ 2019-01-17 10:19 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, pablo.de.lara.guarch, Kovacevic, Marko, Kovacevic
This patch adds new out of space testcase to check
that the destination mbuf is smaller than required for
the output of compression to ensure the driver doesn't crash
and returns the valid error case.
Signed-off-by: Kovacevic, Marko <marko.kovacevic@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
V5:
Made minor code changes (Pablo)
V4:
Added Acks
V3:
Made requested changes(Pablo)
---
test/test/test_compressdev.c | 180 +++++++++++++++++++++++++++++++++++++++----
1 file changed, 167 insertions(+), 13 deletions(-)
diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index 20895fc..40e095d 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -42,6 +42,8 @@
#define GZIP_HEADER_SIZE 10
#define GZIP_TRAILER_SIZE 8
+#define OUT_OF_SPACE_BUF 1
+
const char *
huffman_type_strings[] = {
[RTE_COMP_HUFFMAN_DEFAULT] = "PMD default",
@@ -81,6 +83,7 @@ struct test_data_params {
enum rte_comp_op_type state;
unsigned int sgl;
enum zlib_direction zlib_dir;
+ unsigned int out_of_space;
};
static struct comp_testsuite_params testsuite_params = { 0 };
@@ -677,6 +680,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
unsigned int num_xforms = int_data->num_xforms;
enum rte_comp_op_type state = test_data->state;
unsigned int sgl = test_data->sgl;
+ unsigned int out_of_space = test_data->out_of_space;
enum zlib_direction zlib_dir = test_data->zlib_dir;
int ret_status = -1;
int ret;
@@ -693,6 +697,12 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
unsigned int i;
struct rte_mempool *buf_pool;
uint32_t data_size;
+ /* Compressing with CompressDev */
+ unsigned int oos_zlib_decompress =
+ (zlib_dir == ZLIB_NONE || zlib_dir == ZLIB_DECOMPRESS);
+ /* Decompressing with CompressDev */
+ unsigned int oos_zlib_compress =
+ (zlib_dir == ZLIB_NONE || zlib_dir == ZLIB_COMPRESS);
const struct rte_compressdev_capabilities *capa =
rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
char *contig_buf = NULL;
@@ -749,8 +759,12 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
if (sgl) {
for (i = 0; i < num_bufs; i++) {
- data_size = strlen(test_bufs[i]) *
- COMPRESS_BUF_SIZE_RATIO;
+ if (out_of_space == 1 && oos_zlib_decompress)
+ data_size = OUT_OF_SPACE_BUF;
+ else
+ (data_size = strlen(test_bufs[i]) *
+ COMPRESS_BUF_SIZE_RATIO);
+
if (prepare_sgl_bufs(NULL, comp_bufs[i],
data_size,
ts_params->small_mbuf_pool,
@@ -761,8 +775,12 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
} else {
for (i = 0; i < num_bufs; i++) {
- data_size = strlen(test_bufs[i]) *
- COMPRESS_BUF_SIZE_RATIO;
+ if (out_of_space == 1 && oos_zlib_decompress)
+ data_size = OUT_OF_SPACE_BUF;
+ else
+ (data_size = strlen(test_bufs[i]) *
+ COMPRESS_BUF_SIZE_RATIO);
+
rte_pktmbuf_append(comp_bufs[i], data_size);
}
}
@@ -928,6 +946,19 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
* compress operation information is needed for the decompression stage)
*/
for (i = 0; i < num_bufs; i++) {
+ if (out_of_space && oos_zlib_decompress) {
+ if (ops_processed[i]->status !=
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED) {
+ ret_status = -1;
+
+ RTE_LOG(ERR, USER1,
+ "Operation without expected out of "
+ "space status error\n");
+ goto exit;
+ } else
+ continue;
+ }
+
if (ops_processed[i]->status != RTE_COMP_OP_STATUS_SUCCESS) {
RTE_LOG(ERR, USER1,
"Some operations were not successful\n");
@@ -938,6 +969,11 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
uncomp_bufs[priv_data->orig_idx] = NULL;
}
+ if (out_of_space && oos_zlib_decompress) {
+ ret_status = 0;
+ goto exit;
+ }
+
/* Allocate buffers for decompressed data */
ret = rte_pktmbuf_alloc_bulk(buf_pool, uncomp_bufs, num_bufs);
if (ret < 0) {
@@ -951,7 +987,12 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
for (i = 0; i < num_bufs; i++) {
priv_data = (struct priv_op_data *)
(ops_processed[i] + 1);
- data_size = strlen(test_bufs[priv_data->orig_idx]) + 1;
+ if (out_of_space == 1 && oos_zlib_compress)
+ data_size = OUT_OF_SPACE_BUF;
+ else
+ data_size =
+ strlen(test_bufs[priv_data->orig_idx]) + 1;
+
if (prepare_sgl_bufs(NULL, uncomp_bufs[i],
data_size,
ts_params->small_mbuf_pool,
@@ -964,7 +1005,12 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
for (i = 0; i < num_bufs; i++) {
priv_data = (struct priv_op_data *)
(ops_processed[i] + 1);
- data_size = strlen(test_bufs[priv_data->orig_idx]) + 1;
+ if (out_of_space == 1 && oos_zlib_compress)
+ data_size = OUT_OF_SPACE_BUF;
+ else
+ data_size =
+ strlen(test_bufs[priv_data->orig_idx]) + 1;
+
rte_pktmbuf_append(uncomp_bufs[i], data_size);
}
}
@@ -1125,6 +1171,19 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
* compress operation information is still needed)
*/
for (i = 0; i < num_bufs; i++) {
+ if (out_of_space && oos_zlib_compress) {
+ if (ops_processed[i]->status !=
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED) {
+ ret_status = -1;
+
+ RTE_LOG(ERR, USER1,
+ "Operation without expected out of "
+ "space status error\n");
+ goto exit;
+ } else
+ continue;
+ }
+
if (ops_processed[i]->status != RTE_COMP_OP_STATUS_SUCCESS) {
RTE_LOG(ERR, USER1,
"Some operations were not successful\n");
@@ -1135,6 +1194,11 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
comp_bufs[priv_data->orig_idx] = NULL;
}
+ if (out_of_space && oos_zlib_compress) {
+ ret_status = 0;
+ goto exit;
+ }
+
/*
* Compare the original stream with the decompressed stream
* (in size and the data)
@@ -1232,7 +1296,8 @@ test_compressdev_deflate_stateless_fixed(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1301,7 +1366,8 @@ test_compressdev_deflate_stateless_dynamic(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1353,7 +1419,8 @@ test_compressdev_deflate_stateless_multi_op(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
/* Compress with compressdev, decompress with Zlib */
@@ -1401,7 +1468,8 @@ test_compressdev_deflate_stateless_multi_level(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1489,7 +1557,8 @@ test_compressdev_deflate_stateless_multi_xform(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
/* Compress with compressdev, decompress with Zlib */
@@ -1533,7 +1602,8 @@ test_compressdev_deflate_stateless_sgl(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
1,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1609,7 +1679,8 @@ test_compressdev_deflate_stateless_checksum(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
0,
- ZLIB_DECOMPRESS
+ ZLIB_DECOMPRESS,
+ 0
};
/* Check if driver supports crc32 checksum and test */
@@ -1700,6 +1771,87 @@ test_compressdev_deflate_stateless_checksum(void)
return ret;
}
+static int
+test_compressdev_out_of_space_buffer(void)
+{
+ struct comp_testsuite_params *ts_params = &testsuite_params;
+ int ret;
+ uint16_t i;
+ const struct rte_compressdev_capabilities *capab;
+
+ RTE_LOG(INFO, USER1, "This is a negative test errors are expected\n");
+
+ capab = rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
+ TEST_ASSERT(capab != NULL, "Failed to retrieve device capabilities");
+
+ if ((capab->comp_feature_flags & RTE_COMP_FF_HUFFMAN_FIXED) == 0)
+ return -ENOTSUP;
+
+ struct rte_comp_xform *compress_xform =
+ rte_malloc(NULL, sizeof(struct rte_comp_xform), 0);
+
+ if (compress_xform == NULL) {
+ RTE_LOG(ERR, USER1,
+ "Compress xform could not be created\n");
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ struct interim_data_params int_data = {
+ &compress_test_bufs[0],
+ 1,
+ &i,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ 0,
+ ZLIB_DECOMPRESS,
+ 1
+ };
+ /* Compress with compressdev, decompress with Zlib */
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ /* Compress with Zlib, decompress with compressdev */
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_SGL_OUT) {
+ /* Compress with compressdev, decompress with Zlib */
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ test_data.sgl = 1;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+
+ /* Compress with Zlib, decompress with compressdev */
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ test_data.sgl = 1;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
+ ret = TEST_FAILED;
+ goto exit;
+ }
+ }
+
+ ret = TEST_SUCCESS;
+
+exit:
+ rte_free(compress_xform);
+ return ret;
+}
+
+
static struct unit_test_suite compressdev_testsuite = {
.suite_name = "compressdev unit test suite",
.setup = testsuite_setup,
@@ -1721,6 +1873,8 @@ static struct unit_test_suite compressdev_testsuite = {
test_compressdev_deflate_stateless_sgl),
TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
test_compressdev_deflate_stateless_checksum),
+ TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
+ test_compressdev_out_of_space_buffer),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* [dpdk-dev] [PATCH v5 3/3] test/compress: add varied buffer input/outputs
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 0/3] Compression Unit Tests Kovacevic, Marko
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 1/3] test/compress: refactor main test function Kovacevic, Marko
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 2/3] test/compress: add out of space test Kovacevic, Marko
@ 2019-01-17 10:19 ` Kovacevic, Marko
2019-01-18 0:06 ` [dpdk-dev] [PATCH v5 0/3] Compression Unit Tests Thomas Monjalon
3 siblings, 0 replies; 25+ messages in thread
From: Kovacevic, Marko @ 2019-01-17 10:19 UTC (permalink / raw)
To: dev; +Cc: akhil.goyal, pablo.de.lara.guarch, Kovacevic, Marko, Kovacevic
Added unit test to check if a SGL buffer
was added as an input and a Linear Buffer
as output and vice versa so we can test if the
application would process the different buffers
properly.
Signed-off-by: Kovacevic, Marko <marko.kovacevic@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
v5:
No changes
V4:
Added Acks resolved checkpatch issue
V3:
Merged test into sgl test to make
it all into one
---
test/test/test_compressdev.c | 124 ++++++++++++++++++++++++++++++-------------
1 file changed, 88 insertions(+), 36 deletions(-)
diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index 40e095d..e8476ed 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -58,6 +58,13 @@ enum zlib_direction {
ZLIB_ALL
};
+enum varied_buff {
+ LB_BOTH = 0, /* both input and output are linear*/
+ SGL_BOTH, /* both input and output are chained */
+ SGL_TO_LB, /* input buffer is chained */
+ LB_TO_SGL /* output buffer is chained */
+};
+
struct priv_op_data {
uint16_t orig_idx;
};
@@ -81,7 +88,7 @@ struct interim_data_params {
struct test_data_params {
enum rte_comp_op_type state;
- unsigned int sgl;
+ enum varied_buff buff_type;
enum zlib_direction zlib_dir;
unsigned int out_of_space;
};
@@ -368,7 +375,7 @@ compress_zlib(struct rte_comp_op *op,
}
/* Assuming stateless operation */
- /* SGL */
+ /* SGL Input */
if (op->m_src->nb_segs > 1) {
single_src_buf = rte_malloc(NULL,
rte_pktmbuf_pkt_len(op->m_src), 0);
@@ -376,14 +383,10 @@ compress_zlib(struct rte_comp_op *op,
RTE_LOG(ERR, USER1, "Buffer could not be allocated\n");
goto exit;
}
- single_dst_buf = rte_malloc(NULL,
- rte_pktmbuf_pkt_len(op->m_dst), 0);
- if (single_dst_buf == NULL) {
- RTE_LOG(ERR, USER1, "Buffer could not be allocated\n");
- goto exit;
- }
- if (rte_pktmbuf_read(op->m_src, 0,
- rte_pktmbuf_pkt_len(op->m_src),
+
+ if (rte_pktmbuf_read(op->m_src, op->src.offset,
+ rte_pktmbuf_pkt_len(op->m_src) -
+ op->src.offset,
single_src_buf) == NULL) {
RTE_LOG(ERR, USER1,
"Buffer could not be read entirely\n");
@@ -392,15 +395,32 @@ compress_zlib(struct rte_comp_op *op,
stream.avail_in = op->src.length;
stream.next_in = single_src_buf;
- stream.avail_out = rte_pktmbuf_pkt_len(op->m_dst);
- stream.next_out = single_dst_buf;
} else {
stream.avail_in = op->src.length;
- stream.next_in = rte_pktmbuf_mtod(op->m_src, uint8_t *);
+ stream.next_in = rte_pktmbuf_mtod_offset(op->m_src, uint8_t *,
+ op->src.offset);
+ }
+ /* SGL output */
+ if (op->m_dst->nb_segs > 1) {
+
+ single_dst_buf = rte_malloc(NULL,
+ rte_pktmbuf_pkt_len(op->m_dst), 0);
+ if (single_dst_buf == NULL) {
+ RTE_LOG(ERR, USER1,
+ "Buffer could not be allocated\n");
+ goto exit;
+ }
+
+ stream.avail_out = op->m_dst->pkt_len;
+ stream.next_out = single_dst_buf;
+
+ } else {/* linear output */
stream.avail_out = op->m_dst->data_len;
- stream.next_out = rte_pktmbuf_mtod(op->m_dst, uint8_t *);
+ stream.next_out = rte_pktmbuf_mtod_offset(op->m_dst, uint8_t *,
+ op->dst.offset);
}
+
/* Stateless operation, all buffer will be compressed in one go */
zlib_flush = map_zlib_flush_flag(op->flush_flag);
ret = deflate(&stream, zlib_flush);
@@ -414,14 +434,14 @@ compress_zlib(struct rte_comp_op *op,
goto exit;
/* Copy data to destination SGL */
- if (op->m_src->nb_segs > 1) {
+ if (op->m_dst->nb_segs > 1) {
uint32_t remaining_data = stream.total_out;
uint8_t *src_data = single_dst_buf;
struct rte_mbuf *dst_buf = op->m_dst;
while (remaining_data > 0) {
- uint8_t *dst_data = rte_pktmbuf_mtod(dst_buf,
- uint8_t *);
+ uint8_t *dst_data = rte_pktmbuf_mtod_offset(dst_buf,
+ uint8_t *, op->dst.offset);
/* Last segment */
if (remaining_data < dst_buf->data_len) {
memcpy(dst_data, src_data, remaining_data);
@@ -438,12 +458,14 @@ compress_zlib(struct rte_comp_op *op,
op->consumed = stream.total_in;
if (xform->compress.chksum == RTE_COMP_CHECKSUM_ADLER32) {
rte_pktmbuf_adj(op->m_dst, ZLIB_HEADER_SIZE);
- op->produced = stream.total_out -
- (ZLIB_HEADER_SIZE + ZLIB_TRAILER_SIZE);
+ rte_pktmbuf_trim(op->m_dst, ZLIB_TRAILER_SIZE);
+ op->produced = stream.total_out - (ZLIB_HEADER_SIZE +
+ ZLIB_TRAILER_SIZE);
} else if (xform->compress.chksum == RTE_COMP_CHECKSUM_CRC32) {
rte_pktmbuf_adj(op->m_dst, GZIP_HEADER_SIZE);
- op->produced = stream.total_out -
- (GZIP_HEADER_SIZE + GZIP_TRAILER_SIZE);
+ rte_pktmbuf_trim(op->m_dst, GZIP_TRAILER_SIZE);
+ op->produced = stream.total_out - (GZIP_HEADER_SIZE +
+ GZIP_TRAILER_SIZE);
} else
op->produced = stream.total_out;
@@ -679,7 +701,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
struct rte_comp_xform **decompress_xforms = int_data->decompress_xforms;
unsigned int num_xforms = int_data->num_xforms;
enum rte_comp_op_type state = test_data->state;
- unsigned int sgl = test_data->sgl;
+ unsigned int buff_type = test_data->buff_type;
unsigned int out_of_space = test_data->out_of_space;
enum zlib_direction zlib_dir = test_data->zlib_dir;
int ret_status = -1;
@@ -715,7 +737,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
memset(ops_processed, 0, sizeof(struct rte_comp_op *) * num_bufs);
memset(priv_xforms, 0, sizeof(void *) * num_bufs);
- if (sgl)
+ if (buff_type == SGL_BOTH)
buf_pool = ts_params->small_mbuf_pool;
else
buf_pool = ts_params->large_mbuf_pool;
@@ -730,7 +752,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
goto exit;
}
- if (sgl) {
+ if (buff_type == SGL_BOTH || buff_type == SGL_TO_LB) {
for (i = 0; i < num_bufs; i++) {
data_size = strlen(test_bufs[i]) + 1;
if (prepare_sgl_bufs(test_bufs[i], uncomp_bufs[i],
@@ -757,7 +779,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
goto exit;
}
- if (sgl) {
+ if (buff_type == SGL_BOTH || buff_type == LB_TO_SGL) {
for (i = 0; i < num_bufs; i++) {
if (out_of_space == 1 && oos_zlib_decompress)
data_size = OUT_OF_SPACE_BUF;
@@ -983,7 +1005,7 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
goto exit;
}
- if (sgl) {
+ if (buff_type == SGL_BOTH || buff_type == LB_TO_SGL) {
for (i = 0; i < num_bufs; i++) {
priv_data = (struct priv_op_data *)
(ops_processed[i] + 1);
@@ -1295,7 +1317,7 @@ test_compressdev_deflate_stateless_fixed(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1365,7 +1387,7 @@ test_compressdev_deflate_stateless_dynamic(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1418,7 +1440,7 @@ test_compressdev_deflate_stateless_multi_op(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1467,7 +1489,7 @@ test_compressdev_deflate_stateless_multi_level(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1556,7 +1578,7 @@ test_compressdev_deflate_stateless_multi_xform(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1601,7 +1623,7 @@ test_compressdev_deflate_stateless_sgl(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 1,
+ SGL_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1619,6 +1641,36 @@ test_compressdev_deflate_stateless_sgl(void)
test_data.zlib_dir = ZLIB_COMPRESS;
if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
return TEST_FAILED;
+
+ if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_LB_OUT) {
+ /* Compress with compressdev, decompress with Zlib */
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ test_data.buff_type = SGL_TO_LB;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
+ return TEST_FAILED;
+
+ /* Compress with Zlib, decompress with compressdev */
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ test_data.buff_type = SGL_TO_LB;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
+ return TEST_FAILED;
+ }
+
+ if (capab->comp_feature_flags & RTE_COMP_FF_OOP_LB_IN_SGL_OUT) {
+ /* Compress with compressdev, decompress with Zlib */
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ test_data.buff_type = LB_TO_SGL;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
+ return TEST_FAILED;
+
+ /* Compress with Zlib, decompress with compressdev */
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ test_data.buff_type = LB_TO_SGL;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
+ return TEST_FAILED;
+ }
+
+
}
return TEST_SUCCESS;
@@ -1678,7 +1730,7 @@ test_compressdev_deflate_stateless_checksum(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
0
};
@@ -1808,7 +1860,7 @@ test_compressdev_out_of_space_buffer(void)
struct test_data_params test_data = {
RTE_COMP_OP_STATELESS,
- 0,
+ LB_BOTH,
ZLIB_DECOMPRESS,
1
};
@@ -1829,7 +1881,7 @@ test_compressdev_out_of_space_buffer(void)
if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_SGL_OUT) {
/* Compress with compressdev, decompress with Zlib */
test_data.zlib_dir = ZLIB_DECOMPRESS;
- test_data.sgl = 1;
+ test_data.buff_type = SGL_BOTH;
if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
@@ -1837,7 +1889,7 @@ test_compressdev_out_of_space_buffer(void)
/* Compress with Zlib, decompress with compressdev */
test_data.zlib_dir = ZLIB_COMPRESS;
- test_data.sgl = 1;
+ test_data.buff_type = SGL_BOTH;
if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
ret = TEST_FAILED;
goto exit;
--
2.9.5
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [dpdk-dev] [PATCH v5 0/3] Compression Unit Tests
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 0/3] Compression Unit Tests Kovacevic, Marko
` (2 preceding siblings ...)
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 3/3] test/compress: add varied buffer input/outputs Kovacevic, Marko
@ 2019-01-18 0:06 ` Thomas Monjalon
3 siblings, 0 replies; 25+ messages in thread
From: Thomas Monjalon @ 2019-01-18 0:06 UTC (permalink / raw)
To: Kovacevic, Marko, pablo.de.lara.guarch; +Cc: dev, akhil.goyal
17/01/2019 11:19, Kovacevic, Marko:
> Made changes to the two unit tests for the out of space i have added
> proper checkes for all the cases compressing with compress dev and
> decompressing with compress dev.
>
> Varied buffer patch i have removed the extra unit test and merged it
> into the sgl test as one.
>
> Added a third patch into my patch set this patch refactors the
> test_deflate_comp_decomp to make it a less congested with parameters
>
> V5 has minor code chnages requested by Pablo.
>
> Kovacevic, Marko (2):
> test/compress: add out of space test
> test/compress: add varied buffer input/outputs
>
> Pablo de Lara (1):
> test/compress: refactor main test function
Applied, thanks
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2019-01-18 0:06 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-14 15:33 [dpdk-dev] [PATCH v1 1/2] test/compress: add out of space test Marko Kovacevic
2018-12-14 15:33 ` [dpdk-dev] [PATCH v1 2/2] test/compress: add varied buffer input/outputs Marko Kovacevic
2018-12-14 15:56 ` Daly, Lee
2018-12-14 15:55 ` [dpdk-dev] [PATCH v1 1/2] test/compress: add out of space test Daly, Lee
2018-12-20 14:58 ` [dpdk-dev] [PATCH v2 " Marko Kovacevic
2018-12-20 14:58 ` [dpdk-dev] [PATCH v2 2/2] test/compress: add varied buffer input/outputs Marko Kovacevic
2018-12-21 0:44 ` Trahe, Fiona
2019-01-09 17:02 ` De Lara Guarch, Pablo
2018-12-21 0:41 ` [dpdk-dev] [PATCH v2 1/2] test/compress: add out of space test Trahe, Fiona
2019-01-09 16:47 ` De Lara Guarch, Pablo
2019-01-11 15:08 ` [dpdk-dev] [PATCH v3 0/3] Compression Unit Tests Kovacevic, Marko
2019-01-11 15:08 ` [dpdk-dev] [PATCH v3 1/3] test/compress: refactor main test function Kovacevic, Marko
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 0/3] Compression Unit Tests Kovacevic, Marko
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 1/3] test/compress: refactor main test function Kovacevic, Marko
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 0/3] Compression Unit Tests Kovacevic, Marko
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 1/3] test/compress: refactor main test function Kovacevic, Marko
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 2/3] test/compress: add out of space test Kovacevic, Marko
2019-01-17 10:19 ` [dpdk-dev] [PATCH v5 3/3] test/compress: add varied buffer input/outputs Kovacevic, Marko
2019-01-18 0:06 ` [dpdk-dev] [PATCH v5 0/3] Compression Unit Tests Thomas Monjalon
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 2/3] test/compress: add out of space test Kovacevic, Marko
2019-01-16 17:16 ` De Lara Guarch, Pablo
2019-01-11 16:52 ` [dpdk-dev] [PATCH v4 3/3] test/compress: add varied buffer input/outputs Kovacevic, Marko
2019-01-16 17:21 ` De Lara Guarch, Pablo
2019-01-11 15:08 ` [dpdk-dev] [PATCH v3 2/3] test/compress: add out of space test Kovacevic, Marko
2019-01-11 15:09 ` [dpdk-dev] [PATCH v3 3/3] test/compress: add varied buffer input/outputs Kovacevic, Marko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).