#define MAX_LIST 32
#define MIN_COMPRESSED_BUF_SIZE 8
-#define EXPANSE_RATIO 1.05
+#define EXPANSE_RATIO 1.1
#define MAX_MBUF_DATA_SIZE (UINT16_MAX - RTE_PKTMBUF_HEADROOM)
#define MAX_SEG_SIZE ((int)(MAX_MBUF_DATA_SIZE / EXPANSE_RATIO))
* if data cannot be compressed
*/
mem->compressed_data = rte_zmalloc_socket(NULL,
- test_data->input_data_sz * EXPANSE_RATIO
- + MIN_COMPRESSED_BUF_SIZE, 0,
+ RTE_MAX(
+ (size_t) test_data->out_seg_sz * total_segs,
+ (size_t) MIN_COMPRESSED_BUF_SIZE),
+ 0,
rte_socket_id());
if (mem->compressed_data == NULL) {
RTE_LOG(ERR, USER1, "Memory to hold the data from the input "
data_addr = (uint8_t *)rte_pktmbuf_append(next_seg,
test_data->out_seg_sz);
-
if (data_addr == NULL) {
RTE_LOG(ERR, USER1, "Could not append data\n");
return -1;
for (i = 0; i < num_deq; i++) {
struct rte_comp_op *op = deq_ops[i];
- if (op->status != RTE_COMP_OP_STATUS_SUCCESS) {
+ if (op->status ==
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED ||
+ op->status ==
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE) {
+ RTE_LOG(ERR, USER1,
+"Out of space error occurred due to uncompressible input data expanding to larger than destination buffer. Increase the EXPANSE_RATIO constant to use this data.\n");
+ res = -1;
+ goto end;
+ } else if (op->status !=
+ RTE_COMP_OP_STATUS_SUCCESS) {
RTE_LOG(ERR, USER1,
"Some operations were not successful\n");
goto end;
for (i = 0; i < num_deq; i++) {
struct rte_comp_op *op = deq_ops[i];
- if (op->status != RTE_COMP_OP_STATUS_SUCCESS) {
+ if (op->status ==
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED ||
+ op->status ==
+ RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE) {
+ RTE_LOG(ERR, USER1,
+"Out of space error occurred due to uncompressible input data expanding to larger than destination buffer. Increase the EXPANSE_RATIO constant to use this data.\n");
+ res = -1;
+ goto end;
+ } else if (op->status !=
+ RTE_COMP_OP_STATUS_SUCCESS) {
RTE_LOG(ERR, USER1,
"Some operations were not successful\n");
goto end;
}
-
const void *read_data_addr =
rte_pktmbuf_read(op->m_dst,
op->dst.offset,